Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
btl2capchannel_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef BTL2CAPCHANNEL_P_H
5#define BTL2CAPCHANNEL_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/private/qcore_mac_p.h>
19#include <QtCore/private/qglobal_p.h>
20
21#include <Foundation/Foundation.h>
22
23#include <IOBluetooth/IOBluetooth.h>
24
25#include <cstddef>
26
27QT_BEGIN_NAMESPACE
28
29class QBluetoothAddress;
30
31namespace DarwinBluetooth {
32
33class ChannelDelegate;
34
35}
36
37QT_END_NAMESPACE
38
39@interface QT_MANGLE_NAMESPACE(DarwinBTL2CAPChannel) : NSObject<IOBluetoothL2CAPChannelDelegate>
40
41- (id)initWithDelegate:(QT_PREPEND_NAMESPACE(DarwinBluetooth)::ChannelDelegate *)aDelegate;
42- (id)initWithDelegate:(QT_PREPEND_NAMESPACE(DarwinBluetooth)::ChannelDelegate *)aDelegate
43 channel:(IOBluetoothL2CAPChannel *)aChannel;
44
45- (void)dealloc;
46
47// Async. connection (connect can be called only once).
48- (IOReturn)connectAsyncToDevice:(const QT_PREPEND_NAMESPACE(QBluetoothAddress) &)address
49 withPSM:(BluetoothL2CAPChannelID)psm;
50
51// IOBluetoothL2CAPChannelDelegate:
52- (void)l2capChannelData:(IOBluetoothL2CAPChannel*)l2capChannel
53 data:(void *)dataPointer length:(size_t)dataLength;
54- (void)l2capChannelOpenComplete:(IOBluetoothL2CAPChannel*)
55 l2capChannel status:(IOReturn)error;
56- (void)l2capChannelClosed:(IOBluetoothL2CAPChannel*)l2capChannel;
57- (void)l2capChannelReconfigured:(IOBluetoothL2CAPChannel*)l2capChannel;
58- (void)l2capChannelWriteComplete:(IOBluetoothL2CAPChannel*)l2capChannel
59 refcon:(void*)refcon status:(IOReturn)error;
60- (void)l2capChannelQueueSpaceAvailable:(IOBluetoothL2CAPChannel*)l2capChannel;
61
62//
63- (BluetoothL2CAPPSM)getPSM;
64- (BluetoothDeviceAddress)peerAddress;
65- (NSString *)peerName;
66- (bool)isConnected;
67
68// Writes the given data synchronously over the target L2CAP channel to the remote
69// device.
70// The length of the data may not exceed the L2CAP channel's outgoing MTU.
71// This method will block until the data has been successfully sent to the
72// hardware for transmission (or an error occurs).
73- (IOReturn) writeSync:(void*)data length:(UInt16)length;
74
75// The length of the data may not exceed the L2CAP channel's outgoing MTU.
76// When the data has been successfully passed to the hardware to be transmitted,
77// the delegate method -l2capChannelWriteComplete:refcon:status: will be called.
78// Returns kIOReturnSuccess if the data was buffered successfully.
79- (IOReturn) writeAsync:(void*)data length:(UInt16)length;
80
81@end
82
83QT_NAMESPACE_ALIAS_OBJC_CLASS(DarwinBTL2CAPChannel);
84
85#endif
#define QT_BT_MAC_AUTORELEASEPOOL
Definition btutility_p.h:78
Q_FORWARD_DECLARE_OBJC_CLASS(NSString)