Logo
Developing with ZBOSS for Zigbee
ZGP Sink API

Data Structures

struct  zgp_to_zb_cmd_mapping_s
 Mapping of ZGPD command ID to Zigbee ZCL command ID. More...
 
struct  zb_zgps_mapping_entry_additional_info_option_selector_s
 Mapping table entry additional info option selector structure Figure 84 – Format of the Option selector field of the Option record field of the Translation Table entry. More...
 
struct  zb_zgps_mapping_entry_generic_switch_option_data_s
 Mapping table entry additional info generic switch option data structure Figure 85 – Format of the Option data of the Generic switch command execution option of the Translation Table entry. More...
 
struct  zb_zgps_mapping_entry_generic_switch_option_s
 Mapping table entry additional info generic switch option structure. More...
 
struct  zb_zgps_mapping_entry_additional_info_option_record_s
 Mapping table entry additional info option record structure A.3.6.2.2 GPD application functionality translation Figure 83 – Format of the Option record field of the Translation Table entry. More...
 
struct  zb_zgps_mapping_entry_additional_info_s
 Mapping table entry additional info structure Figure 82 – Format of the Additional information block field of the Translation Table entry. More...
 
struct  zb_zgps_mapping_entry_s
 Mapping table entry structure. More...
 

Macros

#define ZB_ZGP_ZCL_CMD_ID_UNDEFINED   (0xff)
 
#define ZB_ZGP_ZCL_CLUSTER_ID_UNDEFINED   (0xffff)
 
#define ZB_GPDF_CMD_UNDEFINED   (0xff)
 
#define ZB_ZGP_MAPPING_ENTRY_ENDPOINT_PASS_RAW_GPDF_TO_APP   (0xfc)
 
#define ZB_ZGP_MAPPING_ENTRY_ENDPOINT_NO_PAIRS   (0xfd)
 
#define ZB_ZGP_MAPPING_ENTRY_ENDPOINT_ALL_ARE_MATCHED   (0xff)
 
#define ZB_ZGP_MAPPING_ENTRY_NO_PAYLOAD   (0x00)
 
#define ZB_ZGP_MAPPING_ENTRY_GPDF_PAYLOAD   (0xff)
 
#define ZB_ZGP_MAPPING_ENTRY_PARSED_PAYLOAD   (0xfe)
 
#define ZB_ZGP_MAPPING_ENTRY_OPTIONS(app_id, add_info_present)   (((((add_info_present) & 0x01) << 3)) | ((app_id) & 0x07))
 
#define ZB_ZGP_MAPPING_ENTRY_OPTIONS_IS_ADDITIONAL_INFO_PRESENT(options)   (((options) >> 3) & 0x01)
 
#define ZB_ZGP_GET_MAPPING_ENTRY_ZCL_PAYLOAD_PTR(entry)   (&entry->zcl_payload_length+sizeof(entry->zcl_payload_length))
 
#define ZB_ZGP_SET_MAPPING_TABLE(table_ptr, table_size_ptr)
 Set mapping table information that is used to fill ZGP command - ZCL cluster mapping table. More...
 
#define ZB_ZGP_REGISTER_COMM_REQ_CB(cb)
 Register commissioning request callback. More...
 
#define ZB_ZGP_REGISTER_APP_CIC_CB(cb)
 Register application commissioning indication callback. More...
 
#define ZB_ZGP_FILL_GPS_SECURITY_LEVEL(sec_lvl, with_link_key, involve_tc)   (((sec_lvl) & 3U) | ((!!(with_link_key)) << 2U) | ((!!(involve_tc)) << 3U))
 

Typedefs

typedef struct zgp_to_zb_cmd_mapping_s zgp_to_zb_cmd_mapping_t
 Mapping of ZGPD command ID to Zigbee ZCL command ID. More...
 
typedef struct zb_zgps_mapping_entry_additional_info_option_selector_s zb_zgps_mapping_entry_additional_info_option_selector_t
 Mapping table entry additional info option selector structure Figure 84 – Format of the Option selector field of the Option record field of the Translation Table entry. More...
 
