nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches

◆ dult_sound_state_update()

int dult_sound_state_update ( const struct dult_user user,
const struct dult_sound_state_param param 
)

#include <include/dult.h>

Update the sound state.

This function should be called by the upper layer on each sound state change as defined by the dult_sound_state_param structure. All fields defined in the linked structure compose the sound state. The sound state change should be reported as soon as possible with this API, so that the DULT module is able to track the state in the real-time.

This API is typically used to respond to the callbacks defined by the dult_sound_cb structure. Each callback requests a specific action and the upper layer can accept a request by changing the sound state with this API. The upper layer is the ultimate owner of the sound state and only notifies the DULT module about each change.

This function can be used to change the sound state asynchronously as it is often impossible to execute sound playing action on the speaker device in the context of the requesting callbacks (as defined in the dult_sound_cb structure). Asynchronous support is also necessary to report sound state changes triggered by an external source unknown to the DULT module (see DULT_SOUND_SRC_EXTERNAL source type).

Parameters
userUser structure used to authenticate the user.
paramSound state parameters.
Returns
0 if the operation was successful. Otherwise, a (negative) error code is returned.