Developing with ZBOSS for Zigbee
ZGP common definitions

Data Structures

union  zb_zgpd_addr_u
 ZGPD address. More...
 
struct  zb_zgpd_id_s
 ZGPD identification info (ZGPD ID) More...
 
struct  zgp_attr_record_s
 
struct  zgp_data_point_desc_options_s
 
struct  zgp_data_point_desc_s
 
struct  zgp_report_desc_options_s
 
struct  zgp_report_desc_s
 

Macros

#define ZGP_ENDPOINT   242
 
#define ZGP_ATTR_OPT_GET_REMAINING_LEN(opt)   ((opt) & 0xFU)
 
#define ZGP_ATTR_OPT_GET_REPORTED(opt)   (((opt) >> 4U) & 0x1U)
 
#define ZGP_ATTR_OPT_GET_VAL_PRESENT(opt)   (((opt) >> 5U) & 0x1U)
 
#define ZB_APP_DESCR_ATTR_VAL_SIZE   8U
 
#define ZB_APP_DESCR_ATTR_REC_SIZE   4U
 
#define ZB_APP_DESCR_REPORT_DATA_SIZE   32U
 
#define SIZE_BY_APP_ID(app_id)   (((app_id) == ZB_ZGP_APP_ID_0000) ? 4U : 8U)
 
#define ZGPD_ID_SIZE(zgpd_id)   SIZE_BY_APP_ID((zgpd_id)->app_id)
 
#define ZB_ZGPD_IDS_ARE_EQUAL(id1, id2)
 
#define ZB_ZGP_SRC_ID_UNSPECIFIED   0x00000000U
 
#define ZB_ZGP_SRC_ID_ALL   (zb_uint32_t)(~0u)
 
#define ZB_INIT_ZGPD_ID(zgpd_id)
 
#define ZB_ZGPD_IS_SPECIFIED(zgpd_id)
 
#define ZB_MAKE_ZGPD_ID(zgpd_id, s_app_id, s_endpoint, s_addr)
 

Typedefs

typedef enum zb_zgp_app_id_e zb_zgp_app_id_t
 ZGPD application ID.
 
typedef union zb_zgpd_addr_u zb_zgpd_addr_t
 ZGPD address. More...
 
typedef struct zb_zgpd_id_s zb_zgpd_id_t
 ZGPD identification info (ZGPD ID) More...
 
typedef struct zgp_attr_record_s zgp_attr_record_t
 
typedef struct zgp_data_point_desc_options_s zgp_data_point_desc_options_t
 
typedef struct zgp_data_point_desc_s zgp_data_point_desc_t
 
typedef struct zgp_report_desc_options_s zgp_report_desc_options_t
 
typedef struct zgp_report_desc_s zgp_report_desc_t
 
typedef enum zb_zgpd_dev_id_e zb_zgpd_dev_id_t
 Possible ZGPD device identifiers. More...
 
typedef enum zb_zgpd_manuf_specific_dev_id_e zb_zgpd_manuf_specific_dev_id_t
 Manufacturer-specific device identifiers for GreanPeak. More...
 
typedef enum zgp_communication_mode_e zgp_communication_mode_t
 
typedef enum zgp_commissioning_exit_mode_e zgp_commissioning_exit_mode_t
 
typedef enum zb_zgp_comm_status_e zb_zgp_comm_status_t
 Possible commissioning result.
 
typedef void(* zb_zgp_comm_req_cb_t) (zb_zgpd_id_t *zgpd_id, zb_uint8_t device_id, zb_uint16_t manuf_id, zb_uint16_t manuf_model_id, zb_ieee_addr_t ieee_addr)
 Commissioning request callback type. More...
 

Enumerations

enum  zb_zgp_app_id_e { ZB_ZGP_APP_ID_0000 = 0x00, ZB_ZGP_APP_ID_0001 = 0x01, ZB_ZGP_APP_ID_0010 = 0x02, ZB_ZGP_APP_ID_INVALID = 0x07 }
 ZGPD application ID. More...
 
enum  zb_zgp_endpoint_e { ZB_ZGP_COMMUNICATION_ENDPOINT, ZB_ZGP_ALL_ENDPOINTS = 255 }
 
