device.c

Simple demonstration device application.

Summary
device.cSimple demonstration device application.
Device descriptionThis demo device consists of an EPI23 (ANSI E1.30-1) standard Device Identifier subdevice (including facility to change the device’s UACN) and a two dimensional array of scalar integer properties labelled as a ‘bargraph’ (probably because this was originally the intented display method).
Variables
Identity strings
‘Bargraph’ variables.Each property in the “bar graph” is printed as a BAR_PLACES wide integer with a select indicator string either side.
Command line options
Functions
mainParse command line options and start device

Device description

This demo device consists of an EPI23 (ANSI E1.30-1) standard Device Identifier subdevice (including facility to change the device’s UACN) and a two dimensional array of scalar integer properties labelled as a ‘bargraph’ (probably because this was originally the intented display method).  The dimensions of the array, the maximum value of an element and the DMP addresses of the array are specified in the DDL file demo.dev.ddl with DCID 684867b8-eb9b-11e2-b590-0017316c497d.

The terminal display shows the values of a single row in the array.  Left/right arrow keys select elements in the row while up/down arrows increase or decrease the value of the element.  Shift key increases the step size for all arrows.  Page up and down change the row displayed.

The array is accessible via DMP and changes made via DMP are displayed while changes made either via the terminal or via DMP generate events if there are any controllers subscribed.  Events are generated in a dedicated event session.

Variables

Identity strings

hardversionHardware version string
softversionSoftware version string
serialnoSerial number, constructed at run time from CID and DCID.
fctnFCTN used in didcovery.
uacn_dfltUACN default.  Used if no user value has been set.

‘Bargraph’ variables.

Each property in the “bar graph” is printed as a BAR_PLACES wide integer with a select indicator string either side.  Between bars is a BAR_GAP string.

Select indicators

The currently selected property has BAR_LSEL and BAR_RSEL strings to left and right respectively, whilst unselected properties have BAR_LUNSEL and BAR_RUNSEL strings.

Command line options

Functions

main

int main(int argc,
char *argv[])

Parse command line options and start device

int main(int argc,
char *argv[])
Parse command line options and start device
Device Description for simple Acacian demo device.
Close