User Manual

116 Developing a LonTalk Stack Device Application
any application-specific processing of update completion. The following figure
shows the control flow for processing a network variable update.
LonPropagateNv()
Host Processor
Application
LonTalk Protocol Stack
and API
Send Network Variable
Update to Network
Add “Update Complete”
Event to Queue
LonEventPump()
LonNvUpdateCompleted()
LonEventReady()
In the case of an unacknowledged or repeated service type, the LonTalk host
stack considers the update complete when it has finished sending the update to
the network. In the case of an acknowledged service type, the LonTalk host stack
considers the update complete when it receives acknowledgements from all
receiving devices, or when the retry timer expires n times (where n is the retry
count for the network variable + 1).
To process an update failure, edit the LonNvUpdateCompleted() callback
handler function in the FtxlHandlers.c file. This function is passed the network
variable index (the same one that you passed to the LonPropagateNv()
function), and is also passed a success flag. The function is initially empty, but
you can edit it to add your application-specific processing. The function initially
appears as:
void LonNvUpdateCompleted(const unsigned index, const
LonBool success)
{
/* TBD */
}