How can i set JN-AN-1223 working in end device mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can i set JN-AN-1223 working in end device mode

761 Views
xubovey
Contributor III

hi, thanks for your help

In my project, i need my device worked in end device mode with JN-AN-1223. I can send the command from "ZGWUI",but i find JN-AN-1223 only support Router or Coordinator mode. Can you tell me why it not support end device or how can i modify the code to support it.

Labels (2)
0 Kudos
3 Replies

639 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Xu, I hope you're doing well!

 

Could you please take a look at our other Gateway Tool example? JN-AN-1216 has another implementation of the ZGWUI, and it supports the 3 device types. The binaries generated by this application note offer full functionality, and, because of this, take more space in the MCU.

You can find JN-AN-1216 here.

 

Please let me know if you need any more information.

 

Best regards,

Sebastian

0 Kudos

639 Views
xubovey
Contributor III

thanks for your replay.

I have checked JN-AN-1216 which have the same code with JN-AN-1223:

```

            case (E_SL_MSG_SET_DEVICETYPE):
            {

                if(au8LinkRxBuffer[0>= 2 )
                {
                    APP_vConfigureDevice(1); /* configure it in HA compatibility mode */
                }
                else
                {
                    APP_vConfigureDevice(au8LinkRxBuffer[0]);
                }

                sZllState.u8DeviceType =  au8LinkRxBuffer[0];
                PDM_eSaveRecordData( PDM_ID_APP_ZLL_CMSSION, &sZllStatesizeof ( sZllState ) );
            }

```

and

```

PUBLIC void APP_vConfigureDevice ( uint8 u8DeviceType )
{
    if( u8DeviceType !=  0 )
    {
        ZPS_vAplSecSetInitialSecurityState(ZPS_ZDO_DISTRIBUTED_LINK_KEY,
                                           sBDB.pu8DistributedLinkKey,
                                           0x00,
                                           ZPS_APS_GLOBAL_LINK_KEY);
    }
    else
    {
        ZPS_vTcInitFlash(&sSet, asTclkStruct);
        ZPS_vTCSetCallback(APP_bSendHATransportKey);
    }

    ZPS_vNwkSetDeviceType ( ZPS_pvAplZdoGetNwkHandle(),
                           ( u8DeviceType + 1 ) );  /* coordinator is 1 - ED is 3 Router is 2*/
    ZPS_vSetZdoDeviceType ( u8DeviceType );     /* coordinator is 0 - ED is 2 and Router is 1 */
}
0 Kudos

639 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Xu,

 

The command to set the device type as a Sleeping End Device is implemented in the JN-AN-1216 example. The event that's called when sending the command should call the function to change device type, and one of the options is setting it as an end device.

 

Best regards,

Sebastian

0 Kudos