RF24 icon indicating copy to clipboard operation
RF24 copied to clipboard

RF24:Read documentation wrong for return value.

Open kihon opened this issue 12 years ago • 1 comments

The Code appears to return a bool indicating if there is more data to be read (or rather that there is no more data to be read).

bool RF24::read( void* buf, uint8_t len ) { // Fetch the payload read_payload( buf, len );

// was this the last of the data available? return read_register(FIFO_STATUS) & _BV(RX_EMPTY); }

however the documentation indicates that the return value indicates success in reading the data.

bool RF24::read ( void * buf, uint8_t len )

Read the payload.

Return the last payload received

The size of data read is the fixed payload size, see getPayloadSize()

Note: I specifically chose 'void*' as a data type to make it easier for beginners to use. No casting needed.

Parameters: buf Pointer to a buffer where the data should be written len Maximum number of bytes to read into the buffer

Returns: True if the payload was delivered successfully false if not

kihon avatar Jul 01 '13 13:07 kihon

Goto https://github.com/maniacbug/RF24/network/ and choose one of the most recent forks...

stanleyseow avatar Jul 03 '13 13:07 stanleyseow