43 #include "generic_onoff_server.h" 44 #include "app_transition.h" 45 #include "app_timer.h" 95 #define APP_ONOFF_SERVER_DEF(_name, _force_segmented, _mic_size, _set_cb, _get_cb, _transition_cb) \ 96 APP_TIMER_DEF(_name ## _timer); \ 97 static app_onoff_server_t _name = \ 99 .server.settings.force_segmented = _force_segmented, \ 100 .server.settings.transmic_size = _mic_size, \ 101 .state.transition.timer.p_timer_id = &_name ## _timer, \ 102 .onoff_set_cb = _set_cb, \ 103 .onoff_get_cb = _get_cb, \ 104 .onoff_transition_cb = _transition_cb \ 163 uint32_t transition_time_ms,
223 uint32_t
app_onoff_init(app_onoff_server_t * p_app, uint8_t element_index);
bool present_onoff
Present value of the OnOff state.
bool value_updated
Internal variable.
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.
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 last_rtc_counter
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_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.