summaryrefslogtreecommitdiffstats
path: root/low-can-binding.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-02-13 23:29:01 +0000
committerRomain Forlot <romain.forlot@iot.bzh>2017-02-13 23:31:56 +0000
commit90e20942222d7b6142dbdaa05ab7e81bc0f79904 (patch)
tree9c86470ba813e504a4e6de840ddce00bac65ca03 /low-can-binding.cpp
parent2fc26a117842428f4148621361c53082ac93722f (diff)
Added needed functions for basics decode needs.
Change-Id: Ic6202927058ff693c7c5c9b04e25b7be2fba340c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding.cpp')
-rw-r--r--low-can-binding.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/low-can-binding.cpp b/low-can-binding.cpp
index b523e9d..bb219be 100644
--- a/low-can-binding.cpp
+++ b/low-can-binding.cpp
@@ -7,7 +7,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -44,7 +44,7 @@
#include "obd2.h"
/*
- * Interface between the daemon and the binding
+ * Interface between the daemon and the binding
*/
static const struct afb_binding_interface *interface;
@@ -84,11 +84,12 @@ static int on_event(sd_event_source *s, int fd, uint32_t revents, void *userdata
}
/*
+ * USELESS SINCE THREADS SEPARATION
+ *
* Get the event loop running.
* Will trigger on_event function on EPOLLIN event on socket
*
* Return 0 or positive value on success. Else negative value for failure.
- */
static int connect_to_event_loop(CanBus &CanBus_handler)
{
sd_event *event_loop;
@@ -113,6 +114,7 @@ static int connect_to_event_loop(CanBus &CanBus_handler)
return rc;
}
+ */
/********************************************************************************
*
@@ -156,7 +158,7 @@ static int subscribe_unsubscribe_name(struct afb_req request, int subscribe, con
if (0 == strcmp(name, "*"))
return subscribe_unsubscribe_all(request, subscribe);
- sig = getsig(name);
+ sig = getSignal(name);
if (sig == NULL) {
return 0;
}
@@ -204,8 +206,8 @@ static void unsubscribe(struct afb_req request)
}
static const struct afb_verb_desc_v1 verbs[]=
{
- { .name= "subscribe", .session= AFB_SESSION_NONE, .callback= subscribe, .info= "subscribe to notification of CAN bus messages." },
- { .name= "unsubscribe", .session= AFB_SESSION_NONE, .callback= unsubscribe, .info= "unsubscribe a previous subscription." },
+ { .name= "subscribe", .session= AFB_SESSION_NONE, .callback= subscribe, .info= "subscribe to notification of CAN bus messages." },
+ { .name= "unsubscribe", .session= AFB_SESSION_NONE, .callback= unsubscribe, .info= "unsubscribe a previous subscription." },
{NULL}
};
@@ -230,9 +232,7 @@ int afbBindingV1ServiceInit(struct afb_service service)
/* Open JSON conf file */
/* Open CAN socket */
- CanBus_t CanBus_handler;
+ CanBus_c CanBus_handler(interface);
CanBus_handler.open();
- CanBus_handler.start_threads();
-
- return connect_to_event_loop(CanBus_handler);
-} \ No newline at end of file
+ CanBus_handler.start_threads();
+}