Echelon Mini EVK User Manual

Page 68

Advertising
background image


when(timer_expires(serviceTimer)) {
if (service_pin_state()) {
ServicePinActivation++;
if (ServicePinActivation > LONG_SERVICE_PIN) {
IsiCancelEnrollment();
}
} else if (ServicePinActivation) {
if (isiState == isiNormal) {
IsiOpenEnrollment(nvoTemperature::global_index);
} else if (isiState == isiPending ||
isiState == isiApprovedHost) {
IsiCreateEnrollment(nvoTemperature::global_index);
}
ServicePinActivation = 0;
}
}

// MyCsmoData defines the connections details for the automatic
// ISI network variable connection advertised by this device
static const IsiCsmoData MyCsmoData =
{ ISI_DEFAULT_GROUP, isiDirectionOutput, 1, 2, 105u, 0 };

// Create the enrollment open message
void IsiCreateCsmo(unsigned Assembly, IsiCsmoData* pCsmoData) {
memcpy(pCsmoData, &MyCsmoData, sizeof(IsiCsmoData));
#pragma ignore_notused Assembly
}

// Relay information provided by the ISI engine
void IsiUpdateUserInterface(IsiEvent Event, unsigned Parameter) {
switch (Event) {
// When these event occur, the ISI engine is in the
// normal state
case isiImplemented:
case isiRun:
case isiWarm:
case isiCancelled:
case isiDeleted:
isiState = isiNormal;
break;
// Otherwise set the state to the event
default:
isiState = Event;
break;
}
#pragma ignore_notused Parameter
}

// Override IsiGetAssembly() with a version that connects to
// automatic connections offering a digital actuator
unsigned IsiGetAssembly(const IsiCsmoData * pCsmo, boolean Auto) {
if (!Auto && //Manual Connection
pCsmo->Profile == 14 && //SFPTspaceComfortController
pCsmo->Direction == isiDirectionInput &&
pCsmo->Width == 1) {
return nvoTemperature::global_index;
}
return ISI_NO_INDEX;

}

62

Mini EVK User’s Guide

Advertising