Handling local network management tasks, Handling reset events, Querying the error log – Echelon LonTal Stack User Manual

Page 139: Working with ecs devices

Advertising
background image

LonTalk Stack Developer’s Guide

127

or reset, and are handled by your LonWink(), LonOffline(), LonOnline(), and

LonReset() callback handler functions.

Handling Local Network Management Tasks

There are various network management tasks that a device can choose to initiate

on its own. These are local network management tasks, which are initiated by
the LonTalk Stack application and implemented by the LonTalk host stack.

Local network management commands are never propagated to the network.

The Extended LonTalk APIs allow you to include handling of these local network
management commands if your LonTalk Stack application requires it.

Handling Reset Events

A network management tool can send a reset message to the LonTalk Stack

device for a variety of reasons. For example, to reset the device after changing
the communication parameters (including setting the priority), or following an

update to a configuration property that is declared with a restriction flag which

indicates that the network manager must reset the device after an update. The
LonTalk host stack processes reset messages and manages everything that is

required by the protocol. It also calls the LonReset() event handler function to
inform the application, so that the application can perform any application

specific processing.
The LonReset() callback handler function returns a pointer to the
LonResetNotification structure, but this pointer is always NULL. The pointer

is included for code compatibility with ShortStack applications. Whenever the
LonTalk Stack device is reset, the state of the device is set to configured, and the

mode of the device is changed to online, but no LonOnline() event is generated.
Resetting a LonTalk Stack device from the network affects only the LonTalk
Stack, and does not cause a processor or application software reset.

Querying the Error Log

The LonTalk host stack writes application errors to the system error log. The

LonStatus structure, which is returned by the LonQueryStatus() function
contains complete statistics information, such as the number of transmit errors,

transaction timeouts, missed and lost messages, and so on.

Working with ECS Devices

A LonTalk Stack device is an extended command set (ECS) device (that is, the
ver_nm_max field of the Capability Info Record in the device’s self-identification

string is greater than 0). A LonTalk Stack device supports both the extended
command set and legacy network management commands. However, after a

device receives any extended commands, it operates in the extended mode, and

returns a negative response to legacy commands.

Any OpenLNS-based tool communicates with a LonTalk Stack device using ECS

commands (for example, during device commissioning), and thus places the

device in extended mode. Some tools that are not based on OpenLNS, such as the
NodeUtil utility, might not be able to communicate with a device that is in the

extended mode.

Advertising