Application level Default Transition Time server behavioral structures, functions, and callbacks. More...
Data Structures | |
| struct | app_dtt_server_t |
| Application level structure holding the DTT server model context and DTT state representation. More... | |
Macros | |
| #define | APP_DTT_SERVER_DEF(_name, _force_segmented, _mic_size, _set_cb) |
| Macro to create application level app_dtt_server_t context. More... | |
Typedefs | |
| typedef void(* | app_dtt_set_cb_t) (const app_dtt_server_t *p_app, uint32_t default_tt) |
| Application state set callback prototype. More... | |
Functions | |
| uint32_t | app_dtt_init (app_dtt_server_t *p_app, uint8_t element_index) |
| Initializes the behavioral module for the generic DTT model. More... | |
Detailed Description
Application level Default Transition Time server behavioral structures, functions, and callbacks.
This module implements a thin layer to store and restore Defaut Transition time states for the applications which want to use Default Transition Time model independently (unlike app modules for some other models that encapsulate DTT state storage). This can be utilized to add Default Transition Time support to simple applications based on Generic OnOff or Level servers.
Macro Definition Documentation
◆ APP_DTT_SERVER_DEF
| #define APP_DTT_SERVER_DEF | ( | _name, | |
| _force_segmented, | |||
| _mic_size, | |||
| _set_cb | |||
| ) |
static app_dtt_server_t _name = \ { \ .server.settings.force_segmented = _force_segmented, \ .server.settings.transmic_size = _mic_size, \ .dtt_set_cb = _set_cb, \ };
Macro to create application level app_dtt_server_t context.
- Parameters
-
[in] _name Name of the app_dtt_server_t instance [in] _force_segmented If the Generic DTT server shall use force segmentation of messages [in] _mic_size MIC size to be used by Generic DTT server [in] _set_cb Callback for setting the application state to given value. If this callback is not used by the appplication, this can be set to NULL.
Definition at line 68 of file app_dtt.h.
Typedef Documentation
◆ app_dtt_set_cb_t
| typedef void(* app_dtt_set_cb_t) (const app_dtt_server_t *p_app, uint32_t default_tt) |
Application state set callback prototype.
This callback is called by the this module whenever application is required to be informed to reflect the desired DTT value. Usually it is not necessary to implement this callback since default transition time values are usually consumed by the models internally.
- Parameters
-
[in] p_app Pointer to app_dtt_server_t context. [in] default_tt New default transition time value to be used by the application.
Definition at line 88 of file app_dtt.h.
Function Documentation
◆ app_dtt_init()
| uint32_t app_dtt_init | ( | app_dtt_server_t * | p_app, |
| uint8_t | element_index | ||
| ) |
Initializes the behavioral module for the generic DTT model.
- Parameters
-
[in] p_app Pointer to app_dtt_server_t context. [in] element_index Element index on which this server will be instantiated.
- Return values
-
NRF_SUCCESS If initialization is successful. NRF_ERROR_NO_MEM ACCESS_MODEL_COUNT number of models already allocated, or no more subscription lists available in memory pool. NRF_ERROR_NULL NULL pointer is supplied to the function or to the required member variable pointers. NRF_ERROR_NOT_FOUND Invalid access element index, or access handle invalid. NRF_ERROR_FORBIDDEN Multiple model instances per element are not allowed or changes to device composition are not allowed. Adding a new model after device is provisioned is not allowed. NRF_ERROR_INVALID_PARAM Model not bound to appkey, publish address not set or wrong opcode format. The application timer module has not been initialized or timeout handler is not provided. NRF_ERROR_INVALID_STATE If the application timer is running.