Control Bridge
The Control Bridge device is used in nodes that relay control commands issued from another network, for example, in an Internet router with a ZigBee interface.
The Device ID is 0x0840.
The header file for the device is control_bridge.h.
The clusters supported by the device are listed in Section 3.20.1.
The device structure,
tsZLO_ControlBridgeDevice
, is listed in Section 3.20.2.The endpoint registration function for the device, eZLO_RegisterControlBridgeEndPoint(), is detailed in Section 3.20.3.
Supported clusters
The clusters supported by the Control Bridge device are listed in the table below.
Table: Clusters for Control Bridge
Server (Input) side |
Client (Output) side |
---|---|
Mandatory |
|
Basic |
On/Off |
Identify |
Identify |
Groups |
|
Scenes |
|
Level control |
|
Colour control |
|
Optional |
|
OTA upgrade |
OTA upgrade |
Touchlink commissioning |
Touchlink commissioning |
Illuminance measurement |
|
Illuminance level sensing |
|
Occupancy sensing |
The mandatory attributes within each cluster for this device type are indicated in the ZigBee Lighting and Occupancy Device Specification (15-0014-01).
Parent topic:Control Bridge
Device Structure
The following tsZLO_ControlBridgeDevice
structure is the shared structure for a Control Bridge device:
typedef struct
{
tsZCL_EndPointDefinition sEndPoint;
/* Cluster instances */
tsZLO_ControlBridgeDeviceClusterInstances sClusterInstance;
#if (defined CLD_BASIC) && (defined BASIC_SERVER)
/* Basic Cluster - Server */
tsCLD_Basic sBasicServerCluster;
#endif
#if (defined CLD_IDENTIFY) && (defined IDENTIFY_SERVER)
/* Identify Cluster - Server */
tsCLD_Identify sIdentifyServerCluster;
tsCLD_IdentifyCustomDataStructure sIdentifyServerCustomDataStructure;
#endif
/* Recommended Optional Server Cluster */
#if (defined CLD_OTA) && (defined OTA_SERVER)
/* OTA cluster */
tsCLD_AS_Ota sCLD_ServerOTA;
tsOTA_Common sCLD_OTA_ServerCustomDataStruct;
#endif
#if (defined CLD_ZLL_COMMISSION) && (defined ZLL_COMMISSION_SERVER)
tsCLD_ZllCommission sZllCommissionServerCluster;
tsCLD_ZllCommissionCustomDataStructure
sZllCommissionServerCustomDataStructure;
#endif
/*
* Mandatory client clusters
*/
#if (defined CLD_IDENTIFY) && (defined IDENTIFY_CLIENT)
/* Identify Cluster - Client */
tsCLD_Identify sIdentifyClientCluster;
tsCLD_IdentifyCustomDataStructure sIdentifyClientCustomDataStructure;
#endif
#if (defined CLD_BASIC) && (defined BASIC_CLIENT)
/* Basic Cluster - Client */
tsCLD_Basic sBasicClientCluster;
#endif
#if (defined CLD_ONOFF) && (defined ONOFF_CLIENT)
/* On/Off Cluster - Client */
tsCLD_OnOff sOnOffClientCluster;
#endif
#if (defined CLD_LEVEL_CONTROL) && (defined LEVEL_CONTROL_CLIENT)
/* Level Control Cluster - Client */
tsCLD_LevelControl sLevelControlClientCluster;
tsCLD_LevelControlCustomDataStructure
sLevelControlClientCustomDataStructure;
#endif
#if (defined CLD_SCENES) && (defined SCENES_CLIENT)
/* Scenes Cluster - Client */
tsCLD_Scenes sScenesClientCluster;
tsCLD_ScenesCustomDataStructure sScenesClientCustomDataStructure;
#endif
#if (defined CLD_GROUPS) && (defined GROUPS_CLIENT)
/* Groups Cluster - Client */
tsCLD_Groups sGroupsClientCluster;
tsCLD_GroupsCustomDataStructure sGroupsClientCustomDataStructure;
#endif
#if (defined CLD_COLOUR_CONTROL) && (defined COLOUR_CONTROL_CLIENT)
/* Colour Control Cluster - Client */
tsCLD_ColourControl sColourControlClientCluster;
tsCLD_ColourControlCustomDataStructure
sColourControlClientCustomDataStructure;
#endif
/* Recommended Optional client clusters */
#if (defined CLD_OTA) && (defined OTA_CLIENT)
/* OTA cluster */
tsCLD_AS_Ota sCLD_OTA;
tsOTA_Common sCLD_OTA_CustomDataStruct;
#endif
#if( defined CLD_ILLUMINANCE_MEASUREMENT) && (defined ILLUMINANCE_MEASUREMENT_CLIENT)
/* Illuminance Measurement Cluster - Client */
tsCLD_IlluminanceMeasurement sIlluminanceMeasurementClientCluster;
#endif
#if (defined CLD_ILLUMINANCE_LEVEL_SENSING) && (defined ILLUMINANCE_LEVEL_SENSING_CLIENT)
tsCLD_IlluminanceLevelSensing sIlluminanceLevelSensingClientCluster;
#endif
#if (defined CLD_OCCUPANCY_SENSING) && (defined OCCUPANCY_SENSING_CLIENT)
/* Occupancy Sensing Cluster - Client */
tsCLD_OccupancySensing sOccupancySensingClientCluster;
#endif
#if (defined CLD_ZLL_COMMISSION) && (defined ZLL_COMMISSION_CLIENT)
tsCLD_ZllCommission sZllCommissionClientCluster;
tsCLD_ZllCommissionCustomDataStructure
sZllCommissionClientCustomDataStructure;
#endif
}tsZLO_ControlBridgeDevice;
Parent topic:Control Bridge
Registration Function
The following eZLO_RegisterControlBridgeEndPoint() function is the endpoint registration function for a Control Bridge device.
teZCL_Status eZLO_RegisterControlBridgeEndPoint(
uint8 u8EndPointIdentifier,
tfpZCL_ZCLCallBackFunction cbCallBack,
tsZLO_ControlBridgeDevice *psDeviceInfo);
Description
This function is used to register an endpoint which supports a Control Bridge device. The function must be called after eZCL_Initialise().
The specified identifier for the endpoint is a number in the range 1 to 240 (endpoint 0 is reserved for ZigBee use). Application endpoints are normally numbered consecutively starting at 1. The specified number must be less than or equal to the value of ZLO_NUMBER_OF_ENDPOINTS defined in the zcl_options.h file, which represents the highest endpoint number used for applications.
While invoking this function, specify a user-defined callback function, which is invoked when an event associated with the endpoint occurs. This callback function is defined according to the typedef:
typedef void(* tfpZCL_ZCLCallBackFunction)
(tsZCL_CallBackEvent *pCallBackEvent);
Also provide a pointer to a tsZLO_ControlBridgeDevice
structure, described in Section 3.20.2. This structure stores all variables relating to the color Controller device associated with the endpoint. The sEndPoint
and sClusterInstance
fields of this structure are set by this function and must not be directly written to by the application.
The function is called multiple times if more than one endpoint is being used - for example, if more than one Control Bridge device is housed in the same hardware, sharing the same module.
Parameters
u8EndPointIdentifier: Endpoint that is to be associated with the registered structure and callback function.
cbCallBack: Pointer to the function that is used to indicate events to the application for this endpoint.
psDeviceInfo: Pointer to the structure that acts as storage for all variables related to the device being registered on this endpoint (see Section 3.20.2). The
sEndPoint
andsClusterInstance
fields are set by this register function for internal use and must not be written to by the application.
Returns
E_ZCL_SUCCESS
E_ZCL_FAIL
E_ZCL_ERR_PARAMETER_NULL
E_ZCL_ERR_PARAMETER_RANGE
E_ZCL_ERR_EP_RANGE
E_ZCL_ERR_CLUSTER_0
E_ZCL_ERR_CALLBACK_NULL
E_ZCL_ERR_CLUSTER_NULL
E_ZCL_ERR_SECURITY_RANGE
E_ZCL_ERR_CLUSTER_ID_RANGE
E_ZCL_ERR_MANUFACTURER_SPECIFIC
E_ZCL_ERR_ATTRIBUTE_TYPE_UNSUPPORTED
E_ZCL_ERR_ATTRIBUTE_ID_ORDER
E_ZCL_ERR_ATTRIBUTES_ACCESS
The above codes are described in the ZCL User Guide (JNUG3132).
Parent topic:Control Bridge
Parent topic:Lighting and Occupancy Device Types