Populate WifiProjectionStatus.cpp, NavigationStatusService.cpp
This commit is contained in:
parent
68759ee2fa
commit
406368d8dd
@ -46,6 +46,9 @@ namespace f1x {
|
||||
|
||||
void onChannelError(const aasdk::error::Error &e) override;
|
||||
|
||||
void NavigationStatusService::onStatusUpdate(const aap_protobuf::channel::navigation::event::NavigationStatus &navStatus) override;
|
||||
void NavigationStatusService::onTurnEvent(const aap_protobuf::channel::navigation::event::NavigationNextTurnEvent &turnEvent) override;
|
||||
void NavigationStatusService::onDistanceEvent(const aap_protobuf::service::navigation::message::NavigationNextTurnDistanceEvent &distanceEvent) override;
|
||||
|
||||
private:
|
||||
using std::enable_shared_from_this<NavigationStatusService>::shared_from_this;
|
||||
@ -53,7 +56,6 @@ namespace f1x {
|
||||
boost::asio::io_service::strand strand_;
|
||||
aasdk::channel::navigationstatus::NavigationStatusService::Pointer channel_;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,28 +28,28 @@
|
||||
|
||||
/*
|
||||
* HU > MD Version Request
|
||||
* HU < MD ServiceDiscoveryRequest
|
||||
* HU > MD Car MetaData (Make, Model, year etc)
|
||||
* HU < MD when Video Projection starts, it MUST be shown without User Ineraction
|
||||
* HU < MD Prompt Use to Enable and Pair with Car
|
||||
* HU < MD Request Video Focus for Projection (HU Grant)
|
||||
* HU < MD ServiceDiscoveryRequest **
|
||||
* HU > MD Car MetaData (Make, Model, year etc) **
|
||||
* HU < MD when Video Projection starts, it MUST be shown without User Ineraction ***********
|
||||
* HU < MD Prompt Use to Enable and Pair with Car ***********
|
||||
* HU < MD Request Video Focus for Projection (HU Grant) ***********
|
||||
*
|
||||
* AAP neds Bluetooth HFP for Telephone
|
||||
* AAP needs Bluetooth HFP for Telephone
|
||||
*
|
||||
* HU > MD Bluetooth Announcement (HU MAC Address, Supported Pairing Methods)
|
||||
* HU < MD Bluetooth Pairing Request
|
||||
* HU > MD Bluetoth Pairing Response
|
||||
* HU > MD Bluetooth Announcement (HU MAC Address, Supported Pairing Methods) ***********
|
||||
* HU < MD Bluetooth Pairing Request ***********
|
||||
* HU > MD Bluetoth Pairing Response***********
|
||||
*
|
||||
* AfterPairing, HU can request the Bluetooth PhoneBookAccessProtocol. Sensible UI.
|
||||
*
|
||||
* HU < MD connect to Bluetooth HFP
|
||||
* HU Suppress BAP or MAP while AAP connected.
|
||||
* A2DP should be treated by OEM as another such such as a USB stick or radio. If the user plays music via AA, HU should grant request from AA to change focus to AA. HU manages connectivity.
|
||||
* MD connects to HU and routes call over Bluetooth (non Bluetooth call)
|
||||
* MD connects Blueooth call and display projection mode
|
||||
* MD on call to HFP device - MD continues call, disconnects from other HFP and connects to HFP on Vehicle.
|
||||
* AA only uses HFP, hhowever HU may use MAP, PBAP, PAN and RSAP
|
||||
* MD will reconnect when required.
|
||||
* HU < MD connect to Bluetooth HFP***********
|
||||
* HU Suppress BAP or MAP while AAP connected.***********
|
||||
* A2DP should be treated by OEM as another such such as a USB stick or radio. If the user plays music via AA, HU should grant request from AA to change focus to AA. HU manages connectivity., ***********
|
||||
* MD connects to HU and routes call over Bluetooth (non Bluetooth call) ***********
|
||||
* MD connects Blueooth call and display projection mode ***********
|
||||
* MD on call to HFP device - MD continues call, disconnects from other HFP and connects to HFP on Vehicle. ***********
|
||||
* AA only uses HFP, hhowever HU may use MAP, PBAP, PAN and RSAP ***********
|
||||
* MD will reconnect when required. ***********
|
||||
*
|
||||
* Video
|
||||
* HU < MD - During Service Discovery, MD requests Video Configs supported
|
||||
@ -103,13 +103,13 @@ namespace f1x {
|
||||
|
||||
eventHandler_ = eventHandler;
|
||||
std::for_each(serviceList_.begin(), serviceList_.end(), std::bind(&IService::start, std::placeholders::_1));
|
||||
|
||||
OPENAUTO_LOG(info) << "[AndroidAutoEntity] Event handlers added.";
|
||||
|
||||
auto versionRequestPromise = aasdk::channel::SendPromise::defer(strand_);
|
||||
versionRequestPromise->then([]() {}, std::bind(&AndroidAutoEntity::onChannelError, this->shared_from_this(),
|
||||
versionRequestPromise->then([]() { OPENAUTO_LOG(info) << "[AndroidAutoEntity] SUCCESS: Version request sent."; }, std::bind(&AndroidAutoEntity::onChannelError, this->shared_from_this(),
|
||||
std::placeholders::_1));
|
||||
|
||||
OPENAUTO_LOG(info) << "[AndroidAutoEntity] Sending version request.";
|
||||
OPENAUTO_LOG(info) << "[AndroidAutoEntity] Send Version Request.";
|
||||
controlServiceChannel_->sendVersionRequest(std::move(versionRequestPromise));
|
||||
controlServiceChannel_->receive(this->shared_from_this());
|
||||
});
|
||||
@ -123,7 +123,7 @@ namespace f1x {
|
||||
eventHandler_ = nullptr;
|
||||
std::for_each(serviceList_.begin(), serviceList_.end(),
|
||||
std::bind(&IService::stop, std::placeholders::_1));
|
||||
//pinger_->cancel();
|
||||
|
||||
messenger_->stop();
|
||||
transport_->stop();
|
||||
cryptor_->deinit();
|
||||
@ -172,11 +172,11 @@ namespace f1x {
|
||||
OPENAUTO_LOG(info) << "[AndroidAutoEntity] Version matches.";
|
||||
|
||||
try {
|
||||
OPENAUTO_LOG(info) << "[AndroidAutoEntity] Beginning SSL handshake...";
|
||||
OPENAUTO_LOG(info) << "[AndroidAutoEntity] Beginning SSL handshake.";
|
||||
cryptor_->doHandshake();
|
||||
|
||||
auto handshakePromise = aasdk::channel::SendPromise::defer(strand_);
|
||||
handshakePromise->then([]() {}, std::bind(&AndroidAutoEntity::onChannelError, this->shared_from_this(),
|
||||
handshakePromise->then([]() { OPENAUTO_LOG(info) << "[AndroidAutoEntity] SUCCESS: Sent SSL handshake."; }, std::bind(&AndroidAutoEntity::onChannelError, this->shared_from_this(),
|
||||
std::placeholders::_1));
|
||||
controlServiceChannel_->sendHandshake(cryptor_->readHandshakeBuffer(), std::move(handshakePromise));
|
||||
controlServiceChannel_->receive(this->shared_from_this());
|
||||
@ -246,7 +246,7 @@ namespace f1x {
|
||||
std::bind(&IService::fillFeatures, std::placeholders::_1, std::ref(serviceDiscoveryResponse)));
|
||||
|
||||
auto promise = aasdk::channel::SendPromise::defer(strand_);
|
||||
promise->then([]() {},
|
||||
promise->then([]() { OPENAUTO_LOG(info) << "[AndroidAutoEntity] SUCCESS: Send ServiceDiscoveryResponse."; },
|
||||
std::bind(&AndroidAutoEntity::onChannelError, this->shared_from_this(), std::placeholders::_1));
|
||||
controlServiceChannel_->sendServiceDiscoveryResponse(serviceDiscoveryResponse, std::move(promise));
|
||||
controlServiceChannel_->receive(this->shared_from_this());
|
||||
@ -271,8 +271,8 @@ namespace f1x {
|
||||
response.set_audio_focus_state(audioFocusStateType);
|
||||
|
||||
auto promise = aasdk::channel::SendPromise::defer(strand_);
|
||||
promise->then([]() {},
|
||||
std::bind(&AndroidAutoEntity::onChannelError, this->shared_from_this(), std::placeholders::_1));
|
||||
promise->then([]() { OPENAUTO_LOG(info) "[AndroidAutoEntity] Resolved Promise"; },
|
||||
[capture0 = this->shared_from_this()](auto && PH1) { OPENAUTO_LOG(info) "[AndroidAutoEntity] Failed to Resolve Promise"; capture0->onChannelError(std::forward<decltype(PH1)>(PH1)); });
|
||||
controlServiceChannel_->sendAudioFocusResponse(response, std::move(promise));
|
||||
controlServiceChannel_->receive(this->shared_from_this());
|
||||
}
|
||||
@ -312,16 +312,15 @@ namespace f1x {
|
||||
controlServiceChannel_->receive(this->shared_from_this());
|
||||
}
|
||||
|
||||
void AndroidAutoEntity::onBatteryStatusNotification(const aap_protobuf::channel::control::BatteryStatusNotification ¬ification) {
|
||||
OPENAUTO_LOG(info) << "[AndroidAutoEntity] onBatteryStatusNotification()";
|
||||
controlServiceChannel_->receive(this->shared_from_this());
|
||||
}
|
||||
|
||||
void AndroidAutoEntity::onVoiceSessionRequest(
|
||||
const aap_protobuf::channel::control::voice::VoiceSessionNotification &request) {
|
||||
OPENAUTO_LOG(info) << "[AndroidAutoEntity] onVoiceSessionRequest()";
|
||||
}
|
||||
|
||||
void AndroidAutoEntity::onPingRequest(const aap_protobuf::channel::control::ping::PingRequest &request) {
|
||||
OPENAUTO_LOG(info) << "[AndroidAutoEntity] onPingRequest()";
|
||||
OPENAUTO_LOG(info) << "[AndroidAutoEntity] Timestamp: " << request.timestamp();
|
||||
//pinger_->ping();
|
||||
//controlServiceChannel_->receive(this->shared_from_this());
|
||||
controlServiceChannel_->receive(this->shared_from_this());
|
||||
}
|
||||
|
||||
void AndroidAutoEntity::onPingResponse(const aap_protobuf::channel::control::ping::PingResponse &response) {
|
||||
@ -373,7 +372,6 @@ namespace f1x {
|
||||
request.set_timestamp(timestamp.count());
|
||||
controlServiceChannel_->sendPingRequest(request, std::move(promise));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,53 +28,47 @@
|
||||
#include <f1x/openauto/autoapp/Service/AndroidAutoEntity.hpp>
|
||||
#include <f1x/openauto/autoapp/Service/Pinger.hpp>
|
||||
|
||||
namespace f1x
|
||||
{
|
||||
namespace openauto
|
||||
{
|
||||
namespace autoapp
|
||||
{
|
||||
namespace service
|
||||
{
|
||||
namespace f1x {
|
||||
namespace openauto {
|
||||
namespace autoapp {
|
||||
namespace service {
|
||||
|
||||
AndroidAutoEntityFactory::AndroidAutoEntityFactory(boost::asio::io_service& ioService,
|
||||
configuration::IConfiguration::Pointer configuration,
|
||||
IServiceFactory& serviceFactory)
|
||||
: ioService_(ioService)
|
||||
, configuration_(std::move(configuration))
|
||||
, serviceFactory_(serviceFactory)
|
||||
{
|
||||
AndroidAutoEntityFactory::AndroidAutoEntityFactory(boost::asio::io_service &ioService,
|
||||
configuration::IConfiguration::Pointer configuration,
|
||||
IServiceFactory &serviceFactory)
|
||||
: ioService_(ioService), configuration_(std::move(configuration)), serviceFactory_(serviceFactory) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
IAndroidAutoEntity::Pointer AndroidAutoEntityFactory::create(aasdk::usb::IAOAPDevice::Pointer aoapDevice)
|
||||
{
|
||||
auto transport(std::make_shared<aasdk::transport::USBTransport>(ioService_, std::move(aoapDevice)));
|
||||
return create(std::move(transport));
|
||||
}
|
||||
IAndroidAutoEntity::Pointer AndroidAutoEntityFactory::create(aasdk::usb::IAOAPDevice::Pointer aoapDevice) {
|
||||
auto transport(std::make_shared<aasdk::transport::USBTransport>(ioService_, std::move(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::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 cryptor(std::make_shared<aasdk::messenger::Cryptor>(std::move(sslWrapper)));
|
||||
cryptor->init();
|
||||
IAndroidAutoEntity::Pointer AndroidAutoEntityFactory::create(aasdk::transport::ITransport::Pointer transport) {
|
||||
auto sslWrapper(std::make_shared<aasdk::transport::SSLWrapper>());
|
||||
auto cryptor(std::make_shared<aasdk::messenger::Cryptor>(std::move(sslWrapper)));
|
||||
cryptor->init();
|
||||
|
||||
auto messenger(std::make_shared<aasdk::messenger::Messenger>(ioService_,
|
||||
std::make_shared<aasdk::messenger::MessageInStream>(ioService_, transport, cryptor),
|
||||
std::make_shared<aasdk::messenger::MessageOutStream>(ioService_, transport, cryptor)));
|
||||
auto messenger(std::make_shared<aasdk::messenger::Messenger>(ioService_,
|
||||
std::make_shared<aasdk::messenger::MessageInStream>(
|
||||
ioService_, transport, cryptor),
|
||||
std::make_shared<aasdk::messenger::MessageOutStream>(
|
||||
ioService_, transport, cryptor)));
|
||||
|
||||
auto serviceList = serviceFactory_.create(messenger);
|
||||
auto pinger(std::make_shared<Pinger>(ioService_, 5000));
|
||||
return std::make_shared<AndroidAutoEntity>(ioService_, std::move(cryptor), std::move(transport), std::move(messenger), configuration_, std::move(serviceList), std::move(pinger));
|
||||
}
|
||||
auto serviceList = serviceFactory_.create(messenger);
|
||||
auto pinger(std::make_shared<Pinger>(ioService_, 5000));
|
||||
return std::make_shared<AndroidAutoEntity>(ioService_, std::move(cryptor), std::move(transport),
|
||||
std::move(messenger), configuration_, std::move(serviceList),
|
||||
std::move(pinger));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -85,6 +85,20 @@ namespace f1x {
|
||||
channel_->receive(this->shared_from_this());
|
||||
}
|
||||
|
||||
void NavigationStatusService::onStatusUpdate(const aap_protobuf::channel::navigation::event::NavigationStatus &navStatus) {
|
||||
channel_->receive(this->shared_from_this());
|
||||
}
|
||||
|
||||
|
||||
void NavigationStatusService::onTurnEvent(const aap_protobuf::channel::navigation::event::NavigationNextTurnEvent &turnEvent) {
|
||||
channel_->receive(this->shared_from_this());
|
||||
}
|
||||
|
||||
void NavigationStatusService::onDistanceEvent(const aap_protobuf::service::navigation::message::NavigationNextTurnDistanceEvent &distanceEvent) {
|
||||
channel_->receive(this->shared_from_this());
|
||||
}
|
||||
|
||||
|
||||
void NavigationStatusService::onChannelError(const aasdk::error::Error &e) {
|
||||
OPENAUTO_LOG(error) << "[NavigationStatusService] onChannelError(): " << e.what();
|
||||
}
|
||||
|
@ -60,8 +60,6 @@ namespace f1x {
|
||||
|
||||
}
|
||||
|
||||
// TODO: MEDIA SERVICE
|
||||
|
||||
ServiceList ServiceFactory::create(aasdk::messenger::IMessenger::Pointer messenger) {
|
||||
OPENAUTO_LOG(info) << "[ServiceFactory] create()";
|
||||
ServiceList serviceList;
|
||||
|
@ -71,8 +71,21 @@ namespace f1x {
|
||||
|
||||
void WifiProjectionService::onWifiCredentialsRequest(
|
||||
const aap_protobuf::service::wifiprojection::message::WifiCredentialsRequest &request) {
|
||||
|
||||
aap_protobuf::service::wifiprojection::message::WifiCredentialsResponse response;
|
||||
|
||||
response.set_access_point_type(aap_protobuf::service::wifiprojection::message::AccessPointType::DYNAMIC);
|
||||
response.set_car_wifi_password("1234567890");
|
||||
response.set_car_wifi_ssid("CRANKSHAFT-NG");
|
||||
response.set_car_wifi_security_mode(aap_protobuf::service::wifiprojection::message::WifiSecurityMode::WPA2_PERSONAL);
|
||||
|
||||
OPENAUTO_LOG(info) << "[WifiProjectionService] onWifiCredentialsRequest()";
|
||||
// channel_->sendWifiCredentialsResponse(response, std::move(promise));
|
||||
|
||||
auto promise = aasdk::channel::SendPromise::defer(strand_);
|
||||
promise->then([]() {}, std::bind(&WifiProjectionService::onChannelError, this->shared_from_this(),
|
||||
std::placeholders::_1));
|
||||
channel_->sendWifiCredentialsResponse(response, std::move(promise));
|
||||
channel_->receive(this->shared_from_this());
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user