43 #include "generic_onoff_server.h" 44 #include "app_transition.h" 45 #include "app_timer.h" 46 #if (SCENE_SETUP_SERVER_INSTANCES_MAX > 0) || (DOXYGEN) 47 #include "app_scene.h" 98 #define APP_ONOFF_SERVER_DEF(_name, _force_segmented, _mic_size, _set_cb, _get_cb, _transition_cb) \ 99 APP_TIMER_DEF(_name ## _timer); \ 100 static app_onoff_server_t _name = \ 102 .server.settings.force_segmented = _force_segmented, \ 103 .server.settings.transmic_size = _mic_size, \ 104 .state.transition.timer.p_timer_id = &_name ## _timer, \ 105 .onoff_set_cb = _set_cb, \ 106 .onoff_get_cb = _get_cb, \ 107 .onoff_transition_cb = _transition_cb \ 166 uint32_t transition_time_ms,
188 #if (SCENE_SETUP_SERVER_INSTANCES_MAX > 0) || (DOXYGEN) 231 uint32_t
app_onoff_init(app_onoff_server_t * p_app, uint8_t element_index);
247 #if (SCENE_SETUP_SERVER_INSTANCES_MAX > 0) || (DOXYGEN) bool present_onoff
Present value of the OnOff state.
app_onoff_state_t state
Internal variable.
void app_onoff_status_publish(app_onoff_server_t *p_app)
Initiates value fetch from the user application by calling a get callback, updates internal state...
void(* app_onoff_get_cb_t)(const app_onoff_server_t *p_app, bool *p_present_onoff)
Application state read callback prototype.
void(* app_onoff_transition_cb_t)(const app_onoff_server_t *p_app, uint32_t transition_time_ms, bool target_onoff)
Application transition time callback prototype.
uint32_t app_onoff_scene_context_set(app_onoff_server_t *p_app, app_scene_setup_server_t *p_app_scene)
Sets the scene context.
app_timer_id_t const * p_timer_id
APP timer instance pointer.
generic_onoff_server_t server
OnOff server model interface context structure.
Internal structure to hold state and timing information.
Application level structure holding the OnOff server model context and OnOff state representation...
uint32_t app_onoff_value_restore(app_onoff_server_t *p_app)
Restores the onoff value from persistent storage.
uint32_t last_rtc_counter
Internal variable.
app_scene_model_interface_t scene_if
Internal variable.
uint32_t app_onoff_init(app_onoff_server_t *p_app, uint8_t element_index)
Initializes the behavioral module for the generic OnOff model.
app_onoff_get_cb_t onoff_get_cb
Callback to be called for requesting current value from the user application.
app_transition_t transition
Structure for using transition module functionality.
app_scene_setup_server_t * p_app_scene
Internal variable.
app_onoff_set_cb_t onoff_set_cb
Callaback to be called for informing the user application to update the value.
app_onoff_transition_cb_t onoff_transition_cb
Callaback to be called for informing the user application to update the value.
void(* app_onoff_set_cb_t)(const app_onoff_server_t *p_app, bool onoff)
Application state set callback prototype.
bool target_onoff
Target value of the OnOff state, as received from the model interface.
bool initial_present_onoff
Initial value for transition.