My goal is to store the number of Tx "retries" in a variable. The Nordic data sheet describes a read-only register called PLOS_CNT which contains the number of retries. I am trying to read that register. Does anyone know how to accomplish this?
FAILURE INFO
I am using the tmrh20 RF24 library, which has a class reference document that refers to a protected member function called read_register(). But being a protected member function it causes the Arduino IDE to say:
uint8_t RF24::read_register(uint8_t, uint8_t*, uint8_t)' is private within this context
The RF24 Class documentation says this about "protected member functions":
Regular users cannot ever call these. They are documented for completeness and for developers who may want to extend this class.
My code:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define CE_PIN 9
#define CSN_PIN 10
int potRead; //
uint8_t ploss; //packet loss
const byte slaveAddress[5] = {0x52,0x78,0x41,0x41,0x41};
RF24 radio(CE_PIN, CSN_PIN);
void setup() {
radio.begin(); //
radio.setDataRate( RF24_250KBPS );
radio.setRetries(3,5);
radio.openWritingPipe(slaveAddress);
}
void loop() {
potRead=(analogRead(A0));
radio.write(&potRead, sizeof(potRead));
radio.read_register(PLOS_CNT, ploss, 2);
delay(50);
}
Class pages:
For reading a chunk from a register
For reading a byte from a register
Any solution to reading the PLOS_CNT register or a tmrh20/RF24 public class for accessing the PLOS_CNT value would be greatly appreciated.
Thanks,
Dan
San Jose