Chris_v:
the address of the pipe variable, confuses me now.
The address of the variable pipe is passed to available, so it can be set to the pipe number the current packet
was received on. This number is extracted directly from a status register.
bool RF24::available(uint8_t* pipe_num) {
if (!( read_register(FIFO_STATUS) & _BV(RX_EMPTY) )){
// If the caller wants the pipe number, include that
if ( pipe_num ){
uint8_t status = get_status();
*pipe_num = ( status >> RX_P_NO ) & 0b111;
}
return 1;
}
return 0;
}