 |
EnigmaIOT
0.9.3
Secure sensor and gateway platform based on ESP8266 and ESP32
|
Go to the documentation of this file.
12 #if defined(ARDUINO) && ARDUINO >= 100
19 #include <ESP8266WiFi.h>
56 static void ICACHE_FLASH_ATTR
rx_cb (uint8_t* mac_addr, uint8_t*
data, uint8_t len);
63 static void ICACHE_FLASH_ATTR
tx_cb (uint8_t* mac_addr, uint8_t
status);
86 int32_t
send (uint8_t* da, uint8_t*
data,
int len);
peerType_t
Peer role on communication.
void onDataRcvd(comms_hal_rcvd_data dataRcvd)
Attach a callback function to be run on every received message.
static const size_t COMMS_HAL_MAX_MESSAGE_LENGTH
Maximum message length for ESP-NOW.
int32_t send(uint8_t *da, uint8_t *data, int len)
Sends data to the other peer.
comms_hal_rcvd_data dataRcvd
Pointer to a function to be called on every received message.
uint8_t gateway[COMMS_HAL_ADDR_LEN]
Gateway address.
Definition for ESP-NOW hardware abstraction layer.
uint8_t getAddressLength()
Get address length used on ESP-NOW subsystem.
static void ICACHE_FLASH_ATTR tx_cb(uint8_t *mac_addr, uint8_t status)
Function that gets sending status.
void onDataSent(comms_hal_sent_data dataRcvd)
Attach a callback function to be run after sending a message to receive its status.
static void ICACHE_FLASH_ATTR rx_cb(uint8_t *mac_addr, uint8_t *data, uint8_t len)
Function that processes incoming messages and passes them to upper layer.
void stop()
Terminates communication and closes all connectrions.
uint8_t channel
WiFi channel to be used.
void(* comms_hal_rcvd_data)(uint8_t *address, uint8_t *data, uint8_t len)
Espnow_halClass Espnow_hal
Singleton instance of ESP-NOW class.
void begin(uint8_t *gateway, uint8_t channel=0, peerType_t peerType=COMM_NODE)
Setup communication environment and establish the connection from node to gateway.
void initComms(peerType_t peerType)
Communication subsistem initialization.
Auxiliary function definition.
size_t getMaxMessageLength()
Get maximum message length on ESP-NOW subsystem.
comms_hal_sent_data sentResult
Pointer to a function to be called to notify last sending status.
Generic communication system abstraction layer.
void(* comms_hal_sent_data)(uint8_t *address, uint8_t status)
Interface for communication subsystem abstraction layer definition.
Auxiliary functions for debugging over Serial.
static const uint8_t COMMS_HAL_ADDR_LEN
Address length for ESP-NOW. Correspond to mac address.