ZGP Device Command API
Zigbee Green Power Device (ZGPD) commands related APIs for ESP Zigbee SDK.
API Reference
Header File
Functions
-
void esp_zb_zgpd_stack_init(esp_zb_zgpd_commissioning_signal_callback_t cb)
ZGP device stack initialization.
- Parameters
cb – A callback for indicating the commissioning process for ZGP device
-
void esp_zb_zgpd_init(uint8_t zgp_app_id, uint8_t zgpd_commissioning_method, uint8_t zgpd_device_id)
ZGP device commissioning information initialization.
- Parameters
zgp_app_id – [in] App identifier, refer to esp_zb_zgp_app_id_t
zgpd_commissioning_method – [in] Commissioning method, refer to esp_zb_zgpd_commissioning_method_t
zgpd_device_id – [in] Device identifier, refer to esp_zb_zgpd_dev_id_t
-
esp_err_t esp_zb_zgpd_dev_start(void)
ZGP device start.
- Returns
ESP_OK: on success
ESP_FAIL: on failed
-
void esp_zb_zgpd_main_loop(void)
ZGP device main loop.
-
void esp_zb_zgpd_start_commissioning(void)
ZGP device start commissioning.
-
void esp_zb_zgpd_set_source_id(uint32_t src_id)
Set the source identifier for ZGP device.
- Parameters
src_id – A 32-bit source identifier
-
void esp_zb_zgpd_set_security(uint8_t level, uint8_t type, uint8_t *key)
Set the security information for ZGP device.
- Parameters
level – [in] Security level
type – [in] Security type
key – [in] Security key
-
void esp_zb_zgpd_set_OOB_key(uint8_t *key)
Set the security out-of-the-box key for ZGP device.
- Parameters
key – [in] The OOB key
-
void esp_zb_zgpd_set_channel(uint8_t channel)
Set the channel for ZGP device.
- Parameters
channel – [in] The channel will be set for device
-
void esp_zb_zgpd_set_security_level(uint8_t level)
Set the security level for ZGP device.
- Parameters
level – [in] Security level
-
void esp_zb_zgpd_set_security_key_type(uint8_t type)
Set the type key of security for ZGP device.
- Parameters
type – [in] Security type
-
void esp_zb_zgpd_set_security_frame_counter(uint16_t counter)
Set the frame counter for ZGP device security.
- Parameters
counter – [in] The value of frame counter
-
void esp_zb_zgpd_set_application_info_present(uint8_t presented)
Present the application information setting.
- Parameters
presented – [in] The flag indicates whether to present the application information.
-
void esp_zb_zgpd_config_application_info_cmd(uint8_t presented, uint8_t *cmd)
ZGP device application information presented command setting.
- Parameters
presented – [in] Whether present the application information of ZGP device
cmd – [in] The application information command, note that the first byte indicates the length of command.
-
void esp_zb_zgpd_send_command(esp_zb_zgpd_cmd_id_t cmd_id)
ZGP device send command.
- Parameters
cmd_id – [in] The command identifier will be sent by the ZGP device
Type Definitions
-
typedef enum esp_zb_zgpd_signal_e esp_zb_zgpd_signal_t
ZGP device application signal.
-
typedef enum esp_zb_zgpd_cmd_id_e esp_zb_zgpd_cmd_id_t
Supported command identifier for ZGP device.
Note
1. The recall scene 8-11 are got from LCGW. But GPPB specification does not define recall scenes 8-11. Only 8 scenes are supported.
0x39 - 0x3F, 0x4C - 0x4F, 0x4C - 0x4F, 0x52 - 0x5F, 0x6b-0x6f, 0x70-0x9f, 0xA7 0xA9 - 0xAE, 0xC0 - 0xDF, 0xE5 - 0xEF Reserved
Manufacturer-defined GPD commands (payload is manufacturer-specific)
0xB1 - 0xBE: Manufacturer-defined GPD commands (payload is manufacturer-specific)
0xF4 - 0xF5: Reserved for other commands sent to the GPD
0xF7 - 0xFF: Reserved for other commands sent to the GPD
-
typedef void (*esp_zb_zgpd_commissioning_signal_callback_t)(esp_zb_zgpd_signal_t, esp_err_t)
ZGP device commissioning signal callback.
Enumerations
-
enum esp_zb_zgpd_signal_e
ZGP device application signal.
Values:
-
enumerator ESP_ZB_ZGPD_SIGNAL_DEVICE_STARTED_UP
During the startup process
-
enumerator ESP_ZB_ZGPD_SIGNAL_COMMISSIONING
During the commissioning process
-
enumerator ESP_ZB_ZGPD_SIGNAL_DEVICE_STARTED_UP
-
enum esp_zb_zgpd_cmd_id_e
Supported command identifier for ZGP device.
Note
1. The recall scene 8-11 are got from LCGW. But GPPB specification does not define recall scenes 8-11. Only 8 scenes are supported.
0x39 - 0x3F, 0x4C - 0x4F, 0x4C - 0x4F, 0x52 - 0x5F, 0x6b-0x6f, 0x70-0x9f, 0xA7 0xA9 - 0xAE, 0xC0 - 0xDF, 0xE5 - 0xEF Reserved
Manufacturer-defined GPD commands (payload is manufacturer-specific)
0xB1 - 0xBE: Manufacturer-defined GPD commands (payload is manufacturer-specific)
0xF4 - 0xF5: Reserved for other commands sent to the GPD
0xF7 - 0xFF: Reserved for other commands sent to the GPD
Values:
-
enumerator ESP_ZB_GPDF_CMD_IDENTIFY
Identify
-
enumerator ESP_ZB_GPDF_CMD_RECALL_SCENE0
Recall scene
-
enumerator ESP_ZB_GPDF_CMD_RECALL_SCENE1
-
enumerator ESP_ZB_GPDF_CMD_RECALL_SCENE2
-
enumerator ESP_ZB_GPDF_CMD_RECALL_SCENE3
-
enumerator ESP_ZB_GPDF_CMD_RECALL_SCENE4
-
enumerator ESP_ZB_GPDF_CMD_RECALL_SCENE5
-
enumerator ESP_ZB_GPDF_CMD_RECALL_SCENE6
-
enumerator ESP_ZB_GPDF_CMD_RECALL_SCENE7
-
enumerator ESP_ZB_GPDF_CMD_RECALL_SCENE8
-
enumerator ESP_ZB_GPDF_CMD_RECALL_SCENE9
-
enumerator ESP_ZB_GPDF_CMD_RECALL_SCENE10
-
enumerator ESP_ZB_GPDF_CMD_RECALL_SCENE11
-
enumerator ESP_ZB_GPDF_CMD_STORE_SCENE4
Store Scene
-
enumerator ESP_ZB_GPDF_CMD_STORE_SCENE5
-
enumerator ESP_ZB_GPDF_CMD_STORE_SCENE6
-
enumerator ESP_ZB_GPDF_CMD_STORE_SCENE7
-
enumerator ESP_ZB_GPDF_CMD_OFF
On/Off
-
enumerator ESP_ZB_GPDF_CMD_ON
-
enumerator ESP_ZB_GPDF_CMD_TOGGLE
-
enumerator ESP_ZB_GPDF_CMD_RELEASE
-
enumerator ESP_ZB_GPDF_CMD_MOVE_UP
-
enumerator ESP_ZB_GPDF_CMD_MOVE_DOWN
-
enumerator ESP_ZB_GPDF_CMD_STEP_UP
-
enumerator ESP_ZB_GPDF_CMD_STEP_DOWN
-
enumerator ESP_ZB_GPDF_CMD_LC_STOP
-
enumerator ESP_ZB_GPDF_CMD_MOVE_UP_W_ONOFF
-
enumerator ESP_ZB_GPDF_CMD_MOVE_DOWN_W_ONOFF
-
enumerator ESP_ZB_GPDF_CMD_STEP_UP_W_ONOFF
-
enumerator ESP_ZB_GPDF_CMD_STEP_DOWN_W_ONOFF
-
enumerator ESP_ZB_GPDF_CMD_MOVE_HUE_STOP
-
enumerator ESP_ZB_GPDF_CMD_MOVE_HUE_UP
-
enumerator ESP_ZB_GPDF_CMD_MOVE_HUE_DOWN
-
enumerator ESP_ZB_GPDF_CMD_STEP_HUE_UP
-
enumerator ESP_ZB_GPDF_CMD_STEP_HUE_DOWN
-
enumerator ESP_ZB_GPDF_CMD_MOVE_SATURATION_STOP
-
enumerator ESP_ZB_GPDF_CMD_MOVE_SATURATION_UP
-
enumerator ESP_ZB_GPDF_CMD_MOVE_SATURATION_DOWN
-
enumerator ESP_ZB_GPDF_CMD_STEP_SATURATION_UP
-
enumerator ESP_ZB_GPDF_CMD_STEP_SATURATION_DOWN
-
enumerator ESP_ZB_GPDF_CMD_MOVE_COLOR
-
enumerator ESP_ZB_GPDF_CMD_STEP_COLOR
-
enumerator ESP_ZB_GPDF_CMD_LOCK_DOOR
-
enumerator ESP_ZB_GPDF_CMD_UNLOCK_DOOR
-
enumerator ESP_ZB_GPDF_CMD_PRESS_1_OF_1
-
enumerator ESP_ZB_GPDF_CMD_RELEASE_1_OF_1
-
enumerator ESP_ZB_GPDF_CMD_PRESS_1_OF_2
-
enumerator ESP_ZB_GPDF_CMD_RELEASE_1_OF_2
-
enumerator ESP_ZB_GPDF_CMD_PRESS_2_OF_2
-
enumerator ESP_ZB_GPDF_CMD_RELEASE_2_OF_2
-
enumerator ESP_ZB_GPDF_CMD_SHORT_PRESS_1_OF_1
-
enumerator ESP_ZB_GPDF_CMD_SHORT_PRESS_1_OF_2
-
enumerator ESP_ZB_GPDF_CMD_SHORT_PRESS_2_OF_2
-
enumerator ESP_ZB_GPDF_CMD_8BIT_VECTOR_PRESS
-
enumerator ESP_ZB_GPDF_CMD_8BIT_VECTOR_RELEASE
-
enumerator ESP_ZB_GPDF_CMD_ATTR_REPORT
-
enumerator ESP_ZB_GPDF_CMD_MANUF_SPEC_ATTR_REPORT
-
enumerator ESP_ZB_GPDF_CMD_MULTI_CLUSTER_ATTR_REPORT
-
enumerator ESP_ZB_GPDF_CMD_MANUF_SPEC_MULTI_CLUSTER_ATTR_REPORT
-
enumerator ESP_ZB_GPDF_CMD_REQUEST_ATTRIBUTES
-
enumerator ESP_ZB_GPDF_CMD_READ_ATTR_RESP
-
enumerator ESP_ZB_GPDF_CMD_ZCL_TUNNELING_FROM_ZGPD
-
enumerator ESP_ZB_GPDF_CMD_COMPACT_ATTR_REPORTING
-
enumerator ESP_ZB_GPDF_CMD_ATTR_REPORT_ANY
-
enumerator ESP_ZB_GPDF_CMD_MANUF_DEFINED_B0
-
enumerator ESP_ZB_GPDF_CMD_MANUF_DEFINED_BF
-
enumerator ESP_ZB_GPDF_CMD_COMMISSIONING
-
enumerator ESP_ZB_GPDF_CMD_DECOMMISSIONING
-
enumerator ESP_ZB_GPDF_CMD_SUCCESS
-
enumerator ESP_ZB_GPDF_CMD_CHANNEL_REQUEST
-
enumerator ESP_ZB_GPDF_CMD_APPLICATION_DESCR
-
enumerator ESP_ZB_GPDF_CMD_COMMISSIONING_REPLY
-
enumerator ESP_ZB_GPDF_CMD_WRITE_ATTRIBUTES
-
enumerator ESP_ZB_GPDF_CMD_READ_ATTRIBUTES
-
enumerator ESP_ZB_GPDF_CMD_CHANNEL_CONFIGURATION
-
enumerator ESP_ZB_GPDF_CMD_ZCL_TUNNELING_TO_ZGPD