Isi example – Echelon Mini FX User Manual
Page 105

92 Developing
Device
Applications
Display(3,0, "Setpoint: 0.00", nviSetpoint);
// Schedule next sample:
if (nciHeartbeat) {
// Round to the next full second
sampleTimer = (nciHeartbeat + 9u) / 10ul;
} else {
sampleTimer = SAMPLETIMER_DEFAULT_INTERVAL;
}
}
Finally, the application provides two utility functions, ToAscii() and Display(), to help
display the current ambient temperature and setpoint values:
//
// The ToAscii() utility function converts an unsigned
// long number into its decimal representation, stored
// in the requested buffer backwards.
//
void ToAscii(char* buffer, unsigned long value)
{
while(value) {
*buffer-- = (char)(value % 10) + '0';
value /= 10;
}
}
void Display(unsigned row, unsigned column,
const char* format, SNVT_temp_p value)
{
char buffer[21];
(void)strcpy(buffer, format);
ToAscii(buffer+19, value % 100);
ToAscii(buffer+16, value / 100);
LcdDisplayString(row, column, buffer);
}
ISI Example
The following example demonstrates an application that uses the Interoperable
Self-Installation (ISI) engine and API. Most commercial networked devices are
integrated into a network using the LonMaker tool or other network tool. The
integration process can be semi-automated, but it typically involves manual steps and
decisions taken by an experienced network integrator.
Home network and other small networks cannot afford the complexity and cost of a
manual integration step. In addition, their limited size and complexity makes them
more conducive for automatic integration. User interaction (if any) can be limited to
simple tasks such as pushing a button in response to a flashing LED.
Applications that use the ISI engine can be divided into three major tasks: defining the
application algorithm and interface, starting and running the ISI engine, and providing
application-specific information to the ISI engine when requested.
The application algorithm and interface of an ISI-enabled application is almost identical
to that of a non ISI-enabled application. The ISI-aware application simply adds a
SCPTnwrkCnfg configuration property, which allows the network tool to disable the
self-installation procedures. As a result, the self-installed device can be integrated into a
managed network.
The ISI engine is started through a simple function call, usually from the when(reset)
task. The application adds logic to decide whether to start the engine, considering the
current value of the SCPTnwrkCnfg configuration property. The application must