typedef struct zb_zgps_mapping_entry_generic_switch_option_data_s zb_zgps_mapping_entry_generic_switch_option_data_t
 Mapping table entry additional info generic switch option data structure Figure 85 – Format of the Option data of the Generic switch command execution option of the Translation Table entry. More...
 
typedef struct zb_zgps_mapping_entry_generic_switch_option_s zb_zgps_mapping_entry_generic_switch_option_t
 Mapping table entry additional info generic switch option structure. More...
 
typedef struct zb_zgps_mapping_entry_additional_info_option_record_s zb_zgps_mapping_entry_additional_info_option_record_t
 Mapping table entry additional info option record structure A.3.6.2.2 GPD application functionality translation Figure 83 – Format of the Option record field of the Translation Table entry. More...
 
typedef struct zb_zgps_mapping_entry_additional_info_s zb_zgps_mapping_entry_additional_info_t
 Mapping table entry additional info structure Figure 82 – Format of the Additional information block field of the Translation Table entry. More...
 
typedef struct zb_zgps_mapping_entry_s zb_zgps_mapping_entry_t
 Mapping table entry structure. More...
 
typedef void(* zb_zgp_app_comm_ind_cb_t) (zb_zgpd_id_t *zgpd_id, zb_uint8_t param)
 Application callback, indication of the attempted commissioning in GPS operational mode. More...
 

Enumerations

enum  zb_zgps_mapping_entry_8bit_vector_option_ids_e { ZB_ZGPS_MAPPING_ENTRY_8BIT_VECTOR_OPTION_ID_GENERIC_SWITCH_COMMAND_EXECUTION = 0U }
 A.3.6.2.2.1.1 OptionIDs for GPD 8-bit vector commands. More...
 
enum  zb_zgps_mapping_entry_compact_attr_report_option_ids_e { ZB_ZGPS_MAPPING_ENTRY_COMPACT_ATTR_REPORT_REPORTABLE = 0U }
 A.3.6.2.2.1.2 OptionIDs for GPD Compact Attribute Reporting. More...
 

Functions

void zb_zgps_start_commissioning (zb_time_t timeout)
 Puts ZGPS into the commissioning mode. More...
 
void zb_zgps_start_commissioning_on_ep (zb_uint8_t ep, zb_time_t timeout)
 Puts ZGPS into the commissioning mode on a specific endpoint. More...
 
void zb_zgps_stop_commissioning (void)
 Switches ZGPS back to the operational mode from the commissioning mode. More...
 
void zb_zgps_accept_commissioning (zb_bool_t accept)
 Accepts/rejects ZGPD commissioning attempt. More...
 
void zb_zgps_delete_zgpd (zb_uint8_t buf_ref, zb_zgpd_id_t *zgpd_id)
 Removes all information about ZGPD from the stack. More...
 
void zb_zgps_delete_all_zgpd (void)
 Removes all information about all ZGPDs from the stack. More...
 
void zb_zgps_get_diag_data (zb_zgpd_id_t *zgpd_id, zb_uint8_t *lqi, zb_int8_t *rssi)
 Retrieves LQI and RSSI last received from the ZGPD. More...
 
void zb_zgps_set_security_level (zb_uint_t level)
 Sets gpsSecurityLevel GP cluster attribute of GPCB. More...
 
zb_uint8_t zb_zgps_get_security_level (void)
 Gets gpsSecurityLevel GP cluster attribute of the GPCB. More...
 
void zb_zgp_set_shared_security_key_type (zb_uint_t key_type)
 Sets gpSharedSecurityKeyType GP cluster attribute. More...
 
void zb_zgp_set_shared_security_key (zb_uint8_t *key)
 Sets gpSharedSecurityKey GP cluster attribute. More...
 
void zb_zgps_set_commissioning_exit_mode (zb_uint_t cem)
 Sets gpsCommissioningExitMode GP cluster attribute. More...
 
