using aasdk nextdev
This commit is contained in:
parent
0f317bdc3f
commit
dd2c0a445e
1
include/f1x/aasdk
Symbolic link
1
include/f1x/aasdk
Symbolic link
@ -0,0 +1 @@
|
||||
../../../aasdk/include/aasdk/
|
@ -18,11 +18,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <f1x/aasdk/USB/IUSBHub.hpp>
|
||||
#include <f1x/aasdk/USB/IConnectedAccessoriesEnumerator.hpp>
|
||||
#include <f1x/aasdk/USB/USBWrapper.hpp>
|
||||
#include <f1x/aasdk/TCP/ITCPWrapper.hpp>
|
||||
#include <f1x/aasdk/TCP/ITCPEndpoint.hpp>
|
||||
#include <aasdk/USB/IUSBHub.hpp>
|
||||
#include <aasdk/USB/IConnectedAccessoriesEnumerator.hpp>
|
||||
#include <aasdk/USB/USBWrapper.hpp>
|
||||
#include <aasdk/TCP/ITCPWrapper.hpp>
|
||||
#include <aasdk/TCP/ITCPEndpoint.hpp>
|
||||
#include <f1x/openauto/autoapp/Service/IAndroidAutoEntityEventHandler.hpp>
|
||||
#include <f1x/openauto/autoapp/Service/IAndroidAutoEntityFactory.hpp>
|
||||
|
||||
|
@ -60,8 +60,10 @@ public:
|
||||
void onShutdownRequest(const aasdk::proto::messages::ShutdownRequest& request) override;
|
||||
void onShutdownResponse(const aasdk::proto::messages::ShutdownResponse& response) override;
|
||||
void onNavigationFocusRequest(const aasdk::proto::messages::NavigationFocusRequest& request) override;
|
||||
void onPingResponse(const aasdk::proto::messages::PingResponse& response) override;
|
||||
void onChannelError(const aasdk::error::Error& e) override;
|
||||
void onPingRequest(const aasdk::proto::messages::PingRequest& request) override;
|
||||
void onPingResponse(const aasdk::proto::messages::PingResponse& response) override;
|
||||
void onVoiceSessionRequest(const aasdk::proto::messages::VoiceSessionRequest& request) override;
|
||||
|
||||
private:
|
||||
using std::enable_shared_from_this<AndroidAutoEntity>::shared_from_this;
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <QBluetoothServer>
|
||||
#include <f1x/openauto/btservice/IAndroidBluetoothServer.hpp>
|
||||
#include <f1x/openauto/autoapp/Configuration/IConfiguration.hpp>
|
||||
#include <f1x/aasdk/Messenger/Message.hpp>
|
||||
#include <aasdk/Messenger/Message.hpp>
|
||||
|
||||
namespace f1x
|
||||
{
|
||||
|
@ -17,8 +17,8 @@
|
||||
*/
|
||||
|
||||
#include <thread>
|
||||
#include <f1x/aasdk/USB/AOAPDevice.hpp>
|
||||
#include <f1x/aasdk/TCP/TCPEndpoint.hpp>
|
||||
#include <aasdk/USB/AOAPDevice.hpp>
|
||||
#include <aasdk/TCP/TCPEndpoint.hpp>
|
||||
#include <f1x/openauto/autoapp/App.hpp>
|
||||
#include <f1x/openauto/Common/Log.hpp>
|
||||
|
||||
|
@ -238,6 +238,20 @@ void AndroidAutoEntity::onShutdownRequest(const aasdk::proto::messages::Shutdown
|
||||
controlServiceChannel_->sendShutdownResponse(response, std::move(promise));
|
||||
}
|
||||
|
||||
void AndroidAutoEntity::onPingRequest(const aasdk::proto::messages::PingRequest& request)
|
||||
{
|
||||
OPENAUTO_LOG(info) << "[AndroidAutoEntity] ping request ";
|
||||
|
||||
auto promise = aasdk::channel::SendPromise::defer(strand_);
|
||||
promise->then([]() {}, std::bind(&AndroidAutoEntity::onChannelError, this->shared_from_this(), std::placeholders::_1));
|
||||
controlServiceChannel_->sendPingRequest(request, std::move(promise));
|
||||
}
|
||||
|
||||
void AndroidAutoEntity::onVoiceSessionRequest(const aasdk::proto::messages::VoiceSessionRequest& request)
|
||||
{
|
||||
OPENAUTO_LOG(error) << "[AndroidAutoEntity] voice session request not implemented";
|
||||
}
|
||||
|
||||
void AndroidAutoEntity::onShutdownResponse(const aasdk::proto::messages::ShutdownResponse&)
|
||||
{
|
||||
OPENAUTO_LOG(info) << "[AndroidAutoEntity] Shutdown response ";
|
||||
|
@ -188,7 +188,7 @@ void SensorService::sendGPSLocationData()
|
||||
auto * locInd = indication.add_gps_location();
|
||||
|
||||
// epoch seconds
|
||||
locInd->set_timestamp(this->gpsData_.fix.time * 1e3);
|
||||
locInd->set_timestamp(this->gpsData_.fix.time.tv_sec);
|
||||
// degrees
|
||||
locInd->set_latitude(this->gpsData_.fix.latitude * 1e7);
|
||||
locInd->set_longitude(this->gpsData_.fix.longitude * 1e7);
|
||||
@ -229,8 +229,7 @@ void SensorService::sensorPolling()
|
||||
|
||||
if ((this->gpsEnabled_) &&
|
||||
(gps_waiting(&this->gpsData_, 0)) &&
|
||||
(gps_read(&this->gpsData_) > 0) &&
|
||||
(this->gpsData_.status != STATUS_NO_FIX) &&
|
||||
(gps_read(&this->gpsData_, nullptr, 0) > 0) &&
|
||||
(this->gpsData_.fix.mode == MODE_2D || this->gpsData_.fix.mode == MODE_3D) &&
|
||||
(this->gpsData_.set & TIME_SET) &&
|
||||
(this->gpsData_.set & LATLON_SET))
|
||||
|
@ -19,12 +19,12 @@
|
||||
#include <thread>
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <f1x/aasdk/USB/USBHub.hpp>
|
||||
#include <f1x/aasdk/USB/ConnectedAccessoriesEnumerator.hpp>
|
||||
#include <f1x/aasdk/USB/AccessoryModeQueryChain.hpp>
|
||||
#include <f1x/aasdk/USB/AccessoryModeQueryChainFactory.hpp>
|
||||
#include <f1x/aasdk/USB/AccessoryModeQueryFactory.hpp>
|
||||
#include <f1x/aasdk/TCP/TCPWrapper.hpp>
|
||||
#include <aasdk/USB/USBHub.hpp>
|
||||
#include <aasdk/USB/ConnectedAccessoriesEnumerator.hpp>
|
||||
#include <aasdk/USB/AccessoryModeQueryChain.hpp>
|
||||
#include <aasdk/USB/AccessoryModeQueryChainFactory.hpp>
|
||||
#include <aasdk/USB/AccessoryModeQueryFactory.hpp>
|
||||
#include <aasdk/TCP/TCPWrapper.hpp>
|
||||
#include <f1x/openauto/autoapp/App.hpp>
|
||||
#include <f1x/openauto/autoapp/Configuration/IConfiguration.hpp>
|
||||
#include <f1x/openauto/autoapp/Configuration/RecentAddressesList.hpp>
|
||||
@ -38,7 +38,6 @@
|
||||
#include <f1x/openauto/autoapp/UI/UpdateDialog.hpp>
|
||||
#include <f1x/openauto/Common/Log.hpp>
|
||||
|
||||
namespace aasdk = f1x::aasdk;
|
||||
namespace autoapp = f1x::openauto::autoapp;
|
||||
using ThreadPool = std::vector<std::thread>;
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <QString>
|
||||
#include <QtCore/QDataStream>
|
||||
#include <QNetworkInterface>
|
||||
|
||||
#include <aasdk_proto/WifiInfoRequestMessage.pb.h>
|
||||
#include <aasdk_proto/WifiInfoResponseMessage.pb.h>
|
||||
#include <aasdk_proto/WifiSecurityResponseMessage.pb.h>
|
||||
@ -61,7 +62,7 @@ namespace f1x {
|
||||
// connect(socket, &QBluetoothSocket::disconnected, this,
|
||||
// QOverload<>::of(&ChatServer::clientDisconnected));
|
||||
|
||||
f1x::aasdk::proto::messages::WifiInfoRequest request;
|
||||
::aasdk::proto::messages::WifiInfoRequest request;
|
||||
request.set_ip_address(getIP4_("wlan0"));
|
||||
request.set_port(5000);
|
||||
|
||||
@ -121,26 +122,26 @@ namespace f1x {
|
||||
}
|
||||
|
||||
void AndroidBluetoothServer::handleWifiInfoRequest(QByteArray &buffer, uint16_t length) {
|
||||
f1x::aasdk::proto::messages::WifiInfoRequest msg;
|
||||
::aasdk::proto::messages::WifiInfoRequest msg;
|
||||
msg.ParseFromArray(buffer.data() + 4, length);
|
||||
OPENAUTO_LOG(info) << "WifiInfoRequest: " << msg.DebugString();
|
||||
|
||||
f1x::aasdk::proto::messages::WifiInfoResponse response;
|
||||
::aasdk::proto::messages::WifiInfoResponse response;
|
||||
response.set_ip_address(getIP4_("wlan0"));
|
||||
response.set_port(5000);
|
||||
response.set_status(aasdk::proto::messages::WifiInfoResponse_Status_STATUS_SUCCESS);
|
||||
response.set_status(::aasdk::proto::messages::WifiInfoResponse_Status_STATUS_SUCCESS);
|
||||
|
||||
sendMessage(response, 7);
|
||||
}
|
||||
|
||||
void AndroidBluetoothServer::handleWifiSecurityRequest(QByteArray &buffer, uint16_t length) {
|
||||
f1x::aasdk::proto::messages::WifiSecurityReponse response;
|
||||
::aasdk::proto::messages::WifiSecurityReponse response;
|
||||
|
||||
response.set_ssid(configuration_->getParamFromFile("/etc/hostapd/hostapd.conf","ssid").toStdString());
|
||||
response.set_bssid(QNetworkInterface::interfaceFromName("wlan0").hardwareAddress().toStdString());
|
||||
response.set_key(configuration_->getParamFromFile("/etc/hostapd/hostapd.conf","wpa_passphrase").toStdString());
|
||||
response.set_security_mode(aasdk::proto::messages::WifiSecurityReponse_SecurityMode_WPA2_PERSONAL);
|
||||
response.set_access_point_type(aasdk::proto::messages::WifiSecurityReponse_AccessPointType_STATIC);
|
||||
response.set_security_mode(::aasdk::proto::messages::WifiSecurityReponse_SecurityMode_WPA2_PERSONAL);
|
||||
response.set_access_point_type(::aasdk::proto::messages::WifiSecurityReponse_AccessPointType_STATIC);
|
||||
|
||||
sendMessage(response, 3);
|
||||
}
|
||||
@ -170,7 +171,7 @@ namespace f1x {
|
||||
}
|
||||
|
||||
void AndroidBluetoothServer::handleWifiInfoRequestResponse(QByteArray &buffer, uint16_t length) {
|
||||
f1x::aasdk::proto::messages::WifiInfoResponse msg;
|
||||
::aasdk::proto::messages::WifiInfoResponse msg;
|
||||
msg.ParseFromArray(buffer.data() + 4, length);
|
||||
OPENAUTO_LOG(info) << "WifiInfoResponse: " << msg.DebugString();
|
||||
}
|
||||
@ -184,4 +185,4 @@ namespace f1x {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user