-STATIC int volOnSvcCB (sd_event_source* source,uint64_t timer, void* pTag) {
- ucsContextT *ucsContext = (ucsContextT*) pTag;
-
- sd_event_source_unref(source);
- UCSI_Vol_Service(&ucsContext->ucsiData);
-
- return 0;
-}
-
-/* This callback is fire each time an volume event wait in the queue */
-void volumeCB (uint16_t timeout) {
- uint64_t usec;
- sd_event_now(afb_daemon_get_event_loop(afbIface->daemon), CLOCK_BOOTTIME, &usec);
- sd_event_add_time(afb_daemon_get_event_loop(afbIface->daemon), NULL, CLOCK_MONOTONIC, usec + (timeout*1000), 250, volOnSvcCB, ucsContextS);
-}
-
-STATIC int volSndCmd (struct afb_req request, struct json_object *commandJ, ucsContextT *ucsContext) {
- int numid, vol, err;
- struct json_object *nameJ, *channelJ, *volJ;
-
- enum json_type jtype= json_object_get_type(commandJ);
- switch (jtype) {
- case json_type_array:
- if (!sscanf (json_object_get_string (json_object_array_get_idx(commandJ, 0)), "%d", &numid)) {
- afb_req_fail_f (request, "channel-invalid","command=%s channel is not an integer", json_object_get_string (channelJ));
- goto OnErrorExit;
- }
- if (!sscanf (json_object_get_string (json_object_array_get_idx(commandJ, 1)), "%d", &vol)) {
- afb_req_fail_f (request, "vol-invalid","command=%s vol is not an integer", json_object_get_string (channelJ));
- goto OnErrorExit;
- }
- break;