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.

BDB_COMMISSIONING_MODE_FINDING_BINDING 如何设置才可以只作为target 而不是target & initiator ?

Genius 3030 points


按照如下方式启动bdb_find_bind设备会作为target & initiator,怎样配置才可以只作为target呢?

bdb_SetIdentifyActiveEndpoint(TEMPERATURE_HUMIDITY_SENSOR_ENDPOINT);
bdb_StartCommissioning(BDB_COMMISSIONING_MODE_FINDING_BINDING);

  • 可以在这个函数得到解答
    /*********************************************************************
    * @fn bdb_zclFindingBindingEpType
    *
    * @brief Gives the Ep Type according to application clusters in
    * simple descriptor
    *
    * @return epType - If Target, Initiator or both
    */
    uint8 bdb_zclFindingBindingEpType( endPointDesc_t *epDesc )
    {
    uint8 epType = 0;
    uint8 status;
    uint8 type1ClusterCnt;
    uint8 type2ClusterCnt;

    type1ClusterCnt = sizeof( bdb_ZclType1Clusters )/sizeof( uint16 );
    type2ClusterCnt = sizeof( bdb_ZclType2Clusters )/sizeof( uint16 );


    // Are there matching type 1 on server side?
    status = ZDO_AnyClusterMatches( epDesc->simpleDesc->AppNumInClusters,
    epDesc->simpleDesc->pAppInClusterList,
    type1ClusterCnt,
    (uint16*)bdb_ZclType1Clusters);

    if( status == TRUE )
    {
    epType |= BDB_FINDING_AND_BINDING_TARGET;
    }

    // Are there matching type 1 on client side?
    status = ZDO_AnyClusterMatches( epDesc->simpleDesc->AppNumOutClusters,
    epDesc->simpleDesc->pAppOutClusterList,
    type1ClusterCnt,
    (uint16*)bdb_ZclType1Clusters);

    if( status == TRUE )
    {
    epType |= BDB_FINDING_AND_BINDING_INITIATOR;
    }

    // Are there matching type 2 on server side?
    status = ZDO_AnyClusterMatches( epDesc->simpleDesc->AppNumInClusters,
    epDesc->simpleDesc->pAppInClusterList,
    type2ClusterCnt,
    (uint16*)bdb_ZclType2Clusters);

    if( status == TRUE )
    {
    epType |= BDB_FINDING_AND_BINDING_INITIATOR;
    }

    // Are there matching type 2 on client side?
    status = ZDO_AnyClusterMatches( epDesc->simpleDesc->AppNumOutClusters,
    epDesc->simpleDesc->pAppOutClusterList,
    type2ClusterCnt,
    (uint16*)bdb_ZclType2Clusters);

    if( status == TRUE )
    {
    epType |= BDB_FINDING_AND_BINDING_TARGET;
    }

    return epType;

    }