Add method to create entity based on TCP transport
This commit is contained in:
parent
fba7aaf208
commit
53ebc1b75c
@ -19,6 +19,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
|
#include <f1x/aasdk/Transport/ITransport.hpp>
|
||||||
#include <f1x/openauto/autoapp/Configuration/IConfiguration.hpp>
|
#include <f1x/openauto/autoapp/Configuration/IConfiguration.hpp>
|
||||||
#include <f1x/openauto/autoapp/Projection/IAndroidAutoEntityFactory.hpp>
|
#include <f1x/openauto/autoapp/Projection/IAndroidAutoEntityFactory.hpp>
|
||||||
#include <f1x/openauto/autoapp/Projection/IServiceFactory.hpp>
|
#include <f1x/openauto/autoapp/Projection/IServiceFactory.hpp>
|
||||||
@ -41,8 +42,11 @@ public:
|
|||||||
IServiceFactory& serviceFactory);
|
IServiceFactory& serviceFactory);
|
||||||
|
|
||||||
IAndroidAutoEntity::Pointer create(aasdk::usb::DeviceHandle deviceHandle) override;
|
IAndroidAutoEntity::Pointer create(aasdk::usb::DeviceHandle deviceHandle) override;
|
||||||
|
IAndroidAutoEntity::Pointer create(aasdk::tcp::ITCPEndpoint::Pointer tcpEndpoint) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
IAndroidAutoEntity::Pointer create(aasdk::transport::ITransport::Pointer transport);
|
||||||
|
|
||||||
aasdk::usb::IUSBWrapper& usbWrapper_;
|
aasdk::usb::IUSBWrapper& usbWrapper_;
|
||||||
boost::asio::io_service& ioService_;
|
boost::asio::io_service& ioService_;
|
||||||
configuration::IConfiguration::Pointer configuration_;
|
configuration::IConfiguration::Pointer configuration_;
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <f1x/aasdk/TCP/ITCPEndpoint.hpp>
|
||||||
#include <f1x/aasdk/USB/USBWrapper.hpp>
|
#include <f1x/aasdk/USB/USBWrapper.hpp>
|
||||||
#include <f1x/openauto/autoapp/Projection/IAndroidAutoEntity.hpp>
|
#include <f1x/openauto/autoapp/Projection/IAndroidAutoEntity.hpp>
|
||||||
|
|
||||||
@ -36,6 +37,7 @@ public:
|
|||||||
virtual ~IAndroidAutoEntityFactory() = default;
|
virtual ~IAndroidAutoEntityFactory() = default;
|
||||||
|
|
||||||
virtual IAndroidAutoEntity::Pointer create(aasdk::usb::DeviceHandle deviceHandle) = 0;
|
virtual IAndroidAutoEntity::Pointer create(aasdk::usb::DeviceHandle deviceHandle) = 0;
|
||||||
|
virtual IAndroidAutoEntity::Pointer create(aasdk::tcp::ITCPEndpoint::Pointer tcpEndpoint) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include <f1x/aasdk/USB/AOAPDevice.hpp>
|
#include <f1x/aasdk/USB/AOAPDevice.hpp>
|
||||||
#include <f1x/aasdk/Transport/SSLWrapper.hpp>
|
#include <f1x/aasdk/Transport/SSLWrapper.hpp>
|
||||||
#include <f1x/aasdk/Transport/USBTransport.hpp>
|
#include <f1x/aasdk/Transport/USBTransport.hpp>
|
||||||
|
#include <f1x/aasdk/Transport/TCPTransport.hpp>
|
||||||
#include <f1x/aasdk/Messenger/Cryptor.hpp>
|
#include <f1x/aasdk/Messenger/Cryptor.hpp>
|
||||||
#include <f1x/openauto/autoapp/Projection/AndroidAutoEntityFactory.hpp>
|
#include <f1x/openauto/autoapp/Projection/AndroidAutoEntityFactory.hpp>
|
||||||
#include <f1x/openauto/autoapp/Projection/AndroidAutoEntity.hpp>
|
#include <f1x/openauto/autoapp/Projection/AndroidAutoEntity.hpp>
|
||||||
@ -49,6 +50,17 @@ IAndroidAutoEntity::Pointer AndroidAutoEntityFactory::create(aasdk::usb::DeviceH
|
|||||||
auto aoapDevice(aasdk::usb::AOAPDevice::create(usbWrapper_, ioService_, deviceHandle));
|
auto aoapDevice(aasdk::usb::AOAPDevice::create(usbWrapper_, ioService_, deviceHandle));
|
||||||
auto transport(std::make_shared<aasdk::transport::USBTransport>(ioService_, aoapDevice));
|
auto transport(std::make_shared<aasdk::transport::USBTransport>(ioService_, aoapDevice));
|
||||||
|
|
||||||
|
return create(std::move(transport));
|
||||||
|
}
|
||||||
|
|
||||||
|
IAndroidAutoEntity::Pointer AndroidAutoEntityFactory::create(aasdk::tcp::ITCPEndpoint::Pointer tcpEndpoint)
|
||||||
|
{
|
||||||
|
auto transport(std::make_shared<aasdk::transport::TCPTransport>(ioService_, std::move(tcpEndpoint)));
|
||||||
|
return create(std::move(transport));
|
||||||
|
}
|
||||||
|
|
||||||
|
IAndroidAutoEntity::Pointer AndroidAutoEntityFactory::create(aasdk::transport::ITransport::Pointer transport)
|
||||||
|
{
|
||||||
auto sslWrapper(std::make_shared<aasdk::transport::SSLWrapper>());
|
auto sslWrapper(std::make_shared<aasdk::transport::SSLWrapper>());
|
||||||
auto cryptor(std::make_shared<aasdk::messenger::Cryptor>(std::move(sslWrapper)));
|
auto cryptor(std::make_shared<aasdk::messenger::Cryptor>(std::move(sslWrapper)));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user