Determining a device's location – Echelon LNS User Manual

Page 106

Advertising
background image

LNS Programmer's Guide

92

network database when your application receives the OnAttachment

event.

• Force the LNS Object Server to discover configured devices on a given

domain, and all unconfigured devices on the network, by calling the

System

object’s DiscoverDevices() method. Unconfigured devices

discovered by this method will be placed in the

Discovered.Uninstalled

subsystem. Configured devices will be

placed in the

Discovered.Installed

subsystem.

This method cannot be used to discover devices configured on a domain
other than the system domain if those devices are on the far side of a
router whose class is lcaConfiguredRouter, lcaBridge or
lcaPermananentBridge.

• Cause the device to inform the LNS Object Server that it has been

attached to the network by sending a service pin message. The device’s
application program or hardware could be designed to send a service pin

message when the device is attached to the network, or the installation

staff could simply press the device’s service pin. To discover a device via
the service pin message, your application should call the
BeginServicePinEvent() method to subscribe to the
OnSystemServicePin event, and process the service pin events as they

are generated.
Alternatively, your application can set the System object’s
RegisterServicePin property to True. The LNS Object Server will
then add an AppDevice object to the Discovered.Uninstalled

subsystem (and generate an OnChangeEvent event) when it receives a

service pin message from any unconfigured device. Subscription to service

pin message events is not required in this case. If you use this approach,

pressing the device’s service pin at the completion of physical installation
is not required, but it allows for instant recognition of the newly added

device.

Once the LNS Object Server has discovered a device, you should perform the tasks

described in the Installing Devices section on page 93 to configure the device in the LNS

database. Following that, you can also begin adding the device to connections on your
network.

Determining a Device's Location

Before using LNS to discover the devices attached to a network, you should note that

most LNS applications will need to know the physical location of a device in order to

automate installation in some scenarios. For example, suppose a building is composed of
a group of rooms, each of which contains a group of light devices and a switch device. All

of the light devices in a room must be connected to the switch device in that particular

room. The application can identify the type of each device by its program ID, which is
stored in the LNS database, but it needs another to way to determine which light devices

are in the same room as a given switch device.

In order for an application to determine the location of a device, a user needs to supply

the application with the information, or the device itself must provide the information.

One way for a device to communicate its physical location is by using the location field in
its Neuron Chip. The location field is a 6-byte field used for storing installation-related

information.

Advertising