43 #include "generic_level_server.h" 44 #include "app_timer.h" 45 #include "app_transition.h" 46 #if (SCENE_SETUP_SERVER_INSTANCES_MAX > 0) || (DOXYGEN) 47 #include "app_scene.h" 113 #define APP_LEVEL_SERVER_DEF(_name, _force_segmented, _mic_size, _p_dtt, _set_cb, _get_cb, _transition_cb) \ 114 APP_TIMER_DEF(_name ## _timer); \ 115 static app_level_server_t _name = \ 117 .server.settings.force_segmented = _force_segmented, \ 118 .server.settings.transmic_size = _mic_size, \ 119 .state.transition.timer.p_timer_id = &_name ## _timer, \ 120 .p_dtt_ms = _p_dtt, \ 121 .level_set_cb = _set_cb, \ 122 .level_get_cb = _get_cb, \ 123 .level_transition_cb = _transition_cb \ 207 uint32_t transition_time_ms,
208 uint16_t target_level,
228 #if (SCENE_SETUP_SERVER_INSTANCES_MAX > 0) || (DOXYGEN) 283 uint32_t
app_level_init(app_level_server_t * p_app, uint8_t element_index);
299 #if (SCENE_SETUP_SERVER_INSTANCES_MAX > 0) || (DOXYGEN) int32_t required_delta
For storing actual required amount of level change.
int16_t required_move
Scaled representation of the Level value.
app_scene_model_interface_t scene_if
Internal variable.
Application level structure holding the Level server model context and Level state representation...
void(* app_level_get_cb_t)(const app_level_server_t *p_app, int16_t *p_present_level)
Application state read callback prototype.
const uint32_t * p_dtt_ms
Pointer to the default transition time value (in milliseconds) if present.
app_scene_setup_server_t * p_app_scene
Internal variable.
app_transition_t transition
Structure for using transition module functionality.
Internal structure for holding Move transition related variables.
int16_t present_level
Present value of the Level state.
uint32_t app_level_value_restore(app_level_server_t *p_app)
Restores the level value from persistent storage.
uint32_t app_level_scene_context_set(app_level_server_t *p_app, app_scene_setup_server_t *p_app_scene)
Sets the scene context.
generic_level_server_t server
Level server model interface context structure.
uint32_t app_level_init(app_level_server_t *p_app, uint8_t element_index)
Initializes the behavioral module for the Generic Level model.
int16_t initial_present_level
Initial present level required for handling Set/Delta Set message.
int32_t delta
For storing actual required amount of level change.
int16_t target_snapshot
Requested target.
int16_t initial_present_level
Initial present level required for handling Set/Delta Set message.
app_level_transition_cb_t level_transition_cb
Callaback to be called for informing the user application to update the value.
int16_t initial_present_level
Initial present level required for handling Set/Delta Set message.
app_level_set_cb_t level_set_cb
Callaback to be called for informing the user application to update the value.
Internal structure to hold state and timing information.
uint32_t app_level_current_value_publish(app_level_server_t *p_app)
Initiates value fetch from the user application by calling a get callback, updates internal state...
app_transition_type_t
Transition types.
app_level_get_cb_t level_get_cb
Callback to be called for requesting current value from the user application.
int16_t init_present_snapshot
Present value when message was received.
Internal structure for holding Set/Delta Set transition related variables.
void(* app_level_transition_cb_t)(const app_level_server_t *p_app, uint32_t transition_time_ms, uint16_t target_level, app_transition_type_t transition_type)
Application transition time callback prototype.
void(* app_level_set_cb_t)(const app_level_server_t *p_app, int16_t present_level)
Application state set callback prototype.
app_level_state_t state
Internal variable.
int16_t target_level
Target value of the Level state, as received from the model interface.