一.z-stack home 1.22a
1.
afStatus_t ZDP_EndDeviceBindReq( zAddrType_t *dstAddr,
uint16 LocalCoordinator,
byte endPoint,
uint16 ProfileID,
byte NumInClusters, cId_t *InClusterList,
byte NumOutClusters, cId_t *OutClusterList,
byte SecurityEnable )
afStatus_t ZDP_BindUnbindReq( uint16 BindOrUnbind, zAddrType_t *dstAddr,
uint8 *SourceAddr, byte SrcEndPoint,
cId_t ClusterID,
zAddrType_t *destinationAddr, byte DstEndPoint,
byte SecurityEnable )
在z-stack home1.22a 中有这一部分:
zAddrType_t dstAddr;
HalLedSet ( HAL_LED_4, HAL_LED_MODE_OFF );
// Initiate an End Device Bind Request, this bind request will
// only use a cluster list that is important to binding.
dstAddr.addrMode = afAddr16Bit;
dstAddr.addr.shortAddr = 0; // Coordinator makes the match
ZDP_EndDeviceBindReq( &dstAddr, NLME_GetShortAddr(),
SAMPLESW_ENDPOINT,
ZCL_HA_PROFILE_ID,
0, NULL, // No incoming clusters to bind
ZCLSAMPLESW_BINDINGLIST, bindingOutClusters,
TRUE );
2.EZ-MODE:
zclEZMode_InvokeData_t ezModeData;
static uint16 clusterIDs[] = { ZCL_CLUSTER_ID_GEN_ON_OFF }; // only bind on the on/off cluster
// Invoke EZ-Mode
ezModeData.endpoint = SAMPLESW_ENDPOINT; // endpoint on which to invoke EZ-Mode
if ( (zclSampleSw_NwkState == DEV_ZB_COORD) ||
(zclSampleSw_NwkState == DEV_ROUTER) ||
(zclSampleSw_NwkState == DEV_END_DEVICE) )
{
ezModeData.onNetwork = TRUE; // node is already on the network
}
else
{
ezModeData.onNetwork = FALSE; // node is not yet on the network
}
ezModeData.initiator = TRUE; // OnOffSwitch is an initiator
ezModeData.numActiveOutClusters = 1; // active output cluster
ezModeData.pActiveOutClusterIDs = clusterIDs;
ezModeData.numActiveInClusters = 0; // no active input clusters
ezModeData.pActiveInClusterIDs = NULL;
zcl_InvokeEZMode( &ezModeData );