Interface for communication subsystem abstraction layer definition.
More...
#include <Comms_hal.h>
Interface for communication subsystem abstraction layer definition.
Definition at line 41 of file Comms_hal.h.
◆ Comms_halClass()
Comms_halClass::Comms_halClass |
( |
| ) |
|
|
inline |
◆ 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
-
gateway | Address of gateway. It may be NULL in case this is used in the own gateway |
channel | Establishes a channel for the communication. Its use depends on actual communications subsystem |
peerType | Role 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
-
enable | true 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 |
◆ initComms()
virtual void Comms_halClass::initComms |
( |
peerType_t |
peerType | ) |
|
|
protectedpure virtual |
Communication subsistem initialization.
- Parameters
-
peerType | Role that peer plays into the system, node or gateway. |
Implemented in Espnow_halClass.
◆ onDataRcvd()
Attach a callback function to be run on every received message.
- Parameters
-
dataRcvd | Pointer to the callback function |
Implemented in Espnow_halClass.
◆ onDataSent()
Attach a callback function to be run after sending a message to receive its status.
- Parameters
-
dataRcvd | Pointer 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
-
da | Destination address to send the message to |
data | Data buffer that contain the message to be sent |
len | Data 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.
◆ _ownPeerType
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 |
◆ 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
Pointer to a function to be called on every received message.
Definition at line 50 of file Comms_hal.h.
◆ gateway
◆ sentResult
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: