Using an Enumeration Data Type

You can use an enumeration data type for a datapoint or property. IzoT enumerations are defined as signed 8-bit types. Signed 8-bit enumerated types are not generally portable across different C compilers. To increase portability, the IzoT Interface Interpreter changes each enumeration to an assigned 8-bit scalar such as signed char, with C preprocessor definitions for the enumerated values.

Example

The IzoT Interface Interpreter generates the following code for a SNVT_config_src datapoint type, which implements the config_source_t enumeration.

typedef signed char config_source_t 
#define CFG_NUL -1      /* enum config_source_t */ 
#define CFG_LOCAL 0     /* enum config_source_t */ 
#define CFG_EXTERNAL 1  /* enum config_source_t */  
 
typedef config_source_t SNVT_config_src