@@ -359,18 +359,16 @@ void ntripServerPrintStatus(int serverIndex)
359
359
void ntripServerProcessRTCM (int serverIndex, uint8_t incoming)
360
360
{
361
361
NTRIP_SERVER_DATA *ntripServer = &ntripServerArray[serverIndex];
362
- static uint32_t rtcmBytesSent;
363
362
364
363
if (ntripServer->state == NTRIP_SERVER_CASTING)
365
364
{
366
365
// Generate and print timestamp if needed
367
366
uint32_t currentMilliseconds;
368
- static uint32_t previousMilliseconds = 0 ;
369
367
if (online.rtc )
370
368
{
371
369
// Timestamp the RTCM messages
372
370
currentMilliseconds = millis ();
373
- if (((settings.debugNtripServerRtcm && ((currentMilliseconds - previousMilliseconds) > 5 )) ||
371
+ if (((settings.debugNtripServerRtcm && ((currentMilliseconds - ntripServer-> previousMilliseconds ) > 5 )) ||
374
372
PERIODIC_DISPLAY (PD_NTRIP_SERVER_DATA)) &&
375
373
(!settings.enableRtcmMessageChecking ) && (!inMainMenu) && ntripServer->bytesSent )
376
374
{
@@ -383,10 +381,10 @@ void ntripServerProcessRTCM(int serverIndex, uint8_t incoming)
383
381
char timestamp[30 ];
384
382
strftime (timestamp, sizeof (timestamp), " %Y-%m-%d %H:%M:%S" , &timeinfo);
385
383
systemPrintf (" Tx%d RTCM: %s.%03ld, %d bytes sent\r\n " , serverIndex, timestamp, rtc.getMillis (),
386
- rtcmBytesSent);
387
- rtcmBytesSent = 0 ;
384
+ ntripServer-> rtcmBytesSent );
385
+ ntripServer-> rtcmBytesSent = 0 ;
388
386
}
389
- previousMilliseconds = currentMilliseconds;
387
+ ntripServer-> previousMilliseconds = currentMilliseconds;
390
388
}
391
389
392
390
// If we have not gotten new RTCM bytes for a period of time, assume end of frame
@@ -403,7 +401,7 @@ void ntripServerProcessRTCM(int serverIndex, uint8_t incoming)
403
401
{
404
402
ntripServer->networkClient ->write (incoming); // Send this byte to socket
405
403
ntripServer->bytesSent ++;
406
- rtcmBytesSent++;
404
+ ntripServer-> rtcmBytesSent ++;
407
405
ntripServer->timer = millis ();
408
406
netOutgoingRTCM = true ;
409
407
}
0 commit comments