enum  zb_zgp_security_level_e { ZB_ZGP_SEC_LEVEL_NO_SECURITY = 0x00, ZB_ZGP_SEC_LEVEL_REDUCED = 0x01, ZB_ZGP_SEC_LEVEL_FULL_NO_ENC = 0x02, ZB_ZGP_SEC_LEVEL_FULL_WITH_ENC = 0x03 }
 ZGP security level type. More...
 
enum  zb_zgp_security_key_type_e {
  ZB_ZGP_SEC_KEY_TYPE_NO_KEY = 0x00, ZB_ZGP_SEC_KEY_TYPE_NWK = 0x01, ZB_ZGP_SEC_KEY_TYPE_GROUP = 0x02, ZB_ZGP_SEC_KEY_TYPE_GROUP_NWK_DERIVED = 0x03,
  ZB_ZGP_SEC_KEY_TYPE_ZGPD_INDIVIDUAL = 0x04, ZB_ZGP_SEC_KEY_TYPE_DERIVED_INDIVIDUAL = 0x07
}
 
enum  zb_zgpd_dev_id_e {
  ZB_ZGP_SIMPLE_GEN_1_STATE_SWITCH_DEV_ID = 0x00, ZB_ZGP_ON_OFF_SWITCH_DEV_ID = 0x02, ZB_ZGP_LEVEL_CONTROL_SWITCH_DEV_ID = 0x03, ZB_ZGP_TEMPERATURE_SENSOR_DEV_ID = 0x30,
  ZB_ZGP_ENVIRONMENT_SENSOR_DEV_ID = 0x33, ZB_ZGP_MANUF_SPECIFIC_DEV_ID = 0xfe, ZB_ZGP_UNDEFINED_DEV_ID = 0xff
}
 Possible ZGPD device identifiers. More...
 
enum  zb_zgpd_manuf_specific_dev_id_e {
  ZB_ZGP_MS_DOOR_SENSOR_DEV_ID = 0x00, ZB_ZGP_MS_DOOR_WINDOW_SENSOR_DEV_ID = 0x01, ZB_ZGP_MS_LEAKAGE_SENSOR_DEV_ID = 0x02, ZB_ZGP_MS_HUMIDITY_SENSOR_DEV_ID = 0x03,
  ZB_ZGP_MS_MOTION_SENSOR_DEV_ID = 0x05, ZB_ZGP_MS_MOVEMENT_SENSOR_DEV_ID = 0x07, ZB_ZGP_MS_SMART_PLUG_DEV_ID = 0X08, ZB_ZGP_MS_KEY_FOB_DEV_ID = 0x0A,
  ZB_ZGP_MS_SMOKE_DETECTOR_DEV_ID = 0x0b, ZB_ZGP_MS_BED_SENSOR_DEV_ID = 0x0c, ZB_ZGP_MS_PARKING_SENSOR_DEV_ID = 0xc0
}
 Manufacturer-specific device identifiers for GreanPeak. More...
 
enum  zgp_communication_mode_e { ZGP_COMMUNICATION_MODE_FULL_UNICAST = 0, ZGP_COMMUNICATION_MODE_GROUPCAST_DERIVED = 1, ZGP_COMMUNICATION_MODE_GROUPCAST_PRECOMMISSIONED = 2, ZGP_COMMUNICATION_MODE_LIGHTWEIGHT_UNICAST = 3 }
 
enum  zgp_commissioning_exit_mode_e {
  ZGP_COMMISSIONING_EXIT_MODE_ON_COMMISSIONING_WINDOW_EXPIRATION = (1<<0), ZGP_COMMISSIONING_EXIT_MODE_ON_PAIRING_SUCCESS = (1<<1), ZGP_COMMISSIONING_EXIT_MODE_ON_GP_PROXY_COMMISSIONING_MODE_EXIT = (1<<2), ZGP_COMMISSIONING_EXIT_MODE_ON_CWE_OR_PS,
  ZGP_COMMISSIONING_EXIT_MODE_ON_CWE_OR_PCM, ZGP_COMMISSIONING_EXIT_MODE_ALL
}
 
