The singleton ZigbeeHost Request Queue responsible for storing and dispatching calls.
More...
#include <zigpc_gateway_request_queue.hpp>
The singleton ZigbeeHost Request Queue responsible for storing and dispatching calls.
◆ RequestQueue() [1/2]
zigpc::gateway::RequestQueue::RequestQueue |
( |
| ) |
|
◆ RequestQueue() [2/2]
zigpc::gateway::RequestQueue::RequestQueue |
( |
RequestQueue & |
other | ) |
|
|
delete |
◆ dispatch()
sl_status_t zigpc::gateway::RequestQueue::dispatch |
( |
void |
| ) |
|
Dispatch a EmberAf/ZigbeeHost call from the queue.
This dispatch routine is responsible for sending calls to the EmberAf/ZigbeeHost API.
NOTE: If dispatching a EmberAf/ZigbeeHost call returns SL_STATUS_ZIGBEE_MAX_MESSAGE_LIMIT_REACHED , the call data is assumed to have failed since there are too many messages in-flight on the Zigbee network. To rectify this, the call is not dequeued and and call-defer-cycle counter is increased to defer making any calls for that many iterations.
- Returns
- sl_status_t SL_STATUS_OK on EmberAf/ZigbeeHost call success, SL_STATUS_TRANSMIT_BUSY if there are too many messages on the Zigbee network, or SL_STATUS_FAIL if the EmberAf/ZigbeeHost call failed.
◆ enqueue()
void zigpc::gateway::RequestQueue::enqueue |
( |
std::shared_ptr< Entry > |
call | ) |
|
Store call data to the queue that is used to dispatch calls to EmberAf/ZigbeeHost API.
- Parameters
-
call | Shared pointer to ZigbeeHost derived call data. |
◆ getInstance()
static RequestQueue & zigpc::gateway::RequestQueue::getInstance |
( |
| ) |
|
|
static |
◆ operator=()
void zigpc::gateway::RequestQueue::operator= |
( |
const RequestQueue & |
| ) |
|
|
delete |
◆ startDispatching()
void zigpc::gateway::RequestQueue::startDispatching |
( |
void |
| ) |
|
Configure queue to allow sending ZigbeeHost requests.
NOTE: This must be called after initializing the queue.
◆ stopDispatching()
void zigpc::gateway::RequestQueue::stopDispatching |
( |
| ) |
|
Prevent sending any ZigbeeHost requests due to the NCP being reset.
◆ defer_cycles
size_t zigpc::gateway::RequestQueue::defer_cycles = 0U |
|
private |
Number of cycles to defer before dispatching ZigbeeHost request(default=0U)
◆ DEFER_CYCLES_DEFAULT
const size_t zigpc::gateway::RequestQueue::DEFER_CYCLES_DEFAULT = 1U |
|
static |
Number of cycles to defer under normal circumstances. This is used to increase/decrease the number of times zigbeeHostTick() is called per 1 ZigbeeHost API call.
◆ DEFER_CYCLES_LOST_CONNECTION
const size_t zigpc::gateway::RequestQueue::DEFER_CYCLES_LOST_CONNECTION = 50U |
|
static |
Number of cycles to defer when a return status is indicative of a lost connection to the NCP.
NOTE: This value is chosen arbitrarily based on experimentation.
◆ DEFER_CYCLES_MESSAGE_LIMIT_REACHED
const size_t zigpc::gateway::RequestQueue::DEFER_CYCLES_MESSAGE_LIMIT_REACHED = 10U |
|
static |
Number of defer cycles when too many messages are in-flight on the network.
◆ DEFER_CYCLES_START_BACKOFF
const size_t zigpc::gateway::RequestQueue::DEFER_CYCLES_START_BACKOFF = 20U |
|
static |
Number of cycles to defer when the queue is allowed to send requests either on init or post reset.
NOTE: This value is chosen arbitrarily based on experimentation.
◆ dispatching_allowed
bool zigpc::gateway::RequestQueue::dispatching_allowed = false |
|
private |
Indicate if Requests can be dispatched to ZigbeeHost layer (default=FALSE)
◆ queue
std::queue<std::shared_ptr<Entry> > zigpc::gateway::RequestQueue::queue |
|
private |
The documentation for this class was generated from the following file: