Isicreatecsmo(), Isicreateperiodicmsg() – Echelon ISI User Manual

Page 144

Advertising
background image

ISI Programmer’s Guide

142

IsiCreateCsmo()

void IsiCreateCsmo(unsigned

Assembly

, IsiCsmoData*

pCsmoData

);

Constructs the IsiCsmoData portion of a CSMO Message. The

pCsmoData

parameter is a pointer to an IsiCsmoData structure that is filled by this function

call. This function is called by the ISI engine prior to sending a CSMO message.
This function has the same effect if the ISI engine is running or not.

IsiCreateCsmo() is a forwarder to isiCreateCsmo().

The isiCreateCsmo() forwardee sets the fields of the IsiCsmoData structure as
follows: it uses the IsiGetPrimaryGroup() function to obtain the group ID, and
sets all fields to zero except the Application field (which is filled with data from

the device’s program ID), the Direction field (which is set to isiDirectionAny,

which corresponds to the value 2), and the NvType field, which is set to the
primary network variable’s SNVT ID, or zero for a UNVT.

Most applications will override this function to supply the application-specific
data for open enrollment messages.

IsiCreatePeriodicMsg()

boolean IsiCreatePeriodicMsg(void);

Specifies whether the application has any messages for the ISI engine to send
using the periodic broadcast scheduler. Since the ISI engine sends periodic

outgoing messages at regular intervals, this function allows an application to

send a message at one of the periodic message slots. If the application has no
message to send, then this function should return FALSE. If it does have a

message to send, then this function should return TRUE.

To use this function, you must enable application-specific periodic messages

using the isiFlagApplicationPeriodic flag when you call the IsiStart() function.

The default implementation of IsiCreatePeriodicMsg() does nothing but return
FALSE. You can override this function by providing an application-specific

implementation of IsiCreatePeriodicMsg().

Do not send any messages, start other network transactions, or call other ISI API
functions while the IsiCreatePeriodicMsg() callback executes. To call other ISI

API functions or start other network transactions, set an application-specific flag

in the IsiCreatePeriodicMsg() callback function and check the flag in a separate
when task. This separate when task can send the periodic message soon after

the IsiCreatePeriodicMsg() function is completed.

Advertising