Echelon LonTal Stack User Manual

Page 119

Advertising
background image

LonTalk Stack Developer’s Guide

107

Echelon Smart

Transceiver

or

Neuron

Processor

Host Application

LonTalk API

Application Framework

Operating System Abstraction Layer

Hardware Abstraction Layer

LonWorks Channel

FtxlApi.h

FtxlDev.h

LonTalk Protocol Stack

The [LonTalkStack]\Source folder contains the LonTalk Host stack, the
LonTalk API, and the serial interface driver example, which together allow your

LonTalk Stack application to handle network events, propagate network

variables, respond to network variable poll requests, and so on.

A LonTalk Stack application must include the FtxlDev.h file to be able to use

the LonTalk API. This file is generated by the LonTalk Interface Developer

utility, and is located in your application project directory. The FtxlDev.h file
includes the [LonTalkStack]\Source\FtxlApi.h file, which contains definitions

for accessing the LonTalk API.

The [LonTalkStack]\Source\FtxlHandlers.c source file contains stubs for the

event handler functions and callback handler functions that the LonTalk API

calls. You must add code to these stubs to respond to specific events. For
example, the LonNvUpdateOccurred() event handler function could inform the

application of the arrival of new data for a set-point value, and the related code
could re-calculate the device’s response, assign output values to peripheral I/O

devices, update the appropriate network variables, and propagate the changes to

the network.

The following recommendations can help you manage your LonTalk Stack

application project:

• Keep edits to LonTalk Interface Developer utility-generated files to a

minimum, that is, do not edit the LonNvTypes.h, LonCpTypes.h,

FtxlDev.h or FtxlDev.c files unless necessary

• Add #include “FtxlDev.h” to your application source files to provide

access to network variable types and instantiations and the LonTalk API

• Keep changes to the FtxlHandlers.c file to a minimum

o

Add calls to your own functions in files that you create and
maintain

Advertising