summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bluetooth/qlowenergycontroller_winrt.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/bluetooth/qlowenergycontroller_winrt.cpp b/src/bluetooth/qlowenergycontroller_winrt.cpp
index e4ae76b0..8517a942 100644
--- a/src/bluetooth/qlowenergycontroller_winrt.cpp
+++ b/src/bluetooth/qlowenergycontroller_winrt.cpp
@@ -651,6 +651,7 @@ void QLowEnergyControllerPrivate::discoverServiceDetails(const QBluetoothUuid &s
void QLowEnergyControllerPrivate::startAdvertising(const QLowEnergyAdvertisingParameters &, const QLowEnergyAdvertisingData &, const QLowEnergyAdvertisingData &)
{
+ setError(QLowEnergyController::AdvertisingError);
Q_UNIMPLEMENTED();
}
@@ -669,6 +670,12 @@ void QLowEnergyControllerPrivate::readCharacteristic(const QSharedPointer<QLowEn
{
qCDebug(QT_BT_WINRT) << __FUNCTION__ << service << charHandle;
Q_ASSERT(!service.isNull());
+ if (role == QLowEnergyController::PeripheralRole) {
+ service->setError(QLowEnergyService::CharacteristicReadError);
+ Q_UNIMPLEMENTED();
+ return;
+ }
+
if (!service->characteristicList.contains(charHandle)) {
qCDebug(QT_BT_WINRT) << charHandle << "could not be found in service" << service->uuid;
service->setError(QLowEnergyService::CharacteristicReadError);
@@ -728,6 +735,12 @@ void QLowEnergyControllerPrivate::readDescriptor(const QSharedPointer<QLowEnergy
{
qCDebug(QT_BT_WINRT) << __FUNCTION__ << service << charHandle << descHandle;
Q_ASSERT(!service.isNull());
+ if (role == QLowEnergyController::PeripheralRole) {
+ service->setError(QLowEnergyService::DescriptorReadError);
+ Q_UNIMPLEMENTED();
+ return;
+ }
+
if (!service->characteristicList.contains(charHandle)) {
qCDebug(QT_BT_WINRT) << "Descriptor" << descHandle << "in characteristic" << charHandle
<< "cannot be found in service" << service->uuid;
@@ -854,6 +867,11 @@ void QLowEnergyControllerPrivate::writeCharacteristic(const QSharedPointer<QLowE
{
qCDebug(QT_BT_WINRT) << __FUNCTION__ << service << charHandle << newValue << mode;
Q_ASSERT(!service.isNull());
+ if (role == QLowEnergyController::PeripheralRole) {
+ service->setError(QLowEnergyService::CharacteristicWriteError);
+ Q_UNIMPLEMENTED();
+ return;
+ }
if (!service->characteristicList.contains(charHandle)) {
qCDebug(QT_BT_WINRT) << "Characteristic" << charHandle << "cannot be found in service" << service->uuid;
service->setError(QLowEnergyService::CharacteristicWriteError);
@@ -938,6 +956,12 @@ void QLowEnergyControllerPrivate::writeDescriptor(
{
qCDebug(QT_BT_WINRT) << __FUNCTION__ << service << charHandle << descHandle << newValue;
Q_ASSERT(!service.isNull());
+ if (role == QLowEnergyController::PeripheralRole) {
+ service->setError(QLowEnergyService::DescriptorWriteError);
+ Q_UNIMPLEMENTED();
+ return;
+ }
+
if (!service->characteristicList.contains(charHandle)) {
qCDebug(QT_BT_WINRT) << "Descriptor" << descHandle << "in characteristic" << charHandle
<< "could not be found in service" << service->uuid;