@@ -367,18 +367,16 @@ void ntripServerPrintStatus (int serverIndex)
367
367
void ntripServerProcessRTCM (int serverIndex, uint8_t incoming)
368
368
{
369
369
NTRIP_SERVER_DATA * ntripServer = &ntripServerArray[serverIndex];
370
- static uint32_t zedBytesSent;
371
370
372
371
if (ntripServer->state == NTRIP_SERVER_CASTING)
373
372
{
374
373
// Generate and print timestamp if needed
375
374
uint32_t currentMilliseconds;
376
- static uint32_t previousMilliseconds = 0 ;
377
375
if (online.rtc )
378
376
{
379
377
// Timestamp the RTCM messages
380
378
currentMilliseconds = millis ();
381
- if (((settings.debugNtripServerRtcm && ((currentMilliseconds - previousMilliseconds) > 5 ))
379
+ if (((settings.debugNtripServerRtcm && ((currentMilliseconds - ntripServer-> previousMilliseconds ) > 5 ))
382
380
|| PERIODIC_DISPLAY (PD_NTRIP_SERVER_DATA)) && (!settings.enableRtcmMessageChecking )
383
381
&& (!inMainMenu) && ntripServer->bytesSent )
384
382
{
@@ -390,10 +388,10 @@ void ntripServerProcessRTCM(int serverIndex, uint8_t incoming)
390
388
struct tm timeinfo = rtc.getTimeStruct ();
391
389
char timestamp[30 ];
392
390
strftime (timestamp, sizeof (timestamp), " %Y-%m-%d %H:%M:%S" , &timeinfo);
393
- systemPrintf (" Tx%d RTCM: %s.%03ld, %d bytes sent\r\n " , serverIndex, timestamp, rtc.getMillis (), zedBytesSent);
394
- zedBytesSent = 0 ;
391
+ systemPrintf (" Tx%d RTCM: %s.%03ld, %d bytes sent\r\n " , serverIndex, timestamp, rtc.getMillis (), ntripServer-> zedBytesSent );
392
+ ntripServer-> zedBytesSent = 0 ;
395
393
}
396
- previousMilliseconds = currentMilliseconds;
394
+ ntripServer-> previousMilliseconds = currentMilliseconds;
397
395
}
398
396
399
397
// If we have not gotten new RTCM bytes for a period of time, assume end of frame
@@ -409,7 +407,7 @@ void ntripServerProcessRTCM(int serverIndex, uint8_t incoming)
409
407
{
410
408
ntripServer->networkClient ->write (incoming); // Send this byte to socket
411
409
ntripServer->bytesSent ++;
412
- zedBytesSent++;
410
+ ntripServer-> zedBytesSent ++;
413
411
ntripServer->timer = millis ();
414
412
netOutgoingRTCM = true ;
415
413
}
0 commit comments