Implementing a connection – Echelon ISI User Manual

Page 43

Advertising
background image

41

ISI Programmer’s Guide

Implementing a Connection

In a manual or controlled enrollment, when a connection host sends a connection
invitation by broadcasting an open enrollment message, one or more devices may

accept the connection invitation and respond with an enrollment acceptance

message (CSME). When the host receives at least one CSME message, the host
indicates this to the host’s application by calling the IsiUpdateUserInterface()

callback function. Typically, the host’s application will change the state of the

related Connect light from flashing to solid on.

Once the host assembly is in that state (isiApprovedHost), the connection can be
cancelled or implemented. See

Canceling a Connection

for details about

cancellation.

To implement a connection on a connection host, call either
IsiCreateEnrollment() or IsiExtendEnrollment(). The connection host joins the

connection and issues a connection enrollment confirmation message (CSMC).

When calling IsiCreateEnrollment(), any connection that exists for the same
assembly will be removed (See

Deleting a Connection

, later in this chapter).

When calling IsiExtendEnrollment(), the new connection is added to any existing

connections for the same assembly, consuming an alias table entry for each NV in
the assembly.

Once the connection host confirms the connection, devices that have previously
accepted the connection invitation join the connection by replacing or extending

an existing connection, depending on the function that was used to accept the
invitation.

When a device joins a connection, the ISI engine on that device updates the

network configuration for the device, and the accepted connection becomes active.

The ISI engine automatically implements the connections for the accepted
assembly. To determine the NVs to be connected, the ISI engine calls the

IsiGetNvIndex() and IsiGetNextNvIndex() functions for each selector used with

the connection.

You can provide feedback to the user when a connection has been joined, for
example by turning off the Connect light. This is typically only done with

manual connections. The ISI engine informs your application that a connection

has been implemented by calling the IsiUpdateUserInterface() callback function.
This allows the application to indicate the new connection.

E

XAMPLE

1

The following manual enrollment example implements a connection on a
connection host when the user presses the Connect button a second time. It

turns off the Connect light to indicate the acceptance on the host.

void ProcessIsiButton(unsigned Assembly, boolean Constructive,
boolean Alternative) {
switch(isiState)

{

...
case

isiApprovedHost:

// An approved host is a connection host that has

// received at least one enrollment acceptance

Advertising