Echelon ISI User Manual

Page 55

Advertising
background image

53

ISI Programmer’s Guide

void IsiUpdateUserInterface(IsiEvent event,
unsigned parameter) {
if (event == isiPending || event == isiPendingHost) {
SetConnectLed(LED_BLINKING);
} else if (event == isiApproved ||
event == isiApprovedHost) {
SetConnectLed(LED_ON);

} else {
SetConnectLed(LED_OFF);
}
deviceState = event;
}

SetConnectLed() is a device-specific function that is defined elsewhere. The

function sets the device’s LED into the three states mentioned above. While the
default implementation of the IsiUpdateUserInterface() function contained in the

ISI implementation library does nothing, the overridden implementation above

connects the ISI engine with the user interface—a single LED in this case.
The second parameter of IsiUpdateUserInterface() generally indicates the

assembly number to which the event applies. Since the sample device only has
one assembly, the parameter is disregarded here.
ISI requires no specific user-interface, but a simple user interface is typically

required for devices that implement manual connections. A minimal user

interface can be implemented by monitoring state changes to isiPendingHost,
isiPending, isiApprovedHost, isiApproved, and isiNormal for each assembly. To

relay a user command to the ISI engine, you can detect the related user interface

operation and call the related ISI command function. For a small device this user
input device can be as simple as a single Connect button, which may be in one of

three states: 1) not pressed, 2) pressed for a short while, or 3) pressed for a

prolonged period of time. This single-button input is often combined with the
current state of the related assembly, as indicated with the DeviceState tracking

variable introduced above.
The following table summarizes the response to a button press, based on the

DeviceState value.

DeviceState

Connection Host

Response to Connect Button

isiPendingHost

Yes

A pending connection host is one

that has issued a connection
invitation (CSMO message) but

has not yet received a single

CSME. In this state, only
cancellation is a valid operation.

Call IsiCancelEnrollment() to

cancel the open enrollment.

isiPending

No

A pending connection member is
one that has received and

provisionally approved a

connection invitation. Call
IsiCreateEnrollment() or

IsiExtendEnrollment()

to accept

the connection.

Advertising