summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/osx/osxbtsdpinquiry_p.h
diff options
context:
space:
mode:
authorTimur Pocheptsov <Timur.Pocheptsov@digia.com>2014-09-04 10:23:05 +0200
committerTimur Pocheptsov <Timur.Pocheptsov@digia.com>2014-09-16 15:27:09 +0200
commitdc34c7aae7d4d641f4d06990141c7915542363ee (patch)
treec0245f807242b904ba44f5268d3551938cb4e5f8 /src/bluetooth/osx/osxbtsdpinquiry_p.h
parent982eeb3547f85dc76e5864559ee56db74a7dd86f (diff)
Port QBluetoothServiceInfo and QBluetoothServiceDiscoveryAgent to OS X.
QBluetoothServiceInfo and QBluetoothServiceDiscoveryAgent - version for OS X (IOBluetooth-based). Update 0: initial dummy version + mods to enable this new classes to be built with qtconnectivity. Update 1: SDP query + initial implementation of a services discovery agent. Update 2: aux functions to "parse" a service records once I got it. Update 3: extract services UUIDs on a discovered device, if any. Update 4: refactor Update 5: "fix" asserts Update 6: more asserts fixed. Update 7: add the ability to stop SDP query (to be tested!!!) Update 8: mods as suggested in review. Update 9: no reason to check the size of discoveredDevices after 'clear' call. Update 10: set an error and error description only if it's a 'singleDevice'. Update 11: fix private header (_p suffix). Update 12: on 10.7 (with quite old clang) there is no 'subscript operator' syntax for NSDictionary. Change-Id: Ib3b07b49e3ed6381af75fb8b1e29cdf1e7a11237 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/bluetooth/osx/osxbtsdpinquiry_p.h')
-rw-r--r--src/bluetooth/osx/osxbtsdpinquiry_p.h103
1 files changed, 103 insertions, 0 deletions
diff --git a/src/bluetooth/osx/osxbtsdpinquiry_p.h b/src/bluetooth/osx/osxbtsdpinquiry_p.h
new file mode 100644
index 00000000..b96de620
--- /dev/null
+++ b/src/bluetooth/osx/osxbtsdpinquiry_p.h
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtBluetooth module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef OSXBTSDPINQUIRY_H
+#define OSXBTSDPINQUIRY_H
+
+#include "qbluetoothaddress.h"
+#include "qbluetoothuuid.h"
+
+#include <QtCore/qglobal.h>
+#include <QtCore/qlist.h>
+
+#include <Foundation/Foundation.h>
+
+@class QT_MANGLE_NAMESPACE(OSXBTSDPInquiry);
+@class IOBluetoothSDPServiceRecord;
+@class IOBluetoothSDPDataElement;
+@class IOBluetoothDevice;
+
+QT_BEGIN_NAMESPACE
+
+class QBluetoothServiceInfo;
+class QVariant;
+
+namespace OSXBluetooth {
+
+class SDPInquiryDelegate {
+public:
+ typedef QT_MANGLE_NAMESPACE(OSXBTSDPInquiry) ObjCServiceInquiry;
+
+ virtual ~SDPInquiryDelegate();
+
+ virtual void SDPInquiryFinished(IOBluetoothDevice *device) = 0;
+ virtual void SDPInquiryError(IOBluetoothDevice *device, IOReturn errorCode) = 0;
+};
+
+void extract_service_record(IOBluetoothSDPServiceRecord *record, QBluetoothServiceInfo &serviceInfo);
+QVariant extract_attribute_value(IOBluetoothSDPDataElement *dataElement);
+QList<QBluetoothUuid> extract_services_uuids(IOBluetoothDevice *device);
+
+}
+
+QT_END_NAMESPACE
+
+@interface QT_MANGLE_NAMESPACE(OSXBTSDPInquiry) : NSObject
+{
+ QT_PREPEND_NAMESPACE(OSXBluetooth::SDPInquiryDelegate) *delegate;
+ IOBluetoothDevice *device;
+ bool isActive;
+}
+
+- (id)initWithDelegate:(QT_PREPEND_NAMESPACE(OSXBluetooth::SDPInquiryDelegate) *)aDelegate;
+- (void)dealloc;
+
+- (IOReturn)performSDPQueryWithDevice:(const QBluetoothAddress &)address;
+- (IOReturn)performSDPQueryWithDevice:(const QBluetoothAddress &)address
+ filters:(const QList<QBluetoothUuid> &)filters;
+
+- (void)stopSDPQuery;
+
+- (void)sdpQueryComplete:(IOBluetoothDevice *)aDevice status:(IOReturn)status;
+
+@end
+
+#endif