summaryrefslogtreecommitdiff
path: root/src/components/transport_manager/include/transport_manager
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/transport_manager/include/transport_manager')
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h29
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h7
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h9
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_manager_impl.h6
4 files changed, 36 insertions, 15 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 df4c932260..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.
@@ -416,15 +436,6 @@ class TransportAdapterImpl : public TransportAdapter,
void StopDevice(const DeviceUID& device_id) const OVERRIDE;
/**
- * @brief DeviceSwitched is triggered for adapter to proceed with possible
- * further switching steps required on device side. E.g. to notify device
- * on end of switching so it can disconnect transport being switched from.
- * This is default implemenation does nothing. Must be overloaded if needed.
- * @param device_handle Device id to notify on event
- */
- void DeviceSwitched(const DeviceUID& device_handle) 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 db8ab4fce5..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
@@ -270,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 f5a7934ed6..9b853d9610 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
@@ -263,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_;
diff --git a/src/components/transport_manager/include/transport_manager/transport_manager_impl.h b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
index bd592a4686..eaa71ce3bb 100644
--- a/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
+++ b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
@@ -462,14 +462,10 @@ class TransportManagerImpl
* initiates switching sequence for upper layers. Also starts timer to wait
* for sequence to complete.
* @param ta Transport adapter having device to try switching sequence
- * @param value Value from device-to-adapter container having all the data
- * required
* At the moment implementation implies only IAP2-Bluetooth to IAP2-USB
* switching
- * @return True if sequence has been successfully initiated, otherwise - false
*/
- bool TryDeviceSwitch(TransportAdapter* ta,
- DeviceToAdapterMap::iterator value);
+ void TryDeviceSwitch(TransportAdapter* ta);
void AddDataToContainer(
ConnectionUID id,