Class that:
More...
#include <cs_MeshModelMulticast.h>
Class that:
- Sends and receives multicast non-segmented messages.
- Queues messages to be sent.
- Interleaves sending queued messages.
◆ callback_msg_t
Callback function definition.
◆ addToQueue()
Add a msg to an empty spot in the queue (transmissions == 0).
Start looking at SendIndex, then reverse iterate over the queue. Then set the new SendIndex at the newly added item, so that it will be send first. We do the reverse iterate, so that the old SendIndex should be handled early (for a large enough queue).
◆ configureSelf()
void MeshModelMulticast::configureSelf |
( |
dsm_handle_t |
appkeyHandle | ) |
|
Configure the model.
Subscribes, and sets publish address.
◆ getNextItemInQueue()
int MeshModelMulticast::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 MeshModelMulticast::handleMsg |
( |
const access_message_rx_t * |
accessMsg | ) |
|
◆ init()
void MeshModelMulticast::init |
( |
uint16_t |
modelId | ) |
|
◆ processQueue()
void MeshModelMulticast::processQueue |
( |
| ) |
|
|
private |
Send messages from queue.
◆ registerMsgHandler()
void MeshModelMulticast::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.
◆ sendMsg()
cs_ret_code_t MeshModelMulticast::sendMsg |
( |
const uint8_t * |
data, |
|
|
uint16_t |
len |
|
) |
| |
|
private |
Send a message over the mesh via publish, without reply.
◆ sendMsgFromQueue()
bool MeshModelMulticast::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.
◆ tick()
void MeshModelMulticast::tick |
( |
uint32_t |
tickCount | ) |
|
To be called at a regular interval.
◆ _accessModelHandle
access_model_handle_t MeshModelMulticast::_accessModelHandle = ACCESS_HANDLE_INVALID |
|
private |
◆ _groupAddressHandle
dsm_handle_t MeshModelMulticast::_groupAddressHandle = DSM_HANDLE_INVALID |
|
private |
◆ _msgCallback
◆ _queue
◆ _queueIndexNext
uint8_t MeshModelMulticast::_queueIndexNext = 0 |
|
private |
Next index in queue to send.
◆ _queueSize
const uint8_t MeshModelMulticast::_queueSize = 20 |
|
staticprivate |
The documentation for this class was generated from the following file: