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.

CC2652R: ZED polling control through application

Part Number: CC2652R
Other Parts Discussed in Thread: Z-STACK

Hi,

Is there anyway for me to perform a control ZED polling through my application in Z.Stack 4.10.00.78.

In ZStack 3.0.2, I had the option to perform a one time poll using NLME_SetPollRate(1) when my application needs it.(to trigger message reception).
For e.g. after button pressed, perform poll after 5 seconds.

Would something like this work

//Initialize default pollrate (set default)
zstack_sysConfigWriteReq_t writeReq = {0};
writeReq.has_pollRate = true;
writeReq.pollRate = 60000;
writeReq.pollRateType = POLL_RATE_TYPE_DEFAULT;
Zstackapi_sysConfigWriteReq(appServiceTaskId, &writeReq);

/* On button press callback */
//Initialize app pollrate to 5000ms
zstack_sysConfigWriteReq_t writeReq = {0};
writeReq.has_pollRate = true;
writeReq.pollRate = 5000;
writeReq.pollRateType = POLL_RATE_TYPE_APP_1;  // what is the different between POLL_RATE_TYPE_APP_1 and POLL_RATE_TYPE_DEFAULT
Zstackapi_sysConfigWriteReq(appServiceTaskId, &writeReq);
//start clock for 5.1 seconds
Timer_setTimeout(handle, 5100);

/*In Timer callback*/
//restore to default poll rate of 60000
zstack_sysConfigWriteReq_t writeReq = {0};
writeReq.has_pollRate = true;
writeReq.pollRate = 60000;
writeReq.pollRateType = POLL_RATE_TYPE_DEFAULT;
Zstackapi_sysConfigWriteReq(appServiceTaskId, &writeReq);

Is there anyway to do something similar to ZStack 3.0.2 like a onetime poll in this ZStack 4.10.00.78 ?
Please could you share any instruction set to use the Zstackapi_sysConfigWriteReq and when the various Poll Types are in effect, if any.

Thanks
Akhilesh

  • Yes, it's the same in CC26xx Z-Stack to use your pseudo code to achieve similar function.

  • Hi,

    Agree with YK.

    With the addition of a more refined polling module in CC13x2/CC26x2 SDK since 3.20 SDK, this older API for setting poll rate has been removed.
    You could try using OsalPort_setEvent( NWK_TaskID, NWK_AUTO_POLL_EVT ); to trigger a single MAC data request.

    In general, the quickest poll rate which is enabled will be used.
    For example, if a ZED is in rejoin process, then POLL_RATE_TYPE_JOIN_REJOIN will be enabled, with REJOIN_POLL_RATE (default is 440 ms). Then when rejoin is complete, POLL_RATE_TYPE_JOIN_REJOIN will be disabled. More info can be found here: http://dev.ti.com/tirex/content/simplelink_cc13x2_26x2_sdk_4_20_00_35/docs/zigbee/html/zigbee/z-stack-overview.html#configuring-child-management-for-child-devices


    Regards,
    Toby

  • Hi,

    Thanks for the inputs. I will try the setting the NWK_AUTO_POLL_EVT and will check if that works.

    Also, in nwk_globals.c, I have observed that in nwk_InitializeDefaultPollRates function, they are calling this
    nwk_SetConfigPollRate and nwk_SetCurrentPollRateType functions. Can I/ Should I use these functions to directly set the nwk poll rates ?


    Thanks
    Akhilesh

  • I would not suggest calling nwk_* functions directly. The recommended method of modifying poll rates is with Zstackapi_sysConfigWriteReq.

  • Hello,

    After testing, this is what I have observed
    1. OsalPort_setEvent( NWK_TaskID, NWK_AUTO_POLL_EVT )   => performs one time poll

    2. Can update default poll rate using
    zstack_sysConfigWriteReq_t writeReq = {0};
    writeReq.has_pollRate = true;
    writeReq.pollRate = 60000;
    writeReq.pollRateType = POLL_RATE_TYPE_DEFAULT;
    Zstackapi_sysConfigWriteReq(appServiceTaskId, &writeReq);


    3. Updating POLL_RATE_TYPE_APP_1 doesn't do anything, even if poll rate time <  DEFAULT, still polls with default poll rate.
    zstack_sysConfigWriteReq_t writeReq = {0};
    writeReq.has_pollRate = true;
    writeReq.pollRate = 5000;
    writeReq.pollRateType = POLL_RATE_TYPE_APP_1; 
    Zstackapi_sysConfigWriteReq(appServiceTaskId, &writeReq);


    This maybe linked to the fact in nwk_globals.c the POLL_RATE_TYPE_APP_1 is not configured
            //Configure the stack pollrates defined
            nwk_SetConfigPollRate(POLL_RATE_TYPE_DEFAULT, POLL_RATE);
            nwk_SetConfigPollRate(POLL_RATE_TYPE_JOIN_REJOIN, REJOIN_POLL_RATE);
            nwk_SetConfigPollRate(POLL_RATE_TYPE_QUEUED, QUEUED_POLL_RATE);
            nwk_SetConfigPollRate(POLL_RATE_TYPE_RESPONSE, RESPONSE_POLL_RATE);
            nwk_SetConfigPollRate(POLL_RATE_TYPE_GENERIC_1_SEC, GENERIC_POLL_RATE_1_SEC);

            //Enabled the default Poll Rate
            nwk_SetCurrentPollRateType(POLL_RATE_TYPE_DEFAULT,TRUE);

    Thanks
    Akhilesh