summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bluetooth/qlowenergycontroller_darwin.mm30
1 files changed, 2 insertions, 28 deletions
diff --git a/src/bluetooth/qlowenergycontroller_darwin.mm b/src/bluetooth/qlowenergycontroller_darwin.mm
index 3f7fb215..ccac9d30 100644
--- a/src/bluetooth/qlowenergycontroller_darwin.mm
+++ b/src/bluetooth/qlowenergycontroller_darwin.mm
@@ -277,10 +277,10 @@ void QLowEnergyControllerPrivateDarwin::requestConnectionUpdate(const QLowEnergy
void QLowEnergyControllerPrivateDarwin::addToGenericAttributeList(const QLowEnergyServiceData &service,
QLowEnergyHandle startHandle)
{
+ // Darwin LE controller implements the addServiceHelper() for adding services, and thus
+ // the base class' addServiceHelper(), which calls this function, is not used
Q_UNUSED(service);
Q_UNUSED(startHandle);
- // TODO: check why I don't need this (apparently it is used in addServiceHelper
- // of the base class).
}
int QLowEnergyControllerPrivateDarwin::mtu() const
@@ -319,27 +319,11 @@ void QLowEnergyControllerPrivateDarwin::readRssi()
QLowEnergyService * QLowEnergyControllerPrivateDarwin::addServiceHelper(const QLowEnergyServiceData &service)
{
- // Three checks below should be removed, they are done in the q_ptr's class.
if (!isValid()) {
qCWarning(QT_BT_DARWIN) << "invalid peripheral";
return nullptr;
}
- if (role != QLowEnergyController::PeripheralRole) {
- qCWarning(QT_BT_DARWIN) << "not in peripheral role";
- return nullptr;
- }
-
- if (state != QLowEnergyController::UnconnectedState) {
- qCWarning(QT_BT_DARWIN) << "invalid state";
- return nullptr;
- }
-
- if (!service.isValid()) {
- qCWarning(QT_BT_DARWIN) << "invalid service";
- return nullptr;
- }
-
for (auto includedService : service.includedServices())
includedService->d_ptr->type |= QLowEnergyService::IncludedService;
@@ -1000,19 +984,9 @@ void QLowEnergyControllerPrivateDarwin::startAdvertising(const QLowEnergyAdverti
const QLowEnergyAdvertisingData &advertisingData,
const QLowEnergyAdvertisingData &scanResponseData)
{
- if (role != QLowEnergyController::PeripheralRole) {
- qCWarning(QT_BT_DARWIN) << "controller is not a peripheral, cannot start advertising";
- return;
- }
-
if (!lazyInit()) // Error was emit already.
return;
- if (state != QLowEnergyController::UnconnectedState) {
- qCWarning(QT_BT_DARWIN) << "invalid state" << state;
- return;
- }
-
auto leQueue(DarwinBluetooth::qt_LE_queue());
Q_ASSERT_X(leQueue, Q_FUNC_INFO, "invalid LE queue (nullptr)");