File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -636,14 +636,15 @@ void SensorMesh::onControlDataRecv(mesh::Packet* packet) {
636636 }
637637
638638 if ((filter & (1 << ADV_TYPE_SENSOR)) != 0 && _prefs.discovery_mod_timestamp >= since) {
639+ bool prefix_only = packet->payload [0 ] & 1 ;
639640 uint8_t data[6 + PUB_KEY_SIZE];
640641 data[0 ] = CTL_TYPE_NODE_DISCOVER_RESP | ADV_TYPE_SENSOR; // low 4-bits for node type
641642 data[1 ] = packet->_snr ; // let sender know the inbound SNR ( x 4)
642643 memcpy (&data[2 ], &tag, 4 ); // include tag from request, for client to match to
643644 memcpy (&data[6 ], self_id.pub_key , PUB_KEY_SIZE);
644- auto resp = createControlData (data, sizeof (data) );
645+ auto resp = createControlData (data, prefix_only ? 6 + 8 : 6 + PUB_KEY_SIZE );
645646 if (resp) {
646- sendZeroHop (resp, getRetransmitDelay (resp)); // apply random delay, as multiple nodes can respond to this
647+ sendZeroHop (resp, getRetransmitDelay (resp)* 4 ); // apply random delay (widened x4) , as multiple nodes can respond to this
647648 }
648649 }
649650 }
You can’t perform that action at this time.
0 commit comments