Added JSON conf file read and initialize CanBus
[apps/low-level-can-service.git] / obsolete / ll-can-binding.h
1 /*
2  * Copyright (C) 2015, 2016 "IoT.bzh"
3  * Author "Romain Forlot" <romain.forlot@iot.bzh>
4  *
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
8  *
9  *   http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  */
17
18 /*
19  * Interface between the daemon and the binding
20  */
21 static const struct afb_binding_interface *interface;
22
23 /* CAN variable initialization */
24 struct canfd_frame canfd_frame;
25
26 /*
27  * each generated event
28  */
29 typedef struct _event event;
30 struct _event {
31         event *next;                    /* link for the next event */
32         const char *name;               /* name of the event */
33         struct afb_event afb_event;     /* the event for the binder */
34         openxc_CanMessage can_message;  /* value for the can_message */
35 };
36
37 /*
38  * each can event, will browse by the id
39  */
40 typedef struct _can_event can_event;
41 struct _can_event {
42         can_event *next;        /* Link to the next other can message */
43         event *events;          /* events for the can message */
44         uint32_t id;            /* id of the event for unsubscribe */
45         enum type type;         /* the type of data expected */
46 };
47
48 can_event *can_events_list;