@@ -186,6 +186,11 @@ void handleNotifications()
186186 it->second .nodeName = tmpNodeName;
187187 it->second .nodeName .trim ();
188188 it->second .nodeType = udpIn[38 ];
189+ uint32_t build = 0 ;
190+ if (len >= 44 )
191+ for (byte i=0 ; i<sizeof (uint32_t ); i++)
192+ build |= udpIn[40 +i]<<(8 *i);
193+ it->second .build = build;
189194 }
190195 return ;
191196 }
@@ -414,7 +419,8 @@ void sendSysInfoUDP(uint8_t repeats)
414419 // 6: 32 char name
415420 // 38: 1 byte node type id
416421 // 39: 1 byte node id
417- // 40 bytes total
422+ // 40: 4 byte version ID
423+ // 44 bytes total
418424
419425 // send my info to the world...
420426 for (;repeats--;)
@@ -423,7 +429,7 @@ void sendSysInfoUDP(uint8_t repeats)
423429 escapedMac // mac address
424430 */
425431
426- uint8_t data[40 ] = {0 };
432+ uint8_t data[44 ] = {0 };
427433 data[0 ] = 255 ;
428434 data[1 ] = 1 ;
429435
@@ -440,9 +446,13 @@ void sendSysInfoUDP(uint8_t repeats)
440446 #endif
441447 data[39 ] = ip[3 ]; // unit ID == last IP number
442448
449+ uint32_t build = VERSION;
450+ for (byte i=0 ; i<sizeof (uint32_t ); i++)
451+ data[40 +i] = (build>>(8 *i)) & 0xFF ;
452+
443453 IPAddress broadcastIP (255 , 255 , 255 , 255 );
444454 notifier2Udp.beginPacket (broadcastIP, udpPort2);
445- notifier2Udp.write (data, 40 );
455+ notifier2Udp.write (data, sizeof (data) );
446456 notifier2Udp.endPacket ();
447457
448458 if (repeats) delay (500 );
@@ -467,5 +477,6 @@ void sendSysInfoUDP(uint8_t repeats)
467477 it->second .nodeType = NODE_TYPE_ID_UNDEFINED;
468478 #endif
469479 it->second .unit = ip[3 ];
480+ it->second .build = VERSION;
470481 }
471482}
0 commit comments