Class that:
More...
#include <cs_MeshModelUnicast.h>
Class that:
- Sends and receives targeted acked messages.
- Uses reliable segmented messages for this.
- Queues messages to be sent.
- Handles queue 1 by 1.
◆ callback_msg_t
Callback function definition.
◆ addToQueue()
◆ cancelQueueItem()
void MeshModelUnicast::cancelQueueItem |
( |
uint8_t |
index | ) |
|
|
private |
If item at index is in progress, cancel it.
◆ checkDone()
void MeshModelUnicast::checkDone |
( |
| ) |
|
|
private |
Check if a message is done (success or timed out).
◆ configureSelf()
void MeshModelUnicast::configureSelf |
( |
dsm_handle_t |
appkeyHandle | ) |
|
Configure the model.
Subscribes, and sets publish address.
◆ getNextItemInQueue()
int MeshModelUnicast::getNextItemInQueue |
( |
bool |
priority | ) |
|
|
private |
Check if there is a msg in queue with more than 0 transmissions.
If so, return that index. Start looking at index SendIndex as that item should be sent first. Returns -1 if none found.
◆ handleMsg()
void MeshModelUnicast::handleMsg |
( |
const access_message_rx_t * |
accessMsg | ) |
|
◆ handleReliableStatus()
void MeshModelUnicast::handleReliableStatus |
( |
access_reliable_status_t |
status | ) |
|
◆ init()
void MeshModelUnicast::init |
( |
uint16_t |
modelId | ) |
|
◆ processQueue()
void MeshModelUnicast::processQueue |
( |
| ) |
|
|
private |
Send messages from queue.
◆ registerMsgHandler()
void MeshModelUnicast::registerMsgHandler |
( |
const callback_msg_t & |
closure | ) |
|
Register a callback function that's called when a message from the mesh is received.
◆ remFromQueue()
Remove a msg from the queue.
◆ remQueueItem()
void MeshModelUnicast::remQueueItem |
( |
uint8_t |
index | ) |
|
|
private |
Remove an item from the queue.
◆ sendFailedResultToUart()
◆ sendMsg()
cs_ret_code_t MeshModelUnicast::sendMsg |
( |
const uint8_t * |
msg, |
|
|
uint16_t |
msgSize, |
|
|
uint32_t |
timeoutUs |
|
) |
| |
|
private |
Send a unicast message over the mesh.
This message will be have to acked or timed out, before the next message can be sent.
Message data has to stay in ram until acked or timedout!
◆ sendMsgFromQueue()
bool MeshModelUnicast::sendMsgFromQueue |
( |
| ) |
|
|
private |
Get a msg from the queue, and send it.
Returns true when message was sent, false when no more messages to be sent.
◆ sendReply()
cs_ret_code_t MeshModelUnicast::sendReply |
( |
const access_message_rx_t * |
accessMsg, |
|
|
const uint8_t * |
msg, |
|
|
uint16_t |
msgSize |
|
) |
| |
|
private |
Send a reply when receiving a reliable message.
◆ setPublishAddress()
Sets the publish address.
Do this while no message is in progress.
◆ setTtl()
cs_ret_code_t MeshModelUnicast::setTtl |
( |
uint8_t |
ttl, |
|
|
bool |
temp = false |
|
) |
| |
|
private |
Sets the TTL.
Do this while no message is in progress.
◆ tick()
void MeshModelUnicast::tick |
( |
uint32_t |
tickCount | ) |
|
To be called at a regular interval.
◆ _accessModelHandle
access_model_handle_t MeshModelUnicast::_accessModelHandle = ACCESS_HANDLE_INVALID |
|
private |
◆ _accessReliableMsg
access_reliable_t MeshModelUnicast::_accessReliableMsg |
|
private |
◆ _msgCallback
◆ _publishAddressHandle
dsm_handle_t MeshModelUnicast::_publishAddressHandle = DSM_HANDLE_INVALID |
|
private |
◆ _queue
◆ _queueIndexInProgress
Queue index of message currently being sent.
◆ _queueIndexNext
uint8_t MeshModelUnicast::_queueIndexNext = 0 |
|
private |
Next index in queue to send.
◆ _reliableStatus
uint8_t MeshModelUnicast::_reliableStatus = 255 |
|
private |
Status of the reliable msg.
255 for no status.
◆ _replyReceived
bool MeshModelUnicast::_replyReceived = false |
|
private |
Whether the reply message has been received.
◆ _ttl
◆ QUEUE_INDEX_NONE
const uint8_t MeshModelUnicast::QUEUE_INDEX_NONE = 255 |
|
staticprivate |
◆ QUEUE_SIZE
const uint8_t MeshModelUnicast::QUEUE_SIZE = 5 |
|
staticprivate |
The documentation for this class was generated from the following file: