@@ -103,7 +103,7 @@ void ESBNetwork<radio_t>::begin(uint8_t _channel, uint16_t _node_address)
103
103
setup_address ();
104
104
105
105
// Open up all listening pipes
106
- uint8_t i = 6 ;
106
+ uint8_t i = NUM_PIPES ;
107
107
while (i--)
108
108
radio.openReadingPipe (i, pipe_address (_node_address, i));
109
109
@@ -956,7 +956,7 @@ void ESBNetwork<radio_t>::logicalToPhysicalAddress(logicalToPhysicalStruct* conv
956
956
// }
957
957
}
958
958
else if (is_descendant (*to_node)) {
959
- pre_conversion_send_pipe = 5 ; // Send to its listening pipe
959
+ pre_conversion_send_pipe = NUM_PIPES - 1 ; // Send to its listening pipe
960
960
// If the node is a direct child,
961
961
if (is_direct_child (*to_node)) {
962
962
// Send directly
@@ -1131,7 +1131,7 @@ bool ESBNetwork<radio_t>::is_valid_address(uint16_t node)
1131
1131
#endif
1132
1132
while (node) {
1133
1133
uint8_t digit = node & 0x07 ;
1134
- if (digit < 1 || digit > 5 ) {
1134
+ if (digit < 1 || digit > (NUM_PIPES - 1 ) ) {
1135
1135
result = false ;
1136
1136
IF_SERIAL_DEBUG_MINIMAL (printf_P (PSTR (" *** WARNING *** Invalid address 0%o\n\r " ), origNode););
1137
1137
break ;
@@ -1181,7 +1181,7 @@ template<class radio_t>
1181
1181
uint64_t ESBNetwork<radio_t >::pipe_address (uint16_t node, uint8_t pipe)
1182
1182
{
1183
1183
1184
- static uint8_t address_translation[] = {0xc3 , 0x3c , 0x33 , 0xce , 0x3e , 0xe3 , 0xec };
1184
+ static uint8_t address_translation[] = {0xc3 , 0x3c , 0x33 , 0xce , 0x3e , 0xe3 , 0xec , 0xee , 0xed };
1185
1185
uint64_t result = 0xCCCCCCCCCCLL ;
1186
1186
uint8_t * out = reinterpret_cast <uint8_t *>(&result);
1187
1187
0 commit comments