@@ -44,7 +44,7 @@ void stInitTransition() {
44
44
_transportSM.failedUplinkTransmissions = 0 ;
45
45
_transportSM.pingActive = false ;
46
46
_transportSM.transportActive = false ;
47
- #if defined(MY_TRANSPORT_SANITY_CHECK) || defined(MY_GATEWAY_FEATURE) || defined( MY_REPEATER_FEATURE)
47
+ #if defined(MY_TRANSPORT_SANITY_CHECK) || defined(MY_REPEATER_FEATURE)
48
48
_transport_lastSanityCheck = hwMillis ();
49
49
#endif
50
50
_transport_lastUplinkCheck = 0 ;
@@ -558,7 +558,8 @@ void transportProcessMessage() {
558
558
_transport_lastUplinkCheck = hwMillis ();
559
559
#endif
560
560
debug (PSTR (" TSP:MSG:GWL OK\n " )); // GW uplink ok
561
- // delay(hwMillis() & 0x3ff);
561
+ // delay minimizes collisions
562
+ delay (hwMillis () & 0x3ff );
562
563
transportRouteMessage (build (_msgTmp, _nc.nodeId , sender, NODE_SENSOR_ID, C_INTERNAL, I_FIND_PARENT_RESPONSE, false ).set (_nc.distance ));
563
564
}
564
565
}
@@ -669,9 +670,9 @@ bool transportSendWrite(uint8_t to, MyMessage &message) {
669
670
setIndication (INDICATION_TX);
670
671
bool ok = transportSend (to, &message, min (MAX_MESSAGE_LENGTH, HEADER_SIZE + length));
671
672
672
- debug (PSTR (" %sTSP:MSG:SEND %d-%d-%d-%d s=%d,c=%d,t=%d,pt=%d,l=%d,sg=%d,st=%s:%s\n " ),
673
+ debug (PSTR (" %sTSP:MSG:SEND %d-%d-%d-%d s=%d,c=%d,t=%d,pt=%d,l=%d,sg=%d,ft=%d, st=%s:%s\n " ),
673
674
(ok || to == BROADCAST_ADDRESS ? " " : " !" ),message.sender ,message.last , to, message.destination , message.sensor , mGetCommand (message), message.type ,
674
- mGetPayloadType (message), mGetLength (message), mGetSigned (message), to==BROADCAST_ADDRESS ? " bc" : (ok ? " ok" :" fail" ), message.getString (_convBuf));
675
+ mGetPayloadType (message), mGetLength (message), mGetSigned (message), _transportSM. failedUplinkTransmissions , to==BROADCAST_ADDRESS ? " bc" : (ok ? " ok" :" fail" ), message.getString (_convBuf));
675
676
676
677
return (ok || to==BROADCAST_ADDRESS);
677
678
}
0 commit comments