enum  zb_zgp_comm_status_e {
  ZB_ZGP_COMMISSIONING_COMPLETED, ZB_ZGP_COMMISSIONING_FAILED, ZB_ZGP_COMMISSIONING_TIMED_OUT, ZB_ZGP_COMMISSIONING_NO_MATCH_ERROR,
  ZB_ZGP_COMMISSIONING_INTERNAL_ERROR, ZB_ZGP_COMMISSIONING_CRITICAL_ERROR, ZB_ZGP_COMMISSIONING_CANCELLED_BY_USER, ZB_ZGP_ZGPD_DECOMMISSIONED
}
 Possible commissioning result. More...
 
enum  zb_zgpd_switch_type_e { ZB_GPD_SWITCH_TYPE_BUTTON = 0x01, ZB_GPD_SWITCH_TYPE_ROCKER = 0x02 }
 
enum  zb_zgpd_cmd_id_e {
  ZB_GPDF_CMD_RECALL_SCENE0 = 0x10, ZB_GPDF_CMD_RECALL_SCENE1 = 0x11, ZB_GPDF_CMD_RECALL_SCENE2 = 0x12, ZB_GPDF_CMD_RECALL_SCENE3 = 0x13,
  ZB_GPDF_CMD_RECALL_SCENE4 = 0x14, ZB_GPDF_CMD_RECALL_SCENE5 = 0x15, ZB_GPDF_CMD_RECALL_SCENE6 = 0x16, ZB_GPDF_CMD_RECALL_SCENE7 = 0x17,
  ZB_GPDF_CMD_RECALL_SCENE8 = 0x18, ZB_GPDF_CMD_RECALL_SCENE9 = 0x19, ZB_GPDF_CMD_RECALL_SCENE10 = 0x1A, ZB_GPDF_CMD_RECALL_SCENE11 = 0x1B,
  ZB_GPDF_CMD_STORE_SCENE4 = 0x1C, ZB_GPDF_CMD_STORE_SCENE5 = 0x1D, ZB_GPDF_CMD_STORE_SCENE6 = 0x1E, ZB_GPDF_CMD_STORE_SCENE7 = 0x1F,
  ZB_GPDF_CMD_OFF = 0x20, ZB_GPDF_CMD_ON = 0x21, ZB_GPDF_CMD_TOGGLE = 0x22, ZB_GPDF_CMD_MOVE_UP = 0x30,
  ZB_GPDF_CMD_MOVE_DOWN = 0x31, ZB_GPDF_CMD_STEP_UP = 0x32, ZB_GPDF_CMD_STEP_DOWN = 0x33, ZB_GPDF_CMD_LC_STOP = 0x34,
  ZB_GPDF_CMD_MOVE_UP_W_ONOFF = 0x35, ZB_GPDF_CMD_MOVE_DOWN_W_ONOFF = 0x36, ZB_GPDF_CMD_STEP_UP_W_ONOFF = 0x37, ZB_GPDF_CMD_STEP_DOWN_W_ONOFF = 0x38,
  ZB_GPDF_CMD_MOVE_HUE_STOP = 0x40, ZB_GPDF_CMD_MOVE_HUE_UP = 0x41, ZB_GPDF_CMD_MOVE_HUE_DOWN = 0x42, ZB_GPDF_CMD_STEP_HUE_UP = 0x43,
  ZB_GPDF_CMD_STEP_HUE_DOWN = 0x44, ZB_GPDF_CMD_MOVE_SATURATION_STOP = 0x45, ZB_GPDF_CMD_MOVE_SATURATION_UP = 0x46, ZB_GPDF_CMD_MOVE_SATURATION_DOWN = 0x47,
  ZB_GPDF_CMD_STEP_SATURATION_UP = 0x48, ZB_GPDF_CMD_STEP_SATURATION_DOWN = 0x49, ZB_GPDF_CMD_MOVE_COLOR = 0x4A, ZB_GPDF_CMD_STEP_COLOR = 0x4B,
  ZB_GPDF_CMD_PRESS_1_OF_1 = 0x60, ZB_GPDF_CMD_RELEASE_1_OF_1 = 0x61, ZB_GPDF_CMD_PRESS_1_OF_2 = 0x62, ZB_GPDF_CMD_RELEASE_1_OF_2 = 0X63,
  ZB_GPDF_CMD_8BIT_VECTOR_PRESS = 0X69, ZB_GPDF_CMD_8BIT_VECTOR_RELEASE = 0X6A, ZB_GPDF_CMD_ATTR_REPORT = 0xA0, ZB_GPDF_CMD_MANUF_SPEC_ATTR_REPORT = 0xA1,
  ZB_GPDF_CMD_MULTI_CLUSTER_ATTR_REPORT = 0xA2, ZB_GPDF_CMD_MANUF_SPEC_MULTI_CLUSTER_ATTR_REPORT = 0xA3, ZB_GPDF_CMD_REQUEST_ATTRIBUTES = 0xA4, ZB_GPDF_CMD_READ_ATTR_RESP = 0xA5,
  ZB_GPDF_CMD_ZCL_TUNNELING_FROM_ZGPD = 0xA6, ZB_GPDF_CMD_COMPACT_ATTR_REPORTING = 0xA8, ZB_GPDF_CMD_MANUF_DEFINED_B0 = 0xB0, ZB_GPDF_CMD_MANUF_DEFINED_BF = 0xBF,
  ZB_GPDF_CMD_COMMISSIONING = 0xE0, ZB_GPDF_CMD_DECOMMISSIONING = 0xE1, ZB_GPDF_CMD_SUCCESS = 0xE2, ZB_GPDF_CMD_CHANNEL_REQUEST = 0xE3,
  ZB_GPDF_CMD_APPLICATION_DESCR = 0xE4, ZB_GPDF_CMD_COMMISSIONING_REPLY = 0xF0, ZB_GPDF_CMD_WRITE_ATTRIBUTES = 0xF1, ZB_GPDF_CMD_READ_ATTRIBUTES = 0xF2,
  ZB_GPDF_CMD_CHANNEL_CONFIGURATION = 0xF3, ZB_GPDF_CMD_ZCL_TUNNELING_TO_ZGPD = 0xF6
}
 Command identifiers sent from or to ZGPD.
 

