Library for handling subset of coap functionality by radio transmitter.
Dependencies: nRF24L01P cantcoap
Diff: radioWrapper.h
- Revision:
- 4:9f635ab44d8e
- Parent:
- 2:c3ca8b8526e0
--- a/radioWrapper.h Sun Jan 20 23:28:23 2019 +0000 +++ b/radioWrapper.h Mon Jan 21 18:52:22 2019 +0000 @@ -15,21 +15,24 @@ nRF24L01P radio; // mosi, miso, sck, csn, ce, irq public: - RadioWrapper(int channel, unsigned long long rx_address, unsigned long long tx_address); + RadioWrapper(int channel, unsigned long long tx_address, unsigned long long rx_addresses[]); int packetSize() { return 32; } - /* + /*a read bytes and saves them to given buffer turncating it. @len @return number of read bytes, -1 if error */ - int read(uint8_t* buffer, int len, int timeout); + int read(uint8_t* buffer, int len, int timeout, int* pipe); /* send bytes from given buffor @return number of writeen bytes, -1 if error. */ - int write(uint8_t* buffer, int len); + int write(uint8_t* buffer, uint8_t len, int pipe); + + private: + int readFromPipe(uint8_t* buffer, int len, int pipe); }; \ No newline at end of file