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.

the question about the parameter of ZDP_BindUnbindReq ()

what is  the different  between     zAddrType_t *dstAddr    with   zAddrType_t *destinationAddr    two parameter in  the ZDP_BindUnbindReq ?

/*********************************************************************
 * @fn          ZDP_BindUnbindReq
 *
 * @brief       This builds and send a Bind_req or Unbind_req message
 *              Depending on the ClusterID. This function
 *              sends a unicast message to the local coordinator.
 *
 * @param       BindOrUnbind - either Bind_req or Unbind_req
 * @param       dstAddr - destination address of the message
 * @param       SourceAddr - source 64 bit address of the binding
 * @param       SrcEPIntf - Source endpoint/interface
 * @param       ClusterID - Binding cluster ID
 * @param       DestinationAddr - destination 64 bit addr of binding
 * @param       DstEPIntf - destination endpoint/interface
 * @param       SecurityEnable - Security Options
 *
 * @return      afStatus_t
 */
afStatus_t ZDP_BindUnbindReq( uint16 BindOrUnbind, zAddrType_t *dstAddr,
                              uint8 *SourceAddr, byte SrcEndPoint,
                              cId_t ClusterID,
                              zAddrType_t *destinationAddr, byte DstEndPoint,
                              byte SecurityEnable )

  • dstAddr is the short address of device that you want to send this command. destinationAddr is IEEE address of binding destination.
  • Hi Yikai


    if ZED1 need ZED2 to build the bind list about them , (ZED1 Bind with ZED2)

    ZED 1 using this function ZDP_BindUnbindReq()

    as you said :

    dstAddr is the short address of device that you want to send =====> So dstAddr is ZED2 short address
    destinationAddr is IEEE address of binding destination =====> destinationAddr is ZED1 IEEE address


    is that right
  • Let me clarify something. Do you mean ZED2 send report to ZED1 after binding?
  • yes!

    ZED1  is switch ( initiaor )  and after it  bind the  ZED2  light  (target)  ,

    ZED1 need to get the light on/off state when ZED2 change on/off state .

    ZED2 sending the  report to tell its On/off State , i  using the board cast mode to sending the report at first.

    but it is easy make the network busy, so i want to using the binding Mode, so ZED2 light need to build the binding list .

    br

  • For on/off command sent from ZED1(switch) to ZED2(light), you have to use short address of ZED1 as dstAddr and IEEE address of ZED2 as DestinationAddr. For on/off status report from ZED2(light) to ZED1(switch), you have to do another binding and use short address of ZED2 as dstAddr and IEEE address of ZED1 as DestinationAddr.
  • Thanks Yikai

    it seems clearly.

    But i always confused when i using those  function like below

    ZED1(switch)  sending  a  ZDP_BindReq()  to ZED2( light ) to ask it buid the banding list .

    ZDP_BindReq( zAddrType_t *dstAddr, byte *SourceAddr, byte SrcEP, byte ClusterID, byte *DestinationAddr, byte DstEP, byte SecuritySuite );
    
    DstAddr - The destination address.
    SourceAddr – 64 bit IEEE address of the device generating the messages.
    SrcEP – endpoint of the application generating the messages.
    ClusterID – cluster ID of the messages to bind.
    DestinationAddr – 64 bit IEEE address of the device receiving the messages.
    DstEP – endpoint of the application receiving the messages.
    SecuritySuite - Type of security wanted on the message.
    
    
    So
    zAddrType_t *dstAddr  ====>  ZED2(light) short address
    SourceAddr           =====>  ZED2 (light ) IEEE address
    SrcEP                =====>  ZED2 (light ) endpoint
    
    DestinationAddr      =====>  ZED1 (switch ) IEEE address
    DstEP                =====>  ZED1 (switch ) endpoint
    
    is that right ?
    

    and  when ZED2 ( light ) receive the ZDP_BindReq , I  Using below function to  get  the data

    void ZDO_ParseBindUnbindReq( zdoIncomingMsg_t *inMsg, ZDO_BindUnbindReq_t *pReq )
    
    typedef struct
    {
      uint8       srcAddress[Z_EXTADDR_LEN];
      uint8       srcEndpoint;
      uint16      clusterID;
      zAddrType_t dstAddress;
      uint8       dstEndpoint;
    } ZDO_BindUnbindReq_t;
    
    
    So am i right as noting below 
    
    srcAddress            ====> ZED2 (light)  IEEE address
    srcEndpoint           ====> ZED2 (light)  endpoint the one sending the MSG
    
    dstAddress            ====> ZED1 (switch) IEEE address
    dstEndpoint           ====> ZED1 (switch) endpoint the one receive the MSG 
    
    
    
    

    BR!

     

  • Your understanding about those parameters is correct but we usually send ZDP_BindReq from ZC.