Asset_tracker_v2 Model

I working on Asset_tracker_v2. After going hrough the code, I estimated the work flow to be as:

1. When either Passive or Active state is intialized, the Sample Timer is Configured and Intialied

2. data_sample_timer_handler() generates APP_EVT_DATA_GET_ALL event repeatitively.

3. in the infinite loop of main module, inside the on_state_running()  function, if APP_EVT_DATA_GET_ALL event is detected, then APP_EVT_DATA_GET is generated. 

4. All the other modules respond to APP_EVT_DATA_GET event if subcribed.

My query is:

1. is my explanation right or wrong ?

2. In the other modules, there are threads, where APP_EVT_DATA_GET event has been handled. Have the threads been used in this application ? If yes, where had the thread configuration and Initilazation been done ? 

3. May we handl the APP_EVT_DATA_GET in event habdler or log_event fuctions ?

  • Hello

    1. When either Passive or Active state is intialized, the Sample Timer is Configured and Intialied

    It's either started or stopped, not configured/initialized.

    2. data_sample_timer_handler() generates APP_EVT_DATA_GET_ALL event repeatitively.

    Yes.

    3. in the infinite loop of main module, inside the on_state_running()  function, if APP_EVT_DATA_GET_ALL event is detected, then APP_EVT_DATA_GET is generated. 

    Yes.

    4. All the other modules respond to APP_EVT_DATA_GET event if subcribed.

    Not all of them, but a few of them do.

    1. is my explanation right or wrong ?

    For the most part, it's correct.

    2. In the other modules, there are threads, where APP_EVT_DATA_GET event has been handled. Have the threads been used in this application ? If yes, where had the thread configuration and Initilazation been done ? 

    Yes, the thread initialization and configuration is done in the K_THREAD_DEFINE().

    3. May we handl the APP_EVT_DATA_GET in event habdler or log_event fuctions ?

    Yeah, I see no reason why not.

Related