Detailed Description

Macro Definition Documentation

◆ ZB_INIT_ZGPD_ID

#define ZB_INIT_ZGPD_ID (   zgpd_id)
Value:
{ \
(zgpd_id)->app_id = ZB_ZGP_APP_ID_0000; \
(zgpd_id)->addr.src_id = ZB_ZGP_SRC_ID_UNSPECIFIED; \
}

◆ ZB_MAKE_ZGPD_ID

#define ZB_MAKE_ZGPD_ID (   zgpd_id,
  s_app_id,
  s_endpoint,
  s_addr 
)
Value:
{\
(zgpd_id).app_id = (s_app_id);\
(zgpd_id).endpoint = (s_endpoint);\
(zgpd_id).addr = (s_addr);\
}

◆ ZB_ZGPD_IDS_ARE_EQUAL

#define ZB_ZGPD_IDS_ARE_EQUAL (   id1,
  id2 
)
Value:
(((id1)->app_id == (id2)->app_id) && \
(((id1)->app_id == ZB_ZGP_APP_ID_0000) ? \
((id1)->addr.src_id == (id2)->addr.src_id) : \
(!ZB_MEMCMP(&(id1)->addr.ieee_addr, &(id2)->addr.ieee_addr, sizeof(zb_ieee_addr_t)) &&\
((id1)->endpoint == (id2)->endpoint))))

◆ ZB_ZGPD_IS_SPECIFIED

#define ZB_ZGPD_IS_SPECIFIED (   zgpd_id)
Value:
(((zgpd_id)->app_id != ZB_ZGP_APP_ID_0000) \
|| ((zgpd_id)->addr.src_id != ZB_ZGP_SRC_ID_UNSPECIFIED))

Typedef Documentation

◆ zb_zgp_comm_req_cb_t

typedef void( * zb_zgp_comm_req_cb_t) (zb_zgpd_id_t *zgpd_id, zb_uint8_t device_id, zb_uint16_t manuf_id, zb_uint16_t manuf_model_id, zb_ieee_addr_t ieee_addr)

