2 * Copyright (C) 2016 "IoT.bzh"
3 * Author Fulup Ar Foll <fulup@iot.bzh>
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
27 #include <sys/types.h>
29 #include "ucs_binding.h"
31 const struct afb_binding_interface *afbIface;
32 struct afb_service afbSrv;
35 * array of the verbs exported to afb-daemon
37 static const struct afb_verb_desc_v1 binding_verbs[] = {
38 /* VERB'S NAME SESSION MANAGEMENT FUNCTION TO CALL SHORT DESCRIPTION */
39 { .name= "initialise", .session= AFB_SESSION_NONE, .callback= ucs2Init, .info= "Parse XML & initialise Unicens " },
40 { .name= "setvol" , .session= AFB_SESSION_NONE, .callback= ucs2SetVol, .info= "Set Volume" },
41 // { .name= "monitor" , .session= AFB_SESSION_NONE, .callback= ucs2Monitor, .info= "Subscribe to network error" },
44 { .name= NULL } /* marker for end of the array */
48 * description of the binding for afb-daemon
50 static const struct afb_binding binding_description = {
51 /* description conforms to VERSION 1 */
52 .type= AFB_BINDING_VERSION_1,
55 .info= "Unicens MOST Control API",
56 .verbs = binding_verbs
60 // this is call when after all bindings are loaded
61 int afbBindingV1ServiceInit(struct afb_service service) {
67 * activation function for registering the binding called by afb-daemon
69 const struct afb_binding *afbBindingV1Register(const struct afb_binding_interface *itf) {
72 return &binding_description; /* returns the description of the binding */