|
EnigmaIOT
0.9.8
Secure sensor and gateway platform based on ESP8266 and ESP32
|
Go to the documentation of this file.
13 #if defined(ARDUINO) && ARDUINO >= 100
84 virtual int32_t
send (uint8_t* da, uint8_t*
data,
int len) = 0;
virtual void onDataRcvd(comms_hal_rcvd_data dataRcvd)=0
Attach a callback function to be run on every received message.
peerType_t
Peer role on communication.
static const size_t ENIGMAIOT_ADDR_LEN
Address size. Mac address = 6 bytes.
virtual void onDataSent(comms_hal_sent_data dataRcvd)=0
Attach a callback function to be run after sending a message to receive its status.
static const uint8_t MAX_MESSAGE_LENGTH
Maximum payload size on ESP-NOW.
virtual void begin(uint8_t *gateway, uint8_t channel, peerType_t peerType=COMM_NODE)=0
Setup communication environment and establish the connection from node to gateway.
static const size_t COMMS_HAL_MAX_MESSAGE_LENGTH
Maximum message length.
comms_hal_sent_data sentResult
Pointer to a function to be called to notify last sending status.
virtual int32_t send(uint8_t *da, uint8_t *data, int len)=0
Sends data to the other peer.
virtual uint8_t getAddressLength()=0
Get address length that a specific communication subsystem uses.
virtual void handle()=0
Sends next message in the queue.
void(* comms_hal_rcvd_data)(uint8_t *address, uint8_t *data, uint8_t len)
comms_hal_rcvd_data dataRcvd
Pointer to a function to be called on every received message.
peerType_t _ownPeerType
Stores peer type, node or gateway.
virtual void enableTransmit(bool enable)=0
Enables or disables transmission of queued messages. Used to disable communication during wifi scan.
static const uint8_t COMMS_HAL_ADDR_LEN
Address length.
void(* comms_hal_sent_data)(uint8_t *address, uint8_t status)
virtual void initComms(peerType_t peerType)=0
Communication subsistem initialization.
uint8_t gateway[COMMS_HAL_ADDR_LEN]
Gateway address.
uint8_t channel
Comms channel to be used.
Interface for communication subsystem abstraction layer definition.
virtual void stop()=0
Terminates communication and closes all connectrions.