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.

How to get ZStatus_t from feedback my zcl_SendCommand() ?

Hi,

  I am using  cc2538(SmartRF06+CC2538EM) and Z-Stack Home 1.2.1 ...

When ZC do zcl_SendCommand(ZCL_CLUSTER_ID_XXX) to ZR, but ZR return 'ZFailure' to ZC for some issue,

How the ZC get ZStatus_t:ZFailure from ZR feedback?

Can you show which example code or which document ?

thanks.

  • You can try to set a breakpoint in zcl_SendCommand() and check why it returns ZFailure. According to my experiences, it might be caused by wrong parameters.
  • I had try to show the return of zcl_SendCommand(), but the return always is 0(ZSuccess)...
  • I am confused by your question. You said you get ZFailure before. Can you describe your problem clearly?
  • Update my test/issue flow as below

    ----

    ZC                                                                                                    <->    ZR

    zcl_SendCommand(ZCL_CLUSTER_ID_XX, COMMAND_ID_YY) -> zclGeneral_HdlIncoming(ZCL_CLUSTER_ID_XX,COMMAND_ID_YY)

    Which function call back ?                                                                <- return (OK? ZSuccess: ZFailure)

    ----

  • Do you mean you can use zcl_SendCommand to send command correctly from ZC but ZR can not receive it?
  • "... ZR can not receive it" => Not the issue.

    my issue is "ZR can receive data OK, but ZR send ZFailure to ZC for something after process data", then "How to get the ZFailure from ZR" for ZC?

  • Since ZR receives message from ZC, why does ZR would send ZFailure to ZC. ZSucess/ZFailure is only an acknowledge that if message is sent our correctly. Do you intend to parse something in application side and feedback to coordinator that if ZR processes command correctly?
  • "Do you intend to parse something in application side and feedback to coordinator that if ZR processes command correctly?" => YES, because I want to cost down RF data, maybe I will change ZR to ZED for power save.
  • Since you are talking about application ack, can you describe your application in detail so maybe I can give suggestion?
  • Dear YK,
    I will send big data by ZigBee/zcl_SendCommand()/Proprietary(ZCL_CLUSTER_ID_XX) or modify existed(ZCL_CLUSTER_ID_XX), I will send many packet over ZigBee ... so I need to soon feedback ack to cost down RF data, and need to down power saving ...
    Do you know how to callback to get ZR(ZSuccess or ZFailure) from ZC ? or I need to breakpoint which function call to trace the issue ?
    thanks.
  • I would suggest you using AF_DataRequest to send proprietary data with AF_ACK_REQUEST Option. If ZR receives message, it will send ack in AF_DATA_CONFIRM_CMD.

  • Dear YK,
    I will try AF_DataRequest/AF_DATA_CONFIRM_CMD...
    so Do you meet that ZC can't get ZR's response of ZC's zcl_SendCommand() ?
  • As I know, zcl_SendCommand doesn't enable APS ack so ZR won't reply APS ack to ZC.
  • Follow "I would suggest you using AF_DataRequest to send proprietary data with AF_ACK_REQUEST Option. If ZR receives message, it will send ack in AF_DATA_CONFIRM_CMD."... I had try modify:

    step#1: ZC send data by that using AF_DataRequest to send proprietary data with AF_ACK_REQUEST, and

    step#2: ZR's patch as below for always send ZFailure to ZC for my proprietary ZCL_CLUSTER_ID_XX

    ----

    @@ -274,6 +274,7 @@ static ZStatus_t zclGeneral_PHdlIncoming( zclIncoming_t *pIn
    +stat = ZFailure; //@@test^M
    return ( stat );
    }

    ----

    step#3: test/confirm OK by  sniffer as below for that ZR return ZFailure(0x81)

    step#4: then ZC's patch as below, but "sentStatus" alway is 0x00

    ----

    uint16 zclSampleThermostat_event_loop( uint8 task_id, uint16 events )
    {

    ...

    if ( events & SYS_EVENT_MSG )

    {
    while ( (MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive( zclSampleThermostat_TaskID )) )
    {

    switch ( MSGpkt->hdr.event )

    {
    + case AF_DATA_CONFIRM_CMD: //@@
    + {
    + // The status is of ZStatus_t type [defined in ZComDef.h]
    + // The message fields are defined in AF.h
    + afDataConfirm_t *afDataConfirm = (afDataConfirm_t *)MSGpkt;
    + uint8 sentEP = afDataConfirm->endpoint;
    + uint8 sentStatus = afDataConfirm->hdr.status;
    + uint8 sentTransID = afDataConfirm->transID;
    + if (sentStatus!=0)
    + {
    + char buf[10];
    + HalLcdWriteString( toHex2(buf,sentEP), HAL_LCD_LINE_5);
    + HalLcdWriteString( toHex2(buf,sentStatus), HAL_LCD_LINE_6);
    + HalLcdWriteString( toHex2(buf,sentTransID), HAL_LCD_LINE_7);
    + }
    + }
    + break;

    ----

    so ZC can't get ZR's return stat by AF_DATA_CONFIRM_CMD....

    Please help... maybe lose something ?

  • Dear YK,
    As reply(Jan 21, 2015 11:02 AM),
    Do you know how to get ZR's return Status(ex. 0x81) for ZC ?
  • Since you use private cluster, you have to do APS ack by yourself.