Library for the nRF2401A Transceiver
Dependents: nRF2401A_Hello_World nRF2401A_Wireless_Accelerometer_joypad nRF2401A_Gameduino_Invaders
Diff: nRF2401A.cpp
- Revision:
- 5:18ce8a56b248
- Parent:
- 4:e8523ef6e472
- Child:
- 7:22f69cf045d9
diff -r e8523ef6e472 -r 18ce8a56b248 nRF2401A.cpp --- a/nRF2401A.cpp Sun Oct 06 16:17:32 2013 +0000 +++ b/nRF2401A.cpp Sat Oct 19 11:10:47 2013 +0000 @@ -40,7 +40,7 @@ _state(nRF2401A::UNDEF), _rx_handler((nRF2401A_rx_handler_t) 0), _rx_handler_arg((void *) 0), - _dr1_isr(InterruptIn(dr1)) { + _dr1_isr(InterruptIn(dr1)) { // init member variables _data.output(); @@ -91,6 +91,19 @@ return *this; } +nRF2401A& nRF2401A::readMsg( uint8_t *msg_buf, uint8_t msg_len ) { + for(int i = 0; i < msg_len; i++) + { + msg_buf[i] = _data_buf[i]; + } + return *this; +} + +nRF2401A& nRF2401A::readMsg_byte( uint8_t *msg_buf, uint8_t buf_index ) { + *msg_buf = _data_buf[buf_index]; + return *this; +} + nRF2401A& nRF2401A::sendMsg(nRF2401A::address_t addr, uint8_t addr_len, uint8_t *msg_buf, uint8_t msg_len) { // point to start of address byte in address