summaryrefslogtreecommitdiff
path: root/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc')
-rw-r--r--src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc39
1 files changed, 31 insertions, 8 deletions
diff --git a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
index bdacd68006..c50309d437 100644
--- a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
+++ b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
@@ -2,6 +2,9 @@
* Copyright (c) 2017, 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.
*
@@ -43,6 +46,10 @@
namespace transport_manager {
namespace transport_adapter {
+const char* tc_enabled = "enabled";
+const char* tc_tcp_port = "tcp_port";
+const char* tc_tcp_ip_address = "tcp_ip_address";
+
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
namespace {
// @deprecated DeviceTypes: PASA_AOA, PASA_BLUETOOTH, MME
@@ -54,7 +61,13 @@ DeviceTypes devicesType = {
std::make_pair(DeviceType::MME, std::string("USB_IOS")),
std::make_pair(DeviceType::IOS_BT, std::string("BLUETOOTH_IOS")),
std::make_pair(DeviceType::IOS_USB, std::string("USB_IOS")),
- std::make_pair(DeviceType::TCP, std::string("WIFI"))};
+ std::make_pair(DeviceType::TCP, std::string("WIFI")),
+ std::make_pair(DeviceType::IOS_USB_HOST_MODE,
+ std::string("USB_IOS_HOST_MODE")),
+ std::make_pair(DeviceType::IOS_USB_DEVICE_MODE,
+ std::string("USB_IOS_DEVICE_MODE")),
+ std::make_pair(DeviceType::IOS_CARPLAY_WIRELESS,
+ std::string("CARPLAY_WIRELESS_IOS"))};
}
TransportAdapterImpl::TransportAdapterImpl(
@@ -695,6 +708,16 @@ void TransportAdapterImpl::DataSendFailed(
LOG4CXX_TRACE(logger_, "exit");
}
+void TransportAdapterImpl::TransportConfigUpdated(
+ const TransportConfig& new_config) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end();
+ ++it) {
+ (*it)->OnTransportConfigUpdated(this);
+ }
+}
+
void TransportAdapterImpl::DoTransportSwitch() const {
LOG4CXX_AUTO_TRACE(logger_);
std::for_each(
@@ -803,16 +826,16 @@ ApplicationList TransportAdapterImpl::GetApplicationList(
const DeviceUID& device_id) const {
LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id);
DeviceSptr device = FindDevice(device_id);
- if (device.valid()) {
+ if (device.use_count() != 0) {
ApplicationList lst = device->GetApplicationList();
LOG4CXX_TRACE(logger_,
"exit with ApplicationList. It's size = "
- << lst.size() << " Condition: device.valid()");
+ << lst.size() << " Condition: device.use_count() != 0");
return lst;
}
- LOG4CXX_TRACE(
- logger_,
- "exit with empty ApplicationList. Condition: NOT device.valid()");
+ LOG4CXX_TRACE(logger_,
+ "exit with empty ApplicationList. Condition: NOT "
+ "device.use_count() != 0");
return ApplicationList();
}
@@ -875,7 +898,7 @@ bool TransportAdapterImpl::IsInitialised() const {
std::string TransportAdapterImpl::DeviceName(const DeviceUID& device_id) const {
DeviceSptr device = FindDevice(device_id);
- if (device.valid()) {
+ if (device.use_count() != 0) {
return device->name();
} else {
return "";