diff options
author | Frank Ronneburg <fronneburg@xevo.com> | 2018-04-12 00:23:48 +0900 |
---|---|---|
committer | fronneburg <fronneburg@xevo.com> | 2018-04-11 16:50:50 -0700 |
commit | 4bc109858e8f16c3b37eab3b766976d6039dbf09 (patch) | |
tree | 7e39a2fc337818fce86687f55efaf49c47c0f074 /src/components/connection_handler | |
parent | 52da74267b8d7fe21ce497f5ce1b86c43e49a804 (diff) | |
download | sdl_core-4bc109858e8f16c3b37eab3b766976d6039dbf09.tar.gz |
Merge pull request #243 in NAR/sdl-core from fix/remove_device_id_from_protocol_layer to feature/Ford-WiFi
* commit 'acc25986110b72465268736495b29812db2a3a0a':
fully revert info.h
use connection_type instead of device_id in the protocol layer for secondary transports
Diffstat (limited to 'src/components/connection_handler')
4 files changed, 12 insertions, 32 deletions
diff --git a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h index 2e3c73f20e..edd47f15d5 100644 --- a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h +++ b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h @@ -275,11 +275,11 @@ class ConnectionHandlerImpl void OnMalformedMessageCallback(const uint32_t& connection_key) OVERRIDE; /** - * \brief Returns the device type associated with the connection handle + * \brief Returns the connection type associated with the connection handle * \param connection_handle Handle of the connection being queried - * \return Device Type + * \return Connection Type */ - transport_manager::transport_adapter::DeviceType device_type( + std::string connection_type( transport_manager::ConnectionUID connection_handle) const OVERRIDE; /** diff --git a/src/components/connection_handler/include/connection_handler/device.h b/src/components/connection_handler/include/connection_handler/device.h index c2fb955f55..26376c1d8d 100644 --- a/src/components/connection_handler/include/connection_handler/device.h +++ b/src/components/connection_handler/include/connection_handler/device.h @@ -37,7 +37,6 @@ #include <map> #include <vector> #include "transport_manager/common.h" -#include "transport_manager/transport_adapter/transport_adapter.h" /** * \namespace connection_handler @@ -63,8 +62,7 @@ class Device { Device(DeviceHandle device_handle, const std::string& user_friendly_name, const std::string& mac_address = "", - const std::string& connection_type = "", - transport_manager::transport_adapter::DeviceType device_type = transport_manager::transport_adapter::DeviceType::UNKNOWN); + const std::string& connection_type = ""); /** * \brief Returns device handle @@ -90,12 +88,6 @@ class Device { */ std::string connection_type() const; - /** - * @brief The type of device. - * @return device type - */ - transport_manager::transport_adapter::DeviceType device_type() const; - private: /** * \brief Uniq device handle. @@ -116,11 +108,6 @@ class Device { * \brief The type of connection used by device. */ std::string connection_type_; - - /** - * \brief The DeviceType associated with the device - */ - transport_manager::transport_adapter::DeviceType device_type_; }; /** diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc index 5245c935bd..1a2dd0f76c 100644 --- a/src/components/connection_handler/src/connection_handler_impl.cc +++ b/src/components/connection_handler/src/connection_handler_impl.cc @@ -144,8 +144,7 @@ void ConnectionHandlerImpl::OnDeviceAdded( Device device(handle, device_info.name(), device_info.mac_address(), - device_info.connection_type(), - device_info.device_type()); + device_info.connection_type()); auto result = device_list_.insert(std::make_pair(handle, device)); @@ -817,11 +816,11 @@ void ConnectionHandlerImpl::OnSecondaryTransportEnded( } } -transport_manager::transport_adapter::DeviceType ConnectionHandlerImpl::device_type( +std::string ConnectionHandlerImpl::connection_type( transport_manager::ConnectionUID connection_handle) const { LOG4CXX_AUTO_TRACE(logger_); - - transport_manager::transport_adapter::DeviceType device_type = transport_manager::transport_adapter::DeviceType::UNKNOWN; + + std::string connection_type; sync_primitives::AutoReadLock lock(connection_list_lock_); ConnectionList::const_iterator it = @@ -835,11 +834,11 @@ transport_manager::transport_adapter::DeviceType ConnectionHandlerImpl::device_t if (device_list_.end() == it) { LOG4CXX_ERROR(logger_, "Device not found!"); } else { - device_type = it->second.device_type(); + connection_type = it->second.connection_type(); } } - return device_type; + return connection_type; } uint32_t ConnectionHandlerImpl::KeyFromPair( diff --git a/src/components/connection_handler/src/device.cc b/src/components/connection_handler/src/device.cc index 6512848205..0ecb439172 100644 --- a/src/components/connection_handler/src/device.cc +++ b/src/components/connection_handler/src/device.cc @@ -48,13 +48,11 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "ConnectionHandler") Device::Device(DeviceHandle device_handle, const std::string& user_friendly_name, const std::string& mac_address, - const std::string& connection_type, - transport_manager::transport_adapter::DeviceType device_type) + const std::string& connection_type) : device_handle_(device_handle) , user_friendly_name_(user_friendly_name) , mac_address_(mac_address) - , connection_type_(connection_type) - , device_type_(device_type) { + , connection_type_(connection_type) { mac_address_ = encryption::MakeHash(mac_address); LOG4CXX_DEBUG(logger_, "Device: MAC address - " << mac_address << ", hash - " @@ -77,8 +75,4 @@ std::string Device::connection_type() const { return connection_type_; } -transport_manager::transport_adapter::DeviceType Device::device_type() const { - return device_type_; -} - } // namespace connection_handler |