Example, Wink event, Syntax – Echelon Neuron C User Manual

Page 38

Advertising
background image

18

Predefined Events

Example

mtimer countdown;

...
countdown = 100;
...

when (timer_expires(countdown))
{
...
}

wink

Event

The wink event evaluates to TRUE whenever a

Wink

network management

message is received from a network tool. The device can be configured or
unconfigured, but it must have a program running on it.
The wink event is unique in that it can evaluate to TRUE even though the device

is unconfigured. This event facilitates installation by allowing an unconfigured
device to perform an action in response to the network tool’s wink request.
Each application implements an application-specific behavior in response to the

Wink

message, but all application-specific wink implementations share the same

characteristic: the wink event should trigger a finite, harmless, visual or visual

and audible physical response that allows for unambiguous identification of an
individual physical device.
A typical implementation would flash one of its LEDs for 10 seconds, or show a

similar response.

Note that the wink event and its task can execute when the device is in the

unconfigured state. The application’s implementation of the wink task should,

therefore, not rely on application timers (stimer, mtimer), other when-tasks, or
interrupts.

Syntax

wink

Example

when (wink)
{
...
io_out(io_indicator_light, ON);
delay(...);
io_out(io_indicator_light, OFF);
...
}


Advertising