diff options
Diffstat (limited to 'src/components/transport_manager/src/transport_manager_impl.cc')
-rw-r--r-- | src/components/transport_manager/src/transport_manager_impl.cc | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/components/transport_manager/src/transport_manager_impl.cc b/src/components/transport_manager/src/transport_manager_impl.cc index a364220a64..abe4edd812 100644 --- a/src/components/transport_manager/src/transport_manager_impl.cc +++ b/src/components/transport_manager/src/transport_manager_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. * @@ -44,7 +47,7 @@ #include "utils/macro.h" #include "utils/logger.h" -#include "utils/make_shared.h" + #include "utils/timer_task_impl.h" #include "transport_manager/common.h" #include "transport_manager/transport_manager_listener.h" @@ -1066,7 +1069,7 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) { LOG4CXX_ERROR(logger_, "Transport adapter failed to send data"); // TODO(YK): potential error case -> thread unsafe // update of message content - if (event.event_data.valid()) { + if (event.event_data.use_count() != 0) { event.event_data->set_waiting(true); } else { LOG4CXX_DEBUG(logger_, "Data is invalid"); @@ -1144,6 +1147,13 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) { LOG4CXX_DEBUG(logger_, "eevent_type = ON_UNEXPECTED_DISCONNECT"); break; } + case EventTypeEnum::ON_TRANSPORT_CONFIG_UPDATED: { + LOG4CXX_DEBUG(logger_, "event_type = ON_TRANSPORT_CONFIG_UPDATED"); + transport_adapter::TransportConfig config = + event.transport_adapter->GetTransportConfiguration(); + RaiseEvent(&TransportManagerListener::OnTransportConfigUpdated, config); + break; + } } // switch LOG4CXX_TRACE(logger_, "exit"); } @@ -1203,9 +1213,9 @@ TransportManagerImpl::ConnectionInternal::ConnectionInternal( const DeviceHandle device_handle) : transport_manager(transport_manager) , transport_adapter(transport_adapter) - , timer(utils::MakeShared<timer::Timer, - const char*, - ::timer::TimerTaskImpl<ConnectionInternal>*>( + , timer(std::make_shared<timer::Timer, + const char*, + ::timer::TimerTaskImpl<ConnectionInternal>*>( "TM DiscRoutine", new ::timer::TimerTaskImpl<ConnectionInternal>( this, &ConnectionInternal::DisconnectFailedRoutine))) |