nRF5 SDK for Mesh v5.0.0
Data Structures | Typedefs | Enumerations | Functions
Generic transition module

This module implements the transitional behavior commonly required by mesh models. More...

Data Structures

struct  app_transition_params_t
 
struct  app_transition_t
 Internal structure to hold transition cbs and timing information. More...
 

Typedefs

typedef void(* app_transition_delay_start_cb_t) (const app_transition_t *p_transition)
 Delay start callback prototype. More...
 
typedef void(* app_transition_transition_start_cb_t) (const app_transition_t *p_transition)
 Transition start callback prototype. More...
 
typedef void(* app_transition_transition_tick_cb_t) (const app_transition_t *p_transition)
 Transition tick callback prototype. More...
 
typedef void(* app_transition_transition_complete_cb_t) (const app_transition_t *p_transition)
 Transition complete callback prototype. More...
 

Enumerations

enum  app_transition_type_t { APP_TRANSITION_TYPE_SET, APP_TRANSITION_TYPE_DELTA_SET, APP_TRANSITION_TYPE_MOVE_SET, APP_TRANSITION_TYPE_NONE }
 Transition types. More...
 

Functions

uint32_t app_transition_remaining_time_get (app_transition_t *p_transition)
 Gets the remaining transition time in milliseconds. More...
 
uint32_t app_transition_elapsed_time_get (app_transition_t *p_transition)
 Gets the elapsed transition time in milliseconds. More...
 
bool app_transition_time_complete_check (app_transition_t *p_transition)
 Checks if the transition time has been complete. More...
 
void app_transition_trigger (app_transition_t *p_transition)
 Starts the transition with specified transition parameters. More...
 
void app_transition_abort (app_transition_t *p_transition)
 Aborts the transition if any in progress. More...
 
uint32_t app_transition_init (app_transition_t *p_transition)
 Initializes the transition module. More...
 
static app_transition_params_tapp_transition_requested_get (app_transition_t *p_transition)
 Gets a pointer to the structure with parameters for the requested transition. More...
 
static app_transition_params_tapp_transition_ongoing_get (app_transition_t *p_transition)
 Gets a pointer to the structure with parameters of the ongoing transition. More...
 

Detailed Description

This module implements the transitional behavior commonly required by mesh models.

This transition module provides a generic sample based way to implement incremental value changes.

This module provides four callbacks to indicate various stages of transitions. The higher level module should implement the code for the moving the state from present value to target value with the use of these callbacks.

Depending upon the transition parameters, this module may trigger large number of app_transition_transition_tick_cb_t callbacks, therefore user must not do time consuming operations inside the callback.

The smallest possible callback interval for a given transition time will be limited by MODEL_TIMER_TIMEOUT_MIN_TICKS.

Typedef Documentation

◆ app_transition_delay_start_cb_t

typedef void(* app_transition_delay_start_cb_t) (const app_transition_t *p_transition)

Delay start callback prototype.

This callback is called by the app_transition module at the begining of delay interval.

Parameters
[out]p_transitionPointer to transition context

Definition at line 105 of file app_transition.h.

◆ app_transition_transition_start_cb_t

typedef void(* app_transition_transition_start_cb_t) (const app_transition_t *p_transition)

Transition start callback prototype.

This callback is called by the app_transition module at the start of value transition to reach target state.

Parameters
[out]p_transitionPointer to transition context

Definition at line 114 of file app_transition.h.

◆ app_transition_transition_tick_cb_t

typedef void(* app_transition_transition_tick_cb_t) (const app_transition_t *p_transition)

Transition tick callback prototype.

This callback is called by the app_transition module to inform parent module to advance the current value to the next step. Depending on the choice of underlaying lighting peripheral application may or may not use this callback.

Parameters
[out]p_transitionPointer to transition context

Definition at line 124 of file app_transition.h.

◆ app_transition_transition_complete_cb_t

typedef void(* app_transition_transition_complete_cb_t) (const app_transition_t *p_transition)

Transition complete callback prototype.

This callback is called by the app_transition module to indicate the end of the transition.

Note
In case of MOVE transition, this callback is never called. The move transition stops if it is aborted explicitly or if a new non-move transition is triggered.
Parameters
[out]p_transitionPointer to transition context

Definition at line 135 of file app_transition.h.

Enumeration Type Documentation

◆ app_transition_type_t

Transition types.

Enumerator
APP_TRANSITION_TYPE_SET 

indicating SET message

APP_TRANSITION_TYPE_DELTA_SET 

indicating DELTA SET message

APP_TRANSITION_TYPE_MOVE_SET 

indicating MOVE SET message

APP_TRANSITION_TYPE_NONE 

indicating no transition

Definition at line 70 of file app_transition.h.

Function Documentation

◆ app_transition_remaining_time_get()

uint32_t app_transition_remaining_time_get ( app_transition_t *  p_transition)

Gets the remaining transition time in milliseconds.

Note
If delay is being executed, this function will return the total transition time requested at the start of the transition.
Parameters
[in]p_transitionPointer to transition context.
Returns
Transition time in milliseconds.

◆ app_transition_elapsed_time_get()

uint32_t app_transition_elapsed_time_get ( app_transition_t *  p_transition)

Gets the elapsed transition time in milliseconds.

Note
If delay is being executed, this function will return zero.
Parameters
[in]p_transitionPointer to transition context.
Returns
Transition time in milliseconds.

◆ app_transition_time_complete_check()

bool app_transition_time_complete_check ( app_transition_t *  p_transition)

Checks if the transition time has been complete.

Parameters
[in]p_transitionPointer to transition context.
Return values
TrueIf transition has been completed or no transition is being executed.
FalseIf transition has not been completed.

◆ app_transition_trigger()

void app_transition_trigger ( app_transition_t *  p_transition)

Starts the transition with specified transition parameters.

Parameters
[in]p_transitionPointer to transition context.

◆ app_transition_abort()

void app_transition_abort ( app_transition_t *  p_transition)

Aborts the transition if any in progress.

Parameters
[in]p_transitionPointer to transition context.

◆ app_transition_init()

uint32_t app_transition_init ( app_transition_t *  p_transition)

Initializes the transition module.

Parameters
[in]p_transitionPointer to the app_transition_t structure
Return values
NRF_SUCCESSThe transition module is initialized successfully.
NRF_ERROR_NULLNULL pointer is supplied to the function or to the required member variable pointers.
NRF_ERROR_INVALID_PARAMIf the application timer module has not been initialized.
NRF_ERROR_INVALID_STATEIf the application timer is running.

◆ app_transition_requested_get()

static app_transition_params_t* app_transition_requested_get ( app_transition_t *  p_transition)
inlinestatic

Gets a pointer to the structure with parameters for the requested transition.

Parameters
[in]p_transitionPointer to the app_transition_t structure
Returns
Pointer to the parameters.

Definition at line 228 of file app_transition.h.

◆ app_transition_ongoing_get()

static app_transition_params_t* app_transition_ongoing_get ( app_transition_t *  p_transition)
inlinestatic

Gets a pointer to the structure with parameters of the ongoing transition.

Parameters
[in]p_transitionPointer to the app_transition_t structure
Returns
Pointer to the parameters.

Definition at line 239 of file app_transition.h.


Documentation feedback | Developer Zone | Subscribe | Updated