summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CAN-binder/low-can-binding/can/can-bus-dev.cpp2
-rw-r--r--CAN-binder/low-can-binding/can/can-bus.cpp11
-rw-r--r--CAN-binder/low-can-binding/can/can-message.hpp2
-rw-r--r--CAN-binder/low-can-binding/low-can-binding.cpp15
4 files changed, 15 insertions, 15 deletions
diff --git a/CAN-binder/low-can-binding/can/can-bus-dev.cpp b/CAN-binder/low-can-binding/can/can-bus-dev.cpp
index 1aaefc91..df0c0d6f 100644
--- a/CAN-binder/low-can-binding/can/can-bus-dev.cpp
+++ b/CAN-binder/low-can-binding/can/can-bus-dev.cpp
@@ -28,8 +28,6 @@
#include "../low-can-binding.hpp"
#include "canutil/write.h"
-#define U64_DATA(p) (*(unsigned long long*)(p)->data)
-
/// @brief Class constructor
///
/// @param[in] dev_name - String representing the device name into the linux /dev tree
diff --git a/CAN-binder/low-can-binding/can/can-bus.cpp b/CAN-binder/low-can-binding/can/can-bus.cpp
index 66657443..6e74b86a 100644
--- a/CAN-binder/low-can-binding/can/can-bus.cpp
+++ b/CAN-binder/low-can-binding/can/can-bus.cpp
@@ -15,14 +15,15 @@
* limitations under the License.
*/
-#include <map>
-#include <cerrno>
-#include <vector>
-#include <string>
#include <net/if.h>
#include <sys/socket.h>
#include <json-c/json.h>
#include <linux/can/raw.h>
+#include <map>
+#include <cerrno>
+#include <vector>
+#include <string>
+#include <algorithm>
#include "can-bus.hpp"
@@ -337,7 +338,7 @@ void can_bus_t::push_new_vehicle_message(const openxc_VehicleMessage& v_msg)
/// @brief Create a RX_SETUP receive job for the BCM socket of a CAN signal.
///
-/// @return 0 if ok.
+/// @return 0 if ok -1 if not.
int can_bus_t::create_rx_filter(const can_signal_t& s)
{
const std::string& bus = s.get_message().get_bus_name();
diff --git a/CAN-binder/low-can-binding/can/can-message.hpp b/CAN-binder/low-can-binding/can/can-message.hpp
index 6fe03172..5a6e6eb3 100644
--- a/CAN-binder/low-can-binding/can/can-message.hpp
+++ b/CAN-binder/low-can-binding/can/can-message.hpp
@@ -70,6 +70,6 @@ public:
bool is_correct_to_send();
-static can_message_t convert_from_canfd_frame(const struct canfd_frame& frame, size_t nbytes);
+ static can_message_t convert_from_canfd_frame(const struct canfd_frame& frame, size_t nbytes);
canfd_frame convert_to_canfd_frame();
};
diff --git a/CAN-binder/low-can-binding/low-can-binding.cpp b/CAN-binder/low-can-binding/low-can-binding.cpp
index 4420b0d4..088b76fb 100644
--- a/CAN-binder/low-can-binding/low-can-binding.cpp
+++ b/CAN-binder/low-can-binding/low-can-binding.cpp
@@ -142,6 +142,7 @@ static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe,
for(const auto& sig : signals.diagnostic_messages)
{
+ diagnostic_manager_t& diag_m = conf.get_diagnostic_manager();
DiagnosticRequest* diag_req = conf.get_request_from_diagnostic_message(sig->get_name());
// If the requested diagnostic message isn't supported by the car then unsubcribe it
@@ -150,14 +151,14 @@ static int subscribe_unsubscribe_signals(struct afb_req request, bool subscribe,
if(sig->get_supported() && subscribe)
{
float frequency = sig->get_frequency();
- subscribe = conf.get_diagnostic_manager().add_recurring_request(
+ subscribe = diag_m.add_recurring_request(
diag_req, sig->get_name().c_str(), false, sig->get_decoder(), sig->get_callback(), (float)frequency);
//TODO: Adding callback requesting ignition status: diag_req, sig.c_str(), false, diagnostic_message_t::decode_obd2_response, diagnostic_message_t::check_ignition_status, frequency);
}
else
{
- conf.get_diagnostic_manager().cleanup_request(
- conf.get_diagnostic_manager().find_recurring_request(diag_req), true);
+ diag_m.cleanup_request(
+ diag_m.find_recurring_request(diag_req), true);
WARNING(binder_interface, "%s: signal: %s isn't supported. Canceling operation.", __FUNCTION__, sig->get_name().c_str());
return -1;
}
@@ -213,14 +214,14 @@ extern "C"
{
static void subscribe(struct afb_req request)
{
- std::vector<std::string> signals;
+ std::vector<std::string> args;
struct utils::signals_found sf;
int ok = 0, total = 0;
bool subscribe = true;
- signals = parse_signals_from_request(request, subscribe);
+ args = parse_args_from_request(request, subscribe);
- for(const auto& sig: signals)
+ for(const auto& sig: args)
{
openxc_DynamicField search_key = build_DynamicField(sig);
sf = utils::signals_manager_t::instance().find_signals(search_key);
@@ -241,7 +242,7 @@ extern "C"
static void unsubscribe(struct afb_req request)
{
- parse_signals_from_request(request, false);
+ parse_args_from_request(request, false);
}
static const struct afb_verb_desc_v1 verbs[]=