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.

zcl函数在zcl文档里的说明的疑问(求助TI工程师)

Other Parts Discussed in Thread: Z-STACK

z-stack协议栈里的所有函数在文档里都有说明吗?比如zcl库,在HomeAutomation的例子里面,有一些函数在zcl的文档里就没有,如zclClosures_RegisterDoorLockCmdCallbacks()这个函数(Z-Stack Home 1.2.1),还有其他一些函数也找不到说明,这些函数应该是协议栈定义好的,但为什么没有这个函数的说明呢?

  • /*********************************************************************
     * @fn      zclClosures_RegisterDoorLockCmdCallbacks
     *
     * @brief   Register an applications DoorLock command callbacks
     *
     * @param   endpoint - application's endpoint
     * @param   callbacks - pointer to the callback record.
     *
     * @return  ZMemError if not able to allocate
     */
    ZStatus_t zclClosures_RegisterDoorLockCmdCallbacks( uint8 endpoint, zclClosures_DoorLockAppCallbacks_t *callbacks )
    {
      zclClosuresDoorLockCBRec_t *pNewItem;
      zclClosuresDoorLockCBRec_t *pLoop;
    
      // Register as a ZCL Plugin
      if ( !zclDoorLockPluginRegisted )
      {
        zcl_registerPlugin( ZCL_CLUSTER_ID_CLOSURES_DOOR_LOCK,
                            ZCL_CLUSTER_ID_CLOSURES_DOOR_LOCK,
                            zclClosures_HdlIncoming );
        zclDoorLockPluginRegisted = TRUE;
      }
    
      // Fill in the new profile list
      pNewItem = zcl_mem_alloc( sizeof( zclClosuresDoorLockCBRec_t ) );
      if ( pNewItem == NULL )
      {
        return ( ZMemError );
      }
    
      pNewItem->next = (zclClosuresDoorLockCBRec_t *)NULL;
      pNewItem->endpoint = endpoint;
      pNewItem->CBs = callbacks;
    
      // Find spot in list
      if ( zclClosuresDoorLockCBs == NULL )
      {
        zclClosuresDoorLockCBs = pNewItem;
      }
      else
      {
        // Look for end of list
        pLoop = zclClosuresDoorLockCBs;
        while ( pLoop->next != NULL )
        {
          pLoop = pLoop->next;
        }
    
        // Put new item at end of list
        pLoop->next = pNewItem;
      }
      return ( ZSuccess );
    }
  • 我知道这个函数在哪,我的问题是:这些函数在zcl文档里面为什么没有说明呢?ZCL应该是按照ZigBee官方协议的Standard-ZigBee Home Automation标准实现的吧?里面的很多功能是用户自己实现还是协议栈实现的?

    还想问个问题:

    1.要实现哪些回调函数以及回调函数在回调数组里面的排序是自己定义还是z-stack定义好的?

    2.zclGeneral_HdlIncoming()函数是在哪里被调用的,这个没有找到。