beautypg.com

Echelon ISI User Manual

Page 56

background image

ISI Programmer’s Guide

54

DeviceState

Connection Host

Response to Connect Button

isiApprovedHost

Yes

An approved connection host is

one that has received at least
one connection enrollment

acceptance message (CSME).

Call IsiCreateEnrollment() or
IsiExtendEnrollment() to

implement the connection. Call
IsiCancelEnrollment() to cancel

the enrollment.

isiApproved

No

An approved connection

member is one that awaits a
connection enrollment

confirmation (CSMC) or

cancellation (CSMX) message
from the host. Call

IsiCancelEnrollment() to cancel

the acceptance (opt out of the
open enrollment).

isiNormal

N/A

In the normal state, devices can

become hosts
(IsiOpenEnrollment()) or leave

or delete existing connections

through IsiLeaveEnrollment() or
IsiDeleteEnrollment().


In the example code below, the application Connect button when task calls

enrollment functions based on the DeviceState, which was set in the overridden

IsiUpdateUserInterface() function above. The if (longPress) test represents an
action that would happen if the button was being held down for an extended

period of time, with the implementation details not shown here.


when (io_changes(...)) {
switch(deviceState) {
case isiPendingHost:

if (longPress) {
IsiCancelEnrollment();
}
break;
case isiPending:
IsiCreateEnrollment(assembly);
break;
case isiApprovedHost:
if (longPress) {
IsiCancelEnrollment();
} else {
IsiCreateEnrollment(assembly);
}

break;
case isiApproved:
if (longPress) {
IsiCancelEnrollment();
}
break;