void zb_zgps_set_communication_mode (zgp_communication_mode_t mode)
 Sets gpsCommunicationMode GP cluster attribute of the GPCB. More...
 
zb_ret_t zb_zgp_convert_8bit_vector (zb_uint8_t vector_8bit_cmd_id, zb_uint8_t switch_type, zb_uint8_t num_of_contacts, zb_uint8_t contact_status, zb_uint8_t *zgp_cmd_out)
 The function may be overridden by the application to implement custom translation of 8-bit vector command (generic switch). More...
 
void zb_zgp_gpdf_raw_indication (zb_bufid_t buf_ref)
 Frees the incoming raw GPDF packet (buffer). This function can be overridden by the application to implement custom handling of the buffer. More...
 
void zb_zgp_set_skip_gpdf (zb_uint8_t skip)
 Sets ZBOSS to skip all incoming GPDFs. More...
 
zb_uint8_t zb_zgp_get_skip_gpdf (void)
 Checks if ZBOSS skips all incoming GPDFs. More...
 
void zb_zgp_sync_pib (zb_uint8_t param)
 Calls MLME-SET.request to sync SKIP_ALL_GPF attribute. More...
 

Detailed Description

Macro Definition Documentation

§ ZB_GPDF_CMD_UNDEFINED

§ ZB_ZGP_FILL_GPS_SECURITY_LEVEL

#define ZB_ZGP_FILL_GPS_SECURITY_LEVEL (   sec_lvl,
  with_link_key,
  involve_tc 
)    (((sec_lvl) & 3U) | ((!!(with_link_key)) << 2U) | ((!!(involve_tc)) << 3U))

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Fill security level constant to be passed to zb_zgps_set_security_level()

Described in A.3.3.2.6 gpsSecurityLevel attribute.

Parameters
sec_lvlzb_zgp_security_level_e Minimal GPD Security Level sub-field contains the minimum gpdSecurityLevel this sink accepts
with_link_key1 bit - Protection with the gpLinkKey sub-field, indicates if the GPDs attempting the pairing are required to support protecting the over-the-air exchange of the GPD Key
involve_tcalways zero for the current GPPB specification
Example
Constructing security level value for gpsSecurityLevel

§ ZB_ZGP_GET_MAPPING_ENTRY_ZCL_PAYLOAD_PTR

#define ZB_ZGP_GET_MAPPING_ENTRY_ZCL_PAYLOAD_PTR (   entry)    (&entry->zcl_payload_length+sizeof(entry->zcl_payload_length))

§ ZB_ZGP_MAPPING_ENTRY_ENDPOINT_ALL_ARE_MATCHED

§ ZB_ZGP_MAPPING_ENTRY_ENDPOINT_NO_PAIRS

§ ZB_ZGP_MAPPING_ENTRY_ENDPOINT_PASS_RAW_GPDF_TO_APP

§ ZB_ZGP_MAPPING_ENTRY_GPDF_PAYLOAD

§ ZB_ZGP_MAPPING_ENTRY_NO_PAYLOAD

§ ZB_ZGP_MAPPING_ENTRY_OPTIONS

#define ZB_ZGP_MAPPING_ENTRY_OPTIONS (   app_id,
  add_info_present 
)    (((((add_info_present) & 0x01) << 3)) | ((app_id) & 0x07))

§ ZB_ZGP_MAPPING_ENTRY_OPTIONS_IS_ADDITIONAL_INFO_PRESENT

#define ZB_ZGP_MAPPING_ENTRY_OPTIONS_IS_ADDITIONAL_INFO_PRESENT (   options)    (((options) >> 3) & 0x01)

§ ZB_ZGP_MAPPING_ENTRY_PARSED_PAYLOAD

§ ZB_ZGP_REGISTER_APP_CIC_CB

#define ZB_ZGP_REGISTER_APP_CIC_CB (   cb)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Value:
{ \
zb_zgps_register_app_cic_cb((cb)); \
}

