Tobi's ubw test branch
Dependencies: mavlink_bridge mbed
Fork of AIT_UWB_Range by
Diff: DW1000/DW1000.cpp
- Revision:
- 24:6f25ba679490
- Parent:
- 23:661a79e56208
- Child:
- 25:d58b0595b300
--- a/DW1000/DW1000.cpp Thu Nov 27 13:34:35 2014 +0000 +++ b/DW1000/DW1000.cpp Thu Nov 27 16:26:42 2014 +0000 @@ -56,11 +56,9 @@ sendFrame((uint8_t*)message, strlen(message)+1); } -char* DW1000::receiveString() { +void DW1000::receiveString(char* message) { uint16_t framelength = getFramelength(); - char* receive = new char[framelength]; // prepare memory for the string on the heap - readRegister(DW1000_RX_BUFFER, 0, (uint8_t*)receive, framelength); // get data from buffer - return receive; + readRegister(DW1000_RX_BUFFER, 0, (uint8_t*)message, framelength); // get data from buffer } void DW1000::sendFrame(uint8_t* message, uint16_t length) { @@ -75,7 +73,7 @@ if (receiving) stopTRX(); // stop receiving if we are in this state sending = true; writeRegister8(DW1000_SYS_CTRL, 0, 0x02); // trigger sending process by setting the TXSTRT bit - //if (receiving) startRX(); + if (receiving) startRX(); } void DW1000::startRX() {