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.

what is the parameter of zdoIncomingMsg_t *pMsg

hi !

     when ZC  receive a Msg(Device_annce) from ZED ,ZC can get the MSG in ZDO_MSG_CB

    the MSG was define as zdoIncomingMsg_t *pMsg

     typedef struct
{
  osal_event_hdr_t hdr;
  zAddrType_t      srcAddr;
  uint8            wasBroadcast;
  cId_t            clusterID;
  uint8            SecurityUse;
  uint8            TransSeq;
  uint8            asduLen;
  uint16           macDestAddr;
  uint8            *asdu;
  uint16           macSrcAddr;
} zdoIncomingMsg_t;

       i was confused of those address variable

      For ZC (the code in ZC side) what is macDestAddr and  macSrcAddr ?

       is that right as below:

       the first srcAddr ======》  ZED address(include short address and extern address)?

       macDestAddr     ======》  ZC address( extern address)?

       macSrcAddr     ======》  ZC address(  short address )?

if  there is a address variable  was defined afAddrType_t *dstAddr,(this variable was used for sending MSG)

how could we pick out the MSG from  zdoIncomingMsg_t to  afAddrType_t *dstAddr

if panid and endpoint have not setting ,is that OK?

typedef enum
{
  afAddrNotPresent = AddrNotPresent,
  afAddr16Bit      = Addr16Bit,
  afAddr64Bit      = Addr64Bit,
  afAddrGroup      = AddrGroup,
  afAddrBroadcast  = AddrBroadcast
} afAddrMode_t;

typedef struct
{
  union
  {
    uint16      shortAddr;
    ZLongAddr_t extAddr;
  } addr;
  afAddrMode_t addrMode;
  uint8 endPoint;
  uint16 panId;  // used for the INTER_PAN feature
} afAddrType_t;

  • If node A sends a multi-hop message to node F. The first hop would be from A to B. The next is B to C, and so on The final hop is from E to F. The MAC source and destination address would change along this multi-hops. However, NWK source address would not.

  • hm ,so we don't need to care the mac address variable。

    but  how could we pick out the MSG from  zdoIncomingMsg_t to  afAddrType_t *dstAddr ???

  • You can refer to zclSampleTemperatureSensor_ProcessZDOMsgs() in zcl_sampletemperaturesensor.c of Sample Temperature Sensor.

  • Hi Chen

               it Parsed the Match_DescRsp_t which was different with afAddrType_t   !

    static void zclSampleTemperatureSensor_ProcessZDOMsgs( zdoIncomingMsg_t *pMsg )
    {
      zclEZMode_ActionData_t data;
      ZDO_MatchDescRsp_t *pMatchDescRsp;

      // Let EZ-Mode know of the Match Descriptor Response
      if ( pMsg->clusterID == Match_Desc_rsp )
      {
        pMatchDescRsp = ZDO_ParseEPListRsp( pMsg );
        data.pMatchDescRsp = pMatchDescRsp;
        zcl_EZModeAction( EZMODE_ACTION_MATCH_DESC_RSP, &data );
        osal_mem_free( pMatchDescRsp );
      }
    }

  • ZDO_ParseEPListRsp returns ZDO_ActiveEndpointRsp_t not ZDO_MatchDescRsp_t. You can't do pMatchDescRsp=ZDO_ParseEPListRsp(pMsg).

  • the code was came from TI zstack, it was not made by me ,

    i just copy to show you that ZDO_ParseEPListRsp data can't  put into the  afAddrType_t

    and i ask you how to change it ~~~~