Commissioning request callback type.

Commissioning request callback notifies application about commissioning attempt from ZGPD. Callback is called when ZGPD sends commissioning frame. Callback provides to user ZGPD ID and ZGPD Device ID. Based on these parameters user application should decide whether commissioning procedure should be continued or not.

Commissioning request callback should be set during ZGP initialization using ZB_ZGP_REGISTER_COMM_REQ_CB macro. If callback is not registered, then ZBOSS accepts all incoming commissioning attempts.

Parameters
zgpd_id[in] ZGPD ID
device_id[in] ZGPD device ID
manuf_id[in] Manufacturer ID (meaningful if device_id = 0xFE or 0xFF)
manuf_model_id[in] Manufacturer model ID (meaningful if device_id = 0xFE or 0xFF)
ieee_addr[in] ZGPD long IEEE address if available, otherwise filled with zeroes
See also
zb_zgps_accept_commissioning
ZB_IS_64BIT_ADDR_ZERO

◆ zb_zgpd_addr_t

ZGPD address.

ZGPD is identified in network whether by SrcId or its IEEE address.

◆ zb_zgpd_dev_id_t

Possible ZGPD device identifiers.

See also
ZGP spec, A.4.3

◆ zb_zgpd_id_t

typedef struct zb_zgpd_id_s zb_zgpd_id_t

ZGPD identification info (ZGPD ID)

ZGPD is identified by SrcId if ApplicationID is ZB_ZGP_APP_ID_0000. Otherwise, ZGPD is identified by its IEEE address.

◆ zb_zgpd_manuf_specific_dev_id_t

Manufacturer-specific device identifiers for GreanPeak.

See also
ZGP spec, A.4.3

◆ zgp_communication_mode_t

Values of gpsCommunicationMode attribute Table 27

Enumeration Type Documentation

◆ zb_zgp_app_id_e

ZGPD application ID.

Enumerator
ZB_ZGP_APP_ID_0000 

ApplicationID value 0b000 - usage of the SrcID

ZB_ZGP_APP_ID_0001 

ApplicationID value 0b001 - LPED

ZB_ZGP_APP_ID_0010 

ApplicationID value 0b010 - usage of the GPD IEEE address.

ZB_ZGP_APP_ID_INVALID 

Invalid ApplicationID

◆ zb_zgp_comm_status_e

Possible commissioning result.

Enumerator
ZB_ZGP_COMMISSIONING_COMPLETED 

Commissioning with some device completed successfully

ZB_ZGP_COMMISSIONING_FAILED 

Commissioning failed. The reason can be:

  • parameters of connection can't be negotiated
  • ZGPD device behaves incorrectly
  • Maximum number of connected ZGPDs is reached
ZB_ZGP_COMMISSIONING_TIMED_OUT 

Commissioning failed, because of timeout

ZB_ZGP_COMMISSIONING_NO_MATCH_ERROR 

No functionality match with commissioning device is found. Maybe matching table is not provided by user application

ZB_ZGP_COMMISSIONING_INTERNAL_ERROR 

Commissioning failed, because some internal error occurred in stack. This type of error is recoverable, so next commissioning attempt can be successful

ZB_ZGP_COMMISSIONING_CRITICAL_ERROR 

