ESP32 Transceiver IEEE 802.15.4 Library
Loading...
Searching...
No Matches
ESP32TransceiverStreamIEEE802_15_4.h
Go to the documentation of this file.
1#pragma once
2
4#include "RingBuffer.h"
5
6namespace ieee802154 {
7
30 public:
36 : p_transceiver(&transceiver) {
37 transceiver.setReceiveTask(nullptr);
38 owns_transceiver = false;
39 }
40
50 Address localAdr) {
51 p_transceiver = new ESP32TransceiverIEEE802_15_4(channel, panID, localAdr);
53 owns_transceiver = true;
54 }
55
64
72
77 size_t getRxBufferSize() const { return rx_buffer.size(); }
78
84
89 int getSendDelay() const { return send_delay_ms; }
90
96 bool setRxWhenIdleActive(bool rx_when_idle) {
97 return p_transceiver->setRxWhenIdleActive(rx_when_idle);
98 }
99
108
113 void setDestinationAddress(const Address& address) {
115 }
116
123 void setAckTimeoutUs(uint32_t timeout_us) {
124 p_transceiver->setAckTimeoutUs(timeout_us);
125 }
126
131 uint32_t getAckTimeoutUs() const { return p_transceiver->getAckTimeoutUs(); }
132
138 void setAckActive(bool ack_active) {
139 // Set the acknowledgment request bit in the Frame Control Field
141 }
142
147 bool isAckActive() const {
149 }
150
156 void setRxBufferSize(size_t size) { rx_buffer.resize(size); }
157
167
172 void setSendDelay(int delay_ms) { send_delay_ms = delay_ms; }
173
178 void setSendRetryCount(int count) { send_retry_count = count; }
179
185 void setCCAActive(bool cca_enabled) {
186 p_transceiver->setCCAActive(cca_enabled);
187 }
188
193 bool isCCAActive() const { return p_transceiver->isCCAActive(); }
194
199 bool begin() {
200 is_open_frame = false;
201 last_seq = -1;
202 if (p_transceiver == nullptr) {
203 return false; // Cannot begin without a transceiver
204 }
205 // use no separate task!
209 receive_msg_buffer_size); // Set default message buffer size
210 setRxBufferSize(1024);
212 this);
215 // start with 1;
217
218 return p_transceiver->begin();
219 }
220
227 return begin();
228 }
229
233 void end() { p_transceiver->end(); }
234
241 size_t write(const uint8_t* buffer, size_t size) override {
242 size_t written = 0;
243 for (size_t i = 0; i < size; i++) {
244 if (write(buffer[i]) == 1) {
245 written++;
246 } else {
247 break; // Stop if we can't write more
248 }
249 }
250 if (size < MTU) flush();
251 return written;
252 }
253
259 size_t write(const uint8_t byte) override {
260 bool rc = tx_buffer.write(byte);
261 if (tx_buffer.isFull()) {
262 flush();
263 }
264 return rc ? 1 : 0;
265 }
270 int read() override {
271 receive();
272 return rx_buffer.read();
273 }
274
281 size_t readBytes(uint8_t* buffer, size_t size) {
282 // fill receive buffer
283 uint32_t end = millis() + _timeout;
284 while (receive() && millis() < end);
285 // provide data from receive buffer
286 return rx_buffer.readArray(buffer, size);
287 }
288
293 int peek() {
294 if (rx_buffer.isEmpty()) receive();
295 uint8_t c = 0;
296 bool rc = rx_buffer.peek(c);
297 return rc ? c : -1;
298 }
299
304 virtual int available() override { return rx_buffer.available(); }
305
310 int availableForWrite() override { return 1024; }
311
317 void flush() override {
318 // get data from buffer
319 if (isSendConfirmations()) {
321 } else {
323 }
324 }
325
331
337 bool setChannel(channel_t channel) {
338 return p_transceiver->setChannel(channel);
339 }
340
345 int8_t getTxPower() const { return p_transceiver->getTxPower(); }
346
352 bool setTxPower(int power) { return p_transceiver->setTxPower(power); }
353
359 bool setCoordinatorActive(bool coordinator) {
360 return p_transceiver->setCoordinatorActive(coordinator);
361 }
362
368 bool setPromiscuousModeActive(bool promiscuous) {
369 return p_transceiver->setPromiscuousModeActive(promiscuous);
370 }
371
376
382
388 int getMaxMTU() const { return MTU; }
389
398 bool setTxBufferSize(int buffer_size) {
399 if (buffer_size > 0 && buffer_size <= getMaxMTU()) {
400 tx_buffer.resize(buffer_size);
401 return true;
402 }
403 ESP_LOGE(TAG, "Invalid TX buffer size: %d. Must be between 1 and %d.",
404 buffer_size, getMaxMTU());
405 return false; // Invalid MTU size
406 }
407
412 int getTxBufferSize() const { return tx_buffer.size(); }
413
414
415 protected:
416 static constexpr const char* TAG = "ESP32TransceiverStream";
417 static constexpr int MTU = 116;
419 (sizeof(frame_data_t) + 4) * 100; // Default size for message buffer
421 bool owns_transceiver = false;
424 Frame frame; // For parsing and buffering received frames
425 bool is_open_frame = false;
434 bool is_auto_flush = false;
437 int last_seq = -1;
439 esp_ieee802154_tx_error_t last_tx_error = ESP_IEEE802154_TX_ERR_NONE;
440
442
446
451 bool receive() {
452 frame_data_t packet; // Temporary storage for received frame data
453 if (is_open_frame) {
454 // We have a pending frame that we haven't processed yet
456 delay(10);
457 return false;
458 }
459 // Store payload in receive buffer
461 is_open_frame = false; // Mark frame as processed
462 return true;
463 }
464
465 // get next frame
466 size_t read_bytes = 0;
467 read_bytes =
468 xMessageBufferReceive(p_transceiver->getMessageBuffer(), &packet,
469 sizeof(frame_data_t), pdMS_TO_TICKS(20));
470 if (read_bytes != sizeof(frame_data_t)) {
471 if (read_bytes != 0) {
472 ESP_LOGE(TAG, "Invalid packet size received: %d", read_bytes);
473 }
474 return false;
475 }
476
477 // Parse frame
478 if (!frame.parse(packet.frame, false)) {
479 ESP_LOGE(TAG, "Failed to parse frame");
480 return false;
481 }
482
483 ESP_LOGI(TAG, "Received frame: len=%d, seq=%d", frame.payloadLen,
485
486 // Sequence number check (after successful parse, before buffer handling)
487 if (isSequenceNumbers()) {
488 int seq = frame.sequenceNumber;
489 if (last_seq != -1) {
490 int expected = (last_seq + 1) % 256;
491 if (seq == last_seq) {
492 ESP_LOGI(TAG, "Retransmission ignored: seq %d", seq);
493 return false; // Ignore duplicate
494 } else if (seq != expected) {
495 ESP_LOGI(TAG, "Frame sequence skipped: expected %d, got %d", expected,
496 seq);
497 // Accept the new frame, but log the skip
498 }
499 }
500 last_seq = seq;
501 }
502
504 // will be made availabe with next call
505 ESP_LOGD(TAG, "Received frame payload too large for buffer: %d bytes",
507 is_open_frame = true;
508 return false;
509 }
510
511 // Store payload in receive buffer
513 delay(5);
514
515 return true;
516 }
517
524 uint8_t tmp[tx_buffer.available()];
525 int len = tx_buffer.readArray(tmp, tx_buffer.available());
526 int retry = send_retry_count;
527 // send frame
528 int attempt = 0;
529 do {
530 // send data
532 ESP_LOGD(TAG, "Attempt %d: Sending frame, len: %d", attempt, len);
533 if (!p_transceiver->send(tmp, len)) {
534 ESP_LOGE(TAG, "Failed to send frame: size %d", len);
536 }
537
538 // wait for confirmations
539 uint32_t timeout =
540 millis() + (getAckTimeoutUs() / 1000) + 2; // Add some margin
542 millis() < timeout) {
543 delay(2);
544 }
545
546 // on error retry sending the same frame
547 switch (send_confirmation_state) {
548 case CONFIRMATION_ERROR: {
549 ESP_LOGI(TAG, "Send failed with rc=%d, retrying...", last_tx_error);
550 retry--;
551 if (retry <= 0) {
552 // abort retry and move to next frame
554 delay(send_delay_ms);
555 return;
556 }
557 // Short delay before retrying
558 delay(send_delay_ms);
559 break;
560 }
563 delay(send_delay_ms);
564 break;
565 }
566 default:
567 // we should not be here, but if we are, we just retry
568 retry--;
569 delay(send_delay_ms); // Short delay before retrying if needed
570 break;
571 }
572 ++attempt;
574 }
575
581 uint8_t tmp[tx_buffer.available()];
582 int len = tx_buffer.readArray(tmp, tx_buffer.available());
583 ESP_LOGD(TAG, "Sending frame, len: %d", len);
584 if (p_transceiver->send(tmp, len)) {
586 } else {
587 ESP_LOGE(TAG, "Failed to send frame: size %d", len);
588 }
589 delay(send_delay_ms);
590 }
591
596 const uint8_t* frame, const uint8_t* ack,
597 esp_ieee802154_frame_info_t* ack_frame_info, void* user_data) {
599 *static_cast<ESP32TransceiverStreamIEEE802_15_4*>(user_data);
601 self.last_tx_error = ESP_IEEE802154_TX_ERR_NONE;
602 }
603
608 const uint8_t* frame, esp_ieee802154_tx_error_t error, void* user_data) {
610 *static_cast<ESP32TransceiverStreamIEEE802_15_4*>(user_data);
612 self.last_tx_error = error;
613 }
614};
615
618
619} // namespace ieee802154
IEEE 802.15.4 Address abstraction.
Definition Frame.h:77
Class to manage an IEEE 802.15.4 transceiver using the ESP-IDF API. On the sending side we support br...
Definition ESP32TransceiverIEEE802_15_4.h:109
void incrementSequenceNumber(int n=1)
Increment the sequence number in the current frame by a specified value.
Definition ESP32TransceiverIEEE802_15_4.h:377
bool isCCAActive() const
Check if CCA (Clear Channel Assessment) is enabled.
Definition ESP32TransceiverIEEE802_15_4.h:419
bool setRxWhenIdleActive(bool rx_when_idle)
Set RX when idle mode for the transceiver.
Definition ESP32TransceiverIEEE802_15_4.cpp:451
void setReceiveBufferSize(int size)
Definition ESP32TransceiverIEEE802_15_4.cpp:288
void setReceiveTask(void(*task)(void *pvParameters))
Set a custom FreeRTOS task function for processing received packets.
Definition ESP32TransceiverIEEE802_15_4.h:354
int8_t getTxPower()
Get the current transmit power of the transceiver.
Definition ESP32TransceiverIEEE802_15_4.h:263
bool setChannel(channel_t channel)
Change the IEEE 802.15.4 channel.
Definition ESP32TransceiverIEEE802_15_4.cpp:256
uint32_t getAckTimeoutUs() const
Get the current acknowledgment timeout in microseconds.
Definition ESP32TransceiverIEEE802_15_4.h:406
bool setPromiscuousModeActive(bool promiscuous)
Set promiscuous mode for the transceiver.
Definition ESP32TransceiverIEEE802_15_4.cpp:441
bool setTxFailedCallback(ieee802154_transceiver_tx_failed_callback_t callback, void *user_data)
Set the callback function for failed frame transmission.
Definition ESP32TransceiverIEEE802_15_4.cpp:340
void setFrameControlField(const FrameControlField &fcf)
Set the Frame Control Field (FCF) for outgoing frames.
Definition ESP32TransceiverIEEE802_15_4.h:331
void setCCAActive(bool cca_enabled)
Enable or disable CCA (Clear Channel Assessment).
Definition ESP32TransceiverIEEE802_15_4.h:413
void setDestinationAddress(const Address &address)
Set the destination address for outgoing frames.
Definition ESP32TransceiverIEEE802_15_4.h:317
bool end(void)
Deinitialize the IEEE 802.15.4 transceiver.
Definition ESP32TransceiverIEEE802_15_4.cpp:154
bool send(uint8_t *data, size_t len)
Transmit an IEEE 802.15.4 frame on the current channel.
Definition ESP32TransceiverIEEE802_15_4.cpp:227
bool setCoordinatorActive(bool coordinator)
Set the coordinator mode for the transceiver.
Definition ESP32TransceiverIEEE802_15_4.cpp:432
void setBroadcast()
Set the destination address to the broadcast address (0xFFFF).
Definition ESP32TransceiverIEEE802_15_4.h:324
void setAutoIncrementSequenceNumber(bool auto_increment)
Enable or disable automatic incrementing of the sequence number after each successful transmission.
Definition ESP32TransceiverIEEE802_15_4.h:388
StreamBufferHandle_t getMessageBuffer() const
Get the FreeRTOS message buffer handle for received frames.
Definition ESP32TransceiverIEEE802_15_4.h:368
bool begin()
Initialize the IEEE 802.15.4 transceiver with a specified channel.
Definition ESP32TransceiverIEEE802_15_4.cpp:23
bool setTxDoneCallback(ieee802154_transceiver_tx_done_callback_t callback, void *user_data)
Set the callback function for successful frame transmission.
Definition ESP32TransceiverIEEE802_15_4.cpp:333
channel_t getChannel() const
Get the current channel of the transceiver.
Definition ESP32TransceiverIEEE802_15_4.h:249
bool setTxPower(int power)
Set the transmit power of the transceiver.
Definition ESP32TransceiverIEEE802_15_4.cpp:460
FrameControlField & getFrameControlField()
Get a reference to the Frame Control Field (FCF) for outgoing frames.
Definition ESP32TransceiverIEEE802_15_4.h:341
void setAckTimeoutUs(uint32_t timeout_us)
Set the time in us to wait for the ack frame.
Definition ESP32TransceiverIEEE802_15_4.h:398
Arduino Stream interface for IEEE 802.15.4 transceiver.
Definition ESP32TransceiverStreamIEEE802_15_4.h:29
void setBroadcast()
Set the destination address to the broadcast address (0xFFFF).
Definition ESP32TransceiverStreamIEEE802_15_4.h:375
void setFrameControlField(const FrameControlField &fcf)
Set the Frame Control Field (FCF) for outgoing frames.
Definition ESP32TransceiverStreamIEEE802_15_4.h:105
ESP32TransceiverIEEE802_15_4 & getTransceiver()
Get a reference to the underlying transceiver instance.
Definition ESP32TransceiverStreamIEEE802_15_4.h:381
int getSendDelay() const
Get the delay between send retries in milliseconds.
Definition ESP32TransceiverStreamIEEE802_15_4.h:89
static void ieee802154_transceiver_tx_done_callback(const uint8_t *frame, const uint8_t *ack, esp_ieee802154_frame_info_t *ack_frame_info, void *user_data)
Callback for successful frame transmission.
Definition ESP32TransceiverStreamIEEE802_15_4.h:595
RingBuffer tx_buffer
Definition ESP32TransceiverStreamIEEE802_15_4.h:423
bool setPromiscuousModeActive(bool promiscuous)
Set promiscuous mode for the transceiver.
Definition ESP32TransceiverStreamIEEE802_15_4.h:368
bool begin()
Initialize the stream and underlying transceiver.
Definition ESP32TransceiverStreamIEEE802_15_4.h:199
void setSendRetryCount(int count)
Defines the retry count for faild send requests.
Definition ESP32TransceiverStreamIEEE802_15_4.h:178
bool setTxPower(int power)
Set the transmit power in dBm.
Definition ESP32TransceiverStreamIEEE802_15_4.h:352
RingBuffer rx_buffer
Definition ESP32TransceiverStreamIEEE802_15_4.h:422
int getTxBufferSize() const
Get the current transmit buffer size for the stream.
Definition ESP32TransceiverStreamIEEE802_15_4.h:412
bool receive()
Internal method to receive frames and fill the receive buffer.
Definition ESP32TransceiverStreamIEEE802_15_4.h:451
void setRxBufferSize(size_t size)
Set the size of the receive buffer. This defines how many bytes we can get by calling readBytes();.
Definition ESP32TransceiverStreamIEEE802_15_4.h:156
void setSendDelay(int delay_ms)
Set the delay between sends or send retries.
Definition ESP32TransceiverStreamIEEE802_15_4.h:172
bool is_send_confirations_enabled
Definition ESP32TransceiverStreamIEEE802_15_4.h:433
void setAckTimeoutUs(uint32_t timeout_us)
Set the time in us to wait for the ack frame.
Definition ESP32TransceiverStreamIEEE802_15_4.h:123
int peek()
Peek at the next byte in the receive buffer (not implemented).
Definition ESP32TransceiverStreamIEEE802_15_4.h:293
bool setRxWhenIdleActive(bool rx_when_idle)
Set RX when idle mode for the transceiver.
Definition ESP32TransceiverStreamIEEE802_15_4.h:96
bool setTxBufferSize(int buffer_size)
Set the transmit buffer size for the stream. This defines how much data can be buffered for sending b...
Definition ESP32TransceiverStreamIEEE802_15_4.h:398
bool isAckActive() const
Check if acknowledgment requests are enabled for outgoing frames.
Definition ESP32TransceiverStreamIEEE802_15_4.h:147
bool isSendConfirmations()
Definition ESP32TransceiverStreamIEEE802_15_4.h:441
int getMaxMTU() const
Get the maximum transmission unit (MTU) size for the data content.
Definition ESP32TransceiverStreamIEEE802_15_4.h:388
bool owns_transceiver
Definition ESP32TransceiverStreamIEEE802_15_4.h:421
void setDestinationAddress(const Address &address)
Set the destination address for the stream.
Definition ESP32TransceiverStreamIEEE802_15_4.h:113
ESP32TransceiverStreamIEEE802_15_4(ESP32TransceiverIEEE802_15_4 &transceiver)
Construct a new ESP32TransceiverStream object.
Definition ESP32TransceiverStreamIEEE802_15_4.h:35
~ESP32TransceiverStreamIEEE802_15_4()
Destroy the ESP32TransceiverStream object.
Definition ESP32TransceiverStreamIEEE802_15_4.h:59
bool isCCAActive() const
Check if CCA (Clear Channel Assessment) is enabled.
Definition ESP32TransceiverStreamIEEE802_15_4.h:193
void sendWithoutConfirmations()
Internal method to send a frame without waiting for confirmations. Adds a delay after sending to allo...
Definition ESP32TransceiverStreamIEEE802_15_4.h:580
FrameControlField & getFrameControlField()
Get the current Frame Control Field (FCF) in use.
Definition ESP32TransceiverStreamIEEE802_15_4.h:69
bool is_auto_flush
Definition ESP32TransceiverStreamIEEE802_15_4.h:434
size_t write(const uint8_t *buffer, size_t size) override
Write a buffer of bytes to the transceiver.
Definition ESP32TransceiverStreamIEEE802_15_4.h:241
send_confirmation_state_t
Definition ESP32TransceiverStreamIEEE802_15_4.h:426
@ CONFIRMATION_ERROR
Definition ESP32TransceiverStreamIEEE802_15_4.h:429
@ WAITING_FOR_CONFIRMATION
Definition ESP32TransceiverStreamIEEE802_15_4.h:427
@ CONFIRMATION_RECEIVED
Definition ESP32TransceiverStreamIEEE802_15_4.h:428
void end()
Deinitialize the stream and underlying transceiver.
Definition ESP32TransceiverStreamIEEE802_15_4.h:233
static void ieee802154_transceiver_tx_failed_callback(const uint8_t *frame, esp_ieee802154_tx_error_t error, void *user_data)
Callback for failed frame transmission.
Definition ESP32TransceiverStreamIEEE802_15_4.h:607
esp_ieee802154_tx_error_t last_tx_error
Definition ESP32TransceiverStreamIEEE802_15_4.h:439
int8_t getTxPower() const
Get the current transmit power in dBm.
Definition ESP32TransceiverStreamIEEE802_15_4.h:345
bool setCoordinatorActive(bool coordinator)
Set the coordinator mode for the transceiver.
Definition ESP32TransceiverStreamIEEE802_15_4.h:359
static constexpr int MTU
Definition ESP32TransceiverStreamIEEE802_15_4.h:417
uint32_t getAckTimeoutUs() const
Get the current acknowledgment timeout in microseconds.
Definition ESP32TransceiverStreamIEEE802_15_4.h:131
volatile send_confirmation_state_t send_confirmation_state
Definition ESP32TransceiverStreamIEEE802_15_4.h:431
bool setChannel(channel_t channel)
Set the IEEE 802.15.4 channel.
Definition ESP32TransceiverStreamIEEE802_15_4.h:337
ESP32TransceiverIEEE802_15_4 * p_transceiver
Definition ESP32TransceiverStreamIEEE802_15_4.h:420
size_t getRxBufferSize() const
Get the current receive buffer size in bytes.
Definition ESP32TransceiverStreamIEEE802_15_4.h:77
int availableForWrite() override
Get the number of bytes available for writing.
Definition ESP32TransceiverStreamIEEE802_15_4.h:310
int receive_msg_buffer_size
Definition ESP32TransceiverStreamIEEE802_15_4.h:418
void setRxMessageBufferSize(int size)
Set the size of the message buffer used for receiving frames.
Definition ESP32TransceiverStreamIEEE802_15_4.h:163
int read() override
Read a single byte from the receive buffer.
Definition ESP32TransceiverStreamIEEE802_15_4.h:270
bool is_open_frame
Definition ESP32TransceiverStreamIEEE802_15_4.h:425
void flush() override
Flush the transmit buffer and send its contents as a frame.
Definition ESP32TransceiverStreamIEEE802_15_4.h:317
bool begin(FrameControlField fcf)
Initialize the stream and underlying transceiver.
Definition ESP32TransceiverStreamIEEE802_15_4.h:225
virtual int available() override
Get the number of bytes available to read.
Definition ESP32TransceiverStreamIEEE802_15_4.h:304
int send_delay_ms
Delay after sending a frame when confirmations are not used.
Definition ESP32TransceiverStreamIEEE802_15_4.h:436
size_t readBytes(uint8_t *buffer, size_t size)
Read multiple bytes from the receive buffer.
Definition ESP32TransceiverStreamIEEE802_15_4.h:281
bool isSequenceNumbers()
Definition ESP32TransceiverStreamIEEE802_15_4.h:443
void setAckActive(bool ack_active)
Enable or disable acknowledgment requests for outgoing frames.
Definition ESP32TransceiverStreamIEEE802_15_4.h:138
channel_t getChannel() const
Get the current IEEE 802.15.4 channel.
Definition ESP32TransceiverStreamIEEE802_15_4.h:330
Frame frame
Definition ESP32TransceiverStreamIEEE802_15_4.h:424
ESP32TransceiverStreamIEEE802_15_4(channel_t channel, int16_t panID, Address localAdr)
Construct a new ESP32TransceiverStream object with transceiver parameters.
Definition ESP32TransceiverStreamIEEE802_15_4.h:49
int last_seq
Definition ESP32TransceiverStreamIEEE802_15_4.h:437
static constexpr const char * TAG
Definition ESP32TransceiverStreamIEEE802_15_4.h:416
int getRxMessageBufferSize() const
Get the current message buffer size for receiving frames.
Definition ESP32TransceiverStreamIEEE802_15_4.h:83
size_t write(const uint8_t byte) override
Write a single byte to the transceiver.
Definition ESP32TransceiverStreamIEEE802_15_4.h:259
int send_retry_count
Definition ESP32TransceiverStreamIEEE802_15_4.h:438
void sendWithConfirmations()
Internal method to send a frame with confirmation handling. Retries sending the frame if confirmation...
Definition ESP32TransceiverStreamIEEE802_15_4.h:523
void setCCAActive(bool cca_enabled)
Enable or disable CCA (Clear Channel Assessment).
Definition ESP32TransceiverStreamIEEE802_15_4.h:185
Efficient ring buffer for storing frame data.
Definition RingBuffer.h:18
bool isEmpty() const
Definition RingBuffer.h:65
int readArray(uint8_t *dest, size_t len)
Definition RingBuffer.h:84
int read()
Definition RingBuffer.h:73
bool write(uint8_t byte)
Definition RingBuffer.h:30
int available() const
Definition RingBuffer.h:51
bool isFull() const
Definition RingBuffer.h:61
int availableForWrite() const
Definition RingBuffer.h:102
size_t size() const
Definition RingBuffer.h:69
void resize(size_t new_size)
Definition RingBuffer.h:24
bool peek(uint8_t &out) const
Definition RingBuffer.h:93
int writeArray(const uint8_t *data, size_t len)
Definition RingBuffer.h:38
Definition ESP32TransceiverIEEE802_15_4.cpp:15
channel_t
Enum for IEEE 802.15.4 channel numbers (11-26).
Definition ESP32TransceiverIEEE802_15_4.h:27
IEEE 802.15.4 Frame Control Field (FCF) structure Bit fields are ordered LSB to MSB to match IEEE 802...
Definition Frame.h:53
uint8_t sequenceNumberSuppression
Definition Frame.h:61
uint8_t ackRequest
Definition Frame.h:57
IEEE 802.15.4 MAC frame structure.
Definition Frame.h:183
uint8_t sequenceNumber
Definition Frame.h:185
uint8_t * payload
Definition Frame.h:193
size_t payloadLen
Definition Frame.h:192
bool parse(const uint8_t *data, bool verbose)
parse frame from raw data
Definition Frame.cpp:127
Structure to hold frame data and frame info.
Definition Frame.h:243
uint8_t frame[MAX_FRAME_LEN]
Definition Frame.h:244