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.

LAUNCHXL-CC1352R1: Pause Policy

Part Number: LAUNCHXL-CC1352R1
Other Parts Discussed in Thread: SYSCONFIG

Hello,

I aim to use the pause mechanism in 15.4 DMM_Sensor_oad. I am using the code in FH mode.

For that, I tried the following things -

So, for starters, I want to pause the 15.4 stack on the Button press(used BTN2 for the same). I called the DMMPolicy_updateStackState followed by Sensor_dmmPausePolicyCb() on Button press.

To check if the radio is actually paused, I used a sniffer as well as displayed the radio_activity using - macGetRadioState(). After the Sensor and Collecter started communicating, I pressed BTN2 and found that the sensor had no adv/data_exchange packets on Wireshark.

I am facing a disconnect in the 2nd method I have used (radio state). I have called macGetRadioState() function in sensor_process function. When the sensor and collector are communicating normally, the radio state returned by the function is 1(Radio ON) or 0 (Radio OFF) accordingly. But as soon as I press BTN2 to pause the 15.4 stack, the function returns 1 continuously.

So,

1) What is the proper/graceful way to pause a stack?

2) As 15.4 stack is paused, shouldn't macGetRadioState() function to return 0 since there is no Radio-Activity.

Thanks and Regards,

Yash.

  • HI Yash,

    1) This depends on the stack and what it is currently doing. "Paused" from the DMM point of view is just the callback, it is up to the implementer of the Cb to give this (and resume) a purpose.

    2) This would again depend on how "paused" is implemented. 

    Maybe you could elaborate a bit on your use case with some code snippets?

  • Hello MW,

    Thank you for your prompt response.

    I am calling the already present Sensor_dmmPausePolicyCb() function present in sensor.c file, which in turn sets the event for pausing the function as shown by the snippet below. 

    static void Sensor_dmmPausePolicyCb(uint16_t pause)
    {
        if (pause)
        {   //pause 154sensor
            Util_setEvent(&Sensor_events, SENSOR_PAUSE_EVT);
        }
        else
        {   //unpause 154sensor
            Util_setEvent(&Sensor_events, SENSOR_RESUME_EVT);
        }
    
        /* Wake up the application thread when it waits for clock event */
        Ssf_PostAppSem();
    }
    

    Doesn't setting the 15.4 event to pause, stop the radio-activity?

    Do I have to change the DMM policies in the sysconfig file?

    Thanks and Regards,

    Yash

  • Hi Yash,

    Assuming you run the base example from TI then an "pause event" should lead to the stack turning of the poll and reading clocks (among other things) to stop transmissions. 

    I'm not completely sure I understand what you do, it sounds almost like you manually calling the policy CB? You should not have to call this at all as the application would register this with the DMM (assuming "DMM_OAD" is defined). 

    The callback would then be invoked when ever a newly activated policy puts or brings a stack out of a "paused" state. note that "DMMPolicy_updateStackState" if self do not guarantee that you get into a new policy, the combinations of states from the BLE side and the 15.4 side (in this case) is what makes up which policy is the active one.

  • Hello M-W,

    I apologize if I confused things. I will ask the question differently -

    1) What should I do to pause the 15.4 stack?

    Would calling Util_setEvent(&Sensor_events, SENSOR_PAUSE_EVT); on button press work? If not, how else would you suggest to do it?

    Thanks and Regards,

    Yash

  • Hi Yash,

    One solution is to setup your application policy to make sure that an update will trigger the policy. This can for example mean that you say that "For any BLE" and "This particular state" this policy should be active. 

    What is the use-case here that means you need/want to pause the stack (other than for whatever reason that is already in the examples)?