Echelon ISI User Manual

Page 39

Advertising
background image

37

ISI Programmer’s Guide

Applications need not distinguish between regular and extended incoming

messages.

You can provide feedback to the user when an invitation is received and
provisionally approved, for example by causing a Connect light to flash while

enrollment is open. This is typically only done with a manual connection. The

ISI engine informs your application that an eligible invitation has been received
and provisionally approved by calling the IsiUpdateUserInterface() callback

function for each assembly that is provisionally approved to join the connection,
sending the isiPending event code. This allows the application to indicate the

provisionally approved, but not yet accepted, connection invitations.

E

XAMPLE

1

The following example receives and provisionally approves a connection
invitation, and blinks a Connect light until the invitation is accepted, or the

connection is confirmed or canceled:

//IsiUpdateUserInterface is called with isiPending as the IsiEvent
//parameter in response to receiving a CSMO
void IsiUpdateUserInterface(IsiEvent Event, unsigned Parameter) {

... //Optional event processing

isiState = (Event == isiPending || Event == isiApproved

|| Event > isiWarm) ? Event : isiNormal;

}


unsigned IsiGetAssembly(const IsiCsmoData* pCsmoData, boolean
Auto) {
if (pCsmoData->Group == ISI_LIGHTING_CATEGORY

&& pCsmoData->Extended.Scope == isiScopeStandard

&& pCsmoData->NvType == SNVT_SWITCH_2_INDEX

&& !(pCsmoData->Variant & 0x60)

&&

!pCsmoData->Extended.Acknowledged

&&

!pCsmoData->Extended.Poll)

{

// Recognized CSMO, return appropriate assembly number
return myAssemblyNumber;
}
...

}

mtimer repeating IsiTimer = 1000ul / ISI_TICKS_PER_SECOND;

when (timer_expires(IsiTimer)) {
unsigned

Assembly;


IsiTickS();

// drive the ISI-related LED:

switch(isiState)

{

...
case

isiPending:

SetConnectLed(LED_BLINKING);

break;
...
}
}

Advertising