The callbacks astarte_device_data_event_callback_t, astarte_device_unset_event_callback_t, astarte_device_connection_event_callback_t and astarte_device_disconnection_event_callback_t are lacking a way for the user to share data with them.
This requires the callback functions implementation to rely on global variables.
A simple solution is to add an entry to the astarte_device_config_t struct with a pointer to user-defined data that will then also be passed to the callbacks using the astarte_device_**_event_t structs.
The callbacks
astarte_device_data_event_callback_t
,astarte_device_unset_event_callback_t
,astarte_device_connection_event_callback_t
andastarte_device_disconnection_event_callback_t
are lacking a way for the user to share data with them. This requires the callback functions implementation to rely on global variables.A simple solution is to add an entry to the
astarte_device_config_t
struct with a pointer to user-defined data that will then also be passed to the callbacks using theastarte_device_**_event_t
structs.