Authentication, Setting up devices to use authentication – Echelon Neuron C User Manual
Page 78

66
How Devices Communicate Using Network Variables
Following is an example for the code on a network monitor device:
Example:
network input SNVT_alarm nviAlarm;
SNVT_alarm alarm_value;
nv_in_addr_t alarm_device_addr;
when (nv_update_occurs(nviAlarm)) {
alarm_device_addr = nv_in_addr;
alarm_value = nviAlarm;
// Process alarm_device_addr and alarm_value
// Look up alarm_device_addr in a configuration
// property set by a plug-in at installation time
}
This method is appropriate for any number of devices.
The
Neuron C Reference Guide
describes the contents of the nv_in_addr built-in
variable.
Authentication
Authentication is a special form of an acknowledged service between one writer
device and from 1 to 63 reader devices. Authentication is used by the reader
devices to verify the identity of the writer device. This type of service is useful,
for example, if a device containing an electronic lock receives a message to open
the lock. By using authentication, the electronic lock device can verify that the
“open” message comes from the owner, not from someone attempting to break
into the system.
Authentication doubles the number of messages per transaction. Authentication
can be used with acknowledged updates or network variable polls. It cannot be
used with unacknowledged or repeated updates. An acknowledged message
normally requires two messages, an update and an acknowledgment. An
authenticated message requires four messages, as shown in Figure 8 on page 68.
This could affect system response time and capacity.
The following sections describe how to set up devices to use authentication and
how authentication works.
Setting Up Devices to Use Authentication
To set up a device to use authenticated network variables or send authenticated
messages, follow these steps:
1
Declare the network variable as authenticated. For application messages
to be authenticated, specify TRUE in the authenticated field of the
msg_out object.
2
Specify the authentication key to be used for this device using a network
tool. The LonMaker tool can be used to install a key during development.
These steps are described in more detail in the following sections.