Skip to content

Commit 2ee884f

Browse files
committed
send Hello PGN to AgOpenGPS every 2.5s
1 parent 0aabc39 commit 2ee884f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

AOG_GPS_ESP32/src/headingAndPosition.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ QueueHandle_t RMCQueue = xQueueCreate( 1, sizeof( RMCBuffer ));
8080

8181
bool powerUnstable = false;
8282
time_t powerUnstableMillis = 0;
83+
uint8_t udpHelloCounter;
8384

8485
// Variables ------------------------------
8586

@@ -758,6 +759,11 @@ void headingAndPosition ( void* z ){
758759
else if( ( millis() - powerUnstableMillis ) / 60000 > 5){
759760
powerUnstable = false;
760761
}
762+
if( ++udpHelloCounter >= 25 ){ //2.5s
763+
udpHelloCounter = 0;
764+
uint8_t helloFromGPS[] = { 128, 129, 120, 120, 5, 0, 0, 0, 0, 0, 71 };
765+
udpRoof.writeTo( helloFromGPS, sizeof( helloFromGPS ), ipDestination, gpsConfig.aogPortSendTo );
766+
}
761767
if( millis() - lastHelloReceivedMillis > 5000 ){
762768
ipDestination = IPAddress( 192, 168, 5, 255 );
763769
}

0 commit comments

Comments
 (0)