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 could a HA device reset to Factory Defaults

Other Parts Discussed in Thread: Z-STACK

Hi everyone

     as  Zigbee HA profile noting the return to factory defaults ,but it is so vague

      Return to Factory Defaults
      In support of a return to factory default capability,

      HA devices shall implement the ZDO Management Leave server service.

      When invoked with a unicast address and the DeviceAddress set to NULL=0x00000000, the device shall implement a NWK Leave.

      When invoked with a broadcast address and the DeviceAddress set to NULL=0x00000000, the device shall wait the broadcast timeout period to
allow the message to propagate through network, then the device shall implement a NWK Leave.

Prior to execution of the NWK Leave in either case, processing in the device shall ensure all operating parameters are reset to allow a reset to factory
defaults.

         1. what is the mean of  DeviceAddress set to NULL=0x00000000 ??  which DeviceAddress?

         2. does it mean a factory reset motion should  include ZDO Management Leave (ZDP_MgmtLeaveReq() ) and NWK Leave( NLME_LeaveReq(  )) ? 

              what is the different of them?

         3. where define  the broadcast timeout ?  how long is it ?

         4. unicast to who? if  the ZED want to leave the network ,who should be tell? if  the device isn't working, how could ZED make sure its leave request will send to the one it wanted?

         5. as excute ZDP_MgmtLeaveReq(), it seems that the device should wait a moment before do  MT_SysReset();  or it will be failed to sendout  the leaving request .

 


            

  • Hi The Seven,

    1. what is the mean of DeviceAddress set to NULL=0x00000000 ?? which DeviceAddress?
    [Cetri] NULL for DeviceAddress means the device where the MGMT LeaveReq is invoked itself. Please see section 2.4.3.3.5 Mgmt_Leave_req of ZigBee core spec R20.

    2. does it mean a factory reset motion should include ZDO Management Leave (ZDP_MgmtLeaveReq() ) and NWK Leave( NLME_LeaveReq( )) ?
    [Cetri] Yes

    what is the different of them?
    [Cetri] MGMT LeaveReq is the command to tell a device(local or remote) to do NLME-LEAVE.request operation which is implemented as NLME_LeaveReq() in Z-Stack. Please see section 2.4.3.3.3 Mgmt_Leave_req of ZigBee core spec R20.

    3. where define the broadcast timeout ? how long is it ?
    [Cetri] Please see section 3.5.2.1 Broadcast Delivery Time of ZigBee core spec R20.

    4. unicast to who? if the ZED want to leave the network ,who should be tell? if the device isn't working, how could ZED make sure its leave request will send to the one it wanted?
    [Cetri] A ZED should inform its parent of its leaving.

    5. as excute ZDP_MgmtLeaveReq(), it seems that the device should wait a moment before do MT_SysReset(); or it will be failed to sendout the leaving request .
    [Cetri] Sorry, I don't get your question.

    - Cetri
  • Hi Cetri!

    Thanks for your wonderful reply!

    I would like to make it clear about the last question.

    When  i coding ZDP_MgmtLeaveReq()  close by NLME_LeaveReq( ) as below in ZED, the ZC have not receive  Mgmt_Leave_req in ZDO_CB_MSG event

    static void zclsampletest_BasicResetCB( void )
    {  
      
      // ZDO Management Leave server service
      zAddrType_t *dstAddr_All =NULL;
      afStatus_t Leave_Status;
      dstAddr_All->addrMode = (afAddrMode_t)(AddrBroadcast);
      dstAddr_All->addr.shortAddr = 0xFFFF;
      Leave_Status = ZDP_MgmtLeaveReq(dstAddr_All, NLME_GetExtAddr(), FALSE,TRUE, 1);

      if(Leave_Status == ZSuccess)
      {
          NLME_LeaveReq_t leaveReq;
          osal_memset( &leaveReq, 0, sizeof( NLME_LeaveReq_t ) );
          leaveReq.rejoin = TRUE; 
          if ( NLME_LeaveReq( &leaveReq ) != ZSuccess )
          {
            ZDApp_LeaveReset( FALSE );
          }

           MT_SysCommandProcessing( aProcessCmd ); 
      }
    }

    but when i add a delay operate or delete the  MT_SysCommandProcessing( aProcessCmd );  The ZC could  receive Mgmt_Leave_req .