|
ESP32 Transceiver IEEE 802.15.4 Library
|
Class to manage an IEEE 802.15.4 transceiver using the ESP-IDF API. On the sending side we support broadcast and direct addressing. On the receiving side we support promiscuous mode, and reveiving only frames that are destinated to the device or broadcast frames. More...
#include <ESP32TransceiverIEEE802_15_4.h>

Public Member Functions | |
| bool | begin () |
| Initialize the IEEE 802.15.4 transceiver with a specified channel. | |
| bool | begin (FrameControlField fcf) |
| Initialize the IEEE 802.15.4 transceiver with a specified channel. | |
| bool | end (void) |
| Deinitialize the IEEE 802.15.4 transceiver. | |
| ESP32TransceiverIEEE802_15_4 (channel_t channel, int16_t panID, Address localAddress) | |
| Construct a new ESP32TransceiverIEEE802_15_4 object. | |
| uint32_t | getAckTimeoutUs () const |
| Get the current acknowledgment timeout in microseconds. | |
| channel_t | getChannel () const |
| Get the current channel of the transceiver. | |
| Frame & | getFrame () |
| FrameControlField & | getFrameControlField () |
| Get a reference to the Frame Control Field (FCF) for outgoing frames. | |
| StreamBufferHandle_t | getMessageBuffer () const |
| Get the FreeRTOS message buffer handle for received frames. | |
| esp_ieee802154_pending_mode_t | getPendingMode () |
| Get the current pending mode of the transceiver. | |
| int8_t | getTxPower () |
| Get the current transmit power of the transceiver. | |
| void | incrementSequenceNumber (int n=1) |
| Increment the sequence number in the current frame by a specified value. | |
| bool | isCCAActive () const |
| Check if CCA (Clear Channel Assessment) is enabled. | |
| bool | isCoordinatorActive () const |
| Check if the transceiver is currently set as coordinator. | |
| bool | isPromiscuousModeActive () const |
| Check if promiscuous mode is active. | |
| bool | isRxWhenIdleActive () const |
| Check if RX when idle mode is active. | |
| bool | send (Frame &frame) |
| Transmit an IEEE 802.15.4 frame. You need to setup up all values in the frame object before calling this method. The channel and destination address will be used from the frame object. | |
| bool | send (uint8_t *data, size_t len) |
| Transmit an IEEE 802.15.4 frame on the current channel. | |
| void | setAckTimeoutUs (uint32_t timeout_us) |
| Set the time in us to wait for the ack frame. | |
| void | setAutoIncrementSequenceNumber (bool auto_increment) |
| Enable or disable automatic incrementing of the sequence number after each successful transmission. | |
| void | setBroadcast () |
| Set the destination address to the broadcast address (0xFFFF). | |
| void | setCCAActive (bool cca_enabled) |
| Enable or disable CCA (Clear Channel Assessment). | |
| bool | setChannel (channel_t channel) |
| Change the IEEE 802.15.4 channel. | |
| bool | setCoordinatorActive (bool coordinator) |
| Set the coordinator mode for the transceiver. | |
| void | setDestinationAddress (const Address &address) |
| Set the destination address for outgoing frames. | |
| void | setFrameControlField (const FrameControlField &fcf) |
| Set the Frame Control Field (FCF) for outgoing frames. | |
| bool | setPromiscuousModeActive (bool promiscuous) |
| Set promiscuous mode for the transceiver. | |
| void | setReceiveBufferSize (int size) |
| void | setReceiveTask (void(*task)(void *pvParameters)) |
| Set a custom FreeRTOS task function for processing received packets. | |
| bool | setRxCallback (ieee802154_transceiver_rx_callback_t callback, void *user_data) |
| Set the callback function for received frames. | |
| bool | setRxWhenIdleActive (bool rx_when_idle) |
| Set RX when idle mode for the transceiver. | |
| bool | setSfdCallback (ieee802154_transceiver_sfd_callback_t callback, void *user_data) |
| Set the callback function for SFD (Start Frame Delimiter) received event. | |
| bool | setSfdTxCallback (ieee802154_transceiver_sfd_tx_callback_t callback, void *user_data) |
| Set the callback function for SFD transmitted event. | |
| bool | setTxDoneCallback (ieee802154_transceiver_tx_done_callback_t callback, void *user_data) |
| Set the callback function for successful frame transmission. | |
| bool | setTxFailedCallback (ieee802154_transceiver_tx_failed_callback_t callback, void *user_data) |
| Set the callback function for failed frame transmission. | |
| bool | setTxPower (int power) |
| Set the transmit power of the transceiver. | |
Protected Member Functions | |
| void | onRxDone (uint8_t *frame, esp_ieee802154_frame_info_t *frame_info) |
| void | onStartFrameDelimiterReceived () |
| void | onStartFrameDelimiterTransmitDone (uint8_t *frame) |
| void | onTransmitDone (const uint8_t *frame, const uint8_t *ack, esp_ieee802154_frame_info_t *ack_frame_info) |
| void | onTransmitFailed (const uint8_t *frame, esp_ieee802154_tx_error_t error) |
| esp_err_t | transmit_frame (Frame *frame) |
Static Protected Member Functions | |
| static void | default_receive_packet_task (void *pvParameters) |
Friends | |
| void | receive_packet_task (void *) |
| Forward declarations. | |
Class to manage an IEEE 802.15.4 transceiver using the ESP-IDF API. On the sending side we support broadcast and direct addressing. On the receiving side we support promiscuous mode, and reveiving only frames that are destinated to the device or broadcast frames.
|
inline |
Construct a new ESP32TransceiverIEEE802_15_4 object.
| panID | The Personal Area Network Identifier to use for the transceiver. |
| localAddress | The local address for the device. |
| bool ieee802154::ESP32TransceiverIEEE802_15_4::begin | ( | ) |
Initialize the IEEE 802.15.4 transceiver with a specified channel.
|
inline |
Initialize the IEEE 802.15.4 transceiver with a specified channel.
| fcf | The Frame Control Field to use for the transceiver. transceiver. |
|
staticprotected |
| bool ieee802154::ESP32TransceiverIEEE802_15_4::end | ( | void | ) |
Deinitialize the IEEE 802.15.4 transceiver.
|
inline |
Get the current acknowledgment timeout in microseconds.
|
inline |
Get the current channel of the transceiver.
|
inline |
|
inline |
|
inline |
Get the FreeRTOS message buffer handle for received frames.
|
inline |
Get the current pending mode of the transceiver.
|
inline |
Get the current transmit power of the transceiver.
|
inline |
Increment the sequence number in the current frame by a specified value.
| n | The value to add to the current sequence number. |
|
inline |
Check if CCA (Clear Channel Assessment) is enabled.
|
inline |
Check if the transceiver is currently set as coordinator.
|
inline |
Check if promiscuous mode is active.
|
inline |
Check if RX when idle mode is active.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| bool ieee802154::ESP32TransceiverIEEE802_15_4::send | ( | Frame & | frame | ) |
Transmit an IEEE 802.15.4 frame. You need to setup up all values in the frame object before calling this method. The channel and destination address will be used from the frame object.
| frame | Pointer to the frame to transmit. |
| bool ieee802154::ESP32TransceiverIEEE802_15_4::send | ( | uint8_t * | data, |
| size_t | len | ||
| ) |
Transmit an IEEE 802.15.4 frame on the current channel.
| data | payload data to tramsit. |
| len | length of the payload data. |
|
inline |
Set the time in us to wait for the ack frame.
| [in] | timeout | The time to wait for the ack frame, in us. It Should be a multiple of 16. |
|
inline |
Enable or disable automatic incrementing of the sequence number after each successful transmission.
| auto_increment | True to enable automatic incrementing, false to |
|
inline |
Set the destination address to the broadcast address (0xFFFF).
|
inline |
Enable or disable CCA (Clear Channel Assessment).
| cca_enabled | True to enable CCA (Clear Channel Assessment), false to disable. |
| bool ieee802154::ESP32TransceiverIEEE802_15_4::setChannel | ( | channel_t | channel | ) |
Change the IEEE 802.15.4 channel.
| channel | Channel number (11-26). |
| bool ieee802154::ESP32TransceiverIEEE802_15_4::setCoordinatorActive | ( | bool | coordinator | ) |
Set the coordinator mode for the transceiver.
| coordinator | True to enable coordinator mode, false to disable. |
|
inline |
Set the destination address for outgoing frames.
| address | Destination address to use for outgoing frames. |
|
inline |
| bool ieee802154::ESP32TransceiverIEEE802_15_4::setPromiscuousModeActive | ( | bool | promiscuous | ) |
Set promiscuous mode for the transceiver.
| promiscuous | True to enable promiscuous mode, false to disable. |
| void ieee802154::ESP32TransceiverIEEE802_15_4::setReceiveBufferSize | ( | int | size | ) |
|
inline |
Set a custom FreeRTOS task function for processing received packets.
| task | Pointer to the task function to use for processing received |
| bool ieee802154::ESP32TransceiverIEEE802_15_4::setRxCallback | ( | ieee802154_transceiver_rx_callback_t | callback, |
| void * | user_data | ||
| ) |
Set the callback function for received frames.
| callback | Callback function to invoke on frame reception. |
| user_data | User-defined data to pass to the callback. |
| bool ieee802154::ESP32TransceiverIEEE802_15_4::setRxWhenIdleActive | ( | bool | rx_when_idle | ) |
Set RX when idle mode for the transceiver.
| rx_when_idle | True to enable RX when idle, false to disable. |
| bool ieee802154::ESP32TransceiverIEEE802_15_4::setSfdCallback | ( | ieee802154_transceiver_sfd_callback_t | callback, |
| void * | user_data | ||
| ) |
Set the callback function for SFD (Start Frame Delimiter) received event.
| callback | Callback function to invoke when SFD is received. |
| user_data | User-defined data to pass to the callback. |
| bool ieee802154::ESP32TransceiverIEEE802_15_4::setSfdTxCallback | ( | ieee802154_transceiver_sfd_tx_callback_t | callback, |
| void * | user_data | ||
| ) |
Set the callback function for SFD transmitted event.
| callback | Callback function to invoke when SFD is transmitted. |
| user_data | User-defined data to pass to the callback. |
| bool ieee802154::ESP32TransceiverIEEE802_15_4::setTxDoneCallback | ( | ieee802154_transceiver_tx_done_callback_t | callback, |
| void * | user_data | ||
| ) |
Set the callback function for successful frame transmission.
| callback | Callback function to invoke when a frame is successfully transmitted. |
| user_data | User-defined data to pass to the callback. |
| bool ieee802154::ESP32TransceiverIEEE802_15_4::setTxFailedCallback | ( | ieee802154_transceiver_tx_failed_callback_t | callback, |
| void * | user_data | ||
| ) |
Set the callback function for failed frame transmission.
| callback | Callback function to invoke when a frame transmission fails. |
| user_data | User-defined data to pass to the callback. |
| bool ieee802154::ESP32TransceiverIEEE802_15_4::setTxPower | ( | int | power | ) |
Set the transmit power of the transceiver.
| power | Transmit power value to set (in dBm). -24 dBm to +20 dBm |
|
protected |
|
friend |
Forward declarations.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protecteddefault |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |