Isigetfreealiascount() – Echelon ISI User Manual

Page 132

Advertising
background image

ISI Programmer’s Guide

130

To use the IsiFetchDomain() function, you must implement a when (resp_arrives)

task and call the IsiProcessResponse() function function with the domain address
server’s application to complete the processing involved with fetching a domain

ID.

E

XAMPLE

The following example is part of the domain address server’s application.
The example fetches the domain ID from a remote device and assigns it to a
domain address server when the user presses the Connect button on the

server:

when (connect_button_pressed) {

IsiFetchDomain();

}

// Handle responses to requests in IsiFetchDomain()
when (resp_arrives) {
if (IsiProcessResponse()) {
// TODO: process unprocessed responses here (if any)
}
}

IsiGetFreeAliasCount()

unsigned IsiGetFreeAliasCount(void);

Returns the number of unused network variable aliases on the local device. This
function may be used with applications using one of the compact ISI libraries

that do not supply fully automated resource validation, or with connection hosts.
Devices that share a single network variable among multiple network variable

selectors within one connection also must validate available resources with this

function.

On devices that are built with the IsiFull library, which includes fully automated,
built-in, comprehensive resource validation, an attempt to extend an existing

connection with an explicit IsiExtendEnrollment() call or with the acceptance of

an automatic enrollment, leads to this validation step. The step, implemented
with the ISI engine, determines exactly how many local aliases are currently

unused, and how many are required to implement the pending connection. If

those required exceed those available, the connection will not be implemented.
On a host, the enrollment will be cancelled.

The compact ISI libraries do not include this validation step, but applications
may use the IsiGetFreeAliasCount() function to implement a more compact, and

possibly overestimating, version of this validation step. This more compact code
may take application-specific knowledge into account, and it may ignore previous

connection history for simplicity and brevity, thereby possibly leaning towards an
over-cautious decision.

Example 1:

This example illustrates how an application built with one of the compact ISI
libraries may use the IsiGetFreeAliasCount() function to implement an

application-specific resource validation step. This simple implementation
assumes that every connection extension requires one network variable alias per

Advertising