Fix payload length return

This commit is contained in:
tekka007
2016-10-01 19:37:50 +02:00
parent f6f4e6dde4
commit fc09763c49
+3 -1
View File
@@ -64,11 +64,13 @@ bool transportSanityCheck() {
uint8_t transportReceive(void* data) { uint8_t transportReceive(void* data) {
memcpy(data,(const void *)_radio.DATA, _radio.DATALEN); memcpy(data,(const void *)_radio.DATA, _radio.DATALEN);
// save payload length
const uint8_t dataLen = _radio.DATALEN;
// Send ack back if this message wasn't a broadcast // Send ack back if this message wasn't a broadcast
if (_radio.TARGETID != RF69_BROADCAST_ADDR) if (_radio.TARGETID != RF69_BROADCAST_ADDR)
_radio.ACKRequested(); _radio.ACKRequested();
_radio.sendACK(); _radio.sendACK();
return _radio.DATALEN; return dataLen;
} }
void transportPowerDown() { void transportPowerDown() {