Digi XBee(R) ANSI C Host Library
Data Structures | Macros | Typedefs | Functions | Variables
zcl_types.h File Reference

Macros and structures related to the ZCL datatypes. More...

#include "xbee/platform.h"
#include "xbee/byteorder.h"
#include "zigbee/zcl64.h"

Go to the source code of this file.

Data Structures

struct  zcl_timeofday_t
 Time of Day (for ZCL_TYPE_TIME_TIMEOFDAY Data Type) More...
 
struct  zcl_date_t
 Date (for ZCL_TYPE_TIME_DATE Data Type) More...
 
union  zcl40_t
 40-bit unsigned in host-byte-order More...
 
union  zcl48_t
 48-bit unsigned in host-byte-order More...
 

Macros

#define ZCL_UTCTIME_INVALID   0xFFFFFFFF
 
#define ZCL_TYPE_IS_ANALOG(t)   (zcl_type_info[t] & ZCL_T_ANALOG)
 ZCL data type t is an analog type.
 
#define ZCL_TYPE_IS_DISCRETE(t)   (zcl_type_info[t] & ZCL_T_DISCRETE)
 ZCL data type t is a discrete type.
 
#define ZCL_TYPE_IS_SIGNED(t)   (zcl_type_info[t] & ZCL_T_SIGNED)
 ZCL data type t is a signed type.
 
#define ZCL_TYPE_IS_REPORTABLE(t)   (zcl_type_info[t] & ZCL_T_REPORTABLE)
 ZCL data type t is a reportable type.
 
#define ZCL_TYPE_IS_INVALID(t)   (zcl_type_info[t] == ZCL_T_INVALID)
 ZCL data type t is an invalid (unsupported/unrecognized) type.
 
#define ZCL_SIZE_SHORT   -1
 
#define ZCL_SIZE_LONG   -2
 
#define ZCL_SIZE_VARIABLE   -3
 
#define ZCL_SIZE_INVALID   -127
 

Typedefs

typedef uint32_t zcl_utctime_t
 

Functions

int zcl_sizeof_type (uint8_t type)
 Return the number of octets used by a given ZCL datatype. More...
 
const char * zcl_type_name (uint8_t type)
 Return a descriptive string for a given ZCL attribute type. More...
 

Variables

const uint8_t zcl_type_info [256]
 Table to store information on each ZCL datatype. More...
 

ZCL Null Types

#define ZCL_TYPE_NO_DATA   0x00
 

ZCL General Data (discrete) Types

#define ZCL_TYPE_GENERAL_8BIT   0x08
 
#define ZCL_TYPE_GENERAL_16BIT   0x09
 
#define ZCL_TYPE_GENERAL_24BIT   0x0a
 
#define ZCL_TYPE_GENERAL_32BIT   0x0b
 
#define ZCL_TYPE_GENERAL_40BIT   0x0c
 
#define ZCL_TYPE_GENERAL_48BIT   0x0d
 
#define ZCL_TYPE_GENERAL_56BIT   0x0e
 
#define ZCL_TYPE_GENERAL_64BIT   0x0f
 

ZCL Logical (discrete) Types

#define ZCL_TYPE_LOGICAL_BOOLEAN   0x10
 

Values for #ZCL_TYPE_LOGICAL_BOOLEAN

#define ZCL_BOOL_FALSE   0x00
 
#define ZCL_BOOL_TRUE   0x01
 
#define ZCL_BOOL_INVALID   0xff
 

ZCL Bitmap (discrete) Types

#define ZCL_TYPE_BITMAP_8BIT   0x18
 
#define ZCL_TYPE_BITMAP_16BIT   0x19
 
#define ZCL_TYPE_BITMAP_24BIT   0x1a
 
#define ZCL_TYPE_BITMAP_32BIT   0x1b
 
#define ZCL_TYPE_BITMAP_40BIT   0x1c
 
#define ZCL_TYPE_BITMAP_48BIT   0x1d
 
#define ZCL_TYPE_BITMAP_56BIT   0x1e
 
#define ZCL_TYPE_BITMAP_64BIT   0x1f
 

ZCL Unsigned integer (analog) Types

#define ZCL_TYPE_UNSIGNED_8BIT   0x20
 
#define ZCL_TYPE_UNSIGNED_16BIT   0x21
 
#define ZCL_TYPE_UNSIGNED_24BIT   0x22
 
#define ZCL_TYPE_UNSIGNED_32BIT   0x23
 
#define ZCL_TYPE_UNSIGNED_40BIT   0x24
 
#define ZCL_TYPE_UNSIGNED_48BIT   0x25
 
#define ZCL_TYPE_UNSIGNED_56BIT   0x26
 
#define ZCL_TYPE_UNSIGNED_64BIT   0x27
 

ZCL Signed integer (analog) Types

#define ZCL_TYPE_SIGNED_8BIT   0x28
 
#define ZCL_TYPE_SIGNED_16BIT   0x29
 
#define ZCL_TYPE_SIGNED_24BIT   0x2a
 
