EnigmaIOT  0.9.8
Secure sensor and gateway platform based on ESP8266 and ESP32
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Comms_halClass Class Referenceabstract

Interface for communication subsystem abstraction layer definition. More...

#include <Comms_hal.h>

Inheritance diagram for Comms_halClass:
Espnow_halClass

Public Member Functions

 Comms_halClass ()
 
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. More...
 
virtual void stop ()=0
 Terminates communication and closes all connectrions. More...
 
virtual int32_t send (uint8_t *da, uint8_t *data, int len)=0
 Sends data to the other peer. More...
 
virtual void onDataRcvd (comms_hal_rcvd_data dataRcvd)=0
 Attach a callback function to be run on every received message. More...
 
virtual void onDataSent (comms_hal_sent_data dataRcvd)=0
 Attach a callback function to be run after sending a message to receive its status. More...
 
virtual uint8_t getAddressLength ()=0
 Get address length that a specific communication subsystem uses. More...
 
virtual void handle ()=0
 Sends next message in the queue. More...
 
virtual void enableTransmit (bool enable)=0
 Enables or disables transmission of queued messages. Used to disable communication during wifi scan. More...
 

Static Public Attributes

static const size_t COMMS_HAL_MAX_MESSAGE_LENGTH = 0
 Maximum message length. More...
 
static const uint8_t COMMS_HAL_ADDR_LEN = 1
 Address length. More...
 

Protected Member Functions

virtual void initComms (peerType_t peerType)=0
 Communication subsistem initialization. More...
 

Protected Attributes

uint8_t gateway [COMMS_HAL_ADDR_LEN]
 Gateway address. More...
 
uint8_t channel
 Comms channel to be used. More...
 
comms_hal_rcvd_data dataRcvd = 0
 Pointer to a function to be called on every received message. More...
 
comms_hal_sent_data sentResult = 0
 Pointer to a function to be called to notify last sending status. More...
 
peerType_t _ownPeerType
 Stores peer type, node or gateway. More...
 

Detailed Description

Interface for communication subsystem abstraction layer definition.

Definition at line 41 of file Comms_hal.h.

Constructor & Destructor Documentation

◆ Comms_halClass()

Comms_halClass::Comms_halClass ( )
inline

Definition at line 62 of file Comms_hal.h.

Member Function Documentation

◆ begin()

virtual void Comms_halClass::begin ( uint8_t *  gateway,
uint8_t  channel,
peerType_t  peerType = COMM_NODE 
)
pure virtual

Setup communication environment and establish the connection from node to gateway.

Parameters
gatewayAddress of gateway. It may be NULL in case this is used in the own gateway
channelEstablishes a channel for the communication. Its use depends on actual communications subsystem
peerTypeRole that peer plays into the system, node or gateway.

Implemented in Espnow_halClass.

◆ enableTransmit()

virtual void Comms_halClass::enableTransmit ( bool  enable)
pure virtual

Enables or disables transmission of queued messages. Used to disable communication during wifi scan.

Parameters
enabletrue to enable transmission, false to disable it

Implemented in Espnow_halClass.

◆ getAddressLength()

virtual uint8_t Comms_halClass::getAddressLength ( )
pure virtual

Get address length that a specific communication subsystem uses.

Returns
Returns number of bytes that is used to represent an address

Implemented in Espnow_halClass.

◆ handle()

virtual void Comms_halClass::handle ( )
pure virtual

Sends next message in the queue.

Implemented in Espnow_halClass.

◆ initComms()

virtual void Comms_halClass::initComms ( peerType_t  peerType)
protectedpure virtual

Communication subsistem initialization.

Parameters
peerTypeRole that peer plays into the system, node or gateway.

Implemented in Espnow_halClass.

◆ onDataRcvd()

virtual void Comms_halClass::onDataRcvd ( comms_hal_rcvd_data  dataRcvd)
pure virtual

Attach a callback function to be run on every received message.

Parameters
dataRcvdPointer to the callback function

Implemented in Espnow_halClass.

◆ onDataSent()

virtual void Comms_halClass::onDataSent ( comms_hal_sent_data  dataRcvd)
pure virtual

Attach a callback function to be run after sending a message to receive its status.

Parameters
dataRcvdPointer to the callback function

Implemented in Espnow_halClass.

◆ send()

virtual int32_t Comms_halClass::send ( uint8_t *  da,
uint8_t *  data,
int  len 
)
pure virtual

Sends data to the other peer.

Parameters
daDestination address to send the message to
dataData buffer that contain the message to be sent
lenData length in number of bytes
Returns
Returns sending status. 0 for success, any other value to indicate an error.

Implemented in Espnow_halClass.

◆ stop()

virtual void Comms_halClass::stop ( )
pure virtual

Terminates communication and closes all connectrions.

Implemented in Espnow_halClass.

Member Data Documentation

◆ _ownPeerType

peerType_t Comms_halClass::_ownPeerType
protected

Stores peer type, node or gateway.

Definition at line 52 of file Comms_hal.h.

◆ channel

uint8_t Comms_halClass::channel
protected

Comms channel to be used.

Definition at line 48 of file Comms_hal.h.

◆ COMMS_HAL_ADDR_LEN

const uint8_t Comms_halClass::COMMS_HAL_ADDR_LEN = 1
static

Address length.

Definition at line 44 of file Comms_hal.h.

◆ COMMS_HAL_MAX_MESSAGE_LENGTH

const size_t Comms_halClass::COMMS_HAL_MAX_MESSAGE_LENGTH = 0
static

Maximum message length.

Definition at line 43 of file Comms_hal.h.

◆ dataRcvd

comms_hal_rcvd_data Comms_halClass::dataRcvd = 0
protected

Pointer to a function to be called on every received message.

Definition at line 50 of file Comms_hal.h.

◆ gateway

uint8_t Comms_halClass::gateway[COMMS_HAL_ADDR_LEN]
protected

Gateway address.

Definition at line 47 of file Comms_hal.h.

◆ sentResult

comms_hal_sent_data Comms_halClass::sentResult = 0
protected

Pointer to a function to be called to notify last sending status.

Definition at line 51 of file Comms_hal.h.


The documentation for this class was generated from the following file: