|
@ -25,7 +25,7 @@ struct _node_t { |
|
|
unsigned char lastPacketID = 0; |
|
|
unsigned char lastPacketID = 0; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
_node_t _rfm69_node_info[255]; |
|
|
|
|
|
|
|
|
_node_t _rfm69_node_info[RFM69_MAX_NODES]; |
|
|
unsigned char _rfm69_node_count; |
|
|
unsigned char _rfm69_node_count; |
|
|
unsigned long _rfm69_packet_count; |
|
|
unsigned long _rfm69_packet_count; |
|
|
|
|
|
|
|
@ -115,6 +115,9 @@ void _rfm69Debug(const char * level, packet_t * data) { |
|
|
|
|
|
|
|
|
void _rfm69Process(packet_t * data) { |
|
|
void _rfm69Process(packet_t * data) { |
|
|
|
|
|
|
|
|
|
|
|
// Is node beyond RFM69_MAX_NODES?
|
|
|
|
|
|
if (data->senderID >= RFM69_MAX_NODES) return; |
|
|
|
|
|
|
|
|
// Count seen nodes and packets
|
|
|
// Count seen nodes and packets
|
|
|
if (_rfm69_node_info[data->senderID].count == 0) ++_rfm69_node_count; |
|
|
if (_rfm69_node_info[data->senderID].count == 0) ++_rfm69_node_count; |
|
|
++_rfm69_packet_count; |
|
|
++_rfm69_packet_count; |
|
@ -235,10 +238,10 @@ void _rfm69Loop() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void _rfm69Clear() { |
|
|
void _rfm69Clear() { |
|
|
for(unsigned int i=0; i<(sizeof(_rfm69_node_info) / sizeof(_node_t)); i++) { |
|
|
|
|
|
|
|
|
for(unsigned int i=0; i<RFM69_MAX_NODES; i++) { |
|
|
_rfm69_node_info[i].duplicates = 0; |
|
|
_rfm69_node_info[i].duplicates = 0; |
|
|
_rfm69_node_info[i].missing = 0; |
|
|
_rfm69_node_info[i].missing = 0; |
|
|
_rfm69_node_info [i].count = 0; |
|
|
|
|
|
|
|
|
_rfm69_node_info[i].count = 0; |
|
|
} |
|
|
} |
|
|
_rfm69_node_count = 0; |
|
|
_rfm69_node_count = 0; |
|
|
_rfm69_packet_count = 0; |
|
|
_rfm69_packet_count = 0; |
|
|