Register application commissioning indication callback.

Parameters
cb[in] Application commissioning indication callback (zb_zgp_app_comm_ind_cb_t)

§ ZB_ZGP_REGISTER_COMM_REQ_CB

#define ZB_ZGP_REGISTER_COMM_REQ_CB (   cb)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Value:
{ \
zb_zgps_register_comm_req_cb((cb)); \
}

Register commissioning request callback.

Parameters
cb[in] Commissioning request callback (zb_zgp_comm_req_cb_t)

§ ZB_ZGP_SET_MAPPING_TABLE

#define ZB_ZGP_SET_MAPPING_TABLE (   table_ptr,
  table_size_ptr 
)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Value:
{ \
zb_zgps_set_mapping_table((table_ptr), (table_size_ptr)); \
}

Set mapping table information that is used to fill ZGP command - ZCL cluster mapping table.

Parameters
[in]table_ptrMapping information, pointer to array of type zb_zgps_mapping_entry_t
[in]table_size_ptrpointer to size of the table - max entry number what can be iterated

§ ZB_ZGP_ZCL_CLUSTER_ID_UNDEFINED

§ ZB_ZGP_ZCL_CMD_ID_UNDEFINED

Typedef Documentation

§ zb_zgp_app_comm_ind_cb_t

typedef void( * zb_zgp_app_comm_ind_cb_t) (zb_zgpd_id_t *zgpd_id, zb_uint8_t param)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Application callback, indication of the attempted commissioning in GPS operational mode.

Application commissioning indication callback notifies application about commissioning attempt from ZGPD. Callback is called when commissioning frame or notification is received from ZGPD. Callback provides to zgpd_id and full incoming packet's data. Based on these parameters user application should decide further actions.

Application commissioning indication callback should be set during ZGP initialization using ZB_ZGP_REGISTER_APP_CIC_CB macro.

Parameters
[in]zgpd_idZGPD ID
[in]parambuffer index, containing GPDF

§ zb_zgps_mapping_entry_additional_info_option_record_t

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Mapping table entry additional info option record structure A.3.6.2.2 GPD application functionality translation Figure 83 – Format of the Option record field of the Translation Table entry.

§ zb_zgps_mapping_entry_additional_info_option_selector_t

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Mapping table entry additional info option selector structure Figure 84 – Format of the Option selector field of the Option record field of the Translation Table entry.

§ zb_zgps_mapping_entry_additional_info_t

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Mapping table entry additional info structure Figure 82 – Format of the Additional information block field of the Translation Table entry.

§ zb_zgps_mapping_entry_generic_switch_option_data_t

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Mapping table entry additional info generic switch option data structure Figure 85 – Format of the Option data of the Generic switch command execution option of the Translation Table entry.

§ zb_zgps_mapping_entry_generic_switch_option_t

§ zb_zgps_mapping_entry_t

§ zgp_to_zb_cmd_mapping_t

Enumeration Type Documentation

§ zb_zgps_mapping_entry_8bit_vector_option_ids_e

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

A.3.6.2.2.1.1 OptionIDs for GPD 8-bit vector commands.

Enumerator
ZB_ZGPS_MAPPING_ENTRY_8BIT_VECTOR_OPTION_ID_GENERIC_SWITCH_COMMAND_EXECUTION 

§ zb_zgps_mapping_entry_compact_attr_report_option_ids_e

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

A.3.6.2.2.1.2 OptionIDs for GPD Compact Attribute Reporting.

Enumerator
ZB_ZGPS_MAPPING_ENTRY_COMPACT_ATTR_REPORT_REPORTABLE 

Function Documentation

§ zb_zgp_convert_8bit_vector()

zb_ret_t zb_zgp_convert_8bit_vector ( zb_uint8_t  vector_8bit_cmd_id,
zb_uint8_t  switch_type,
zb_uint8_t  num_of_contacts,
zb_uint8_t  contact_status,
zb_uint8_t zgp_cmd_out 
)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

