summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm15
-rw-r--r--src/bluetooth/qbluetoothlocaldevice_osx.mm21
-rw-r--r--src/bluetooth/qbluetoothserver_osx.mm35
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent_osx.mm2
-rw-r--r--src/bluetooth/qbluetoothserviceinfo_osx.mm8
-rw-r--r--src/bluetooth/qbluetoothsocket_osx.mm12
-rw-r--r--src/bluetooth/qbluetoothtransferreply_osx.mm13
-rw-r--r--src/bluetooth/qlowenergycontroller_osx.mm128
8 files changed, 106 insertions, 128 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm b/src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm
index 620833de..0ead4e36 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm
@@ -152,7 +152,7 @@ void DDATimerHandler::start(int msec)
{
Q_ASSERT_X(msec > 0, Q_FUNC_INFO, "invalid time interval");
if (timer.isActive()) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "timer is active";
+ qCWarning(QT_BT_OSX) << "timer is active";
return;
}
@@ -186,15 +186,13 @@ QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate(con
HostController controller([[IOBluetoothHostController defaultController] retain]);
if (!controller || [controller powerState] != kBluetoothHCIPowerStateON) {
- qCCritical(QT_BT_OSX) << Q_FUNC_INFO << "no default host "
- "controller or adapter is off";
+ qCCritical(QT_BT_OSX) << "no default host controller or adapter is off";
return;
}
DeviceInquiry newInquiry([[DeviceInquiryObjC alloc]initWithDelegate:this]);
if (!newInquiry) { // Obj-C's way of "reporting errors":
- qCCritical(QT_BT_OSX) << Q_FUNC_INFO << "failed to "
- "initialize an inquiry";
+ qCCritical(QT_BT_OSX) << "failed to initialize an inquiry";
return;
}
@@ -311,7 +309,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::stop()
if (agentState == ClassicScan) {
const IOReturn res = [inquiry stop];
if (res != kIOReturnSuccess) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "failed to stop";
+ qCWarning(QT_BT_OSX) << "failed to stop";
startPending = prevStart;
stopPending = false;
setError(res, QCoreApplication::translate(DEV_DISCOVERY, DD_NOT_STOPPED));
@@ -385,7 +383,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::deviceFound(IOBluetoothDeviceInquiry
// Let's collect some info about this device:
const QBluetoothAddress deviceAddress(OSXBluetooth::qt_address([device getAddress]));
if (deviceAddress.isNull()) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "invalid Bluetooth address";
+ qCWarning(QT_BT_OSX) << "invalid Bluetooth address";
return;
}
@@ -478,8 +476,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::checkLETimeout()
return;
}
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "unexpected inquiry state in LE timeout";
- // Actually, this deserves an assert :)
+ qCWarning(QT_BT_OSX) << "unexpected inquiry state in LE timeout";
}
void QBluetoothDeviceDiscoveryAgentPrivate::LEinquiryError(QBluetoothDeviceDiscoveryAgent::Error error)
diff --git a/src/bluetooth/qbluetoothlocaldevice_osx.mm b/src/bluetooth/qbluetoothlocaldevice_osx.mm
index 1d58363d..9fa060d2 100644
--- a/src/bluetooth/qbluetoothlocaldevice_osx.mm
+++ b/src/bluetooth/qbluetoothlocaldevice_osx.mm
@@ -119,29 +119,25 @@ QBluetoothLocalDevicePrivate::QBluetoothLocalDevicePrivate(QBluetoothLocalDevice
HostController defaultController([[IOBluetoothHostController defaultController] retain]);
if (!defaultController) {
- qCCritical(QT_BT_OSX) << Q_FUNC_INFO << "failed to "
- "init a host controller object";
+ qCCritical(QT_BT_OSX) << "failed to init a host controller object";
return;
}
if (!address.isNull()) {
NSString *const hciAddress = [defaultController addressAsString];
if (!hciAddress) {
- qCCritical(QT_BT_OSX) << Q_FUNC_INFO << "failed to "
- "obtain an address";
+ qCCritical(QT_BT_OSX) << "failed to obtain an address";
return;
}
BluetoothDeviceAddress iobtAddress = {};
if (IOBluetoothNSStringToDeviceAddress(hciAddress, &iobtAddress) != kIOReturnSuccess) {
- qCCritical(QT_BT_OSX) << Q_FUNC_INFO << "invalid "
- "local device's address";
+ qCCritical(QT_BT_OSX) << "invalid local device's address";
return;
}
if (address != OSXBluetooth::qt_address(&iobtAddress)) {
- qCCritical(QT_BT_OSX) << Q_FUNC_INFO << "invalid "
- "local device's address";
+ qCCritical(QT_BT_OSX) << "invalid local device's address";
return;
}
}
@@ -184,8 +180,7 @@ void QBluetoothLocalDevicePrivate::requestPairing(const QBluetoothAddress &addre
if ([device isPaired]) {
emitPairingFinished(address, pairing, true);
} else if ([pos.value() start] != kIOReturnSuccess) {
- qCCritical(QT_BT_OSX) << Q_FUNC_INFO << "failed to "
- "start a new pairing request";
+ qCCritical(QT_BT_OSX) << "failed to start a new pairing request";
emitError(QBluetoothLocalDevice::PairingError, true);
}
return;
@@ -196,8 +191,7 @@ void QBluetoothLocalDevicePrivate::requestPairing(const QBluetoothAddress &addre
// it'll just finish with success (skipping any intermediate steps).
PairingRequest newRequest([[ObjCPairingRequest alloc] initWithTarget:address delegate:this], false);
if (!newRequest) {
- qCCritical(QT_BT_OSX) << Q_FUNC_INFO << "failed to "
- "allocate a new pairing request";
+ qCCritical(QT_BT_OSX) << "failed to allocate a new pairing request";
emitError(QBluetoothLocalDevice::PairingError, true);
return;
}
@@ -206,8 +200,7 @@ void QBluetoothLocalDevicePrivate::requestPairing(const QBluetoothAddress &addre
const IOReturn result = [newRequest start];
if (result != kIOReturnSuccess) {
pairingRequests.erase(pos);
- qCCritical(QT_BT_OSX) << Q_FUNC_INFO << "failed to "
- "start a new pairing request";
+ qCCritical(QT_BT_OSX) << "failed to start a new pairing request";
emitError(QBluetoothLocalDevice::PairingError, true);
}
}
diff --git a/src/bluetooth/qbluetoothserver_osx.mm b/src/bluetooth/qbluetoothserver_osx.mm
index 1aaa2201..3828263c 100644
--- a/src/bluetooth/qbluetoothserver_osx.mm
+++ b/src/bluetooth/qbluetoothserver_osx.mm
@@ -96,7 +96,7 @@ QBluetoothServerPrivate::QBluetoothServerPrivate(QSInfo::Protocol type, QBluetoo
{
Q_ASSERT_X(q_ptr, Q_FUNC_INFO, "invalid q_ptr (null)");
if (serverType == QSInfo::UnknownProtocol)
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "unknown protocol";
+ qCWarning(QT_BT_OSX) << "unknown protocol";
}
QBluetoothServerPrivate::~QBluetoothServerPrivate()
@@ -117,7 +117,7 @@ bool QBluetoothServerPrivate::startListener(quint16 realPort)
Q_ASSERT_X(realPort, Q_FUNC_INFO, "invalid port");
if (serverType == QSInfo::UnknownProtocol) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "invalid protocol";
+ qCWarning(QT_BT_OSX) << "invalid protocol";
return false;
}
@@ -218,7 +218,7 @@ void QBluetoothServerPrivate::registerServer(QBluetoothServerPrivate *server, qu
Q_ASSERT_X(!psmIsBusy(port), Q_FUNC_INFO, "port is busy");
busyPSMs()[port] = server;
} else {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "can not register a server "
+ qCWarning(QT_BT_OSX) << "can not register a server "
"with unknown protocol type";
}
}
@@ -235,7 +235,7 @@ QBluetoothServerPrivate *QBluetoothServerPrivate::registeredServer(quint16 port,
if (it != busyPSMs().end())
return it.value();
} else {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "invalid protocol";
+ qCWarning(QT_BT_OSX) << "invalid protocol";
}
return Q_NULLPTR;
@@ -252,17 +252,17 @@ void QBluetoothServerPrivate::unregisterServer(QBluetoothServerPrivate *server)
if (it != busyChannels().end()) {
busyChannels().erase(it);
} else {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "server is not registered";
+ qCWarning(QT_BT_OSX) << "server is not registered";
}
} else if (type == QSInfo::L2capProtocol) {
ServerMapIterator it = busyPSMs().find(port);
if (it != busyPSMs().end()) {
busyPSMs().erase(it);
} else {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "server is not registered";
+ qCWarning(QT_BT_OSX) << "server is not registered";
}
} else {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "invalid protocol";
+ qCWarning(QT_BT_OSX) << "invalid protocol";
}
}
@@ -293,16 +293,15 @@ bool QBluetoothServer::listen(const QBluetoothAddress &address, quint16 port)
typedef QBluetoothServerPrivate::ObjCListener ObjCListener;
if (d_ptr->listener) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "already in listen mode, "
- "close server first";
+ qCWarning(QT_BT_OSX) << "already in listen mode, close server first";
return false;
}
const QBluetoothLocalDevice device(address);
if (!device.isValid()) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "device does not support Bluetooth or "
+ qCWarning(QT_BT_OSX) << "device does not support Bluetooth or"
<< address.toString()
- << " is not a valid local adapter";
+ << "is not a valid local adapter";
d_ptr->lastError = UnknownError;
emit error(UnknownError);
return false;
@@ -310,7 +309,7 @@ bool QBluetoothServer::listen(const QBluetoothAddress &address, quint16 port)
const QBluetoothLocalDevice::HostMode hostMode = device.hostMode();
if (hostMode == QBluetoothLocalDevice::HostPoweredOff) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "Bluetooth device is powered off";
+ qCWarning(QT_BT_OSX) << "Bluetooth device is powered off";
d_ptr->lastError = PoweredOffError;
emit error(PoweredOffError);
return false;
@@ -319,7 +318,7 @@ bool QBluetoothServer::listen(const QBluetoothAddress &address, quint16 port)
const QSInfo::Protocol type = d_ptr->serverType;
if (type == QSInfo::UnknownProtocol) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "invalid protocol";
+ qCWarning(QT_BT_OSX) << "invalid protocol";
d_ptr->lastError = UnsupportedProtocolError;
emit error(d_ptr->lastError);
return false;
@@ -333,14 +332,14 @@ bool QBluetoothServer::listen(const QBluetoothAddress &address, quint16 port)
if (port) {
if (type == QSInfo::RfcommProtocol) {
if (d_ptr->channelIsBusy(port)) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO <<"server port: "
- << port << "already registered";
+ qCWarning(QT_BT_OSX) << "server port:" << port
+ << "already registered";
d_ptr->lastError = ServiceAlreadyRegisteredError;
}
} else {
if (d_ptr->psmIsBusy(port)) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "server port: "
- << port << "already registered";
+ qCWarning(QT_BT_OSX) << "server port:" << port
+ << "already registered";
d_ptr->lastError = ServiceAlreadyRegisteredError;
}
}
@@ -355,7 +354,7 @@ bool QBluetoothServer::listen(const QBluetoothAddress &address, quint16 port)
}
if (!port) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "all ports are busy";
+ qCWarning(QT_BT_OSX) << "all ports are busy";
d_ptr->lastError = ServiceAlreadyRegisteredError;
emit error(d_ptr->lastError);
return false;
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm b/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm
index be579114..51b892e6 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm
+++ b/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm
@@ -334,7 +334,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::SDPInquiryError(IOBluetoothDevice *
{
Q_UNUSED(device)
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "inquiry failed with IOKit code: " << int(errorCode);
+ qCWarning(QT_BT_OSX) << "inquiry failed with IOKit code:" << int(errorCode);
discoveredDevices.clear();
// TODO: find a better mapping from IOReturn to QBluetoothServiceDiscoveryAgent::Error.
diff --git a/src/bluetooth/qbluetoothserviceinfo_osx.mm b/src/bluetooth/qbluetoothserviceinfo_osx.mm
index c51eb1c6..67392226 100644
--- a/src/bluetooth/qbluetoothserviceinfo_osx.mm
+++ b/src/bluetooth/qbluetoothserviceinfo_osx.mm
@@ -106,7 +106,7 @@ bool QBluetoothServiceInfoPrivate::registerService(const QBluetoothAddress &loca
serviceDict(iobluetooth_service_dictionary(*q_ptr));
if (!serviceDict) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "failed to create a service dictionary";
+ qCWarning(QT_BT_OSX) << "failed to create a service dictionary";
return false;
}
@@ -115,13 +115,13 @@ bool QBluetoothServiceInfoPrivate::registerService(const QBluetoothAddress &loca
publishedServiceRecordWithDictionary:serviceDict] retain]);
if (!newRecord) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "failed to register a service record";
+ qCWarning(QT_BT_OSX) << "failed to register a service record";
return false;
}
BluetoothSDPServiceRecordHandle newRecordHandle = 0;
if ([newRecord getServiceRecordHandle:&newRecordHandle] != kIOReturnSuccess) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "failed to register a service record";
+ qCWarning(QT_BT_OSX) << "failed to register a service record";
[newRecord removeServiceRecord];
return false;
}
@@ -149,7 +149,7 @@ bool QBluetoothServiceInfoPrivate::registerService(const QBluetoothAddress &loca
if (!configured) {
[newRecord removeServiceRecord];
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "failed to register a service record";
+ qCWarning(QT_BT_OSX) << "failed to register a service record";
return false;
}
diff --git a/src/bluetooth/qbluetoothsocket_osx.mm b/src/bluetooth/qbluetoothsocket_osx.mm
index b16a2cf9..83c4e88a 100644
--- a/src/bluetooth/qbluetoothsocket_osx.mm
+++ b/src/bluetooth/qbluetoothsocket_osx.mm
@@ -447,7 +447,7 @@ qint64 QBluetoothSocket::bytesToWrite() const
void QBluetoothSocket::connectToService(const QBluetoothServiceInfo &service, OpenMode openMode)
{
if (state() != UnconnectedState && state() != ServiceLookupState) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "called on a busy socket";
+ qCWarning(QT_BT_OSX) << "called on a busy socket";
d_ptr->errorString = QCoreApplication::translate(SOCKET, SOC_CONNECT_IN_PROGRESS);
setSocketError(OperationError);
return;
@@ -463,8 +463,8 @@ void QBluetoothSocket::connectToService(const QBluetoothServiceInfo &service, Op
} else {
// Try service discovery.
if (service.serviceUuid().isNull()) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "No port, "
- "no PSM, and no UUID provided, unable to connect";
+ qCWarning(QT_BT_OSX) << "No port, no PSM, and no "
+ "UUID provided, unable to connect";
return;
}
@@ -476,7 +476,7 @@ void QBluetoothSocket::connectToService(const QBluetoothAddress &address, const
OpenMode openMode)
{
if (state() != QBluetoothSocket::UnconnectedState) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "called on a busy socket";
+ qCWarning(QT_BT_OSX) << "called on a busy socket";
d_ptr->errorString = QCoreApplication::translate(SOCKET, SOC_CONNECT_IN_PROGRESS);
setSocketError(QBluetoothSocket::OperationError);
return;
@@ -493,7 +493,7 @@ void QBluetoothSocket::connectToService(const QBluetoothAddress &address, quint1
OpenMode openMode)
{
if (state() != QBluetoothSocket::UnconnectedState) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "called on a busy socket";
+ qCWarning(QT_BT_OSX) << "called on a busy socket";
d_ptr->errorString = QCoreApplication::translate(SOCKET, SOC_CONNECT_IN_PROGRESS);
setSocketError(OperationError);
return;
@@ -534,7 +534,7 @@ void QBluetoothSocket::setSocketState(QBluetoothSocket::SocketState state)
// We can register for L2CAP/RFCOMM open notifications,
// that's different from 'listen' and is implemented
// in QBluetoothServer.
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "listening sockets are not supported";
+ qCWarning(QT_BT_OSX) << "listening sockets are not supported";
}
}
diff --git a/src/bluetooth/qbluetoothtransferreply_osx.mm b/src/bluetooth/qbluetoothtransferreply_osx.mm
index 99c6cab1..02133860 100644
--- a/src/bluetooth/qbluetoothtransferreply_osx.mm
+++ b/src/bluetooth/qbluetoothtransferreply_osx.mm
@@ -177,7 +177,7 @@ void QBluetoothTransferReplyOSXPrivate::sendConnect(const QBluetoothAddress &dev
errorString.clear();
if (device.isNull() || !channelID) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "invalid device address or port";
+ qCWarning(QT_BT_OSX) << "invalid device address or port";
setReplyError(QBluetoothTransferReply::HostNotFoundError,
QCoreApplication::translate(TRANSFER_REPLY, TR_INVAL_TARGET));
return;
@@ -186,7 +186,7 @@ void QBluetoothTransferReplyOSXPrivate::sendConnect(const QBluetoothAddress &dev
OBEXSession newSession([[ObjCOBEXSession alloc] initWithDelegate:this
remoteDevice:device channelID:channelID]);
if (!newSession) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "failed to allocate OSXBTOBEXSession object";
+ qCWarning(QT_BT_OSX) << "failed to allocate OSXBTOBEXSession object";
setReplyError(QBluetoothTransferReply::UnknownError,
QCoreApplication::translate(TRANSFER_REPLY, TR_SESSION_NO_START));
@@ -201,7 +201,7 @@ void QBluetoothTransferReplyOSXPrivate::sendConnect(const QBluetoothAddress &dev
if ([session isConnected])
sendPut();// Connected, send a PUT request.
} else {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "OBEXConnect failed";
+ qCWarning(QT_BT_OSX) << "OBEXConnect failed";
if (error == QBluetoothTransferReply::NoError) {
// The error is not set yet.
@@ -355,7 +355,7 @@ QBluetoothTransferReplyOSX::QBluetoothTransferReplyOSX(QIODevice *input,
if (input) {
QMetaObject::invokeMethod(this, "start", Qt::QueuedConnection);
} else {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "invalid input stream (null)";
+ qCWarning(QT_BT_OSX) << "invalid input stream (null)";
osx_d_ptr->requestComplete = true;
osx_d_ptr->errorString = QCoreApplication::translate(TRANSFER_REPLY, TR_INVALID_DEVICE);
osx_d_ptr->error = FileNotFoundError;
@@ -416,7 +416,7 @@ bool QBluetoothTransferReplyOSX::start()
if (!osx_d_ptr->isActive()) {
// Step 0: find a channelID.
if (request().address().isNull()) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "invalid device address";
+ qCWarning(QT_BT_OSX) << "invalid device address";
osx_d_ptr->setReplyError(HostNotFoundError,
QCoreApplication::translate(TRANSFER_REPLY, TR_INVAL_TARGET));
return false;
@@ -455,7 +455,8 @@ void QBluetoothTransferReplyOSX::serviceDiscoveryFinished()
void QBluetoothTransferReplyOSX::serviceDiscoveryError(QBluetoothServiceDiscoveryAgent::Error errorCode)
{
- Q_ASSERT_X(osx_d_ptr->agent.data(), Q_FUNC_INFO, "invalid service discovery agent (null)");
+ Q_ASSERT_X(osx_d_ptr->agent.data(), Q_FUNC_INFO,
+ "invalid service discovery agent (null)");
if (errorCode == QBluetoothServiceDiscoveryAgent::PoweredOffError) {
// There's nothing else we can do.
diff --git a/src/bluetooth/qlowenergycontroller_osx.mm b/src/bluetooth/qlowenergycontroller_osx.mm
index 6ab257ea..5c4c7c37 100644
--- a/src/bluetooth/qlowenergycontroller_osx.mm
+++ b/src/bluetooth/qlowenergycontroller_osx.mm
@@ -86,8 +86,7 @@ ServicePrivate qt_createLEService(QLowEnergyControllerPrivateOSX *controller, CB
CBUUID *const cbUuid = cbService.UUID;
if (!cbUuid) {
- qCDebug(QT_BT_OSX) << Q_FUNC_INFO << "invalid service, "
- "UUID is nil";
+ qCDebug(QT_BT_OSX) << "invalid service, UUID is nil";
return ServicePrivate();
}
@@ -159,27 +158,23 @@ QLowEnergyControllerPrivateOSX::QLowEnergyControllerPrivateOSX(QLowEnergyControl
#ifndef Q_OS_TVOS
peripheralManager.reset([[ObjCPeripheralManager alloc] initWith:notifier.data()]);
if (!peripheralManager) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO
- << "failed to initialize peripheral manager";
+ qCWarning(QT_BT_OSX) << "failed to initialize peripheral manager";
return;
}
#else
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO
- << "peripheral role is not supported on your platform";
+ qCWarning(QT_BT_OSX) << "peripheral role is not supported on your platform";
return;
#endif
} else {
centralManager.reset([[ObjCCentralManager alloc] initWith:notifier.data()]);
if (!centralManager) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO
- << "failed to initialize central manager";
+ qCWarning(QT_BT_OSX) << "failed to initialize central manager";
return;
}
}
if (!connectSlots(notifier.data())) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO
- << "failed to connect to notifier's signal(s)";
+ qCWarning(QT_BT_OSX) << "failed to connect to notifier's signal(s)";
}
// Ownership was taken by central manager.
notifier.take();
@@ -258,7 +253,7 @@ void QLowEnergyControllerPrivateOSX::_q_serviceDiscoveryFinished()
continue;
if (discoveredServices.contains(newService->uuid)) {
// It's a bit stupid we first created it ...
- qCDebug(QT_BT_OSX) << Q_FUNC_INFO << "discovered service with a duplicated UUID "
+ qCDebug(QT_BT_OSX) << "discovered service with a duplicated UUID"
<< newService->uuid;
continue;
}
@@ -310,7 +305,7 @@ void QLowEnergyControllerPrivateOSX::_q_serviceDiscoveryFinished()
toVisitNext.resetWithoutRetain([[NSMutableArray alloc] init]);
}
} else {
- qCDebug(QT_BT_OSX) << Q_FUNC_INFO << "no services found";
+ qCDebug(QT_BT_OSX) << "no services found";
}
for (ServiceMap::const_iterator it = discoveredServices.constBegin(); it != discoveredServices.constEnd(); ++it) {
@@ -332,7 +327,7 @@ void QLowEnergyControllerPrivateOSX::_q_serviceDetailsDiscoveryFinished(QSharedP
Q_ASSERT(service);
if (!discoveredServices.contains(service->uuid)) {
- qCDebug(QT_BT_OSX) << Q_FUNC_INFO << "unknown service uuid: "
+ qCDebug(QT_BT_OSX) << "unknown service uuid:"
<< service->uuid;
return;
}
@@ -357,7 +352,7 @@ void QLowEnergyControllerPrivateOSX::_q_characteristicRead(QLowEnergyHandle char
QLowEnergyCharacteristic characteristic(characteristicForHandle(charHandle));
if (!characteristic.isValid()) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "unknown characteristic";
+ qCWarning(QT_BT_OSX) << "unknown characteristic";
return;
}
@@ -374,14 +369,14 @@ void QLowEnergyControllerPrivateOSX::_q_characteristicWritten(QLowEnergyHandle c
ServicePrivate service(serviceForHandle(charHandle));
if (service.isNull()) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "can not find service for characteristic handle "
+ qCWarning(QT_BT_OSX) << "can not find service for characteristic handle"
<< charHandle;
return;
}
QLowEnergyCharacteristic characteristic(characteristicForHandle(charHandle));
if (!characteristic.isValid()) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "unknown characteristic";
+ qCWarning(QT_BT_OSX) << "unknown characteristic";
return;
}
@@ -410,7 +405,7 @@ void QLowEnergyControllerPrivateOSX::_q_characteristicUpdated(QLowEnergyHandle c
QLowEnergyCharacteristic characteristic(characteristicForHandle(charHandle));
if (!characteristic.isValid()) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "unknown characteristic";
+ qCWarning(QT_BT_OSX) << "unknown characteristic";
return;
}
@@ -427,7 +422,7 @@ void QLowEnergyControllerPrivateOSX::_q_descriptorRead(QLowEnergyHandle dHandle,
const QLowEnergyDescriptor qtDescriptor(descriptorForHandle(dHandle));
if (!qtDescriptor.isValid()) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "unknown descriptor " << dHandle;
+ qCWarning(QT_BT_OSX) << "unknown descriptor" << dHandle;
return;
}
@@ -443,7 +438,7 @@ void QLowEnergyControllerPrivateOSX::_q_descriptorWritten(QLowEnergyHandle dHand
const QLowEnergyDescriptor qtDescriptor(descriptorForHandle(dHandle));
if (!qtDescriptor.isValid()) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "unknown descriptor " << dHandle;
+ qCWarning(QT_BT_OSX) << "unknown descriptor" << dHandle;
return;
}
@@ -489,7 +484,7 @@ void QLowEnergyControllerPrivateOSX::_q_CBManagerError(const QBluetoothUuid &ser
ServicePrivate qtService(discoveredServices.value(serviceUuid));
qtService->setState(QLowEnergyService::InvalidService);
} else {
- qCDebug(QT_BT_OSX) << Q_FUNC_INFO << "error reported for unknown service "
+ qCDebug(QT_BT_OSX) << "error reported for unknown service"
<< serviceUuid;
}
}
@@ -498,7 +493,7 @@ void QLowEnergyControllerPrivateOSX::_q_CBManagerError(const QBluetoothUuid &ser
QLowEnergyService::ServiceError errorCode)
{
if (!discoveredServices.contains(serviceUuid)) {
- qCDebug(QT_BT_OSX) << Q_FUNC_INFO << "unknown service uuid: "
+ qCDebug(QT_BT_OSX) << "unknown service uuid:"
<< serviceUuid;
return;
}
@@ -519,7 +514,7 @@ void QLowEnergyControllerPrivateOSX::connectToDevice()
dispatch_queue_t leQueue(OSXBluetooth::qt_LE_queue());
if (!leQueue) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "no LE queue found";
+ qCWarning(QT_BT_OSX) << "no LE queue found";
setErrorDescription(QLowEnergyController::UnknownError);
return;
}
@@ -544,7 +539,7 @@ void QLowEnergyControllerPrivateOSX::discoverServices()
dispatch_queue_t leQueue(OSXBluetooth::qt_LE_queue());
if (!leQueue) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "no LE queue found";
+ qCWarning(QT_BT_OSX) << "no LE queue found";
setErrorDescription(QLowEnergyController::UnknownError);
return;
}
@@ -565,20 +560,19 @@ void QLowEnergyControllerPrivateOSX::discoverServiceDetails(const QBluetoothUuid
if (controllerState != QLowEnergyController::DiscoveredState) {
// This will also exclude peripheral role, since controller
// can never be in discovered state ...
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO
- << "can not discover service details in the current state, "
- << "QLowEnergyController::DiscoveredState is expected";
+ qCWarning(QT_BT_OSX) << "can not discover service details in the current state, "
+ "QLowEnergyController::DiscoveredState is expected";
return;
}
if (!discoveredServices.contains(serviceUuid)) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "unknown service: " << serviceUuid;
+ qCWarning(QT_BT_OSX) << "unknown service: " << serviceUuid;
return;
}
dispatch_queue_t leQueue(OSXBluetooth::qt_LE_queue());
if (!leQueue) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "no LE queue found";
+ qCWarning(QT_BT_OSX) << "no LE queue found";
return;
}
@@ -600,7 +594,7 @@ void QLowEnergyControllerPrivateOSX::setNotifyValue(QSharedPointer<QLowEnergySer
Q_ASSERT_X(isValid(), Q_FUNC_INFO, "invalid controller");
if (role == QLowEnergyController::PeripheralRole) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "invalid role (peripheral)";
+ qCWarning(QT_BT_OSX) << "invalid role (peripheral)";
service->setError(QLowEnergyService::DescriptorWriteError);
return;
}
@@ -610,27 +604,26 @@ void QLowEnergyControllerPrivateOSX::setNotifyValue(QSharedPointer<QLowEnergySer
// With Core Bluetooth we do not write any descriptor,
// but instead call a special method. So it's better to
// intercept wrong data size here:
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "client characteristic configuration descriptor "
+ qCWarning(QT_BT_OSX) << "client characteristic configuration descriptor"
"is 2 bytes, but value size is: " << newValue.size();
service->setError(QLowEnergyService::DescriptorWriteError);
return;
}
if (!discoveredServices.contains(service->uuid)) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "no service with uuid: "
- << service->uuid << " found";
+ qCWarning(QT_BT_OSX) << "no service with uuid:" << service->uuid << "found";
return;
}
if (!service->characteristicList.contains(charHandle)) {
- qCDebug(QT_BT_OSX) << Q_FUNC_INFO << "no characteristic with handle: "
- << charHandle << " found";
+ qCDebug(QT_BT_OSX) << "no characteristic with handle:"
+ << charHandle << "found";
return;
}
dispatch_queue_t leQueue(OSXBluetooth::qt_LE_queue());
if (!leQueue) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "no LE queue found";
+ qCWarning(QT_BT_OSX) << "no LE queue found";
return;
}
ObjCCentralManager *manager = centralManager.data();
@@ -650,25 +643,25 @@ void QLowEnergyControllerPrivateOSX::readCharacteristic(QSharedPointer<QLowEnerg
Q_ASSERT_X(isValid(), Q_FUNC_INFO, "invalid controller");
if (role == QLowEnergyController::PeripheralRole) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "invalid role (peripheral)";
+ qCWarning(QT_BT_OSX) << "invalid role (peripheral)";
return;
}
if (!discoveredServices.contains(service->uuid)) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "no service with uuid:"
+ qCWarning(QT_BT_OSX) << "no service with uuid:"
<< service->uuid << "found";
return;
}
if (!service->characteristicList.contains(charHandle)) {
- qCDebug(QT_BT_OSX) << Q_FUNC_INFO << "no characteristic with handle:"
+ qCDebug(QT_BT_OSX) << "no characteristic with handle:"
<< charHandle << "found";
return;
}
dispatch_queue_t leQueue(OSXBluetooth::qt_LE_queue());
if (!leQueue) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "no LE queue found";
+ qCWarning(QT_BT_OSX) << "no LE queue found";
return;
}
// Attention! We have to copy UUID.
@@ -690,20 +683,20 @@ void QLowEnergyControllerPrivateOSX::writeCharacteristic(QSharedPointer<QLowEner
// (== created by the given LE controller).
if (!discoveredServices.contains(service->uuid)) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "no service with uuid: "
+ qCWarning(QT_BT_OSX) << "no service with uuid:"
<< service->uuid << " found";
return;
}
if (!service->characteristicList.contains(charHandle)) {
- qCDebug(QT_BT_OSX) << Q_FUNC_INFO << "no characteristic with handle: "
+ qCDebug(QT_BT_OSX) << "no characteristic with handle:"
<< charHandle << " found";
return;
}
dispatch_queue_t leQueue(OSXBluetooth::qt_LE_queue());
if (!leQueue) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "no LE queue found";
+ qCWarning(QT_BT_OSX) << "no LE queue found";
return;
}
// Attention! We have to copy objects!
@@ -724,8 +717,7 @@ void QLowEnergyControllerPrivateOSX::writeCharacteristic(QSharedPointer<QLowEner
[manager write:newValueCopy charHandle:charHandle];
});
#else
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO
- << "peripheral role is not supported on your platform";
+ qCWarning(QT_BT_OSX) << "peripheral role is not supported on your platform";
#endif
}
}
@@ -758,19 +750,19 @@ void QLowEnergyControllerPrivateOSX::readDescriptor(QSharedPointer<QLowEnergySer
Q_ASSERT_X(isValid(), Q_FUNC_INFO, "invalid controller");
if (role == QLowEnergyController::PeripheralRole) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "invalid role (peripheral)";
+ qCWarning(QT_BT_OSX) << "invalid role (peripheral)";
return;
}
if (!discoveredServices.contains(service->uuid)) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "no service with uuid:"
+ qCWarning(QT_BT_OSX) << "no service with uuid:"
<< service->uuid << "found";
return;
}
dispatch_queue_t leQueue(OSXBluetooth::qt_LE_queue());
if (!leQueue) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "no LE queue found";
+ qCWarning(QT_BT_OSX) << "no LE queue found";
return;
}
// Attention! Copy objects!
@@ -790,7 +782,7 @@ void QLowEnergyControllerPrivateOSX::writeDescriptor(QSharedPointer<QLowEnergySe
Q_ASSERT_X(isValid(), Q_FUNC_INFO, "invalid controller");
if (role == QLowEnergyController::PeripheralRole) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "invalid role (peripheral)";
+ qCWarning(QT_BT_OSX) << "invalid role (peripheral)";
return;
}
@@ -798,14 +790,14 @@ void QLowEnergyControllerPrivateOSX::writeDescriptor(QSharedPointer<QLowEnergySe
// (== created by the given LE controller),
// otherwise we can not write anything at all.
if (!discoveredServices.contains(service->uuid)) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "no service with uuid: "
+ qCWarning(QT_BT_OSX) << "no service with uuid:"
<< service->uuid << " found";
return;
}
dispatch_queue_t leQueue(OSXBluetooth::qt_LE_queue());
if (!leQueue) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "no LE queue found";
+ qCWarning(QT_BT_OSX) << "no LE queue found";
return;
}
// Attention! Copy objects!
@@ -987,7 +979,7 @@ QLowEnergyController::QLowEnergyController(const QBluetoothAddress &remoteAddres
osx_d_ptr->remoteAddress = remoteAddress;
osx_d_ptr->localAddress = QBluetoothLocalDevice().address();
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "construction with remote address "
+ qCWarning(QT_BT_OSX) << "construction with remote address "
"is not supported!";
}
@@ -1014,7 +1006,7 @@ QLowEnergyController::QLowEnergyController(const QBluetoothAddress &remoteAddres
osx_d_ptr->remoteAddress = remoteAddress;
osx_d_ptr->localAddress = localAddress;
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "construction with remote/local "
+ qCWarning(QT_BT_OSX) << "construction with remote/local "
"addresses is not supported!";
}
@@ -1153,8 +1145,8 @@ void QLowEnergyController::disconnectFromDevice()
emit stateChanged(UnconnectedState);
}
} else {
- qCCritical(QT_BT_OSX) << Q_FUNC_INFO << "qt LE queue is nil,"
- << "can not dispatch 'disconnect'";
+ qCCritical(QT_BT_OSX) << "qt LE queue is nil, "
+ "can not dispatch 'disconnect'";
}
}
}
@@ -1162,8 +1154,7 @@ void QLowEnergyController::disconnectFromDevice()
void QLowEnergyController::discoverServices()
{
if (role() == PeripheralRole) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO
- << "invalid role (peripheral)";
+ qCWarning(QT_BT_OSX) << "invalid role (peripheral)";
return;
}
@@ -1221,8 +1212,7 @@ void QLowEnergyController::startAdvertising(const QLowEnergyAdvertisingParameter
Q_UNUSED(params)
Q_UNUSED(advertisingData)
Q_UNUSED(scanResponseData)
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO
- << "advertising is not supported on your platform";
+ qCWarning(QT_BT_OSX) << "advertising is not supported on your platform";
#else
OSX_D_PTR;
@@ -1230,18 +1220,18 @@ void QLowEnergyController::startAdvertising(const QLowEnergyAdvertisingParameter
return osx_d_ptr->_q_CBManagerError(UnknownError);
if (role() != PeripheralRole) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "invalid role";
+ qCWarning(QT_BT_OSX) << "invalid role";
return;
}
if (state() != UnconnectedState) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "invalid state" << state();
+ qCWarning(QT_BT_OSX) << "invalid state" << state();
return;
}
auto leQueue(OSXBluetooth::qt_LE_queue());
if (!leQueue) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "no LE queue found";
+ qCWarning(QT_BT_OSX) << "no LE queue found";
osx_d_ptr->setErrorDescription(QLowEnergyController::UnknownError);
return;
}
@@ -1263,8 +1253,7 @@ void QLowEnergyController::startAdvertising(const QLowEnergyAdvertisingParameter
void QLowEnergyController::stopAdvertising()
{
#ifdef Q_OS_TVOS
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO
- << "advertising is not supported on your platform";
+ qCWarning(QT_BT_OSX) << "advertising is not supported on your platform";
#else
OSX_D_PTR;
@@ -1272,7 +1261,7 @@ void QLowEnergyController::stopAdvertising()
return osx_d_ptr->_q_CBManagerError(UnknownError);
if (state() != AdvertisingState) {
- qCDebug(QT_BT_OSX) << Q_FUNC_INFO << "called in state" << state();
+ qCDebug(QT_BT_OSX) << "called in state" << state();
return;
}
@@ -1285,7 +1274,7 @@ void QLowEnergyController::stopAdvertising()
osx_d_ptr->controllerState = UnconnectedState;
emit stateChanged(UnconnectedState);
} else {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "no LE queue found";
+ qCWarning(QT_BT_OSX) << "no LE queue found";
osx_d_ptr->setErrorDescription(QLowEnergyController::UnknownError);
return;
}
@@ -1298,8 +1287,7 @@ QLowEnergyService *QLowEnergyController::addService(const QLowEnergyServiceData
#ifdef Q_OS_TVOS
Q_UNUSED(data)
Q_UNUSED(parent)
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO
- << "peripheral role is not supported on your platform";
+ qCWarning(QT_BT_OSX) << "peripheral role is not supported on your platform";
#else
OSX_D_PTR;
@@ -1309,17 +1297,17 @@ QLowEnergyService *QLowEnergyController::addService(const QLowEnergyServiceData
}
if (role() != PeripheralRole) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "not in peripheral role";
+ qCWarning(QT_BT_OSX) << "not in peripheral role";
return nullptr;
}
if (state() != UnconnectedState) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "invalid state";
+ qCWarning(QT_BT_OSX) << "invalid state";
return nullptr;
}
if (!data.isValid()) {
- qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "invalid service";
+ qCWarning(QT_BT_OSX) << "invalid service";
return nullptr;
}