diff --git a/include/RFPowerView.h b/include/RFPowerView.h index 4975a63..5c655e8 100644 --- a/include/RFPowerView.h +++ b/include/RFPowerView.h @@ -24,7 +24,7 @@ public: void loop(); void setPacketCallback(std::function callback); - void sendPacket(const Packet* packet); + bool sendPacket(const Packet* packet); private: RF24 radio; diff --git a/src/RFPowerView.cpp b/src/RFPowerView.cpp index 066075e..2456a99 100644 --- a/src/RFPowerView.cpp +++ b/src/RFPowerView.cpp @@ -4,7 +4,7 @@ RFPowerView::RFPowerView(uint8_t cePin, uint8_t csPin, uint8_t irqPin, uint16_t rfID) : radio(cePin, csPin), packetReceiver(&radio), - bufferFiller(0x00, 0x00, 0x05), + bufferFiller(0x3D, 0x96, 0x05), irqPin(irqPin), rfID{static_cast(rfID & 0xFF), static_cast(rfID >> 8)}, packetCallback(nullptr) {} @@ -77,7 +77,7 @@ void RFPowerView::setPacketCallback(std::function callback) packetCallback = callback; } -void RFPowerView::sendPacket(const Packet* packet) { +bool RFPowerView::sendPacket(const Packet* packet) { if (bufferFiller.fill(sendBuffer, packet)) { startTransmitting(); @@ -93,5 +93,8 @@ void RFPowerView::sendPacket(const Packet* packet) { } startListening(); + + return true; } + return false; } \ No newline at end of file