Anonymous top level types, Legacy neuron c constructs, Using authentication for network variables – Echelon LonTal Stack User Manual

Page 83: Anonymous top-level types

Advertising
background image

LonTalk Stack Developer’s Guide

71

predefines the _FTXL and _MODEL_FILE macros, so that you can use #ifdef or

#ifndef compiler directives to control conditional compilation of source code that
is used for standard Neuron C compilation and as an LonTalk Stack model file.
All constructs not specifically mentioned as unacceptable or ignored are
acceptable.

Anonymous Top-Level Types

Anonymous top-level types are not valid. The following Neuron C construct is

not valid:

network output struct {int a; int b;} nvoZorro;

This statement is not valid because the type of the nvoZorro network variable
does not have a name. The LonTalk Interface Developer utility issues an error

when it detects such a construct.

Using a named type solves the problem, for example:

typedef struct {
int

a;

int

b;

} Zorro;
network output Zorro nvoZorro;

The use of anonymous sub-types is permitted. For example, the LonTalk

Interface Developer utility allows the following type definition:

typedef struct {
int a;
int b;
struct

{

long

x;

long

y;

long

z;

} c;

} Zorro;
network output Zorro nvoZorro;

Legacy Neuron C Constructs

You must use the Neuron C Version 2.1 syntax described in this manual. You

cannot use legacy Neuron C constructs for defining L

ON

M

ARK

-compliant

interfaces. That is, you cannot use the config modifier for network variables,
and you cannot use Neuron C legacy syntax for declaring functional blocks or

configuration properties. The legacy syntax used an sd_string() modifier
containing a string that starts with a ‘&’ or ‘@’ character.

Using Authentication for Network Variables

Authentication is a special acknowledged service between one source device and

one or more (up to 63) destination devices. Authentication is used by the
destination devices to verify the identity of the source device. This type of service

is useful, for example, if a device containing an electronic lock receives a message

to open the lock. By using authentication, the electronic lock device can verify

Advertising