nRF5 SDK for Mesh v5.0.0
Data Structures | Macros | Typedefs | Functions
Generic Default Transition Time server app support file

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 
)
Value:
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]_nameName of the app_dtt_server_t instance
[in]_force_segmentedIf the Generic DTT server shall use force segmentation of messages
[in]_mic_sizeMIC size to be used by Generic DTT server
[in]_set_cbCallback 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_appPointer to app_dtt_server_t context.
[in]default_ttNew 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_appPointer to app_dtt_server_t context.
[in]element_indexElement index on which this server will be instantiated.
Return values
NRF_SUCCESSIf initialization is successful.
NRF_ERROR_NO_MEMACCESS_MODEL_COUNT number of models already allocated, or no more subscription lists available in memory pool.
NRF_ERROR_NULLNULL pointer is supplied to the function or to the required member variable pointers.
NRF_ERROR_NOT_FOUNDInvalid access element index, or access handle invalid.
NRF_ERROR_FORBIDDENMultiple 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_PARAMModel 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_STATEIf the application timer is running.

Documentation feedback | Developer Zone | Subscribe | Updated