The function may be overridden by the application to implement custom translation of 8-bit vector command (generic switch).

Details

If this function is not implemented in the application, then ZBOSS performs a default translation as recommended by ZGP spec (see Green Power Basic specification v1.1.1, tables 51, 52). If no default translation is found, the received command will be dropped.

If this function is implemented in the application, then the application is fully responsible for a translation of GPD 8-bit vector commands. For any return code but RET_OK, ZBOSS will stop command processing and drop it.

Parameters
[in]vector_8bit_cmd_id- incoming command ID: press (0x69) or release (0x6a)
[in]switch_type- switch type of the command's originator (see ZGP spec. A.4.2.1.1.10)
[in]num_of_contacts- number of contacts, which command's originator provides
[in]contact_status- contact status from the payload of the received command
[out]zgp_cmd_out- GPDF command ID, to which incoming command should be translated
Return values
RET_OK- on successful translation
RET_ERROR- on failure
Note
The translation is applied to the GPDF command ID, not to the ZCL command ID.
Example
Sample application implementation of 8-bit vector command translation:
/* "Contact status" possible values for GPD 8-bit vector incoming command.
* Every bit in contact_status is purposed for a specific contact:
* - 0b1 indicates a closed contact
* - 0b0 indicates an open contact
* This sample supports a button switch, which works like a rocker switch. Only
* one contact can be closed, the first contact means "Off", the second contact
* means "On".
*/
#define CONTACT_STATUS_SWITCH_OFF 0x01 /* 0b01 */
#define CONTACT_STATUS_SWITCH_ON 0x02 /* 0b10 */
#ifdef ZB_ZGP_SINK_SUPPORT_LEGACY_8BIT_VECTOR_HANDLING
zb_ret_t zb_zgp_convert_8bit_vector(zb_uint8_t vector_8bit_cmd_id, /* press or release cmd */
zb_uint8_t switch_type, /* see zb_zgpd_switch_type_e */
zb_uint8_t num_of_contacts,
zb_uint8_t contact_status,
zb_uint8_t *zgp_cmd_out)
{
TRACE_MSG(TRACE_APP1, ">> zb_zgp_convert_8bit_vector", (FMT__0));
if ((vector_8bit_cmd_id == ZB_GPDF_CMD_8BIT_VECTOR_PRESS) &&
(num_of_contacts == 2) &&
(switch_type == ZB_GPD_SWITCH_TYPE_BUTTON))
{
if (contact_status == CONTACT_STATUS_SWITCH_ON)
{
*zgp_cmd_out = ZB_GPDF_CMD_ON;
ret = RET_OK;
}
else if (contact_status == CONTACT_STATUS_SWITCH_OFF)
{
*zgp_cmd_out = ZB_GPDF_CMD_OFF;
ret = RET_OK;
}
/* Switch could be a blinds controller with separate "Up" and "Down"
* contacts which can't be closed together. The deactivated code is left
* for demonstration purposes.
*/
#if 0
if (contact_status == 0x02)
{
*zgp_cmd_out = ZB_GPDF_CMD_MOVE_UP;
ret = RET_OK;
}
else if (contact_status == 0x01)
{
*zgp_cmd_out = ZB_GPDF_CMD_MOVE_DOWN;
ret = RET_OK;
}
#endif
}
TRACE_MSG(TRACE_APP1, "<< zb_zgp_convert_8bit_vector, ret %hd", (FMT__H, ret));
return ret;
}
#endif /* ZB_ZGP_SINK_SUPPORT_LEGACY_8BIT_VECTOR_HANDLING */
See also
Green Power Basic specification v1.1.1, chapters A.3.6.2.2.2, A.4.2.2.1

§ zb_zgp_get_skip_gpdf()

zb_uint8_t zb_zgp_get_skip_gpdf ( void  )

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Checks if ZBOSS skips all incoming GPDFs.

