利用APSME_BindRequest()绑定了一个设备,也用bdb_RepAddAttrCfgRecordDefaultToList()向bdb添加了温度属性记录,那温度变化的时候BDB会Report吗?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
是这样的,你可以找到下面的code:
static void bdb_RepReport( uint8 specificCLusterEndpointIndex )
{
afAddrType_t dstAddr;
zclReportCmd_t *pReportCmd;
uint8 i;
bdbReportAttrClusterEndpoint_t* clusterEndpointItem = NULL;
if( specificCLusterEndpointIndex == BDBREPORTING_INVALIDINDEX )
{
if( bdb_reportingNextClusterEndpointIndex < bdb_reportingClusterEndpointArrayCount )
{
clusterEndpointItem = &(bdb_reportingClusterEndpointArray[bdb_reportingNextClusterEndpointIndex]);
}
}
else
{
clusterEndpointItem = &(bdb_reportingClusterEndpointArray[specificCLusterEndpointIndex]);
}
// actually send the report
if( clusterEndpointItem->consolidatedMaxReportInt != ZCL_REPORTING_OFF && clusterEndpointItem->attrLinkedList.numItems )
{
dstAddr.addrMode = (afAddrMode_t)AddrNotPresent;
dstAddr.addr.shortAddr = 0;
dstAddr.endPoint = clusterEndpointItem->endpoint;
dstAddr.panId = _NIB.nwkPanId;
这是读取bdb_reportingClusterEndpointArray的end device 信息。
你可以直接用zcl_SendReportCmd去report.
我试过了,我用了
zAddrType_t dstAddr;
dstAddr.addrMode = Addr16Bit;
dstAddr.addr.shortAddr = 0x0000; // Coordinator
ZDP_EndDeviceBindReq( &dstAddr, NLME_GetShortAddr(),
SAMPLETHERMOSTAT_ENDPOINT,
zclSampleThermostat_SimpleDesc.AppProfId,
zclSampleThermostat_SimpleDesc.AppNumInClusters, (cId_t *)zclSampleThermostat_SimpleDesc.pAppInClusterList,
zclSampleThermostat_SimpleDesc.AppNumOutClusters, (cId_t *)zclSampleThermostat_SimpleDesc.pAppOutClusterList,
FALSE );
去手动绑定是没有report的,你可以用zcl_SendReportCmd去进行report。