Loading automotive/can/1.0/ICanController.hal +5 −5 Original line number Diff line number Diff line Loading @@ -97,8 +97,8 @@ interface ICanController { */ BAD_ADDRESS, /** Provided baud rate is not supported by the hardware. */ BAD_BAUDRATE, /** Provided bit rate is not supported by the hardware. */ BAD_BITRATE, }; /** Loading Loading @@ -152,13 +152,13 @@ interface ICanController { } interfaceId; /** * Baud rate for CAN communication. * Bit rate for CAN communication. * * Typical baud rates are: 100000, 125000, 250000, 500000. * Typical bit rates are: 100000, 125000, 250000, 500000. * * For virtual interfaces this value is ignored. */ uint32_t baudrate; uint32_t bitrate; }; /** Loading automotive/can/1.0/default/CanBusNative.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -22,8 +22,8 @@ namespace android::hardware::automotive::can::V1_0::implementation { CanBusNative::CanBusNative(const std::string& ifname, uint32_t baudrate) : CanBus(ifname), mBaudrate(baudrate) {} CanBusNative::CanBusNative(const std::string& ifname, uint32_t bitrate) : CanBus(ifname), mBitrate(bitrate) {} ICanController::Result CanBusNative::preUp() { if (!netdevice::exists(mIfname)) { Loading @@ -31,7 +31,7 @@ ICanController::Result CanBusNative::preUp() { return ICanController::Result::BAD_ADDRESS; } if (mBaudrate == 0) { if (mBitrate == 0) { // interface is already up and we just want to register it return ICanController::Result::OK; } Loading @@ -41,9 +41,9 @@ ICanController::Result CanBusNative::preUp() { return ICanController::Result::UNKNOWN_ERROR; } if (!netdevice::can::setBitrate(mIfname, mBaudrate)) { LOG(ERROR) << "Can't set bitrate " << mBaudrate << " for " << mIfname; return ICanController::Result::BAD_BAUDRATE; if (!netdevice::can::setBitrate(mIfname, mBitrate)) { LOG(ERROR) << "Can't set bitrate " << mBitrate << " for " << mIfname; return ICanController::Result::BAD_BITRATE; } return ICanController::Result::OK; Loading automotive/can/1.0/default/CanBusNative.h +2 −2 Original line number Diff line number Diff line Loading @@ -21,13 +21,13 @@ namespace android::hardware::automotive::can::V1_0::implementation { struct CanBusNative : public CanBus { CanBusNative(const std::string& ifname, uint32_t baudrate); CanBusNative(const std::string& ifname, uint32_t bitrate); protected: virtual ICanController::Result preUp() override; private: const uint32_t mBaudrate; const uint32_t mBitrate; }; } // namespace android::hardware::automotive::can::V1_0::implementation automotive/can/1.0/default/CanBusSlcan.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ ICanController::Result CanBusSlcan::preUp() { if (kBitrate != 0) { const auto lookupIt = slcanprotocol::kBitrateCommands.find(kBitrate); if (lookupIt == slcanprotocol::kBitrateCommands.end()) { return ICanController::Result::BAD_BAUDRATE; return ICanController::Result::BAD_BITRATE; } canBitrateCommand = lookupIt->second; } Loading automotive/can/1.0/default/CanController.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ Return<ICanController::Result> CanController::upInterface( if (config.iftype == ICanController::InterfaceType::SOCKETCAN) { // TODO(b/135918744): support serialno if (config.interfaceId.getDiscriminator() == IfaceIdDisc::address) { busService = new CanBusNative(config.interfaceId.address(), config.baudrate); busService = new CanBusNative(config.interfaceId.address(), config.bitrate); } else { return ICanController::Result::BAD_ADDRESS; } Loading @@ -73,7 +73,7 @@ Return<ICanController::Result> CanController::upInterface( } } else if (config.iftype == ICanController::InterfaceType::SLCAN) { if (config.interfaceId.getDiscriminator() == IfaceIdDisc::address) { busService = new CanBusSlcan(config.interfaceId.address(), config.baudrate); busService = new CanBusSlcan(config.interfaceId.address(), config.bitrate); } else { return ICanController::Result::BAD_ADDRESS; } Loading Loading
automotive/can/1.0/ICanController.hal +5 −5 Original line number Diff line number Diff line Loading @@ -97,8 +97,8 @@ interface ICanController { */ BAD_ADDRESS, /** Provided baud rate is not supported by the hardware. */ BAD_BAUDRATE, /** Provided bit rate is not supported by the hardware. */ BAD_BITRATE, }; /** Loading Loading @@ -152,13 +152,13 @@ interface ICanController { } interfaceId; /** * Baud rate for CAN communication. * Bit rate for CAN communication. * * Typical baud rates are: 100000, 125000, 250000, 500000. * Typical bit rates are: 100000, 125000, 250000, 500000. * * For virtual interfaces this value is ignored. */ uint32_t baudrate; uint32_t bitrate; }; /** Loading
automotive/can/1.0/default/CanBusNative.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -22,8 +22,8 @@ namespace android::hardware::automotive::can::V1_0::implementation { CanBusNative::CanBusNative(const std::string& ifname, uint32_t baudrate) : CanBus(ifname), mBaudrate(baudrate) {} CanBusNative::CanBusNative(const std::string& ifname, uint32_t bitrate) : CanBus(ifname), mBitrate(bitrate) {} ICanController::Result CanBusNative::preUp() { if (!netdevice::exists(mIfname)) { Loading @@ -31,7 +31,7 @@ ICanController::Result CanBusNative::preUp() { return ICanController::Result::BAD_ADDRESS; } if (mBaudrate == 0) { if (mBitrate == 0) { // interface is already up and we just want to register it return ICanController::Result::OK; } Loading @@ -41,9 +41,9 @@ ICanController::Result CanBusNative::preUp() { return ICanController::Result::UNKNOWN_ERROR; } if (!netdevice::can::setBitrate(mIfname, mBaudrate)) { LOG(ERROR) << "Can't set bitrate " << mBaudrate << " for " << mIfname; return ICanController::Result::BAD_BAUDRATE; if (!netdevice::can::setBitrate(mIfname, mBitrate)) { LOG(ERROR) << "Can't set bitrate " << mBitrate << " for " << mIfname; return ICanController::Result::BAD_BITRATE; } return ICanController::Result::OK; Loading
automotive/can/1.0/default/CanBusNative.h +2 −2 Original line number Diff line number Diff line Loading @@ -21,13 +21,13 @@ namespace android::hardware::automotive::can::V1_0::implementation { struct CanBusNative : public CanBus { CanBusNative(const std::string& ifname, uint32_t baudrate); CanBusNative(const std::string& ifname, uint32_t bitrate); protected: virtual ICanController::Result preUp() override; private: const uint32_t mBaudrate; const uint32_t mBitrate; }; } // namespace android::hardware::automotive::can::V1_0::implementation
automotive/can/1.0/default/CanBusSlcan.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ ICanController::Result CanBusSlcan::preUp() { if (kBitrate != 0) { const auto lookupIt = slcanprotocol::kBitrateCommands.find(kBitrate); if (lookupIt == slcanprotocol::kBitrateCommands.end()) { return ICanController::Result::BAD_BAUDRATE; return ICanController::Result::BAD_BITRATE; } canBitrateCommand = lookupIt->second; } Loading
automotive/can/1.0/default/CanController.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ Return<ICanController::Result> CanController::upInterface( if (config.iftype == ICanController::InterfaceType::SOCKETCAN) { // TODO(b/135918744): support serialno if (config.interfaceId.getDiscriminator() == IfaceIdDisc::address) { busService = new CanBusNative(config.interfaceId.address(), config.baudrate); busService = new CanBusNative(config.interfaceId.address(), config.bitrate); } else { return ICanController::Result::BAD_ADDRESS; } Loading @@ -73,7 +73,7 @@ Return<ICanController::Result> CanController::upInterface( } } else if (config.iftype == ICanController::InterfaceType::SLCAN) { if (config.interfaceId.getDiscriminator() == IfaceIdDisc::address) { busService = new CanBusSlcan(config.interfaceId.address(), config.baudrate); busService = new CanBusSlcan(config.interfaceId.address(), config.bitrate); } else { return ICanController::Result::BAD_ADDRESS; } Loading