Commissioning failed, because some critical error has occurred. Normal functioning of ZGP subsystem is not possible (e.g. physical operational channel can't be changed)

ZB_ZGP_COMMISSIONING_CANCELLED_BY_USER 

User cancelled commissioning by calling zb_zgps_stop_commissioning()

ZB_ZGP_ZGPD_DECOMMISSIONED 

ZGPD sent Decommissioning command

◆ zb_zgp_security_key_type_e

The gpSharedSecurityKeyType attribute can take the following values from Table 48: Table 48 - Values of gpSecurityKeyType

See also Table 12 - Mapping between the gpSecurityKeyType and the SecurityKey sub-field of the Extended NWK Frame Control field

Enumerator
ZB_ZGP_SEC_KEY_TYPE_NO_KEY 

No key

ZB_ZGP_SEC_KEY_TYPE_NWK 

Zigbee NWK key

ZB_ZGP_SEC_KEY_TYPE_GROUP 

ZGPD group key

ZB_ZGP_SEC_KEY_TYPE_GROUP_NWK_DERIVED 

NWK-key derived ZGPD group key

ZB_ZGP_SEC_KEY_TYPE_ZGPD_INDIVIDUAL 

(Individual) out-of-the-box ZGPD key

ZB_ZGP_SEC_KEY_TYPE_DERIVED_INDIVIDUAL 

Derived individual ZGPD key

◆ zb_zgp_security_level_e

ZGP security level type.

See also
ZGP spec, A.1.5.3.2
Enumerator
ZB_ZGP_SEC_LEVEL_NO_SECURITY 

No security

ZB_ZGP_SEC_LEVEL_REDUCED 

1LSB of frame counter and short (2B) MIC

ZB_ZGP_SEC_LEVEL_FULL_NO_ENC 

Full (4B) frame counter and full (4B) MIC

ZB_ZGP_SEC_LEVEL_FULL_WITH_ENC 

Encryption & full (4B) frame counter and full (4B) MIC

◆ zb_zgpd_dev_id_e

Possible ZGPD device identifiers.

See also
ZGP spec, A.4.3
Enumerator
ZB_ZGP_SIMPLE_GEN_1_STATE_SWITCH_DEV_ID 

Simple Generic 1-state ZGP switch

ZB_ZGP_ON_OFF_SWITCH_DEV_ID 

ZGP On/Off switch

ZB_ZGP_LEVEL_CONTROL_SWITCH_DEV_ID 

ZGP Level Control Switch

ZB_ZGP_TEMPERATURE_SENSOR_DEV_ID 

ZGP temperature sensor

ZB_ZGP_ENVIRONMENT_SENSOR_DEV_ID 

ZGP Temperature + Humidity sensor

ZB_ZGP_MANUF_SPECIFIC_DEV_ID 

Manufactures-specific; 2 more fields in the Commissioning frame. See 4.1 Manufacturer Specific Green Power Device Type Use case in Green Power Device Manufacturer Specific Device & Command Definition Proposal

ZB_ZGP_UNDEFINED_DEV_ID 

Undefined device type

◆ zb_zgpd_manuf_specific_dev_id_e

Manufacturer-specific device identifiers for GreanPeak.

See also
ZGP spec, A.4.3
Enumerator
ZB_ZGP_MS_DOOR_SENSOR_DEV_ID 

IAS Zone - Door Sensor

ZB_ZGP_MS_DOOR_WINDOW_SENSOR_DEV_ID 

IAS Zone - Door/Window Sensor

ZB_ZGP_MS_LEAKAGE_SENSOR_DEV_ID 

IAS Zone - Leakage Sensor

ZB_ZGP_MS_HUMIDITY_SENSOR_DEV_ID 

Relative Humidity Sensor

ZB_ZGP_MS_MOTION_SENSOR_DEV_ID 

IAS Zone - Motion sensor

ZB_ZGP_MS_MOVEMENT_SENSOR_DEV_ID 

IAS Zone - Movement sensor

ZB_ZGP_MS_SMART_PLUG_DEV_ID 

GreenPeak Greenpower smart plug

ZB_ZGP_MS_KEY_FOB_DEV_ID 

GreenPeak Greenpower IAS Zone - Key fob

ZB_ZGP_MS_SMOKE_DETECTOR_DEV_ID 

IAS Zone - Smoke Detector

ZB_ZGP_MS_BED_SENSOR_DEV_ID 

IAS Zone - Bed Sensor

ZB_ZGP_MS_PARKING_SENSOR_DEV_ID 

Occupancy - Parking sensor

◆ zgp_communication_mode_e

Values of gpsCommunicationMode attribute Table 27

ZB_ZGP_APP_ID_0000
@ ZB_ZGP_APP_ID_0000
Definition: zboss_api_zgp.h:47
zb_ieee_addr_t
zb_64bit_addr_t zb_ieee_addr_t
Long (64-bit) device address.
Definition: zb_types.h:550