From 521281617cec5d89725c4844eac68b5a772fab57 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Sat, 11 Mar 2017 00:27:30 +0100 Subject: Work in Progress Static/Dynamic Lib Fixed. Source Tree cleaned up Compile but to be tested Business Logic not done --- AudioLogic/AudioLogicBinding.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'AudioLogic/AudioLogicBinding.c') diff --git a/AudioLogic/AudioLogicBinding.c b/AudioLogic/AudioLogicBinding.c index 0c63d00..002ff42 100644 --- a/AudioLogic/AudioLogicBinding.c +++ b/AudioLogic/AudioLogicBinding.c @@ -30,10 +30,21 @@ PUBLIC const struct afb_binding_interface *afbIface; -STATIC void localping(struct afb_req request) { - json_object *query = afb_req_json(request); - afb_req_success(request, query, NULL); -} +// Map HAL Enum to Labels +typedef const struct { + halCtlsEnumT control; + char *label; +} LogicControlT; + +// High Level Control Mapping to String for JSON & HTML5 +STATIC LogicControlT LogicControl[] = { + {.control= Master_Playback_Volume,.label= "Master_Volume"}, + {.control= PCM_Playback_Volume, .label= "Playback_Volume"}, + {.control= PCM_Playback_Switch, .label= "Playback_Switch"}, + {.control= Capture_Volume, .label= "Capture_Volume"}, + + {.control= 0,.label= NULL} // closing convention +}; /* @@ -41,7 +52,7 @@ STATIC void localping(struct afb_req request) { */ STATIC const struct afb_verb_desc_v1 binding_verbs[] = { /* VERB'S NAME SESSION MANAGEMENT FUNCTION TO CALL SHORT DESCRIPTION */ - { .name= "ping" , .session= AFB_SESSION_NONE, .callback= localping, .info= "Ping Binding" }, + { .name= "ping" , .session= AFB_SESSION_NONE, .callback= pingtest, .info= "Ping Binding" }, { .name= "setvolume", .session= AFB_SESSION_CHECK, .callback= audioLogicSetVol, .info= "Set Volume" }, { .name= "getvolume", .session= AFB_SESSION_CHECK, .callback= audioLogicGetVol, .info= "Get Volume" }, { .name= "subscribe", .session= AFB_SESSION_CHECK, .callback= audioLogicSubscribe, .info= "Subscribe AudioBinding Events" }, -- cgit 1.2.3-korg