Return values
ZB_TRUE- direct GPDF reception is ignored: device works always through the proxy
ZB_FALSE- GPDF is processed: device works as a combo (default)
Attention
To be used for testing only.
See also
zb_zgp_set_skip_gpdf()

§ zb_zgp_gpdf_raw_indication()

void zb_zgp_gpdf_raw_indication ( zb_bufid_t  buf_ref)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Frees the incoming raw GPDF packet (buffer). This function can be overridden by the application to implement custom handling of the buffer.

Details

If this function is implemented in the application, the application itself shall handle freeing the buffer; otherwise ZBOSS will drop the buffer without any additional handling.

Parameters
[in]buf_ref- buffer with incoming raw GPDF packet

§ zb_zgp_set_shared_security_key()

void zb_zgp_set_shared_security_key ( zb_uint8_t key)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Sets gpSharedSecurityKey GP cluster attribute.

Details are described in A.3.3.3.1 gpSharedSecurityKey attribute.

Parameters
[in]key- security key to set

§ zb_zgp_set_shared_security_key_type()

void zb_zgp_set_shared_security_key_type ( zb_uint_t  key_type)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Sets gpSharedSecurityKeyType GP cluster attribute.

Details are described in A.3.3.3.1 gpSharedSecurityKeyType attribute.

Parameters
[in]key_type- security key type to set (see zb_zgp_security_key_type_e())

§ zb_zgp_set_skip_gpdf()

void zb_zgp_set_skip_gpdf ( zb_uint8_t  skip)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Sets ZBOSS to skip all incoming GPDFs.

Parameters
[in]skip
  • ZB_TRUE - to ignore direct GPDF reception: always work through the proxy
  • ZB_FALSE - to process GPDF: work as a combo (default)
Attention
To be used for testing only. This function should be used with the ZB_TRUE parameter to prevent Combo device from receiving GPDFs, thus always working through the Proxy device.

§ zb_zgp_sync_pib()

void zb_zgp_sync_pib ( zb_uint8_t  param)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Calls MLME-SET.request to sync SKIP_ALL_GPF attribute.

Parameters
[in]param- reference to the free buffer
Attention
To be used for testing only.
See also
zb_zgp_set_skip_gpdf
zb_zgp_get_skip_gpdf

§ zb_zgps_accept_commissioning()

void zb_zgps_accept_commissioning ( zb_bool_t  accept)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Accepts/rejects ZGPD commissioning attempt.

This function should be called as an answer to commissioning request made by stack via ZB_ZGP_SIGNAL_APPROVE_COMMISSIONING signal or zb_zgp_comm_req_cb_t() callback.

Also, it can be called from zb_zgp_comm_req_cb_t() callback as well as outside it.

Parameters
[in]accept
  • ZB_TRUE - stack will continue ongoing commissioning process with ZGPD
  • ZB_FALSE - ongoing commissioning process will be terminated

§ zb_zgps_delete_all_zgpd()

void zb_zgps_delete_all_zgpd ( void  )

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Removes all information about all ZGPDs from the stack.

This function clears proxy, sink, mapping tables and TX queue.

§ zb_zgps_delete_zgpd()

void zb_zgps_delete_zgpd ( zb_uint8_t  buf_ref,
zb_zgpd_id_t zgpd_id 
)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Removes all information about ZGPD from the stack.

In ZGP, there is no way to instruct the ZGPD to leave the network. ZGPD can leave the network on its own using the "Decommissioning" command, but ZGPD may miss this command if it was not in the commissioning state.

This function removes all information related to the specified ZGPD from the stack.

Parameters
[in]buf_ref- reference to the free buffer
[in]zgpd_id- pointer to the identifier of the ZGPD to be removed
Note
It is safe to free or overwrite memory pointed by zgpd_id after call.

§ zb_zgps_get_diag_data()

void zb_zgps_get_diag_data ( zb_zgpd_id_t zgpd_id,
zb_uint8_t lqi,
zb_int8_t rssi 
)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Retrieves LQI and RSSI last received from the ZGPD.

