38 #ifndef APP_LIGHT_LIGHTNESS_H__ 39 #define APP_LIGHT_LIGHTNESS_H__ 43 #include "light_lightness_setup_server.h" 44 #include "app_timer.h" 45 #include "app_transition.h" 94 #define APP_LIGHT_LIGHTNESS_SETUP_SERVER_DEF(_name, _force_segmented, _mic_size, _set_cb, _get_cb, _transition_cb) \ 95 APP_TIMER_DEF(_name ## _timer); \ 96 static app_light_lightness_setup_server_t _name = \ 98 .light_lightness_setup_server.settings.force_segmented = _force_segmented, \ 99 .light_lightness_setup_server.settings.transmic_size = _mic_size, \ 100 .app_add_notify.app_add_publish_cb = NULL, \ 101 .app_add_notify.app_notify_set_cb = NULL, \ 102 .state.transition.timer.p_timer_id = &_name ## _timer, \ 103 .app_light_lightness_set_cb = _set_cb, \ 104 .app_light_lightness_get_cb = _get_cb, \ 105 .app_light_lightness_transition_cb = _transition_cb \ 127 uint32_t published_ms;
163 uint16_t * p_present_lightness);
176 uint32_t transition_time_ms, uint16_t target_lightness);
void(* app_notify_set_cb_t)(const void *p_app_v, uint16_t lightness)
Application notify callback prototype.
void(* app_light_lightness_set_cb_t)(const app_light_lightness_setup_server_t *p_app, uint16_t lightness)
Application Light Lightness state set callback prototype.
uint16_t target_lightness
Target value of the lightness state, as received from the model interface.
app_light_lightness_state_t state
Internal variable.
app_light_lightness_get_cb_t app_light_lightness_get_cb
Get the device lightness value.
app_transition_t transition
Structure for using transition module functionality.
app_additional_light_lightness_notify_t app_add_notify
Additional publishing/notifying requirements structure.
void * p_app_publish_v
Context pointer for the publish callback.
uint32_t app_light_lightness_binding_setup(app_light_lightness_setup_server_t *p_app)
Informs the model that the system is ready to have the powerup onoff bindings.
uint16_t initial_present_lightness
Initial present lightness required for handling Set/Delta Set message.
void(* app_light_lightness_transition_cb_t)(const app_light_lightness_setup_server_t *p_app, uint32_t transition_time_ms, uint16_t target_lightness)
Application Light Lightness transition time callback prototype.
void(* app_light_lightness_get_cb_t)(const app_light_lightness_setup_server_t *p_app, uint16_t *p_present_lightness)
Application Light Lightness state read callback prototype.
app_light_lightness_set_cb_t app_light_lightness_set_cb
Set the device lightness value.
uint32_t app_light_lightness_model_init(app_light_lightness_setup_server_t *p_app, uint8_t element_index)
Initializes the behavioral module for the generic Light Lightness model.
void(* app_additional_publish_cb_t)(const void *p_app_v, light_lightness_status_params_t *p_pub_data)
Application publish callback prototype.
uint32_t app_light_lightness_direct_actual_set(app_light_lightness_setup_server_t *p_app, uint16_t lightness_value)
Function to set the lightness value (sending to the hardware) and writing the flash state values...
bool abort_move
Internal variable.
Internal structure to hold state and timing information.
light_lightness_setup_server_t light_lightness_setup_server
Light lightness setup server context/.
uint32_t app_light_lightness_current_value_publish(app_light_lightness_setup_server_t *p_app)
Initiates value fetch from the user application by calling a get callback, updates internal state...
bool new_tid
To detect if TID is new while processing delta transition.
Application level structure holding the Light Lightness Setup server model context and Light Lightnes...
app_notify_set_cb_t app_notify_set_cb
A notify callback to call after receiving lightness Set messages.
list_node_t node
Internal variable.
Parameters for the light_lightness Status message.
app_light_lightness_transition_cb_t app_light_lightness_transition_cb
The device lightness transition time.
uint16_t present_lightness
Present value of the lightness state.
Structure for holding publish and notification callbacks for other states bound to Light Lightness st...
void * p_app_notify_v
A context pointer for the notify callback.
app_additional_publish_cb_t app_add_publish_cb
Publish callback to call to before publishing lightness status.