2 * Copyright (C) 2015, 2016 "IoT.bzh"
3 * Author "Romain Forlot" <romain.forlot@iot.bzh>
4 * Author "Loic Collignon" <loic.collignon@iot.bzh>
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
22 #include <sys/timeb.h>
23 #include <linux/can.h>
24 #include <json-c/json.h>
25 #include <linux/can/raw.h>
28 #include "openxc.pb.h"
29 #include "can-utils.hpp"
30 #include "can-signals.hpp"
31 #include "can-decoder.hpp"
32 #include "openxc-utils.hpp"
35 * Interface between the daemon and the binding
37 static const struct afb_binding_interface *interface;
41 #include <afb/afb-binding.h>
42 #include <afb/afb-service-itf.h>
44 static void subscribe(struct afb_req request);
45 static void unsubscribe(struct afb_req request);
48 * @brief Register the binding.
50 * @desc - A binding V1 MUST have a function of this name and signature.
51 * This function is called during loading of the binding. It
52 * receives an 'interface' that should be recorded for later access to
53 * functions provided by the framework.
55 * This function MUST return the address of a structure that describes
56 * the binding and its implemented verbs.
58 * In case of initialisation error, NULL must be returned.
60 * @param[in] const struct afb_binding_interface *itf - interface to the application framework binder.
62 * @return pointer to the binding or NULL in case of error
64 const struct afb_binding *afbBindingV1Register (const struct afb_binding_interface *itf);
67 * @brief Initialize the binding.
69 * @param[in] service Structure which represent the Application Framework Binder.
71 * @return Exit code, zero if success.
73 int afbBindingV1ServiceInit(struct afb_service service);