Isiacquiredomain(), Isiapprovemsg() – Echelon ISI User Manual

Page 126

Advertising
background image

ISI Programmer’s Guide

124

IsiAcquireDomain()

void IsiAcquireDomain(boolean

SharedServicePin

);

Starts or re-starts the domain ID acquisition process in a device that supports
domain acquisition. The IsiAcquireDomain() function must not be called from a

DAS or device that does not support domain acquistion.

The IsiFetchDevice() function provides an alternate method to assign a domain
from a DAS. A DAS must support both methods.

When

SharedServicePin

is set to FALSE, calling this function will always result

in a service pin message, regardless of the state of the ISI engine. When it is set
to TRUE, a service pin message will not be sent. If your application senses the

service pin state and uses that to call the IsiAcquireDomain() function, call it

with

SharedServicePin

set to TRUE. This indicates that the device has already

sent the service pin message, and will not send its own. If your application uses

some other UI to start the domain acquisition procedure, then call

IsiAcquireDomain() with

SharedServicePin

set to FALSE. With the ISI engine

running, this begins the domain acquisition procedure, and with the engine

stopped it simply issues a service pin message.

E

XAMPLE

The following example starts domain acquisition on an ISI-DA device when
the user pushes a Connect button on the device:

when (connect_button_pressed) {

IsiAcquireDomain(FALSE);

}

IsiApproveMsg()

boolean IsiApproveMsg(void);

Determines if an incoming message is an ISI message by verifying the message
code and length. If approved, the received message may be processed by one of

the IsiProcessMsg() functions.

The IsiApproveMsg() function always returns FALSE if the ISI engine is stopped.

When implementing a domain address server, use IsiApproveMsgDas() instead.

E

XAMPLE

The following example tests for incoming ISI messages, and calls
IsiProcessMsgS() to process them:

when (msg_arrives) {

if

(IsiApproveMsg() && IsiProcessMsgS()) {

// TODO: process unprocessed ISI messages here (if any)

} else {

// TODO: process other application messages here (if any)

}
}

Advertising