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.

Z-stack

Other Parts Discussed in Thread: CC2530

Hello everyone !

I'm using CC2530. I want to creat a Zigbee PAN  network, but i don't know how a node join in this PAN.

I have read  ZStack-CC2530-2.4.0-1.4.0, but i don't see.

Please help me! Thanks

 

  • Hi Tuan,

    If you build example Coordinator and End Device devices from the samples that ship with the stack, the Coordinator will start a PAN automatically and any End Device will join at startup by default.  In code, you can discover when the device has joined using the method I described in this post: http://e2e.ti.com/support/low_power_rf/f/158/t/105483.aspx.

    You will want to make sure that in the config files, f8wCoord.cfg, f8wEndDevice.cfg and f8wConfig.cfg have compatible definitions, specifically PANID (ZDAPP_CONFIG_PAN_ID) and Channels (DEFAULT_CHANLIST).

    Typically, even if you compile the stack without any application code they will create or join a network automatically.  The minimum reauired is to specify the task event handler function pointer array, const pTaskEventHandlerFn tasksArr[], and the task initialization function, void osalInitTasks( void ).  In the sample applications you can find these in a file called Sample_OSAL.c or something similar in the App file group.

    For a fully functional stack without any application code, you will need:

     

    const pTaskEventHandlerFn tasksArr[] = {

    macEventLoop,

    nwk_event_loop,

    Hal_ProcessEvent,

    #if defined( MT_TASK )

    MT_ProcessEvent,

    #endif

    APS_event_loop,

    #if defined ( ZIGBEE_FRAGMENTATION )

    APSF_ProcessEvent,

    #endif

    ZDApp_event_loop,

    #if defined ( ZIGBEE_FREQ_AGILITY ) || defined ( ZIGBEE_PANID_CONFLICT )

    ZDNwkMgr_event_loop,

    #endif

    }

     

    and

     

    void osalInitTasks( void )

    {

    T_uint8 taskID = 0;

    tasksEvents = (T_uint16 *)osal_mem_alloc( sizeof( T_uint16 ) * tasksCnt);

    osal_memset( tasksEvents, 0, (sizeof( T_uint16 ) * tasksCnt));

    macTaskInit( taskID++ );

    nwk_init( taskID++ );

    Hal_Init( taskID++ );

    #if defined ( MT_TASK )

    MT_TaskInit( taskID++ );

    #endif

    APS_Init( taskID++ );

    #if defined ( ZIGBEE_FRAGMENTATION )

    APSF_Init( taskID++ );

    #endif

    ZDApp_Init( taskID++ );

    #if defined ( ZIGBEE_FREQ_AGILITY ) || defined ( ZIGBEE_PANID_CONFLICT )

    ZDNwkMgr_Init( taskID++ );

    #endif

    }

    For your own application code, define your own ProcessEvent() function and Init() function and add references to the OSAL as above.  I hope this is of some help.

    iR.