diff options
Diffstat (limited to 'CAN-binder')
-rw-r--r-- | CAN-binder/low-can-binding/can/can-bus-dev.cpp | 11 | ||||
-rw-r--r-- | CAN-binder/low-can-binding/can/can-bus-dev.hpp | 4 | ||||
-rw-r--r-- | CAN-binder/low-can-binding/utils/openxc-utils.cpp | 2 |
3 files changed, 9 insertions, 8 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 6b8d9144..1aaefc91 100644 --- a/CAN-binder/low-can-binding/can/can-bus-dev.cpp +++ b/CAN-binder/low-can-binding/can/can-bus-dev.cpp @@ -33,9 +33,9 @@ /// @brief Class constructor /// /// @param[in] dev_name - String representing the device name into the linux /dev tree -/// @param[in] address - integer identifier of the bus, set using init_can_dev from can_bus_t. -can_bus_dev_t::can_bus_dev_t(const std::string& dev_name, int32_t address) - : device_name_{dev_name}, address_{address} +/// @param[in] index - integer identifier of the bus, set using init_can_dev from can_bus_t. +can_bus_dev_t::can_bus_dev_t(const std::string& dev_name, int index) + : device_name_{dev_name}, index_{index} {} std::string can_bus_dev_t::get_device_name() const @@ -43,9 +43,10 @@ std::string can_bus_dev_t::get_device_name() const return device_name_; } -uint32_t can_bus_dev_t::get_address() const +int can_bus_dev_t::get_index() const { - return address_; + return index_; +} } /// @brief Open the can socket and returning it diff --git a/CAN-binder/low-can-binding/can/can-bus-dev.hpp b/CAN-binder/low-can-binding/can/can-bus-dev.hpp index d32f9a84..38727e03 100644 --- a/CAN-binder/low-can-binding/can/can-bus-dev.hpp +++ b/CAN-binder/low-can-binding/can/can-bus-dev.hpp @@ -36,7 +36,7 @@ private: std::string device_name_; ///< a string identifier identitfying the linux CAN device. utils::socketcan_t can_socket_; - int32_t address_; ///< an identifier used through binding that refer to that device + int index_; std::thread th_reading_; ///< Thread handling read the socket can device filling can_message_q_ queue of can_bus_t bool is_running_ = false; ///< boolean telling whether or not reading is running or not @@ -46,7 +46,7 @@ public: can_bus_dev_t(const std::string& dev_name, int32_t address); std::string get_device_name() const; - uint32_t get_address() const; + int get_index() const; int open(); void configure(); diff --git a/CAN-binder/low-can-binding/utils/openxc-utils.cpp b/CAN-binder/low-can-binding/utils/openxc-utils.cpp index 52b49d29..a597f1ca 100644 --- a/CAN-binder/low-can-binding/utils/openxc-utils.cpp +++ b/CAN-binder/low-can-binding/utils/openxc-utils.cpp @@ -39,7 +39,7 @@ openxc_VehicleMessage build_VehicleMessage(active_diagnostic_request_t* request, message.type = openxc_VehicleMessage_Type::openxc_VehicleMessage_Type_DIAGNOSTIC; message.has_diagnostic_response = true; message.diagnostic_response.has_bus = true; - message.diagnostic_response.bus = configuration_t::instance().get_diagnostic_manager().get_can_bus_dev()->get_address(); + message.diagnostic_response.bus = configuration_t::instance().get_diagnostic_manager().get_can_bus_dev()->get_index(); message.diagnostic_response.has_message_id = true; if(request->get_id() != OBD2_FUNCTIONAL_BROADCAST_ID) |