* \return Zero if success, otherwise a negative error code
*
* Known identifiers:
+ * - _once - execute the once sequence (value = NULL)
* - _verb - set current verb = value
* - _enadev - enable given device = value
* - _disdev - disable given device = value
return err;
}
+static int set_once_user(snd_use_case_mgr_t *uc_mgr,
+ const char *value)
+{
+ int err;
+
+ if (value != NULL && *value) {
+ uc_error("error: wrong value for _once (%s)", value);
+ return -EINVAL;
+ }
+ err = execute_sequence(uc_mgr, &uc_mgr->once_list,
+ &uc_mgr->value_list, NULL, NULL);
+ if (err < 0) {
+ uc_error("Unable to execute once sequence");
+ return err;
+ }
+ return err;
+}
+
static int handle_transition_verb(snd_use_case_mgr_t *uc_mgr,
struct use_case_verb *new_verb)
{
int err = 0;
pthread_mutex_lock(&uc_mgr->mutex);
- if (strcmp(identifier, "_verb") == 0)
+ if (strcmp(identifier, "_once") == 0)
+ err = set_once_user(uc_mgr, value);
+ else if (strcmp(identifier, "_verb") == 0)
err = set_verb_user(uc_mgr, value);
else if (strcmp(identifier, "_enadev") == 0)
err = set_device_user(uc_mgr, value, 1);