1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087 |
- /**************************************************************************************************
- Filename: zcl_gp.h
- Revised: $Date: 2011-05-19 16:43:00 -0700 (Thu, 19 May 2011) $
- Revision: $Revision: 26037 $
- Description: This file contains the ZCL Green Power definitions.
- Copyright 2010 - 2011 Texas Instruments Incorporated. All rights reserved.
- IMPORTANT: Your use of this Software is limited to those specific rights
- granted under the terms of a software license agreement between the user
- who downloaded the software, his/her employer (which must be your employer)
- and Texas Instruments Incorporated (the "License"). You may not use this
- Software unless you agree to abide by the terms of the License. The License
- limits your use, and you acknowledge, that the Software may not be modified,
- copied or distributed unless embedded on a Texas Instruments microcontroller
- or used solely and exclusively in conjunction with a Texas Instruments radio
- frequency transceiver, which is integrated into your product. Other than for
- the foregoing purpose, you may not use, reproduce, copy, prepare derivative
- works of, modify, distribute, perform, display or sell this Software and/or
- its documentation for any purpose.
- YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
- PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
- INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
- NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
- TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
- NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
- LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
- INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
- OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
- OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
- (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
- Should you have any questions regarding your right to use this Software,
- contact Texas Instruments Incorporated at www.TI.com.
- **************************************************************************************************/
- #ifndef ZCL_GP_H
- #define ZCL_GP_H
- #ifdef __cplusplus
- extern "C"
- {
- #endif
- /*********************************************************************
- * INCLUDES
- */
- #include "zcl.h"
- /*********************************************************************
- * CONSTANTS
- */
-
- // Fixed Zigbee Green Power Endpoint for Proxy and Target
- #define ZGP_ENDPOINT_ID 0x00F2
-
- // ZGP Infrastructure Device IDs
- #define ZGP_DEVICE_ID_PROXY 0x0500
- #define ZGP_DEVICE_ID_TARGET 0x0501
- #define ZGP_DEVICE_ID_COMBO 0x0502
- #define ZGP_DEVICE_ID_TARGET_PLUS 0x0503
- #define ZGP_DEVICE_ID_COMMISSIONING_TOOL 0x0504
- #define ZGP_DEVICE_ID_PROXY_MINIMUN 0x0505
- #define ZGP_DEVICE_ID_COMBO_MINIMUM 0x0506
- #define ZGP_STUB_SECURITY_NONE 0
- #define ZGP_STUB_SECURITY_ALL 1
-
- /**********************************************/
- /*** Green Power Features ***/
- /**********************************************
- *
- * Use one of the following compilation flags
- * to determine the device type to be created:
- * ZGP_DEVICE_PROXY
- * ZGP_DEVICE_TARGET
- * ZGP_DEVICE_TARGETPLUS
- * ZGP_DEVICE_COMBO
- * ZGP_DEVICE_PROXY_MIN
- * ZGP_DEVICE_COMBO_MIN
- *
- * Comment (or uncomment) the supported features
- * and supported commands bitmasks added to each
- * device in order to control its capabilities.
- *
- **********************************************/
- #define SUPP_ZGP_FEATURE_COMMON 0x0001
- #define SUPP_ZGP_FEATURE_DIRECT 0x0002
- #define SUPP_ZGP_FEATURE_DERIVED_GROUPCAST 0x0004
- #define SUPP_ZGP_FEATURE_PRECOMMISSIONED 0x0008
- #define SUPP_ZGP_FEATURE_UNICAST 0x0010
- #define SUPP_ZGP_FEATURE_LIGHTWEIGHT_UNICAST 0x0020
- #define SUPP_ZGP_FEATURE_SINGLE_HOP_BIDIR_OPER 0x0040
- #define SUPP_ZGP_FEATURE_MULTI_HOP_BIDIR_OPER 0x0080
- #define SUPP_ZGP_FEATURE_PROXY_TABLE_MAINT 0x0100
- #define SUPP_ZGP_FEATURE_SINGLE_HOP_COMMISS 0x0200
- #define SUPP_ZGP_FEATURE_SINGLE_HOP_BIDIR_COMMISS 0x0400
- #define SUPP_ZGP_FEATURE_MULTI_HOP_COMMISS 0x0800
- #define SUPP_ZGP_FEATURE_MULTI_HOP_BIDIR_COMMISS 0x1000
- #define SUPP_ZGP_FEATURE_CT_BASED_COMMISS 0x2000
- #define SUPP_ZGP_FEATURE_MAINT_ZGPD 0x4000
- #define SUPP_ZGP_CMD_NOTIFICAITON 0x0001
- #define SUPP_ZGP_CMD_TUNNELING_STOP 0x0002
- #define SUPP_ZGP_CMD_PAIRING_SEARCH 0x0004
- #define SUPP_ZGP_CMD_NOTIFICATION_RESP 0x0008
- #define SUPP_ZGP_CMD_PAIRING 0x0010
- #define SUPP_ZGP_CMD_PROXY_COMMISSIONING_MODE 0x0020
- #define SUPP_ZGP_CMD_COMMISSIONING_NOTIF 0x0040
- #define SUPP_ZGP_CMD_RESPONSE 0x0080
- #define SUPP_ZGP_CMD_TT_UPDATE 0x0100
- #define SUPP_ZGP_CMD_TT_REQ 0x0200
- #define SUPP_ZGP_CMD_TT_RESP 0x0400
- #define SUPP_ZGP_CMD_CONFIGURE_PAIRING 0x0800
- #if defined ( ZGP_DEVICE_PROXY ) || ( ZGP_DEVICE_COMBO )
- #define ZGP_DEVICE_SUPPORTED_CLIENT_FEATURE ( \
- SUPP_ZGP_FEATURE_COMMON \
- + SUPP_ZGP_FEATURE_DIRECT \
- + SUPP_ZGP_FEATURE_DERIVED_GROUPCAST \
- + SUPP_ZGP_FEATURE_PRECOMMISSIONED \
- + SUPP_ZGP_FEATURE_UNICAST \
- + SUPP_ZGP_FEATURE_LIGHTWEIGHT_UNICAST \
- + SUPP_ZGP_FEATURE_MULTI_HOP_BIDIR_OPER \
- + SUPP_ZGP_FEATURE_PROXY_TABLE_MAINT \
- + SUPP_ZGP_FEATURE_MULTI_HOP_COMMISS \
- + SUPP_ZGP_FEATURE_SINGLE_HOP_BIDIR_COMMISS \
- + SUPP_ZGP_FEATURE_CT_BASED_COMMISS \
- + SUPP_ZGP_FEATURE_MAINT_ZGPD )
- #endif
- #if defined ( ZGP_DEVICE_PROXY_MIN ) || defined ( ZGP_DEVICE_COMBO_MIN )
- #define ZGP_DEVICE_SUPPORTED_CLIENT_FEATURE \
- ( SUPP_ZGP_FEATURE_COMMON \
- + SUPP_ZGP_FEATURE_DIRECT \
- + SUPP_ZGP_FEATURE_DERIVED_GROUPCAST \
- + SUPP_ZGP_FEATURE_PRECOMMISSIONED \
- /* + SUPP_ZGP_FEATURE_UNICAST \
- + SUPP_ZGP_FEATURE_LIGHTWEIGHT_UNICAST \
- + SUPP_ZGP_FEATURE_MULTI_HOP_BIDIR_OPER \
- + SUPP_ZGP_FEATURE_PROXY_TABLE_MAINT \
- + SUPP_ZGP_FEATURE_MULTI_HOP_COMMISS \
- + SUPP_ZGP_FEATURE_SINGLE_HOP_BIDIR_COMMISS \
- + SUPP_ZGP_FEATURE_CT_BASED_COMMISS \
- + SUPP_ZGP_FEATURE_MAINT_ZGPD */ )
- #endif
- #if defined ( ZGP_DEVICE_TARGET )
- #define ZGP_DEVICE_SUPPORTED_SERVER_FEATURE ( \
- SUPP_ZGP_FEATURE_COMMON \
- + SUPP_ZGP_FEATURE_DERIVED_GROUPCAST \
- + SUPP_ZGP_FEATURE_PRECOMMISSIONED \
- + SUPP_ZGP_FEATURE_UNICAST \
- + SUPP_ZGP_FEATURE_LIGHTWEIGHT_UNICAST \
- + SUPP_ZGP_FEATURE_MULTI_HOP_BIDIR_OPER \
- + SUPP_ZGP_FEATURE_PROXY_TABLE_MAINT \
- + SUPP_ZGP_FEATURE_MULTI_HOP_COMMISS \
- + SUPP_ZGP_FEATURE_MULTI_HOP_BIDIR_COMMISS \
- + SUPP_ZGP_FEATURE_CT_BASED_COMMISS \
- + SUPP_ZGP_FEATURE_MAINT_ZGPD )
- #endif
- #if defined ( ZGP_DEVICE_TARGETPLUS ) || ( ZGP_DEVICE_COMBO )
- #define ZGP_DEVICE_SUPPORTED_SERVER_FEATURE ( \
- SUPP_ZGP_FEATURE_COMMON \
- + SUPP_ZGP_FEATURE_DIRECT \
- + SUPP_ZGP_FEATURE_DERIVED_GROUPCAST \
- + SUPP_ZGP_FEATURE_PRECOMMISSIONED \
- + SUPP_ZGP_FEATURE_UNICAST \
- + SUPP_ZGP_FEATURE_LIGHTWEIGHT_UNICAST \
- + SUPP_ZGP_FEATURE_SINGLE_HOP_BIDIR_OPER \
- + SUPP_ZGP_FEATURE_MULTI_HOP_BIDIR_OPER \
- + SUPP_ZGP_FEATURE_PROXY_TABLE_MAINT \
- + SUPP_ZGP_FEATURE_SINGLE_HOP_COMMISS \
- + SUPP_ZGP_FEATURE_SINGLE_HOP_BIDIR_COMMISS \
- + SUPP_ZGP_FEATURE_MULTI_HOP_COMMISS \
- + SUPP_ZGP_FEATURE_MULTI_HOP_BIDIR_COMMISS \
- + SUPP_ZGP_FEATURE_CT_BASED_COMMISS \
- + SUPP_ZGP_FEATURE_MAINT_ZGPD )
- #endif
- #if defined ( ZGP_DEVICE_COMBO_MIN )
- #define ZGP_DEVICE_SUPPORTED_SERVER_FEATURE ( \
- SUPP_ZGP_FEATURE_COMMON \
- + SUPP_ZGP_FEATURE_DIRECT \
- + SUPP_ZGP_FEATURE_DERIVED_GROUPCAST \
- + SUPP_ZGP_FEATURE_PRECOMMISSIONED \
- + SUPP_ZGP_FEATURE_SINGLE_HOP_BIDIR_OPER \
- + SUPP_ZGP_FEATURE_MULTI_HOP_BIDIR_OPER \
- + SUPP_ZGP_FEATURE_PROXY_TABLE_MAINT \
- + SUPP_ZGP_FEATURE_SINGLE_HOP_COMMISS \
- + SUPP_ZGP_FEATURE_SINGLE_HOP_BIDIR_COMMISS \
- + SUPP_ZGP_FEATURE_MULTI_HOP_COMMISS \
- + SUPP_ZGP_FEATURE_MULTI_HOP_BIDIR_COMMISS \
- + SUPP_ZGP_FEATURE_CT_BASED_COMMISS \
- + SUPP_ZGP_FEATURE_MAINT_ZGPD )
- #endif
- #if defined ( ZGP_DEVICE_PROXY ) || ( ZGP_DEVICE_COMBO )
- #define ZGP_DEVICE_SUPPORTED_CLIENT_TX_CMD ( \
- SUPP_ZGP_CMD_NOTIFICAITON \
- + SUPP_ZGP_CMD_TUNNELING_STOP \
- + SUPP_ZGP_CMD_PAIRING_SEARCH \
- + SUPP_ZGP_CMD_COMMISSIONING_NOTIF )
- #define ZGP_DEVICE_SUPPORTED_CLIENT_RX_CMD ( \
- SUPP_ZGP_CMD_NOTIFICAITON \
- + SUPP_ZGP_CMD_TUNNELING_STOP \
- + SUPP_ZGP_CMD_PAIRING_SEARCH \
- + SUPP_ZGP_CMD_NOTIFICATION_RESP \
- + SUPP_ZGP_CMD_PAIRING \
- + SUPP_ZGP_CMD_PROXY_COMMISSIONING_MODE \
- + SUPP_ZGP_CMD_COMMISSIONING_NOTIF \
- + SUPP_ZGP_CMD_RESPONSE )
- #endif
- #if defined ( ZGP_DEVICE_PROXY_MIN ) || defined ( ZGP_DEVICE_COMBO_MIN )
- #define ZGP_DEVICE_SUPPORTED_CLIENT_TX_CMD ( \
- SUPP_ZGP_CMD_NOTIFICAITON \
- /* + SUPP_ZGP_CMD_TUNNELING_STOP \
- + SUPP_ZGP_CMD_PAIRING_SEARCH \
- + SUPP_ZGP_CMD_COMMISSIONING_NOTIF */ )
- #define ZGP_DEVICE_SUPPORTED_CLIENT_RX_CMD ( \
- SUPP_ZGP_CMD_PAIRING \
- /* + SUPP_ZGP_CMD_NOTIFICAITON \
- + SUPP_ZGP_CMD_TUNNELING_STOP \
- + SUPP_ZGP_CMD_PAIRING_SEARCH \
- + SUPP_ZGP_CMD_NOTIFICATION_RESP \
- + SUPP_ZGP_CMD_PROXY_COMMISSIONING_MODE \
- + SUPP_ZGP_CMD_COMMISSIONING_NOTIF \
- + SUPP_ZGP_CMD_RESPONSE */ )
- #endif
- #if defined ( ZGP_DEVICE_TARGET ) || defined ( ZGP_DEVICE_TARGETPLUS ) || ( ZGP_DEVICE_COMBO )
- #define ZGP_DEVICE_SUPPORTED_SERVER_TX_CMD ( \
- SUPP_ZGP_CMD_NOTIFICATION_RESP \
- + SUPP_ZGP_CMD_PAIRING \
- + SUPP_ZGP_CMD_PROXY_COMMISSIONING_MODE \
- + SUPP_ZGP_CMD_RESPONSE \
- + SUPP_ZGP_CMD_TT_RESP \
- + SUPP_ZGP_CMD_CONFIGURE_PAIRING )
- #define ZGP_DEVICE_SUPPORTED_SERVER_RX_CMD ( \
- + SUPP_ZGP_CMD_NOTIFICAITON \
- + SUPP_ZGP_CMD_PAIRING_SEARCH \
- + SUPP_ZGP_CMD_PAIRING \
- + SUPP_ZGP_CMD_PROXY_COMMISSIONING_MODE \
- + SUPP_ZGP_CMD_COMMISSIONING_NOTIF \
- + SUPP_ZGP_CMD_TT_UPDATE \
- + SUPP_ZGP_CMD_TT_REQ \
- + SUPP_ZGP_CMD_CONFIGURE_PAIRING )
- #endif
- #if defined ( ZGP_DEVICE_COMBO_MIN )
- #define ZGP_DEVICE_SUPPORTED_SERVER_TX_CMD ( \
- + SUPP_ZGP_CMD_NOTIFICAITON \
- + SUPP_ZGP_CMD_PAIRING_SEARCH \
- + SUPP_ZGP_CMD_PAIRING \
- + SUPP_ZGP_CMD_PROXY_COMMISSIONING_MODE \
- + SUPP_ZGP_CMD_COMMISSIONING_NOTIF \
- + SUPP_ZGP_CMD_RESPONSE \
- + SUPP_ZGP_CMD_TT_UPDATE \
- + SUPP_ZGP_CMD_TT_REQ \
- + SUPP_ZGP_CMD_TT_RESP \
- + SUPP_ZGP_CMD_CONFIGURE_PAIRING )
- #define ZGP_DEVICE_SUPPORTED_SERVER_RX_CMD ZGP_DEVICE_SUPPORTED_SERVER_TX_CMD
- #endif
- #ifndef ZGP_DEVICE_SUPPORTED_CLIENT_TX_CMD
- #define ZGP_DEVICE_SUPPORTED_CLIENT_TX_CMD 0x0000
- #endif
- #ifndef ZGP_DEVICE_SUPPORTED_CLIENT_RX_CMD
- #define ZGP_DEVICE_SUPPORTED_CLIENT_RX_CMD 0x0000
- #endif
- #ifndef ZGP_DEVICE_SUPPORTED_SERVER_TX_CMD
- #define ZGP_DEVICE_SUPPORTED_SERVER_TX_CMD 0x0000
- #endif
- #ifndef ZGP_DEVICE_SUPPORTED_SERVER_RX_CMD
- #define ZGP_DEVICE_SUPPORTED_SERVER_RX_CMD 0x0000
- #endif
-
- #ifndef ZGP_DEVICE_SUPPORTED_CLIENT_FEATURE
- #define ZGP_DEVICE_SUPPORTED_CLIENT_FEATURE 0x0000
- #endif
- #ifndef ZGP_DEVICE_SUPPORTED_SERVER_FEATURE
- #define ZGP_DEVICE_SUPPORTED_SERVER_FEATURE 0x0000
- #endif
- #define SUPPORTED_C_FEATURE(x) ( ZGP_DEVICE_SUPPORTED_CLIENT_FEATURE & (x) )
- #define SUPPORTED_S_FEATURE(x) ( ZGP_DEVICE_SUPPORTED_SERVER_FEATURE & (x) )
- #define SUPPORTED_FEATURE(x) ( SUPPORTED_C_FEATURE(x) || SUPPORTED_S_FEATURE(x) )
- #define SUPPORTED_C_RX_CMD(x) ( ZGP_DEVICE_SUPPORTED_CLIENT_RX_CMD & (x) )
- #define SUPPORTED_C_TX_CMD(x) ( ZGP_DEVICE_SUPPORTED_CLIENT_TX_CMD & (x) )
- #define SUPPORTED_S_RX_CMD(x) ( ZGP_DEVICE_SUPPORTED_SERVER_RX_CMD & (x) )
- #define SUPPORTED_S_TX_CMD(x) ( ZGP_DEVICE_SUPPORTED_SERVER_TX_CMD & (x) )
- #define SUPPORTED_RX_CMD(x) ( SUPPORTED_C_RX_CMD(x) || SUPPORTED_S_RX_CMD(x) )
- #define SUPPORTED_TX_CMD(x) ( SUPPORTED_C_TX_CMD(x) || SUPPORTED_S_TX_CMD(x) )
- #define ZGP_FEATURE_STUB_SECURITY
- #if !defined ( ZGP_STUB_SECURITY )
- #if defined ( ZGP_FEATURE_STUB_SECURITY )
- #define ZGP_STUB_SECURITY (ZGP_STUB_SECURITY_ALL)
- #else
- #define ZGP_STUB_SECURITY (ZGP_STUB_SECURITY_NONE)
- #endif
- #endif
-
- #define ZGP_DEVICE_COMISSIONING_TOOL
-
- /**********************************************/
- /*** Green Power Attributes ***/
- /**********************************************/
- // Server Attributes
- #define ATTRID_GP_MAX_GPTT_ENTRIES 0x0000
- #define ATTRID_GP_SINK_TABLE 0x0001
- #define ATTRID_GP_COMM_MODE 0x0002
- #define ATTRID_GP_COMM_EXIT_MODE 0x0003
- #define ATTRID_GP_COMM_WINDOW 0x0004
- #define ATTRID_GP_SECURITY_LEVEL 0x0005
-
- #define ATTRID_GP_SHARED_SECURITY_KEYTYPE 0x0020
- #define ATTRID_GP_SHARED_SECURITY_KEY 0x0021
- #define ATTRID_GP_LINK_KEY 0x0022
- // Client Attributes
- #define ATTRID_GP_MAX_PROXY_ENTRIES 0x0010
- #define ATTRID_GP_PROXY_TABLE 0x0011
- #define ATTRID_GP_NOTIFICATION_RETRY_NUMBER 0x0012
- #define ATTRID_GP_NOTIFICATION_RETRY_TIMER 0x0013
- #define ATTRID_GP_MAX_SEARCH_COUNTER 0x0014
- #define ATTRID_GP_BLOCKED_SRC_ID 0x0015
- // Server Commands
- #define COMMAND_ZGP_NOTIFICATION 0x00
- #define COMMAND_ZGP_PAIRING_SEARCH 0x01
- #define COMMAND_ZGP_TUNNELING_STOP 0x03
- #define COMMAND_ZGP_COMMISSIONING_NOTIFICATION 0x04
- #define COMMAND_ZGP_COMMISSIONING_SUCCESS 0x05
- #define COMMAND_ZGP_TRANSLATION_TABLE_UPDATE 0x07
- #define COMMAND_ZGP_TRANSLATION_TABLE_REQUEST 0x08
- #define COMMAND_ZGP_CONFIGURE_PAIRING 0x09
-
- // Client Commands
- #define COMMAND_ZGP_NOTIFICATION_RESPONSE 0x00
- #define COMMAND_ZGP_PAIRING 0x01
- #define COMMAND_ZGP_PROXY_COMMISSIONING_MODE 0x02
- #define COMMAND_ZGP_RESPONSE 0x06
- #define COMMAND_ZGP_TRANSLATION_TABLE_RESPONSE 0x08
-
- // Command Header Lengths
- #define ZGP_CMDHDRLEN_NOTIFICATION 11
- #define ZGP_CMDHDRLEN_NOTIFICATION_EXTENDED 3
- #define ZGP_CMDHDRLEN_COMMISSIONING_NOTIFICATION 10
- #define ZGP_CMDHDRLEN_TRANSLATION_TABLE_UPDATE 6
- #define ZGP_CMD_TRANSLATION_TABLE_ENTRY_LEN 7
- #define ZGP_CMD_TRANSLATION_TABLE_RSP_ENTRY_LEN 12
- #define ZGP_CMDHDRLEN_CONFIGURE_PAIRING 8
- #define ZGP_CMDHDRLEN_PAIRING 6
- #define ZGP_CMDHDRLEN_RESPONSE 8
- #define ZGP_CMDHDRLEN_TRANSLATION_TABLE_RESPONSE 4
-
- // Tunneling/Communication Modes
- #define ZGP_TUNNEL_MODE_UNICAST 0x00
- #define ZGP_TUNNEL_MODE_GROUP_DGROUPID 0x01
- #define ZGP_TUNNEL_MODE_GROUP_COMM_GROUPID 0x02
- #define ZGP_TUNNEL_MODE_UNICAST_MINIMAL 0x03
-
- // Security Key Types
- #define ZGP_KEYTYPE_NONE 0
- #define ZGP_KEYTYPE_NWK 1
- #define ZGP_KEYTYPE_GROUP 2
- #define ZGP_KEYTYPE_NWK_DERIVED_GROUP 3
- #define ZGP_KEYTYPE_OOBKEY 4
- #define ZGP_KEYTYPE_DERIVED_INDIVIDUAL 7
-
- // Security Level Mode
- #define ZGP_SECURITY_LEVEL_NONE 0
- #define ZGP_SECURITY_LEVEL_SMALL 1
- #define ZGP_SECURITY_LEVEL_LONG 2
- #define ZGP_SECURITY_LEVEL_FULL 3
-
- #define ZGP_SECURITY_LEVEL_SMALL_MIC_SIZE 2
- #define ZGP_SECURITY_LEVEL_STD_MIC_SIZE 4
-
- // Exit Mode Attribute definitions (bitmap)
- #define ZGP_EXIT_MODE_ON_COMMISSIONING_WINDOW_EXPIRATION 0x01
- #define ZGP_EXIT_MODE_ON_FIRST_PAIRING_SUCCESS 0x02
- #define ZGP_EXIT_MODE_ON_PROXY_COMMISSIONING_MODE 0x04
-
- // ATTRID_GP_SHARED_SECURITY_KEYTYPE
- #define ZGP_SHARED_KEYTYPE_NONE 0x00
- #define ZGP_SHARED_KEYTYPE_NWK 0x01
- #define ZGP_SHARED_KEYTYPE_GROUP 0x02
- #define ZGP_SHARED_KEYTYPE_NWK_DERIVED_GROUP 0x03
-
- #define ZGP_TEMP_MASTER_CHANNEL_MASK 0x0F
- // Radius field for groupcast communication
- #define ZGP_GROUPCAST_RADIUS_DEFAULT 0xFF
- // Translation Table NV definitions
- #define ZGP_TRANSLATIONTABLE_ENTRY_MAX_ENDPOINTS 5
- #define ZGP_TRANSLATIONTABLE_ENTRY_MAX_PAYLOAD_LEN 4
-
-
- /*********************************************************************
- * TYPEDEFS
- */
- // Sink Table Entry Options field
- typedef struct
- {
- unsigned int commMode:2; // accepted tunneling mode for this SrcID. ie. ZGP_TUNNEL_MODE_UNICAST
- unsigned int seqNumCap:1; //
- unsigned int rxOnCap:1; // reception capability on this ZGPD.
- unsigned int fixedLoc:1; // set if the location of this ZGPD is expected to change.
- unsigned int assignAlias:1; // indicates that the assigned alias as stored in the ZGPD AssignedAlias field shall be used instead of the alias derived from SrcID.
- unsigned int secUse:1; // Security related fields of the Sink Table entry are present
- unsigned int commissioned:1; // Reserved for future use
- } gpSinkTableOptionsBits_t;
- // ZGP Sink Table Options field bitmap
- typedef union
- {
- gpSinkTableOptionsBits_t optBits;
- uint8 optByte;
- } gpSinkTableOptions_t;
- // ZGP Sink Table Security Options field
- typedef struct
- {
- unsigned int level:2; // security Level
- unsigned int keyType:3; // Key Type
- unsigned int reserved:3; // Reserved for future use
- } gpSinkTableSecOptionsBits_t;
- typedef union
- {
- gpSinkTableSecOptionsBits_t optBits;
- uint8 optByte;
- } gpSinkTableSecOptions_t;
- //typedef struct
- //{
- // uint8 endpoint;
- // uint16 clusterID;
- //} zgpPairedEndpoint_t;
- // ZGP Sink Table Entry
- typedef struct
- {
- uint32 srcID; // srcID of the paired ZGPD
- uint8 deviceID; // The paired device's ID.
- gpSinkTableOptions_t bitmap; // Options field
- gpSinkTableSecOptions_t secOptions; // The security options
- uint16 tempMaster; // Temp Master
- uint8 seqNum; // The last received sequence number from this ZGPD
- uint16 preCommGroupID; // Pre-Commissioned Group ID
- uint16 assignedAlias; // The commissioned 16 bit ID to be used as alias for this ZGPD
- uint8 groupcastRadius; // The range limit of groupcast
- uint32 secFrameCounter; // The incoming security frame counter for the srcID
- uint8 secKey[SEC_KEY_LEN]; // The security key for the srcID. It me be skipped, if common/derived key is used (as indicated by securityUse)
- // uint8 numEndpoints; // number of elements in the following array
- // zgpPairedEndpoint_t endpoints[]; // array of endpoints
-
- // shorthand "Options" access
- #define ST_commissioned bitmap.optBits.commissioned
- #define ST_securityUse bitmap.optBits.secUse
- #define assignedAliasFlag bitmap.optBits.assignAlias
- #define fixedLocation bitmap.optBits.fixedLoc
- #define rxOnCapability bitmap.optBits.rxOnCap
- #define seqNumCapability bitmap.optBits.seqNumCap
- #define tunnelCommMode bitmap.optBits.commMode
- } zclGP_SinkTableEntry_t;
- // Proxy Table Entry Options field
- typedef struct
- {
- unsigned int entryActive:1; // indicates that the current Proxy Table entry is active. A Proxy Table entry with the EntryActive flag equal to 0b0 can contain the SearchCounter field
- unsigned int entryValid:1; // indicates that the current Proxy Table entry contains complete sink information
- unsigned int seqNumCap:1; //
- unsigned int unicastZGPS:1; // indicates that there is at least one ZGPS paired to this SrcID, that require unicast communication mode. Then, Sink address list field is present.
- unsigned int derivedGroupZGPS:1; // indicates that there is at least one ZGPS paired to this SrcID, that requires groupcast communication mode with automatically-derived DGroupID
- unsigned int commGroupZGPS:1; // indicates that there is at least one ZGPS paired to this SrcID, that require groupcast communication mode with the commissioned GroupID
- unsigned int firstToFwd:1; // flag used for zgppTunnelingDelay calculation
- unsigned int inRange:1; // indicates that this ZGPD is in range if this ZGPP. The default value is FALSE
- unsigned int ZGPDFixed:1; // indicates portability capabilities of this ZGPD. The default value is FALSE
- unsigned int allUnicastRoutes:1; // if set to 0b1, indicates that the ZGPP has active routes to all unicast sinks for this SrcID; if set to 0b0, it indicates that at least one unicast route is missing.
- unsigned int assignedAlias:1; // indicates that the ZGPD has an assigned alias
- unsigned int securityUse:1; // indicates that security-related fields of the Sink Table entry are present
- unsigned int reserved:4; // Reserved for future use
- } gpProxyTableOptionsBits_t;
- // ZGP Proxy Table Options field bitmap
- typedef union
- {
- gpProxyTableOptionsBits_t optBits;
- uint8 optWord;
- } gpProxyTableOptions_t;
- // ZGP Sink Table Security Options field
- typedef struct
- {
- unsigned int level:2; // security Level
- unsigned int keyType:3; // Key Type
- unsigned int reserved:3; // Reserved for future use
- } gpProxyTableSecOptionsBits_t;
- typedef union
- {
- gpProxyTableSecOptionsBits_t optBits;
- uint8 optByte;
- } gpProxyTableSecOptions_t;
- typedef struct
- {
- uint8 ieeeAddr[Z_EXTADDR_LEN];
- uint16 nwkAddr;
- } zgpAddressList_t;
- // ZGP Proxy Table Entry
- typedef struct
- {
- uint32 srcID; // srcID of the paired ZGPD
- gpProxyTableOptions_t bitmap; // Options field
- gpProxyTableSecOptions_t secOptions; // The security options
- uint8 seqNum; // The last received sequence number from this ZGPD
- uint16 assignedAlias; // The commissioned 16 bit ID to be used as alias for this ZGPD
- uint32 secFrameCounter; // The incoming security frame counter for the srcID
- uint8 secKey[SEC_KEY_LEN]; // The security key for the srcID. It me be skipped, if common/derived key is used (as indicated by securityUse)
- uint8 numSinkAddrs; // The number of items in the Sink Address List
- uint8 numSinkGroups; // The number of items in the Sink Group List
- uint8 groupcastRadius; // The range limit of groupcast
- uint8 searchCounter;
-
- // shorthand "Options" access
- #define PT_securityUse bitmap.optBits.securityUse
- #define PT_assignedAlias bitmap.optBits.assignedAlias
- #define PT_allUnicastRoutes bitmap.optBits.allUnicastRoutes
- #define PT_ZGPDFixed bitmap.optBits.ZGPDFixed
- #define PT_inRange bitmap.optBits.inRange
- #define PT_firstToFwd bitmap.optBits.firstToFwd
- #define PT_commGroupZGPS bitmap.optBits.commGroupZGPS
- #define PT_derivedGroupZGPS bitmap.optBits.derivedGroupZGPS
- #define PT_unicastZGPS bitmap.optBits.unicastZGPS
- #define PT_seqNumCap bitmap.optBits.seqNumCap
- #define PT_entryValid bitmap.optBits.entryValid
- #define PT_entryActive bitmap.optBits.entryActive
- } zclGP_ProxyTableEntry_t;
- typedef struct
- {
- zclGP_ProxyTableEntry_t *pHdr; // Proxy Table Entry fields
- zgpAddressList_t *pAddrList; // Proxy Table Sink Address List
- uint16 *pGroupList; // Proxy Table Sink Group List
- } zclGP_ProxyTable_t;
- // ZGP Notification Options field bitmap
- typedef struct
- {
- unsigned int alsoUcast:1; // Indicates presence of ZGPSs paired to the same srcID with a different communications mode, as stored in this ZGPP's Green Power Device Table
- unsigned int alsoDerivedGrp:1; // Indicates presence of ZGPSs paired to the same srcID with a different communications mode, as stored in this ZGPP's Green Power Device Table
- unsigned int alsoCommGrp:1; // Indicates presence of ZGPSs paired to the same srcID with a different communications mode, as stored in this ZGPP's Green Power Device Table
- unsigned int secLevel:2; // GPDF security level field
- unsigned int secKeyType:3; // GPDF security key type field
- unsigned int appointTempMst:1; // When set, indiates that the fields ZGPP short address and ZGPP Distance are present
- unsigned int zgppGPDFTxQFull:1; // indicates whether the ZGPP can still receive and store a GPDF Response for this SGPD srcID
- unsigned int reserved:6; // Reserved for future use
- } notificationOptionsbits_t;
- // ZGP Notification Options field bitmap
- typedef union
- {
- notificationOptionsbits_t optBits;
- uint16 optWord;
- } notificationOptions_t;
- // ZGP Notification
- typedef struct
- {
- notificationOptions_t bitmap;
- uint32 ZGPDSrcID;
- uint32 ZGPDSecFrameCounter;
- uint8 ZGPDCmdID;
- uint16 ZGPPShortAddr;
- uint8 ZGPPDistance;
- uint8 payloadLen;
- uint8 *pZGPDCmdPayload;
-
- // shorthand "Options" access
- #define zgppGPDFTxQueueFull bitmap.optBits.zgppGPDFTxQFull
- #define ZGPPpresent bitmap.optBits.appointTempMst
- #define notificationSecKeyType bitmap.optBits.secKeyType
- #define notificationSecLevel bitmap.optBits.secLevel
- #define alsoCommissionedGroup bitmap.optBits.alsoCommGrp
- #define alsoDerivedGroup bitmap.optBits.alsoDerivedGrp
- #define alsoUnicast bitmap.optBits.alsoUcast
- } zclGPNotification_t;
- // ZGP Pairing Search "Options" field
- typedef struct
- {
- unsigned int reqUCastSinks:1; // the proxy requests pairing information on uinicast sinks for the specified ZGPD
- unsigned int reqDerivedGCSinks:1; // the proxy requests pairing information on sinks accepting derived groupcast communication mode for the specified ZGPD
- unsigned int reqCommGCSinks:1; // the proxy requests pairing information on sinks accepting commissioned GroupID communication mode for the specified ZGPD
- unsigned int reqZGPDFC:1; // the proxy requests the security frame counter for the specified ZGPD
- unsigned int reqZGPDKey:1; // the proxy requests the security key for the specified ZGPD
- unsigned int reserved:3; // Reserved for future use
- } pairingSearchOptionsbits_t;
- // ZGP Pairing Search Options field bitmap
- typedef union
- {
- pairingSearchOptionsbits_t optBits;
- uint8 optByte;
- } pairingSearchOptions_t;
- // ZGP Pairing Search
- typedef struct
- {
- pairingSearchOptions_t bitmap;
- uint32 ZGPDSrcID;
-
- // shorthand "Options" access
- #define requestZGPDKey bitmap.optBits.reqZGPDKey
- #define requestZGPDFrameCounter bitmap.optBits.reqZGPDFC
- #define requestCommGroupcastSinks bitmap.optBits.reqCommGCSinks
- #define requestDerivedGroupcastSinks bitmap.optBits.reqDerivedGCSinks
- #define requestUnicastSinks bitmap.optBits.reqUCastSinks
- } zclGPPairingSearch_t;
- // ZGP Tunneling Stop "Options" field
- typedef struct
- {
- unsigned int alsoDerivedGp:1; // indicates the presence of derived Groupcast sink for the specified ZGPD
- unsigned int alsoCommGp:1; // indicates the presence of commissioned Groupcast sink for the specified ZGPD
- unsigned int reserved:6; // Reserved for future use
- } tunnelingStopOptionsbits_t;
- // ZGP Tunneling Stop Options field bitmap
- typedef union
- {
- tunnelingStopOptionsbits_t optBits;
- uint8 optByte;
- } tunnelingStopOptions_t;
- // ZGP Tunneling Stop
- typedef struct
- {
- tunnelingStopOptions_t bitmap;
- uint32 ZGPDSrcID;
- uint32 ZGPDFrameCounter;
- uint16 ZGPPShortAddr;
- uint8 ZGPPDistance;
-
- // These fields aren't sent over the air
- // They are used when queueing the message
- uint8 ZGPDCmdID;
- uint8 payloadLen;
- uint8 *pPayload;
-
- // shorthand "Options" access
- #define tsAlsoCommGrp bitmap.optBits.alsoCommGp
- #define tsAlsoDerivedGrp bitmap.optBits.alsoDerivedGp
- } zclGPTunnelingStop_t;
- // ZGP Commissioning Notification Options field bitmap
- typedef struct
- {
- unsigned int appTempMaster:1; // allows the ZGPP to request ZGPS to select a ZGPP to foward commisioning reply to GPDF to this ZGPD
- unsigned int secLevel:2; // GPDF security level field
- unsigned int secKeyType:3; // GPDF security key type field
- unsigned int secProcFailed:1; // the commissioning GPDF was protected but the security check failed
- unsigned int reserved:1; // Reserved for future use
- } notCommOptionsbits_t;
- // ZGP Commissioning Notification Options field bitmap
- typedef union
- {
- notCommOptionsbits_t optBits;
- uint8 optByte;
- } notCommOptions_t;
- // ZGP Commissioning Notification
- typedef struct
- {
- notCommOptions_t bitmap;
- uint32 ZGPDSrcID;
- uint32 ZGPDFrameCounter;
- uint16 ZGPPShortAddr;
- uint8 ZGPPDistance;
- uint8 ZGPDCmdID;
- uint32 MIC;
- uint8 payloadLen;
- uint8 *pPayload;
-
- // shorthand "Options" access
- #define secProcessingFailed bitmap.optBits.secProcFailed
- #define commSecKeyType bitmap.optBits.secKeyType
- #define commSecLevel bitmap.optBits.secLevel
- #define appointTempMaster bitmap.optBits.appTempMaster
- } zclGPCommNotification_t;
- // ZGP Translation Table
- typedef struct
- {
- uint8 ZGPDCmdID; // ZGPD Command ID
- uint16 profileID; // destination profile ID
- uint16 clusterID; // destination cluster ID
- uint8 cmdID; // destination command ID
- uint8 cmdPayloadLen;
- uint8 cmdPayload[ZGP_TRANSLATIONTABLE_ENTRY_MAX_PAYLOAD_LEN];
- } zgpTranslationTableUpdateRec_t;
- // ZGP Translation Table Response
- typedef struct
- {
- uint32 ZGPDSrcID; // ZGPD ID
- uint8 ZGPDCmdID; // ZGPD Command ID
- uint8 endPoint; // destination endpoint
- uint16 profileID; // destination profile ID
- uint16 clusterID; // destination cluster ID
- uint8 cmdID; // destination command ID
- uint8 cmdPayloadLen;
- uint8 cmdPayload[ZGP_TRANSLATIONTABLE_ENTRY_MAX_PAYLOAD_LEN];
- } zgpTranslationTableListEntry_t;
- typedef struct
- {
- unsigned int addTranslation:1;
- unsigned int translationsNum:3;
- unsigned int reserved:4;
- } zgpTranslationTableUpdateOptionsBits_t;
- typedef union
- {
- zgpTranslationTableUpdateOptionsBits_t optBits;
- uint8 optByte;
- } zgpTranslationTableUpdateOptions_t;
- // ZGP Translation Table Update Options field bitmap
- typedef struct
- {
- zgpTranslationTableUpdateOptions_t bitmap;
- uint32 ZGPDSrcID;
- uint8 endPoint;
- zgpTranslationTableUpdateRec_t translationsSet[];
-
- // shorthand "Options" access
- #define TT_UpdateAddTrans bitmap.optBits.addTranslation
- #define TT_UpdateTransNum bitmap.optBits.translationsNum
- } zclGPTranslationTableUpdate_t;
- // ZGP Translation Table Response Command
- typedef struct
- {
- uint8 status; // SUCCESS or NOT_SUPPORTED
- uint8 totalNumEntries; // number of entries in the ZGPD Command Translation Table of this ZGPS
- uint8 startIndex; // this value equals the value in the request command
- uint8 count; // number of translation table entries in this response command
- zgpTranslationTableListEntry_t transTable[]; // translation table entries
- } zclGPTranslationTableResponse_t;
- // ZGP Translation Table Request Command
- typedef struct
- {
- uint8 startIndex; // The starting index into the ZGPD command translation table from which to get device information.
- } zclGPTranslationRequest_t;
- // ZGP Notification Response Options field bitmap
- typedef struct
- {
- unsigned int firstToFwd:1; // The notification reached the ZGPS first
- unsigned int noPairingFlag:1; // Indicates the sink has no pairing with the srcID
- unsigned int reserved:6; // Reserved for future use
- } notRspOptionsbits_t;
- // ZGP Notification Response Options field bitmap
- typedef union
- {
- notRspOptionsbits_t optBits;
- uint8 optByte;
- } notRspOptions_t;
- // ZGP Notification Response
- typedef struct
- {
- notRspOptions_t bitmap;
- uint32 ZGPDSrcID;
- uint32 ZGPDFrameCounter;
-
- // shorthand "Options" access
- #define noPairing bitmap.optBits.noPairingFlag
- #define firstToForward bitmap.optBits.firstToFwd
- } zclGPNotificationRsp_t;
- // ZGP Pairing Options field bitmap
- typedef struct
- {
- unsigned int addSink:1; // whether the ZGP Sink wishes to add or remove Proxy Table pairing to the ZGPD
- unsigned int removeZGPD:1; // indicates (1) that the ZGPD is being removed from the network.
- unsigned int commMode:2; // communication mode requested by the ZGPS. ie ZGP_TUNNEL_MODE_UNICAST
- unsigned int zgpdFixed:1; // if set, copy the FixedLocation field of the Sink Table
- unsigned int macSeqNoCap:1; // if set, copy the MAC sequence number capabilities from the Sink Table
- unsigned int secLevel:2; // carry the values from the Sink Table
- unsigned int secKeyType:3; // carry the values from the Sink Table
- unsigned int fcPresent:1; // indicates whether the Security Frame Counter is present
- unsigned int keyPresent:1; // indicates whether the Security key is present
- unsigned int aliasPresent:1; // indicates whether the Assigned Alias is present in this message
- unsigned int fwdRadiusPresent:1; // indicates whether the Forward Radius is present in this message
- unsigned int reserved:1; // Reserved for future use
- } pairingOptionsbits_t;
- // ZGP Pairing Options field bitmap
- typedef union
- {
- pairingOptionsbits_t optBits;
- uint16 optWord;
- } pairingOptions_t;
- // ZGP Pairing Command
- typedef struct
- {
- pairingOptions_t bitmap;
- uint32 ZGPDSrcID;
- uint8 sinkIEEEAddr[Z_EXTADDR_LEN];
- uint16 sinkNwkAddr;
- uint16 sinkGroupID;
- uint8 deviceID;
- uint32 ZGPDFrameCounter;
- uint8 ZGPDKey[SEC_KEY_LEN];
- uint16 assignedAlias;
- uint8 forwardingRadius;
-
- // shorthand "Options" access
- #define pairingFwdRadiusPresent bitmap.optBits.fwdRadiusPresent
- #define pairingAliasPresent bitmap.optBits.aliasPresent
- #define pairingsecKeyPresent bitmap.optBits.keyPresent
- #define pairingsecFCPresent bitmap.optBits.fcPresent
- #define pairingtempMasterPresent bitmap.optBits.tempMasterPresent
- #define pairingSecKeyType bitmap.optBits.secKeyType
- #define pairingSecLevel bitmap.optBits.secLevel
- #define pairingMacSeqNoCap bitmap.optBits.macSeqNoCap
- #define pairingFixedLocation bitmap.optBits.zgpdFixed
- #define pairingCommMode bitmap.optBits.commMode
- #define pairingRemoveZGPD bitmap.optBits.removeZGPD
- #define pairingAddSink bitmap.optBits.addSink
- } zclGPPairing_t;
- // ZGP Proxy Commissioning Mode Options field bitmap
- typedef struct
- {
- unsigned int action:1; // indicates a request to enter commissioning mode, if 0 indicates a request to exist commissioning mode
- unsigned int exitMode:2; // zgpsCommissioningExitMode attribute bitmap. ie. ZGP_EXIT_MODE_ON_COMMISSIONING_WINDOW_EXPIRATION
- unsigned int channelPresent:1; // indicates whether the channel field is present
- unsigned int feedback:1; // if set, it requests proxies to report commissioning success on successfully sending GPDF Commissioning Response frame, if 0, it request to report receiving Commissioning GPDF with the correct parameter values.
- unsigned int reserved:2; // Reserved for future use
- } proxyCommOptionsbits_t;
- // ZGP Proxy Commissioning Mode Options field bitmap
- typedef union
- {
- proxyCommOptionsbits_t optBits;
- uint8 optByte;
- } proxyCommOptions_t;
- // ZGP Proxy Commissioning Mode Command
- typedef struct
- {
- proxyCommOptions_t bitmap;
- uint16 commissioningWindow;
- uint8 channel;
-
- // shorthand "Options" access
- #define proxyCommFeedback bitmap.optBits.feedback
- #define proxyCommChannelPresent bitmap.optBits.channelPresent
- #define proxyCommExitMode bitmap.optBits.exitMode
- #define proxyCommAction bitmap.optBits.action
- } zclGPProxyCommMode_t;
- // ZGP Response Command
- typedef struct
- {
- uint16 ZGPPShortAddr; // address of the ZGPP which will transmit the GPDF Response frame to the ZGPD
- uint8 ZGPPTxChan; // indicates the channel the Response GPDF will be sent on.
- uint32 ZGPDSrcID; // intended ZGPD
- uint8 ZGPDCmdID; // ZGPD command ID
- uint8 payloadLen; // Length of the payload field
- uint8 payload[]; // GPDF command payload field
- } zclGPDResponse_t;
- // ZGP Configure Pairing Command
- typedef struct
- {
- zclGP_SinkTableEntry_t sinkTableParams;
- uint8 pairedEPsNum;
- uint8 *pPairedEPsSet;
- } zclGPConfigurePairingCmd_t;
- // This callback is called to process a Notification command
- typedef ZStatus_t (*zclGP_NotificationCB_t)( uint8 transSeqNum, zclGPNotification_t *pCmd );
- // This callback is called to process a Pairing Search command
- typedef ZStatus_t (*zclGP_PairingSearchCB_t)( uint8 transSeqNum, zclGPPairingSearch_t *pCmd );
- // This callback is called to process a Tunnel Stop command
- typedef ZStatus_t (*zclGP_TunnelStopCB_t)( uint8 transSeqNum, zclGPTunnelingStop_t *pCmd );
- // This callback is called to process a Commissioning Notification command
- typedef ZStatus_t (*zclGP_CommissioningNotificationCB_t)( uint8 transSeqNum, zclGPCommNotification_t *pCmd );
- // This callback is called to process a Translation Table Update command
- typedef ZStatus_t (*zclGP_TranslationTableUpdateCB_t)( uint8 transSeqNum, zclGPTranslationTableUpdate_t *pCmd );
- // This callback is called to process a Translation Table Request command
- typedef ZStatus_t (*zclGP_TranslationTableRequestCB_t)( uint8 transSeqNum, zclGPTranslationRequest_t *pCmd );
- // This callback is called to process a Configure Pairing command
- typedef ZStatus_t (*zclGP_ConfigurePairingCB_t)( uint8 transSeqNum, zclGPConfigurePairingCmd_t *pCmd);
- // This callback is called to process a Notification Response command
- typedef ZStatus_t (*zclGP_NotificationResponseCB_t)( uint8 transSeqNum, zclGPNotificationRsp_t *pCmd );
- // This callback is called to process a Pairing command
- typedef ZStatus_t (*zclGP_PairingCB_t)( uint8 transSeqNum, zclGPPairing_t *pCmd );
- // This callback is called to process a Proxy Commissioning Mode command
- typedef ZStatus_t (*zclGP_ProxyCommissioningModeCB_t)( uint8 transSeqNum, zclGPProxyCommMode_t *pCmd );
- // This callback is called to process a Response command
- typedef ZStatus_t (*zclGP_ResponseCB_t)( uint8 transSeqNum, zclGPDResponse_t *pCmd );
- // This callback is called to process a Translation Table Response command
- typedef ZStatus_t (*zclGP_TranslationTableResponseCB_t)( uint8 transSeqNum, zclGPTranslationTableResponse_t *pCmd );
- // Register Callbacks table entry - enter function pointers for callbacks that
- // the application would like to receive
- typedef struct
- {
- // Received Server Commands
- zclGP_NotificationCB_t pfnNotification; // Notification Command
- zclGP_PairingSearchCB_t pfnPairingSearch; // Pairing Search Command
- zclGP_TunnelStopCB_t pfnTunnelStop; // Tunnel Stop Command
- zclGP_CommissioningNotificationCB_t pfnCommissioningNotification; // Commissioning Notification Command
- zclGP_TranslationTableUpdateCB_t pfnTranslationTableUpdate; // Translation Table Update Command
- zclGP_TranslationTableRequestCB_t pfnTranslationTableRequest; // Translation Table Request Command
- zclGP_ConfigurePairingCB_t pfnConfigurePairing; // Configure Pairing Command
-
- // Received Client Commands
- zclGP_NotificationResponseCB_t pfnNotificationResponse; // Notification Response Command
- zclGP_PairingCB_t pfnPairing; // Pairing Command
- zclGP_ProxyCommissioningModeCB_t pfnProxyCommissioningMode; // Proxy Commissioning Mode Command
- zclGP_ResponseCB_t pfnResponse; // Response Command
- zclGP_TranslationTableResponseCB_t pfnTranslationTableResponse; // Translation Table Response Command
- } zclGP_AppCallbacks_t;
- /*********************************************************************
- * VARIABLES
- */
- /*********************************************************************
- * FUNCTIONS
- */
- /*
- * Register for callbacks from this cluster library
- */
- extern ZStatus_t zclGP_RegisterCmdCallbacks( uint8 endpoint, zclGP_AppCallbacks_t *callbacks );
- /*
- * Call to send out a Notification Command
- * pNotification - all of the command's parameters
- */
- extern ZStatus_t zclGP_Send_Notification( uint8 srcEP, afAddrType_t *dstAddr,
- zclGPNotification_t *pNotification,
- uint8 disableDefaultRsp, uint8 seqNum );
- /*
- * Call to send out a Pairing Search Command
- * pPairingSearch - all of the command's parameters
- */
- extern ZStatus_t zclGP_Send_PairingSearch( uint8 srcEP, afAddrType_t *dstAddr,
- zclGPPairingSearch_t *pPairingSearch,
- uint8 disableDefaultRsp, uint8 seqNum );
- /*
- * Call to send out a Tunneling Stop Command
- * pTunnelingStop - all of the command's parameters
- */
- extern ZStatus_t zclGP_Send_TunnelingStop( uint8 srcEP, afAddrType_t *dstAddr,
- zclGPTunnelingStop_t *pTunnelingStop,
- uint8 disableDefaultRsp, uint8 seqNum );
- /*
- * Call to send out a Commissioning Notification Command
- * pCommNotif - all of the command's parameters
- */
- extern ZStatus_t zclGP_Send_CommissioningNotification( uint8 srcEP, afAddrType_t *dstAddr,
- zclGPCommNotification_t *pCommNotif,
- uint8 disableDefaultRsp, uint8 seqNum );
- /*
- * Call to send out a Translation Table Update Command
- * pTransTableUpdate - all of the command's parameters
- */
- extern ZStatus_t zclGP_Send_TranslationTableUpdate( uint8 srcEP, afAddrType_t *dstAddr,
- zclGPTranslationTableUpdate_t *pTransTableUpdate,
- uint8 disableDefaultRsp, uint8 seqNum );
- /*
- * Call to send out a Translation Table Request Command
- * pTransTableReq - all of the command's parameters
- */
- extern ZStatus_t zclGP_Send_TranslationTableRequest( uint8 srcEP, afAddrType_t *dstAddr,
- zclGPTranslationRequest_t *pTransTableReq,
- uint8 disableDefaultRsp, uint8 seqNum );
- /*
- * Call to send out a Configure Pairing Command
- * pConfigPairing - all of the command's parameters
- */
- extern ZStatus_t zclGP_Send_ConfigurePairing( uint8 srcEP, afAddrType_t *dstAddr,
- zclGPConfigurePairingCmd_t *pConfigPairing,
- uint8 disableDefaultRsp, uint8 seqNum );
- /*
- * Call to send out a Notification Response Command
- * pNotRsp - all of the command's parameters
- */
- extern ZStatus_t zclGP_Send_NotificationResponse( uint8 srcEP, afAddrType_t *dstAddr,
- zclGPNotificationRsp_t *pNotRsp,
- uint8 disableDefaultRsp, uint8 seqNum );
- /*
- * Call to send out a Pairing Command
- * pPairing - all of the command's parameters
- */
- extern ZStatus_t zclGP_Send_Pairing( uint8 srcEP, afAddrType_t *dstAddr,
- zclGPPairing_t *pPairing,
- uint8 disableDefaultRsp, uint8 seqNum );
- /*
- * Call to send out a Proxy Commissioning Mode Command
- * pProxyCommMode - all of the command's parameters
- */
- extern ZStatus_t zclGP_Send_ProxyCommissioningMode( uint8 srcEP, afAddrType_t *dstAddr,
- zclGPProxyCommMode_t *pProxyCommMode,
- uint8 disableDefaultRsp, uint8 seqNum );
- /*
- * Call to send out a Response Command
- * pRsp - all of the command's parameters
- */
- extern ZStatus_t zclGP_Send_Response( uint8 srcEP, afAddrType_t *dstAddr,
- zclGPDResponse_t *pRsp,
- uint8 disableDefaultRsp, uint8 seqNum );
- /*
- * Call to send out a Translation Table Response Command
- * pTransTblRsp - all of the command's parameters
- */
- extern ZStatus_t zclGP_Send_TranslationTableResponse( uint8 srcEP, afAddrType_t *dstAddr,
- zclGPTranslationTableResponse_t *pTransTblRsp,
- uint8 disableDefaultRsp, uint8 seqNum );
- /*
- * Call to send out a ZCL command according to a Translation Table's entry
- * pTransTblEntry - the Translation Table's entry with the command's parameters
- */
- extern ZStatus_t zclGP_Send_TranslatedCommand( afAddrType_t *dstAddr,
- zgpTranslationTableListEntry_t *pTransTblEntry,
- uint8 disableDefaultRsp, uint8 seqNum );
- #ifdef __cplusplus
- }
- #endif
- #endif /* ZCL_GP_H */
|