XBee Firmware Library  1.6.0
Files | Data Structures | Typedefs | Functions | Variables

Files

file  zcl_types.c
 
file  zcl_types.h
 

Data Structures

union  zcl40_t
 40-bit unsigned in host-byte-order More...
 
union  zcl48_t
 48-bit unsigned in host-byte-order More...
 

Typedefs

typedef union zcl40_t zcl40_t
 40-bit unsigned in host-byte-order More...
 
typedef union zcl48_t zcl48_t
 48-bit unsigned in host-byte-order More...
 
typedef PACKED_STRUCT zcl_date_t
 Date (for #ZCL_TYPE_TIME_DATE Data Type) More...
 
typedef PACKED_STRUCT zcl_timeofday_t
 Time of Day (for #ZCL_TYPE_TIME_TOD Data Type) More...
 
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

uint8_t day
 1-31 or 0xff for unused More...
 
uint8_t dayofweek
 1-7 (1 = Monday, 7 = Sunday) or 0xff for unused More...
 
uint16_t high16
 
uint8_t high8
 
uint8_t hundredths
 0-99 or 0xff for unused More...
 
uint32_t low32
 
uint32_t low32
 
uint8_t minutes
 0-59 or 0xff for unused More...
 
 mixed
 
 mixed
 
uint8_t month
 1-12 or 0xff for unused More...
 
 PACKED_STRUCT
 
 PACKED_STRUCT
 
uint8_t seconds
 0-59 or 0xff for unused More...
 
uint16_t u16 [3]
 
uint8_t u8 [5]
 
uint8_t u8 [6]
 
const uint8_t zcl_type_info [256]
 Table to store information on each ZCL datatype. More...
 
const uint8_t zcl_type_info [256]
 Table to store information on each ZCL datatype. More...
 

Detailed Description

Typedef Documentation

typedef union zcl40_t zcl40_t

40-bit unsigned in host-byte-order

typedef union zcl48_t zcl48_t

48-bit unsigned in host-byte-order

Initial value:
{
uint8_t year
unsigned char uint8_t
A unsigned char variable 8 bits.
Definition: types.h:43

Date (for #ZCL_TYPE_TIME_DATE Data Type)

year - 1900 or 0xff for unused

Initial value:
{
uint8_t hours
unsigned char uint8_t
A unsigned char variable 8 bits.
Definition: types.h:43

Time of Day (for #ZCL_TYPE_TIME_TOD Data Type)

0-23 or 0xff for unused

Function Documentation

zcl_types_debug int zcl_sizeof_type ( uint8_t  type)

Return the number of octets used by a given ZCL datatype.

Parameters
[in]typeType to look up. Typically one of the ZCL_TYPE_* macros, or the type element of an attribute record.
Return values
ZCL_SIZE_INVALIDunknown or invalid type
ZCL_SIZE_SHORT1-octet size prefix
ZCL_SIZE_LONG2-octet size prefix
ZCL_SIZE_VARIABLEvariable-length type (array, struct, set, bag)
>=0number of octets used by type (0 to 8, 16)
See also
zigbee/zcl_types.h
zcl_types_debug const char * zcl_type_name ( uint8_t  type)

Return a descriptive string for a given ZCL attribute type.

Parameters
[in]typeZCL attribute type
Returns
Pointer to a string description of the type, or "INVALID_0xHH" on unrecognized types (where HH is the hex representation of the type). Never returns NULL.

Variable Documentation

uint8_t day

1-31 or 0xff for unused

uint8_t dayofweek

1-7 (1 = Monday, 7 = Sunday) or 0xff for unused

uint16_t high16
uint8_t high8
uint8_t hundredths

0-99 or 0xff for unused

uint32_t low32
uint32_t low32
uint8_t minutes

0-59 or 0xff for unused

mixed
mixed
uint8_t month

1-12 or 0xff for unused

PACKED_STRUCT
Initial value:
{
#if BYTE_ORDER == LITTLE_ENDIAN
uint32_t low32
PACKED_STRUCT
Initial value:
{
#if BYTE_ORDER == LITTLE_ENDIAN
uint32_t low32
uint8_t seconds

0-59 or 0xff for unused

uint16_t u16[3]
uint8_t u8[5]
uint8_t u8[6]
const uint8_t zcl_type_info[256]

Table to store information on each ZCL datatype.

Lower 4 bits encode size (0 to 8 octets, 16 octets, one-byte size prefix, two-byte size prefix), upper 4 bits encode additional information.

Need to represent 0 to 8 octets, 16 octets, size in first octet, size in first two octets. 12 possible values.

Using this table, it may be possible to simplify the encode/decode functions greatly – just use memcpy or swapcpy to copy the given number of bytes.

Special case for floating point values if the platform doesn't use IEEE floats, and to convert from 2-byte semi-precision float to 4-byte float.

const uint8_t zcl_type_info[256]

Table to store information on each ZCL datatype.

Lower 4 bits encode size (0 to 8 octets, 16 octets, one-byte size prefix, two-byte size prefix), upper 4 bits encode additional information.

Need to represent 0 to 8 octets, 16 octets, size in first octet, size in first two octets. 12 possible values.

Using this table, it may be possible to simplify the encode/decode functions greatly – just use memcpy or swapcpy to copy the given number of bytes.

Special case for floating point values if the platform doesn't use IEEE floats, and to convert from 2-byte semi-precision float to 4-byte float.