#define ZCL_TYPE_SIGNED_32BIT   0x2b
 
#define ZCL_TYPE_SIGNED_40BIT   0x2c
 
#define ZCL_TYPE_SIGNED_48BIT   0x2d
 
#define ZCL_TYPE_SIGNED_56BIT   0x2e
 
#define ZCL_TYPE_SIGNED_64BIT   0x2f
 

ZCL Enumeration (discrete) Types

#define ZCL_TYPE_ENUM_8BIT   0x30
 
#define ZCL_TYPE_ENUM_16BIT   0x31
 

ZCL Floating point (analog) Types

#define ZCL_TYPE_FLOAT_SEMI   0x38
 semi-precision (16-bit) floating point (unsupported)
 
#define ZCL_TYPE_FLOAT_SINGLE   0x39
 single-precision (32-bit) IEEE 754 floating point
 
#define ZCL_TYPE_FLOAT_DOUBLE   0x3a
 double-precision (64-bit) IEEE 754 floating point
 

ZCL String (discrete) Types

#define ZCL_TYPE_STRING_OCTET   0x41
 First octet is number of bytes in string or 0xff for invalid.
 
#define ZCL_TYPE_STRING_CHAR   0x42
 First octet is number of characters in string or 0xff for invalid. More...
 
#define ZCL_TYPE_STRING_LONG_OCTET   0x43
 First two octets are number of bytes in string or 0xffff for invalid. More...
 
#define ZCL_TYPE_STRING_LONG_CHAR   0x44
 First two octets are number of characters in string or 0xffff for invalid. More...
 

ZCL Ordered Sequence (discrete) Types

#define ZCL_TYPE_ARRAY   0x48
 ZCL Array (unsupported)
 
#define ZCL_TYPE_STRUCT   0x4C
 ZCL Struct (unsupported)
 

ZCL Collection (discrete) Types

#define ZCL_TYPE_SET   0x50
 ZCL Set (unsupported)
 
#define ZCL_TYPE_BAG   0x51
 ZCL Bag (unsupported)
 

ZCL Time (analog) Types

#define ZCL_TYPE_TIME_TIMEOFDAY   0xE0
 see zcl_timeofday_t
 
#define ZCL_TYPE_TIME_DATE   0xE1
 see zcl_date_t
 
#define ZCL_TYPE_TIME_UTCTIME   0xE2
 number of seconds (stored in uint32_t) since Midnight on 1/1/2000 UTC
 

ZCL Identifier (discrete) Types

#define ZCL_TYPE_ID_CLUSTER   0xE8
 16-bit cluster ID
 
#define ZCL_TYPE_ID_ATTRIB   0xE9
 16-bit attribute ID
 
#define ZCL_TYPE_ID_BACNET_OID   0xEA
 32-bit BACnet OID
 

ZCL Miscellaneous Types

#define ZCL_TYPE_IEEE_ADDR   0xF0
 64-bit IEEE address
 
#define ZCL_TYPE_SECURITY_KEY   0xF1
 128-bit security key
 

ZCL Unknown Type

#define ZCL_TYPE_UNKNOWN   0xFF
 Unknown ZCL Type.
 

Settings for zcl_type_info[]

These bitfields should only be used internally by the library, and should be exposed to user code via public APIs.

#define ZCL_T_INVALID   0x0F
 Not a valid ZCL type.
 
#define ZCL_T_DISCRETE   0x80
 Discrete values (bitmap, enum, etc.) that can't be added/subtracted or (if reportable) have a reportable change. More...
 
#define ZCL_T_ANALOG   0x20
 If an attribute isn't discrete, it's analog (signed, unsigned, float, etc.)
 
#define ZCL_T_SIGNED   0x40
 Type is signed (default is unsigned). Only analog types can be signed.
 
#define ZCL_T_FLOAT   0x10
 Type is floating point (single, double or semi-precision).
 
#define ZCL_T_REPORTABLE   (ZCL_T_ANALOG | ZCL_T_DISCRETE)
 Type is reportable. More...
 
#define ZCL_T_SIZE_MASK   0x0F
 0x00 to 0x08 represent 0 to 8 bytes; 0x0C is 16 bytes; 0x0D is two-octet size prefix, 0x0E is one-octet size prefix; 0x0F is invalid; 0x09, 0x0A and 0x0B are still available to encode special size information. More...
 
#define ZCL_T_SIZE_INVALID   (ZCL_T_INVALID & ZCL_T_SIZE_MASK)
 Macro used when type is invalid or doesn't have a known size.
 
#define ZCL_T_SIZE_SHORT   0x0E
 First octet of attribute's value is its size.
 
#define ZCL_T_SIZE_LONG   0x0D
 First two octets of attribute's value are its size.
 
#define ZCL_T_SIZE_128BIT   0x0C
 128-bit (16-byte) value
 
#define ZCL_T_SIZE_VARIABLE   0x0B
 variable-length value (array, set, bag, struct)
 

Detailed Description

Macros and structures related to the ZCL datatypes.

All multi-byte types are little-endian.