diff --git a/include/f1x/openauto/autoapp/App.hpp b/include/f1x/openauto/autoapp/App.hpp index 4ecd2454..0af1e185 100644 --- a/include/f1x/openauto/autoapp/App.hpp +++ b/include/f1x/openauto/autoapp/App.hpp @@ -18,11 +18,11 @@ #pragma once -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/include/f1x/openauto/autoapp/Projection/IAudioInput.hpp b/include/f1x/openauto/autoapp/Projection/IAudioInput.hpp index 67c33739..a85d588d 100644 --- a/include/f1x/openauto/autoapp/Projection/IAudioInput.hpp +++ b/include/f1x/openauto/autoapp/Projection/IAudioInput.hpp @@ -19,8 +19,8 @@ #pragma once #include -#include -#include +#include +#include namespace f1x { diff --git a/include/f1x/openauto/autoapp/Projection/IAudioOutput.hpp b/include/f1x/openauto/autoapp/Projection/IAudioOutput.hpp index c41de312..aaec03ad 100644 --- a/include/f1x/openauto/autoapp/Projection/IAudioOutput.hpp +++ b/include/f1x/openauto/autoapp/Projection/IAudioOutput.hpp @@ -19,8 +19,8 @@ #pragma once #include -#include -#include +#include +#include namespace f1x { diff --git a/include/f1x/openauto/autoapp/Projection/IBluetoothDevice.hpp b/include/f1x/openauto/autoapp/Projection/IBluetoothDevice.hpp index 2d151fda..e5794cb6 100644 --- a/include/f1x/openauto/autoapp/Projection/IBluetoothDevice.hpp +++ b/include/f1x/openauto/autoapp/Projection/IBluetoothDevice.hpp @@ -16,7 +16,7 @@ * along with openauto. If not, see . */ -#include +#include #pragma once diff --git a/include/f1x/openauto/autoapp/Projection/IInputDevice.hpp b/include/f1x/openauto/autoapp/Projection/IInputDevice.hpp index 663fbbdf..3c9256a2 100644 --- a/include/f1x/openauto/autoapp/Projection/IInputDevice.hpp +++ b/include/f1x/openauto/autoapp/Projection/IInputDevice.hpp @@ -19,7 +19,7 @@ #pragma once #include -#include +#include #include namespace f1x diff --git a/include/f1x/openauto/autoapp/Projection/IVideoOutput.hpp b/include/f1x/openauto/autoapp/Projection/IVideoOutput.hpp index ef0f91cc..0fdbe5b5 100644 --- a/include/f1x/openauto/autoapp/Projection/IVideoOutput.hpp +++ b/include/f1x/openauto/autoapp/Projection/IVideoOutput.hpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include namespace f1x { diff --git a/include/f1x/openauto/autoapp/Projection/InputEvent.hpp b/include/f1x/openauto/autoapp/Projection/InputEvent.hpp index fe220648..db474422 100644 --- a/include/f1x/openauto/autoapp/Projection/InputEvent.hpp +++ b/include/f1x/openauto/autoapp/Projection/InputEvent.hpp @@ -20,7 +20,7 @@ #include #include -#include +#include namespace f1x { diff --git a/include/f1x/openauto/autoapp/Projection/SequentialBuffer.hpp b/include/f1x/openauto/autoapp/Projection/SequentialBuffer.hpp index 153b6874..179aabe3 100644 --- a/include/f1x/openauto/autoapp/Projection/SequentialBuffer.hpp +++ b/include/f1x/openauto/autoapp/Projection/SequentialBuffer.hpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include namespace f1x { diff --git a/include/f1x/openauto/autoapp/Service/AndroidAutoEntity.hpp b/include/f1x/openauto/autoapp/Service/AndroidAutoEntity.hpp index 0ae914cb..8fc9b15e 100644 --- a/include/f1x/openauto/autoapp/Service/AndroidAutoEntity.hpp +++ b/include/f1x/openauto/autoapp/Service/AndroidAutoEntity.hpp @@ -19,10 +19,10 @@ #pragma once #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -60,8 +60,10 @@ class AndroidAutoEntity: public IAndroidAutoEntity, public aasdk::channel::contr 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::shared_from_this; diff --git a/include/f1x/openauto/autoapp/Service/AndroidAutoEntityFactory.hpp b/include/f1x/openauto/autoapp/Service/AndroidAutoEntityFactory.hpp index b9fed4ff..9c45e27f 100644 --- a/include/f1x/openauto/autoapp/Service/AndroidAutoEntityFactory.hpp +++ b/include/f1x/openauto/autoapp/Service/AndroidAutoEntityFactory.hpp @@ -19,7 +19,7 @@ #pragma once #include -#include +#include #include #include #include diff --git a/include/f1x/openauto/autoapp/Service/AudioInputService.hpp b/include/f1x/openauto/autoapp/Service/AudioInputService.hpp index c8e56c22..6b1dfba7 100644 --- a/include/f1x/openauto/autoapp/Service/AudioInputService.hpp +++ b/include/f1x/openauto/autoapp/Service/AudioInputService.hpp @@ -18,7 +18,7 @@ #pragma once -#include +#include #include #include diff --git a/include/f1x/openauto/autoapp/Service/AudioService.hpp b/include/f1x/openauto/autoapp/Service/AudioService.hpp index 034ddec9..51e54276 100644 --- a/include/f1x/openauto/autoapp/Service/AudioService.hpp +++ b/include/f1x/openauto/autoapp/Service/AudioService.hpp @@ -18,8 +18,8 @@ #pragma once -#include -#include +#include +#include #include #include diff --git a/include/f1x/openauto/autoapp/Service/BluetoothService.hpp b/include/f1x/openauto/autoapp/Service/BluetoothService.hpp index 27b46d89..b5d8619d 100644 --- a/include/f1x/openauto/autoapp/Service/BluetoothService.hpp +++ b/include/f1x/openauto/autoapp/Service/BluetoothService.hpp @@ -18,7 +18,7 @@ #pragma once -#include +#include #include #include diff --git a/include/f1x/openauto/autoapp/Service/IAndroidAutoEntityEventHandler.hpp b/include/f1x/openauto/autoapp/Service/IAndroidAutoEntityEventHandler.hpp index 648d125f..2ae816d7 100644 --- a/include/f1x/openauto/autoapp/Service/IAndroidAutoEntityEventHandler.hpp +++ b/include/f1x/openauto/autoapp/Service/IAndroidAutoEntityEventHandler.hpp @@ -18,7 +18,7 @@ #pragma once -#include +#include namespace f1x { diff --git a/include/f1x/openauto/autoapp/Service/IAndroidAutoEntityFactory.hpp b/include/f1x/openauto/autoapp/Service/IAndroidAutoEntityFactory.hpp index 97b958b5..5a174fd9 100644 --- a/include/f1x/openauto/autoapp/Service/IAndroidAutoEntityFactory.hpp +++ b/include/f1x/openauto/autoapp/Service/IAndroidAutoEntityFactory.hpp @@ -18,8 +18,8 @@ #pragma once -#include -#include +#include +#include #include namespace f1x diff --git a/include/f1x/openauto/autoapp/Service/IPinger.hpp b/include/f1x/openauto/autoapp/Service/IPinger.hpp index d345ed38..c283c88d 100644 --- a/include/f1x/openauto/autoapp/Service/IPinger.hpp +++ b/include/f1x/openauto/autoapp/Service/IPinger.hpp @@ -18,7 +18,7 @@ #pragma once -#include +#include namespace f1x { diff --git a/include/f1x/openauto/autoapp/Service/IServiceFactory.hpp b/include/f1x/openauto/autoapp/Service/IServiceFactory.hpp index 6049d9d9..e7d724aa 100644 --- a/include/f1x/openauto/autoapp/Service/IServiceFactory.hpp +++ b/include/f1x/openauto/autoapp/Service/IServiceFactory.hpp @@ -18,7 +18,7 @@ #pragma once -#include +#include #include namespace f1x diff --git a/include/f1x/openauto/autoapp/Service/InputService.hpp b/include/f1x/openauto/autoapp/Service/InputService.hpp index 03ed01b1..0a1ee00e 100644 --- a/include/f1x/openauto/autoapp/Service/InputService.hpp +++ b/include/f1x/openauto/autoapp/Service/InputService.hpp @@ -19,7 +19,7 @@ #pragma once #include -#include +#include #include #include #include diff --git a/include/f1x/openauto/autoapp/Service/MediaAudioService.hpp b/include/f1x/openauto/autoapp/Service/MediaAudioService.hpp index bbd14140..0d250468 100644 --- a/include/f1x/openauto/autoapp/Service/MediaAudioService.hpp +++ b/include/f1x/openauto/autoapp/Service/MediaAudioService.hpp @@ -18,7 +18,7 @@ #pragma once -#include +#include #include namespace f1x diff --git a/include/f1x/openauto/autoapp/Service/SensorService.hpp b/include/f1x/openauto/autoapp/Service/SensorService.hpp index 93d96d6c..66494fbc 100644 --- a/include/f1x/openauto/autoapp/Service/SensorService.hpp +++ b/include/f1x/openauto/autoapp/Service/SensorService.hpp @@ -19,7 +19,7 @@ #pragma once #include -#include +#include #include namespace f1x diff --git a/include/f1x/openauto/autoapp/Service/SpeechAudioService.hpp b/include/f1x/openauto/autoapp/Service/SpeechAudioService.hpp index d71f1a95..62d31996 100644 --- a/include/f1x/openauto/autoapp/Service/SpeechAudioService.hpp +++ b/include/f1x/openauto/autoapp/Service/SpeechAudioService.hpp @@ -18,7 +18,7 @@ #pragma once -#include +#include #include namespace f1x diff --git a/include/f1x/openauto/autoapp/Service/SystemAudioService.hpp b/include/f1x/openauto/autoapp/Service/SystemAudioService.hpp index af775b2d..c0090ed8 100644 --- a/include/f1x/openauto/autoapp/Service/SystemAudioService.hpp +++ b/include/f1x/openauto/autoapp/Service/SystemAudioService.hpp @@ -18,7 +18,7 @@ #pragma once -#include +#include #include namespace f1x diff --git a/include/f1x/openauto/autoapp/Service/VideoService.hpp b/include/f1x/openauto/autoapp/Service/VideoService.hpp index 391e1bc8..24a8bfbf 100644 --- a/include/f1x/openauto/autoapp/Service/VideoService.hpp +++ b/include/f1x/openauto/autoapp/Service/VideoService.hpp @@ -19,8 +19,8 @@ #pragma once #include -#include -#include +#include +#include #include #include diff --git a/include/f1x/openauto/autoapp/Service/WifiService.hpp b/include/f1x/openauto/autoapp/Service/WifiService.hpp index f9aefcfe..47f630c9 100644 --- a/include/f1x/openauto/autoapp/Service/WifiService.hpp +++ b/include/f1x/openauto/autoapp/Service/WifiService.hpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include namespace f1x { diff --git a/include/f1x/openauto/autoapp/UI/ConnectDialog.hpp b/include/f1x/openauto/autoapp/UI/ConnectDialog.hpp index f97d5fa5..5d39d7aa 100644 --- a/include/f1x/openauto/autoapp/UI/ConnectDialog.hpp +++ b/include/f1x/openauto/autoapp/UI/ConnectDialog.hpp @@ -3,8 +3,8 @@ #include #include #include -#include -#include +#include +#include #include namespace Ui { diff --git a/include/f1x/openauto/btservice/AndroidBluetoothServer.hpp b/include/f1x/openauto/btservice/AndroidBluetoothServer.hpp index bfa40d6c..4eb540b3 100644 --- a/include/f1x/openauto/btservice/AndroidBluetoothServer.hpp +++ b/include/f1x/openauto/btservice/AndroidBluetoothServer.hpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include namespace f1x { diff --git a/src/autoapp/App.cpp b/src/autoapp/App.cpp index 3967385b..b016ea2c 100644 --- a/src/autoapp/App.cpp +++ b/src/autoapp/App.cpp @@ -17,8 +17,8 @@ */ #include -#include -#include +#include +#include #include #include diff --git a/src/autoapp/Service/AndroidAutoEntity.cpp b/src/autoapp/Service/AndroidAutoEntity.cpp index 02986ddd..cea74e5e 100644 --- a/src/autoapp/Service/AndroidAutoEntity.cpp +++ b/src/autoapp/Service/AndroidAutoEntity.cpp @@ -16,7 +16,7 @@ * along with openauto. If not, see . */ -#include +#include #include #include @@ -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 "; diff --git a/src/autoapp/Service/AndroidAutoEntityFactory.cpp b/src/autoapp/Service/AndroidAutoEntityFactory.cpp index d833250d..9f0ace8b 100644 --- a/src/autoapp/Service/AndroidAutoEntityFactory.cpp +++ b/src/autoapp/Service/AndroidAutoEntityFactory.cpp @@ -16,14 +16,14 @@ * along with openauto. If not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/src/autoapp/Service/MediaAudioService.cpp b/src/autoapp/Service/MediaAudioService.cpp index b754d216..b4bf2470 100644 --- a/src/autoapp/Service/MediaAudioService.cpp +++ b/src/autoapp/Service/MediaAudioService.cpp @@ -16,7 +16,7 @@ * along with openauto. If not, see . */ -#include +#include #include namespace f1x diff --git a/src/autoapp/Service/SensorService.cpp b/src/autoapp/Service/SensorService.cpp index 851744e8..7a47d6c3 100644 --- a/src/autoapp/Service/SensorService.cpp +++ b/src/autoapp/Service/SensorService.cpp @@ -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)) diff --git a/src/autoapp/Service/ServiceFactory.cpp b/src/autoapp/Service/ServiceFactory.cpp index 9ef2e700..82aa5c2d 100644 --- a/src/autoapp/Service/ServiceFactory.cpp +++ b/src/autoapp/Service/ServiceFactory.cpp @@ -18,9 +18,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/src/autoapp/Service/SpeechAudioService.cpp b/src/autoapp/Service/SpeechAudioService.cpp index 59300950..47e9006b 100644 --- a/src/autoapp/Service/SpeechAudioService.cpp +++ b/src/autoapp/Service/SpeechAudioService.cpp @@ -16,7 +16,7 @@ * along with openauto. If not, see . */ -#include +#include #include namespace f1x diff --git a/src/autoapp/Service/SystemAudioService.cpp b/src/autoapp/Service/SystemAudioService.cpp index 09986159..33f5f946 100644 --- a/src/autoapp/Service/SystemAudioService.cpp +++ b/src/autoapp/Service/SystemAudioService.cpp @@ -16,7 +16,7 @@ * along with openauto. If not, see . */ -#include +#include #include namespace f1x diff --git a/src/autoapp/autoapp.cpp b/src/autoapp/autoapp.cpp index a2f1ea10..82b423b8 100644 --- a/src/autoapp/autoapp.cpp +++ b/src/autoapp/autoapp.cpp @@ -19,12 +19,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -38,7 +38,6 @@ #include #include -namespace aasdk = f1x::aasdk; namespace autoapp = f1x::openauto::autoapp; using ThreadPool = std::vector; diff --git a/src/btservice/AndroidBluetoothServer.cpp b/src/btservice/AndroidBluetoothServer.cpp index ee3bfd6b..7f257077 100644 --- a/src/btservice/AndroidBluetoothServer.cpp +++ b/src/btservice/AndroidBluetoothServer.cpp @@ -23,6 +23,7 @@ #include #include #include + #include #include #include @@ -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 { } } } -} \ No newline at end of file +}