diff options
author | Jacob Keeler <jacob.keeler@livioradio.com> | 2018-04-05 15:00:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-05 15:00:43 -0400 |
commit | 61fd83fed0dc584019b305bebc82512d2c42b9e7 (patch) | |
tree | 5432b4212b003d07029911423d64bdf185ea0c9d /src/components/transport_manager/include/transport_manager/transport_adapter | |
parent | 6212599da217e95899d63d4b33088082489841bd (diff) | |
parent | c2bdb27e117e30752d0f223ec0e244f207883795 (diff) | |
download | sdl_core-61fd83fed0dc584019b305bebc82512d2c42b9e7.tar.gz |
Merge pull request #2005 from smartdevicelink/release/4.5.04.5.0
Release/4.5.0
Diffstat (limited to 'src/components/transport_manager/include/transport_manager/transport_adapter')
3 files changed, 43 insertions, 21 deletions
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h index d4c97d5233..2b1ada79ad 100644 --- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h +++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h @@ -400,6 +400,26 @@ class TransportAdapterImpl : public TransportAdapter, const DataSendError& error) OVERRIDE; /** + * @brief DoTransportSwitch notifies listeners of transport adapter events + * that transport switching is requested by system + */ + void DoTransportSwitch() const OVERRIDE; + + /** + * @brief DeviceSwitched Notifies system on successful transport switch for + * particular device + * @param device_handle Device handle of switched device + */ + void DeviceSwitched(const DeviceUID& device_handle) OVERRIDE; + + /** + * @brief GetSwitchableDevices Provides list of devices able to switch their + * transport (e.g. iAP2 Bluetooth to iAP2 USB). + * @return + */ + SwitchableDevices GetSwitchableDevices() const OVERRIDE; + + /** * @brief Return name of device. * * @param device_id Device unique identifier. @@ -409,6 +429,13 @@ class TransportAdapterImpl : public TransportAdapter, std::string DeviceName(const DeviceUID& device_id) const OVERRIDE; /** + * @brief StopDevice looks for specific device in devices list and calls + * Stop() interface of that device + * @param device_id unique device identifier that has to be stopped. + */ + void StopDevice(const DeviceUID& device_id) const OVERRIDE; + + /** * @brief Allows to obtain connection type used by device. * @return connection type. */ diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h index 0a1eeb6b4a..424fa53dea 100644 --- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h +++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h @@ -146,6 +146,7 @@ class TransportAdapterListener { const DeviceUID& device_handle, const ApplicationHandle& app_handle, const CommunicationError& error) = 0; + /** * @brief Search specified device adapter in the container of shared pointers *to device adapters to be sure it is available, @@ -269,6 +270,13 @@ class TransportAdapterListener { virtual void OnCommunicationError(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle) = 0; + /** + * @brief OnTransportSwitchRequested notifies on received signal to start + * transport switching flow (at the moment Bluetooth to USB only) + * @param transport_adapter Transport adapter who received the signal + */ + virtual void OnTransportSwitchRequested( + const TransportAdapter* transport_adapter) = 0; }; } // transport_adapter namespace diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h index a7cd544563..8a8031c3cf 100644 --- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h +++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h @@ -49,26 +49,6 @@ class TransportAdapterListenerImpl : public transport_adapter::TransportAdapterListener { public: /** - * @enum Available types of events. - */ - enum EventTypeEnum { - ON_SEARCH_DONE = 0, - ON_SEARCH_FAIL, - ON_DEVICE_LIST_UPDATED, - ON_FIND_NEW_APPLICATIONS_REQUEST, - ON_CONNECT_DONE, - ON_CONNECT_FAIL, - ON_DISCONNECT_DONE, - ON_DISCONNECT_FAIL, - ON_SEND_DONE, - ON_SEND_FAIL, - ON_RECEIVED_DONE, - ON_RECEIVED_FAIL, - ON_COMMUNICATION_ERROR, - ON_UNEXPECTED_DISCONNECT - }; - - /** * @brief Constructor. * * @param manager Pointer to the transport manager class. @@ -283,7 +263,14 @@ class TransportAdapterListenerImpl */ virtual void OnCommunicationError(const TransportAdapter* adapter, const DeviceUID& device, - const ApplicationHandle& app_id); + const ApplicationHandle& app_id) OVERRIDE; + + /** + * @brief OnTransportSwitchRequested notifies on received signal to start + * transport switching flow (at the moment Bluetooth to USB only) + * @param transport_adapter Transport adapter who received the signal + */ + void OnTransportSwitchRequested(const TransportAdapter* adapter) OVERRIDE; private: TransportManager* transport_manager_; |