File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed
Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,23 @@ bool ntripServerRtcmMessage(uint8_t data)
180180
181181 switch (ntripServerCrcState)
182182 {
183+ // Read the upper two bits of the length
184+ case RTCM_TRANSPORT_STATE_READ_LENGTH_1:
185+ if (!(data & 3 ))
186+ {
187+ length = data << 8 ;
188+ crcState = RTCM_TRANSPORT_STATE_READ_LENGTH_2;
189+ break ;
190+ }
191+
192+ // Wait for the preamble byte
193+ crcState = RTCM_TRANSPORT_STATE_WAIT_FOR_PREAMBLE_D3;
194+
195+ // Fall through
196+ // |
197+ // |
198+ // V
199+
183200 // Wait for the preamble byte (0xd3)
184201 case RTCM_TRANSPORT_STATE_WAIT_FOR_PREAMBLE_D3:
185202 sendMessage = false ;
@@ -190,12 +207,6 @@ bool ntripServerRtcmMessage(uint8_t data)
190207 }
191208 break ;
192209
193- // Read the upper two bits of the length
194- case RTCM_TRANSPORT_STATE_READ_LENGTH_1:
195- length = data << 8 ;
196- ntripServerCrcState = RTCM_TRANSPORT_STATE_READ_LENGTH_2;
197- break ;
198-
199210 // Read the lower 8 bits of the length
200211 case RTCM_TRANSPORT_STATE_READ_LENGTH_2:
201212 length |= data;
You can’t perform that action at this time.
0 commit comments