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.

OSAL Event Processing

Other Parts Discussed in Thread: Z-STACK

 

Seeing that the size of tasksEvents is only 16 bits and according to Z-Stack 3.0 Developer's Guide 11.2.2: “The parameter to the task event handler is a 16-bit bitmask”.

 

Does it mean that the maximum number of the tasks that the OSAL can be handled is 16?

 

Thank you,

Barry

  • It is the max number of events can be registered to handle.
  • Interestingly, if we have a look on the osalInitTasks() in the example of LightWitch, the number of tasks originally prepared by TI is 16 (if enable all the features). Does it mean we cannot add any additional task to the program?

    void osalInitTasks( void )
    {
    uint8 taskID = 0;

    tasksEvents = (uint16 *)osal_mem_alloc( sizeof( uint16 ) * tasksCnt);
    osal_memset( tasksEvents, 0, (sizeof( uint16 ) * tasksCnt));

    macTaskInit( taskID++ );
    nwk_init( taskID++ );
    #if (ZG_BUILD_RTR_TYPE)
    gp_Init( taskID++ );
    #endif
    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
    // Added to include TouchLink functionality
    #if defined ( INTER_PAN )
    StubAPS_Init( taskID++ );
    #endif
    // Added to include TouchLink initiator functionality
    #if defined( BDB_TL_INITIATOR )
    touchLinkInitiator_Init( taskID++ );
    #endif
    // Added to include TouchLink target functionality
    #if defined ( BDB_TL_TARGET )
    touchLinkTarget_Init( taskID++ );
    #endif
    zcl_Init( taskID++ );
    bdb_Init( taskID++ );
    zclSampleSw_Init( taskID++ );
    #if (defined OTA_CLIENT) && (OTA_CLIENT == TRUE)
    zclOTA_Init( taskID );
    #endif
    }
  • Yes, it looks so.