Merge branch 'crankshaft-ng' of https://github.com/opencardev/openauto into crankshaft-ng
# Conflicts: # include/f1x/openauto/autoapp/Configuration/Configuration.hpp # include/f1x/openauto/autoapp/Configuration/IConfiguration.hpp # src/autoapp/Configuration/Configuration.cpp # src/autoapp/Service/AndroidAutoEntity.cpp # src/autoapp/Service/SensorService.cpp # src/autoapp/Service/ServiceFactory.cpp # src/autoapp/UI/SettingsWindow.cpp
This commit is contained in:
commit
d19a4438ca
@ -110,8 +110,9 @@ public:
|
|||||||
BluetoothAdapterType getBluetoothAdapterType() const override;
|
BluetoothAdapterType getBluetoothAdapterType() const override;
|
||||||
void setBluetoothAdapterType(BluetoothAdapterType value) override;
|
void setBluetoothAdapterType(BluetoothAdapterType value) override;
|
||||||
std::string getBluetoothAdapterAddress() const override;
|
std::string getBluetoothAdapterAddress() const override;
|
||||||
|
|
||||||
void setBluetoothAdapterAddress(const std::string& value) override;
|
void setBluetoothAdapterAddress(const std::string& value) override;
|
||||||
|
bool getWirelessProjectionEnabled() const override;
|
||||||
|
void setWirelessProjectionEnabled(bool value) override;
|
||||||
|
|
||||||
bool musicAudioChannelEnabled() const override;
|
bool musicAudioChannelEnabled() const override;
|
||||||
void setMusicAudioChannelEnabled(bool value) override;
|
void setMusicAudioChannelEnabled(bool value) override;
|
||||||
@ -159,6 +160,8 @@ private:
|
|||||||
ButtonCodes buttonCodes_;
|
ButtonCodes buttonCodes_;
|
||||||
BluetoothAdapterType bluetoothAdapterType_;
|
BluetoothAdapterType bluetoothAdapterType_;
|
||||||
std::string bluetoothAdapterAddress_;
|
std::string bluetoothAdapterAddress_;
|
||||||
|
bool wirelessProjectionEnabled_;
|
||||||
|
|
||||||
bool _audioChannelEnabledMedia;
|
bool _audioChannelEnabledMedia;
|
||||||
bool _audioChannelEnabledGuidance;
|
bool _audioChannelEnabledGuidance;
|
||||||
bool _audioChannelEnabledSystem;
|
bool _audioChannelEnabledSystem;
|
||||||
@ -206,6 +209,7 @@ private:
|
|||||||
|
|
||||||
static const std::string cBluetoothAdapterTypeKey;
|
static const std::string cBluetoothAdapterTypeKey;
|
||||||
static const std::string cBluetoothAdapterAddressKey;
|
static const std::string cBluetoothAdapterAddressKey;
|
||||||
|
static const std::string cBluetoothWirelessProjectionEnabledKey;
|
||||||
|
|
||||||
static const std::string cInputEnableTouchscreenKey;
|
static const std::string cInputEnableTouchscreenKey;
|
||||||
static const std::string cInputEnablePlayerControlKey;
|
static const std::string cInputEnablePlayerControlKey;
|
||||||
|
@ -114,6 +114,8 @@ public:
|
|||||||
virtual void setBluetoothAdapterType(BluetoothAdapterType value) = 0;
|
virtual void setBluetoothAdapterType(BluetoothAdapterType value) = 0;
|
||||||
virtual std::string getBluetoothAdapterAddress() const = 0;
|
virtual std::string getBluetoothAdapterAddress() const = 0;
|
||||||
virtual void setBluetoothAdapterAddress(const std::string& value) = 0;
|
virtual void setBluetoothAdapterAddress(const std::string& value) = 0;
|
||||||
|
virtual bool getWirelessProjectionEnabled() const = 0;
|
||||||
|
virtual void setWirelessProjectionEnabled(bool value) = 0;
|
||||||
|
|
||||||
virtual bool musicAudioChannelEnabled() const = 0;
|
virtual bool musicAudioChannelEnabled() const = 0;
|
||||||
virtual void setMusicAudioChannelEnabled(bool value) = 0;
|
virtual void setMusicAudioChannelEnabled(bool value) = 0;
|
||||||
|
@ -66,6 +66,7 @@ const std::string Configuration::cAudioOutputBackendType = "Audio.OutputBackendT
|
|||||||
|
|
||||||
const std::string Configuration::cBluetoothAdapterTypeKey = "Bluetooth.AdapterType";
|
const std::string Configuration::cBluetoothAdapterTypeKey = "Bluetooth.AdapterType";
|
||||||
const std::string Configuration::cBluetoothAdapterAddressKey = "Bluetooth.AdapterAddress";
|
const std::string Configuration::cBluetoothAdapterAddressKey = "Bluetooth.AdapterAddress";
|
||||||
|
const std::string Configuration::cBluetoothWirelessProjectionEnabledKey = "Bluetooth.WirelessProjectionEnabled";
|
||||||
|
|
||||||
const std::string Configuration::cInputEnableTouchscreenKey = "Input.EnableTouchscreen";
|
const std::string Configuration::cInputEnableTouchscreenKey = "Input.EnableTouchscreen";
|
||||||
const std::string Configuration::cInputEnablePlayerControlKey = "Input.EnablePlayerControl";
|
const std::string Configuration::cInputEnablePlayerControlKey = "Input.EnablePlayerControl";
|
||||||
@ -137,6 +138,8 @@ void Configuration::load()
|
|||||||
bluetoothAdapterType_ = static_cast<BluetoothAdapterType>(iniConfig.get<uint32_t>(cBluetoothAdapterTypeKey,
|
bluetoothAdapterType_ = static_cast<BluetoothAdapterType>(iniConfig.get<uint32_t>(cBluetoothAdapterTypeKey,
|
||||||
static_cast<uint32_t>(BluetoothAdapterType::NONE)));
|
static_cast<uint32_t>(BluetoothAdapterType::NONE)));
|
||||||
|
|
||||||
|
wirelessProjectionEnabled_ = iniConfig.get<bool>(cBluetoothWirelessProjectionEnabledKey, true);
|
||||||
|
|
||||||
bluetoothAdapterAddress_ = iniConfig.get<std::string>(cBluetoothAdapterAddressKey, "");
|
bluetoothAdapterAddress_ = iniConfig.get<std::string>(cBluetoothAdapterAddressKey, "");
|
||||||
|
|
||||||
_audioChannelEnabledMedia = iniConfig.get<bool>(cAudioChannelMediaEnabled, true);
|
_audioChannelEnabledMedia = iniConfig.get<bool>(cAudioChannelMediaEnabled, true);
|
||||||
@ -192,6 +195,7 @@ void Configuration::reset()
|
|||||||
_audioChannelEnabledTelephony = true;
|
_audioChannelEnabledTelephony = true;
|
||||||
|
|
||||||
audioOutputBackendType_ = AudioOutputBackendType::QT;
|
audioOutputBackendType_ = AudioOutputBackendType::QT;
|
||||||
|
wirelessProjectionEnabled_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::save()
|
void Configuration::save()
|
||||||
@ -230,6 +234,7 @@ void Configuration::save()
|
|||||||
|
|
||||||
iniConfig.put<uint32_t>(cBluetoothAdapterTypeKey, static_cast<uint32_t>(bluetoothAdapterType_));
|
iniConfig.put<uint32_t>(cBluetoothAdapterTypeKey, static_cast<uint32_t>(bluetoothAdapterType_));
|
||||||
iniConfig.put<std::string>(cBluetoothAdapterAddressKey, bluetoothAdapterAddress_);
|
iniConfig.put<std::string>(cBluetoothAdapterAddressKey, bluetoothAdapterAddress_);
|
||||||
|
iniConfig.put<bool>(cBluetoothWirelessProjectionEnabledKey, wirelessProjectionEnabled_);
|
||||||
|
|
||||||
iniConfig.put<bool>(cAudioChannelMediaEnabled, _audioChannelEnabledMedia);
|
iniConfig.put<bool>(cAudioChannelMediaEnabled, _audioChannelEnabledMedia);
|
||||||
iniConfig.put<bool>(cAudioChannelGuidanceEnabled, _audioChannelEnabledGuidance);
|
iniConfig.put<bool>(cAudioChannelGuidanceEnabled, _audioChannelEnabledGuidance);
|
||||||
@ -539,6 +544,14 @@ void Configuration::setBluetoothAdapterAddress(const std::string& value)
|
|||||||
bluetoothAdapterAddress_ = value;
|
bluetoothAdapterAddress_ = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Configuration::getWirelessProjectionEnabled() const {
|
||||||
|
return wirelessProjectionEnabled_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Configuration::setWirelessProjectionEnabled(bool value) {
|
||||||
|
wirelessProjectionEnabled_ = value;
|
||||||
|
}
|
||||||
|
|
||||||
bool Configuration::musicAudioChannelEnabled() const
|
bool Configuration::musicAudioChannelEnabled() const
|
||||||
{
|
{
|
||||||
return _audioChannelEnabledMedia;
|
return _audioChannelEnabledMedia;
|
||||||
|
@ -263,6 +263,21 @@ namespace f1x {
|
|||||||
controlServiceChannel_->sendShutdownResponse(response, std::move(promise));
|
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(info) << "[AndroidAutoEntity] onVoiceSessionRequest()";
|
||||||
|
controlServiceChannel_->receive(this->shared_from_this());
|
||||||
|
}
|
||||||
|
|
||||||
void AndroidAutoEntity::onByeByeResponse(
|
void AndroidAutoEntity::onByeByeResponse(
|
||||||
const aap_protobuf::service::control::message::ByeByeResponse &response) {
|
const aap_protobuf::service::control::message::ByeByeResponse &response) {
|
||||||
OPENAUTO_LOG(info) << "[AndroidAutoEntity] onByeByeResponse()";
|
OPENAUTO_LOG(info) << "[AndroidAutoEntity] onByeByeResponse()";
|
||||||
|
0
src/autoapp/Service/SensorService.cpp
Normal file
0
src/autoapp/Service/SensorService.cpp
Normal file
@ -64,8 +64,15 @@ namespace f1x::openauto::autoapp::service {
|
|||||||
serviceList.emplace_back(this->createSensorService(messenger));
|
serviceList.emplace_back(this->createSensorService(messenger));
|
||||||
serviceList.emplace_back(this->createBluetoothService(messenger));
|
serviceList.emplace_back(this->createBluetoothService(messenger));
|
||||||
serviceList.emplace_back(this->createInputService(messenger));
|
serviceList.emplace_back(this->createInputService(messenger));
|
||||||
|
if (configuration_->getWirelessProjectionEnabled())
|
||||||
|
{
|
||||||
// TODO: What is WiFi Projection Service?
|
// TODO: What is WiFi Projection Service?
|
||||||
//serviceList.emplace_back(this->createWifiProjectionService(messenger));
|
/*
|
||||||
|
* The btservice seems to handle connecting over bluetooth and allow AA to establish a WiFi connection for Projection
|
||||||
|
* If WifiProjection is a legitimate service, then it seems clear it is not what we think it actually is.
|
||||||
|
*/
|
||||||
|
serviceList.emplace_back(this->createWifiProjectionService(messenger));
|
||||||
|
}
|
||||||
|
|
||||||
return serviceList;
|
return serviceList;
|
||||||
}
|
}
|
||||||
@ -141,7 +148,7 @@ namespace f1x::openauto::autoapp::service {
|
|||||||
std::move(guidanceAudioOutput)));
|
std::move(guidanceAudioOutput)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* TODO: This also causes a problem - suspect not actually enabled yet in AA, or removed due to preference of Bluetooth.
|
||||||
if (configuration_->telephonyAudioChannelEnabled()) {
|
if (configuration_->telephonyAudioChannelEnabled()) {
|
||||||
OPENAUTO_LOG(info) << "[ServiceFactory] Telephony Audio Channel enabled";
|
OPENAUTO_LOG(info) << "[ServiceFactory] Telephony Audio Channel enabled";
|
||||||
auto telephonyAudioOutput =
|
auto telephonyAudioOutput =
|
||||||
|
@ -346,6 +346,12 @@ comboBoxBluetooth->addItem(QCoreApplication::translate("SettingsWindow", "none",
|
|||||||
ui_->comboBoxBluetooth->currentData().toString().toStdString());
|
ui_->comboBoxBluetooth->currentData().toString().toStdString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ui_->disableProjectionButton->isChecked()) {
|
||||||
|
configuration_->setWirelessProjectionEnabled(false);
|
||||||
|
} else {
|
||||||
|
configuration_->setWirelessProjectionEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
configuration_->setMusicAudioChannelEnabled(ui_->checkBoxMusicAudioChannel->isChecked());
|
configuration_->setMusicAudioChannelEnabled(ui_->checkBoxMusicAudioChannel->isChecked());
|
||||||
configuration_->setGuidanceAudioChannelEnabled(ui_->checkBoxSpeechAudioChannel->isChecked());
|
configuration_->setGuidanceAudioChannelEnabled(ui_->checkBoxSpeechAudioChannel->isChecked());
|
||||||
//configuration_->setTelephonyAudioChannelEnabled(ui_->checkBoxVoiceAudioChannel->isChecked());
|
//configuration_->setTelephonyAudioChannelEnabled(ui_->checkBoxVoiceAudioChannel->isChecked());
|
||||||
@ -622,6 +628,8 @@ comboBoxBluetooth->addItem(QCoreApplication::translate("SettingsWindow", "none",
|
|||||||
this->loadButtonCheckBoxes();
|
this->loadButtonCheckBoxes();
|
||||||
ui_->checkBoxPlayerControl->setChecked(configuration_->playerButtonControl());
|
ui_->checkBoxPlayerControl->setChecked(configuration_->playerButtonControl());
|
||||||
|
|
||||||
|
ui_->disableProjectionButton->setChecked(!configuration_->getWirelessProjectionEnabled());
|
||||||
|
|
||||||
ui_->checkBoxMusicAudioChannel->setChecked(configuration_->musicAudioChannelEnabled());
|
ui_->checkBoxMusicAudioChannel->setChecked(configuration_->musicAudioChannelEnabled());
|
||||||
ui_->checkBoxSpeechAudioChannel->setChecked(configuration_->guidanceAudioChannelEnabled());
|
ui_->checkBoxSpeechAudioChannel->setChecked(configuration_->guidanceAudioChannelEnabled());
|
||||||
//ui_->telephonyAudioChannelEnabled->setChecked(configuration_->telephonyAudioChannelEnabled());
|
//ui_->telephonyAudioChannelEnabled->setChecked(configuration_->telephonyAudioChannelEnabled());
|
||||||
|
@ -2890,6 +2890,49 @@ outline: none;</string>
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupWirelessProjection">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="cursor">
|
||||||
|
<cursorShape>ArrowCursor</cursorShape>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Wireless Projection</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="groupWirelessProjection_layout" stretch="0">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="disableProjectionButton">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Disable Wireless Projection</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" name="horizontalWidget" native="true">
|
<widget class="QWidget" name="horizontalWidget" native="true">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user