diff options
author | Sho Amano <samano@xevo.com> | 2018-03-13 20:08:38 +0900 |
---|---|---|
committer | Sho Amano <samano@xevo.com> | 2018-03-14 12:57:26 +0900 |
commit | 3d61a8e0e3e84dbe3de72a69e35c1ef0a58eee1f (patch) | |
tree | 438d01d71bdc7eb2988920ecb222b32608748f1e /src/components/include/transport_manager | |
parent | 70165d80ce475cd0f255193e80cefdbbea241178 (diff) | |
download | sdl_core-3d61a8e0e3e84dbe3de72a69e35c1ef0a58eee1f.tar.gz |
Add notification of transport config update through TransportManager
Diffstat (limited to 'src/components/include/transport_manager')
4 files changed, 46 insertions, 5 deletions
diff --git a/src/components/include/transport_manager/transport_adapter/transport_adapter.h b/src/components/include/transport_manager/transport_adapter/transport_adapter.h index 7f6d347535..57407fbc94 100644 --- a/src/components/include/transport_manager/transport_adapter/transport_adapter.h +++ b/src/components/include/transport_manager/transport_adapter/transport_adapter.h @@ -5,6 +5,9 @@ * Copyright (c) 2016, Ford Motor Company * All rights reserved. * + * Copyright (c) 2018 Xevo Inc. + * All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -16,7 +19,7 @@ * disclaimer in the documentation and/or other materials provided with the * distribution. * - * Neither the name of the Ford Motor Company nor the names of its contributors + * Neither the name of the copyright holders nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -86,6 +89,11 @@ typedef std::map<DeviceUID, DeviceSptr> DeviceMap; */ typedef std::list<TransportAdapterListener*> TransportAdapterListenerList; +/** + * @brief Type definition for transport's configuration information + */ +typedef std::map<std::string, std::string> TransportConfig; + class TransportAdapter { public: /** @@ -312,6 +320,12 @@ class TransportAdapter { virtual void DeviceSwitched(const DeviceUID& device_handle) = 0; virtual SwitchableDevices GetSwitchableDevices() const = 0; + + /** + * @brief Returns the transport's configuration information + */ + virtual TransportConfig GetTransportConfiguration() const = 0; + #ifdef TELEMETRY_MONITOR /** * @brief Return Time metric observer diff --git a/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h b/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h index 18f4ccb2d1..5d55960943 100644 --- a/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h +++ b/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h @@ -2,6 +2,9 @@ * Copyright (c) 2013, Ford Motor Company * All rights reserved. * + * Copyright (c) 2018 Xevo Inc. + * All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -13,7 +16,7 @@ * disclaimer in the documentation and/or other materials provided with the * distribution. * - * Neither the name of the Ford Motor Company nor the names of its contributors + * Neither the name of the copyright holders nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -57,7 +60,8 @@ enum class EventTypeEnum { ON_RECEIVED_FAIL, ON_COMMUNICATION_ERROR, ON_UNEXPECTED_DISCONNECT, - ON_TRANSPORT_SWITCH_REQUESTED + ON_TRANSPORT_SWITCH_REQUESTED, + ON_TRANSPORT_CONFIG_UPDATED }; class TransportAdapterEvent { diff --git a/src/components/include/transport_manager/transport_manager_listener.h b/src/components/include/transport_manager/transport_manager_listener.h index d336eade45..0d02bfd8c7 100644 --- a/src/components/include/transport_manager/transport_manager_listener.h +++ b/src/components/include/transport_manager/transport_manager_listener.h @@ -2,6 +2,9 @@ * Copyright (c) 2014, Ford Motor Company * All rights reserved. * + * Copyright (c) 2018 Xevo Inc. + * All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -13,7 +16,7 @@ * disclaimer in the documentation and/or other materials provided with the * distribution. * - * Neither the name of the Ford Motor Company nor the names of its contributors + * Neither the name of the copyright holders nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -33,6 +36,7 @@ #ifndef SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_H_ #define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_H_ +#include <map> #include <vector> #include "transport_manager/common.h" #include "transport_manager/info.h" @@ -193,6 +197,14 @@ class TransportManagerListener { virtual void OnTMMessageSendFailed( const DataSendError& error, const ::protocol_handler::RawMessagePtr message) = 0; + + /** + * @brief Notifies that configuration of a transport has been updated. + * + * @param configs pairs of key and value that represent configuration. + */ + virtual void OnTransportConfigUpdated( + const std::map<std::string, std::string>& configs) = 0; }; } // namespace transport_manager #endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_H_ diff --git a/src/components/include/transport_manager/transport_manager_listener_empty.h b/src/components/include/transport_manager/transport_manager_listener_empty.h index ca6c573a06..a255256290 100644 --- a/src/components/include/transport_manager/transport_manager_listener_empty.h +++ b/src/components/include/transport_manager/transport_manager_listener_empty.h @@ -2,6 +2,9 @@ * Copyright (c) 2014, Ford Motor Company * All rights reserved. * + * Copyright (c) 2018 Xevo Inc. + * All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -13,7 +16,7 @@ * disclaimer in the documentation and/or other materials provided with the * distribution. * - * Neither the name of the Ford Motor Company nor the names of its contributors + * Neither the name of the copyright holders nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -187,6 +190,14 @@ class TransportManagerListenerEmpty : public TransportManagerListener { void OnTMMessageSendFailed( const DataSendError& error, const ::protocol_handler::RawMessagePtr message) OVERRIDE {} + + /** + * @brief Notifies that configuration of a transport has been updated. + * + * @param configs pairs of key and value that represent configuration. + */ + void OnTransportConfigUpdated( + const std::map<std::string, std::string>& configs) OVERRIDE {} }; } // namespace transport_manager #endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_EMPTY_H_ |