34 channel:(IOBluetoothRFCOMMChannel *)aChannel
41 if (self = [super
init]) {
44 [channel setDelegate:self];
45 device = [[channel getDevice] retain];
55 [channel setDelegate:nil];
56 [channel closeChannel];
67 withChannelID:(BluetoothRFCOMMChannelID)channelID
70 qCCritical(QT_BT_DARWIN) <<
"invalid peer address";
71 return kIOReturnNoDevice;
76 qCCritical(QT_BT_DARWIN) <<
"connection is already active";
77 return kIOReturnStillOpen;
83 device = [IOBluetoothDevice deviceWithAddress:&iobtAddress];
85 qCCritical(QT_BT_DARWIN) <<
"failed to create a device";
86 return kIOReturnNoDevice;
89 const IOReturn status = [device openRFCOMMChannelAsync:&channel
90 withChannelID:channelID delegate:self];
91 if (status != kIOReturnSuccess) {
92 qCCritical(QT_BT_DARWIN) <<
"failed to open L2CAP channel";
101 return kIOReturnSuccess;
104- (
void)rfcommChannelData:(IOBluetoothRFCOMMChannel*)rfcommChannel
105 data:(
void *)dataPointer length:(
size_t)dataLength
113 if (!dataPointer || !dataLength)
116 delegate->readChannelData(dataPointer, dataLength);
119- (
void)rfcommChannelOpenComplete:(IOBluetoothRFCOMMChannel*)rfcommChannel
120 status:(IOReturn)error
126 if (
error != kIOReturnSuccess) {
127 delegate->setChannelError(
error);
130 delegate->channelOpenComplete();
134- (
void)rfcommChannelClosed:(IOBluetoothRFCOMMChannel*)rfcommChannel
139 delegate->channelClosed();
143- (
void)rfcommChannelControlSignalsChanged:(IOBluetoothRFCOMMChannel*)rfcommChannel
148- (
void)rfcommChannelFlowControlChanged:(IOBluetoothRFCOMMChannel*)rfcommChannel
153- (
void)rfcommChannelWriteComplete:(IOBluetoothRFCOMMChannel*)rfcommChannel
154 refcon:(
void*)refcon status:(IOReturn)error
161 if (
error != kIOReturnSuccess)
162 delegate->setChannelError(
error);
164 delegate->writeComplete();
167- (
void)rfcommChannelQueueSpaceAvailable:(IOBluetoothRFCOMMChannel*)rfcommChannel
172- (BluetoothRFCOMMChannelID)getChannelID
175 return [channel getChannelID];
180- (BluetoothDeviceAddress)peerAddress
182 const BluetoothDeviceAddress *
const addr =
device ? [device getAddress]
187 return BluetoothDeviceAddress();
190- (NSString *)peerName
198- (BluetoothRFCOMMMTU)getMTU
201 return [channel getMTU];
206- (IOReturn) writeSync:(
void*)data length:(UInt16)length
212 return [channel writeSync:data length:length];
215- (IOReturn) writeAsync:(
void*)data length:(UInt16)length
221 return [channel writeAsync:data length:length refcon:nullptr];
IOBluetoothL2CAPChannel * channel
IOBluetoothDevice * device
IOBluetoothRFCOMMChannel * channel
IOBluetoothDevice * device
#define QT_BT_MAC_AUTORELEASEPOOL
BluetoothDeviceAddress iobluetooth_address(const QBluetoothAddress &qAddress)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
DBusConnection const char DBusError * error
#define qCCritical(category,...)
GLenum GLuint GLenum GLsizei length
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint GLuint64EXT address
#define Q_ASSERT_X(cond, x, msg)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
QT_END_NAMESPACE typedef QT_PREPEND_NAMESPACE(quintptr) WId