If there is no zgpd_id, ZB_MAC_LQI_UNDEFINED and ZB_MAC_RSSI_UNDEFINED will be set respectively.

Parameters
[in]zgpd_id- pointer to the ZGPD identifier
[out]lqi- pointer to store the ZGPD's LQI
[out]rssi- pointer to store the ZGPD's RSSI

§ zb_zgps_get_security_level()

zb_uint8_t zb_zgps_get_security_level ( void  )

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Gets gpsSecurityLevel GP cluster attribute of the GPCB.

Details are described in A.3.3.2.6 gpsSecurityLevel attribute.

Returns
gpsSecurityLevel attribute's value

§ zb_zgps_set_commissioning_exit_mode()

void zb_zgps_set_commissioning_exit_mode ( zb_uint_t  cem)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Sets gpsCommissioningExitMode GP cluster attribute.

Details are described in A.3.3.2.4 gpsCommissioningExitMode attribute.

Parameters
[in]cem- commissioning exit mode to set (see zgp_commissioning_exit_mode_t())

§ zb_zgps_set_communication_mode()

void zb_zgps_set_communication_mode ( zgp_communication_mode_t  mode)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Sets gpsCommunicationMode GP cluster attribute of the GPCB.

Details are described in A.3.3.2.3 gpsCommunicationMode attribute.

Parameters
[in]mode- communication mode to set (see zgp_communication_mode_t())
Example
Set communication mode to ZGP_COMMUNICATION_MODE_LIGHTWEIGHT_UNICAST :

§ zb_zgps_set_security_level()

void zb_zgps_set_security_level ( zb_uint_t  level)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Sets gpsSecurityLevel GP cluster attribute of GPCB.

Details are described in A.3.3.2.6 gpsSecurityLevel attribute.

Parameters
[in]level- security level to set
Example
Setting security level constructed by ZB_ZGP_FILL_GPS_SECURITY_LEVEL

§ zb_zgps_start_commissioning()

void zb_zgps_start_commissioning ( zb_time_t  timeout)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Puts ZGPS into the commissioning mode.

ZB_ZGP_SIGNAL_MODE_CHANGE is generated when sink changes mode from the operational mode to the commissioning mode and vice versa.

ZB_ZGP_SIGNAL_COMMISSIONING is generated if successful commissioning or decommissioning happens.

Parameters
[in]timeout- maximum commissioning time in beacon intervals
  • 0 - no timeout
Note
The mode will be changed back to the operational mode if:
  • "On first Pairing success" is set in the gpsCommissioningModeExit attribute and a successful paring occurs. See ZGP_COMMISSIONING_EXIT_MODE_ON_PAIRING_SUCCESS.
  • timeout parameter is different from 0 (timeout occurs).
  • GP Sink Commissioning Mode command with Action field set to 0x0 is received.
It is safe to call this function when device is already in the commissioning mode. In this case function does nothing.
Example
Starting commissioning for 60 seconds:

§ zb_zgps_start_commissioning_on_ep()

void zb_zgps_start_commissioning_on_ep ( zb_uint8_t  ep,
zb_time_t  timeout 
)

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Puts ZGPS into the commissioning mode on a specific endpoint.

Parameters
[in]ep- endpoint to start commissioning. Will be used for GPD command forwarding
[in]timeout- maximum commissioning time in beacon intervals
  • 0 - no timeout
Note
If timeout occurs, then result of commissioning is ZB_ZGP_COMMISSIONING_TIMED_OUT.
It is safe to call this function when device is already in the commissioning mode. In this case function does nothing.

§ zb_zgps_stop_commissioning()

void zb_zgps_stop_commissioning ( void  )

#include </conan-data/ti_zigbee/9.14.00.04/library-lprf/ga/build/f6d18801b7b469a709ae7e8290b03ecdc7a7ad4c/zboss_r23/include/zboss_api_zgp.h>

Switches ZGPS back to the operational mode from the commissioning mode.

Example
Stopping commissioning: