The Host may enable the option to enforce acknowledgement of every(exceptions below) serial message transacted with the Module, specifically by issuing the /wiki/spaces/RHA/pages/2621455 command to the Module. With the Serial Acknowledgement feature enabled the Host will queue up outgoing messages, messages will be sent one-by-one and only after the previous request is responded to by a frame with a matching Frame Sequence Number or explicitly asked by the Module.
The serial acknowledgment option is disabled by default. If this option is disabled when the Host sends a command, a Status Response will only be issued upon an error; i.e., a Status Response of “Success” will not be issued by the Module upon successful completion of the command. This model has been designed to minimize serial traffic but it is important to note that the Host can overload the Module with requests if not limited.
In terms of complexity, request limiting rather than Serial Ack options is a simpler model to implement for Host developers.
Usage
If the option is enabled, both the Host and Module must acknowledge the receipt of every serial message by returning an appropriate frame with a matching Frame Sequence Number.
...
- The Host should ACK every frame from the Module that is not an ACK frame.
- After the Host sends a frame to the Module, it should wait for an ACK or Response from the Module before proceeding with sending another frame.
- If the Host does not receive an ACK or Response from the Module within expected timeout periods (i.e. up to 15 seconds for a ZCL command that goes out over the network), it should retry.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
while(haveFrameinQueue)
{
Frame sentFrame = SendNextFrame();
bool ack = false;
while(!ack)
{
Frame f = moduleFrameListener.getFrame();
if(f.isAckOf(sentFrame))
{
ack = true;
}
}
} |