X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=CAN-binder%2Flow-can-binding%2Fcan%2Fcan-bus-dev.cpp;h=df0c0d6f993c559ee50a577e499a6bb2fcba2722;hb=14043c56960ced9141ef107c66a6a041a75f6cb3;hp=6cd2264b7d50ee47564adccc0e5ef315d37a0c39;hpb=84264431ca5a9958b3bb00b3de481336cf0cccb1;p=apps%2Fagl-service-can-low-level.git 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 6cd2264b..df0c0d6f 100644 --- a/CAN-binder/low-can-binding/can/can-bus-dev.cpp +++ b/CAN-binder/low-can-binding/can/can-bus-dev.cpp @@ -21,8 +21,6 @@ #include #include #include - -#include "can-bus-dev.hpp" #include #include "can-bus.hpp" @@ -30,13 +28,12 @@ #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 -/// @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 @@ -44,9 +41,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