aboutsummaryrefslogtreecommitdiffhomepage
path: root/IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth_Compat.m
diff options
context:
space:
mode:
Diffstat (limited to 'IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth_Compat.m')
-rw-r--r--IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth_Compat.m102
1 files changed, 102 insertions, 0 deletions
diff --git a/IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth_Compat.m b/IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth_Compat.m
new file mode 100644
index 0000000..6398917
--- /dev/null
+++ b/IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth_Compat.m
@@ -0,0 +1,102 @@
+//
+// IOBluetooth_Compat.m
+// IOBluetooth-Compat
+//
+// Created by TCMac on 15/11/2013.
+// Original Header is (c) Apple Inc.
+// Copyright (c) 2013 TC Wan
+//
+
+#import "IOBluetooth_Compat.h"
+
+@implementation IOBluetooth_Compat
+
+
+/*!
+ @function IOBluetoothSDPServiceRecordGetRFCOMMChannelID
+ @abstract Allows the discovery of the RFCOMM channel ID assigned to the service.
+ @discussion This function will search through the ProtoclDescriptorList attribute to find an entry
+ with the RFCOMM UUID (UUID16: 0x0003). If one is found, it gets the second element of
+ the data element sequence and sets the rfcommChannelID pointer to it. The channel ID
+ only gets set when kIOReturnSuccess is returned.
+ @param serviceRecord The target IOBluetoothSDPServiceRecordRef
+ @param rfcommChannelID A pointer to the location that will get the found RFCOMM channel ID.
+ @result Returns kIOReturnSuccess if the channel ID is found.
+ */
+
+IOReturn IOBluetoothSDPServiceRecordGetRFCOMMChannelID(IOBluetoothSDPServiceRecordRef serviceRecord, BluetoothRFCOMMChannelID *channelID)
+{
+ return kIOReturnError;
+}
+
+/*! @function IOBluetoothRFCOMMChannelGetMTU
+ @abstract
+ @param rfcommChannel (IOBluetoothRFCOMMChannelRef) The channel reference
+ @result Channel MTU size.
+ @discussion Returns the length of the largest chunk of data that this channel can carry. If the
+ caller wishes to use the write:length:sleep: api the length of the data can not be bigger than
+ the channel MTU (maximum transfer unit).
+ */
+
+BluetoothRFCOMMMTU IOBluetoothRFCOMMChannelGetMTU( IOBluetoothRFCOMMChannelRef rfcommChannel ) {
+ return 0;
+}
+
+/*! @function IOBluetoothRFCOMMChannelCloseChannel
+ @param rfcommChannel (IOBluetoothRFCOMMChannelRef) The channel reference
+ @result An error code value. 0 if successful.
+ @discussion
+ */
+
+IOReturn IOBluetoothRFCOMMChannelCloseChannel(IOBluetoothRFCOMMChannelRef rfcommChannel)
+{
+ return kIOReturnError;
+}
+
+/*! @function IOBluetoothRFCOMMChannelWriteAsync
+ @abstract Write data to a RFCOMM channel asynchronously.
+ @param rfcommChannel (IOBluetoothRFCOMMChannelRef) The channel reference
+ @param data is a pointer to the data buffer to be sent.
+ @param length the length of the buffer to be sent (in bytes).
+ @param refcon a NON NULL value that will be contained in the return event (once the data is sent).
+ @result An error code value. 0 if successful.
+ @discussion Sends data tough the channel. The number of bytes to be sent must not exceed the channel MTU.
+ If the return value is an error condition none of the data was sent.
+
+ NOTE: This function is only available in Mac OS X 10.2.5 (Bluetooth v1.2) or later.
+ */
+
+IOReturn IOBluetoothRFCOMMChannelWriteAsync(IOBluetoothRFCOMMChannelRef rfcommChannel, void *data, UInt16 length, void *refcon)
+{
+ return kIOReturnError;
+}
+
+/*!
+ @function IOBluetoothDeviceOpenRFCOMMChannelAsync
+ @abstract Opens a new RFCOMM channel to the target device. Returns immedialty after starting the opening process.
+ @discussion This function will begin the process of opening a new RFCOMM channel to the target device.
+ The baseband connection to the device will be opened if it is not open already. The RFCOMM
+ channel open process will not complete until the client has registered an incoming data
+ listener on the new channel.
+
+ Because a new IOBluetoothL2CAPChannelRef will be created for the client as a result of this
+ function, the client is responsible for releasing the resulting IOBluetoothL2CAPChannelRef
+ (by calling IOBluetoothObjectRelease()).
+
+ NOTE: This function is only available in Mac OS X 10.2.5 (Bluetooth v1.2) or later.
+ @param btDevice The target IOBluetoothDeviceRef
+ @param rfcommChannel A pointer to an IOBluetoothRFCOMMChannelRef to receive the RFCOMM channel
+ requested to be opened. The rfcommChannel pointer will only be set if
+ kIOReturnSuccess is returned.
+ @param channelID The RFCOMM channel ID for the new channel.
+ @param withEventListener a IOBluetoothRFCOMMChannelIncomingEventListener where to receive events
+ regarding the channel (MUST be specified).
+ @param refCon a refcon pointer (for the callback specified above).
+ @result Returns kIOReturnSuccess if the open process was successfully started .
+ */
+
+IOReturn IOBluetoothDeviceOpenRFCOMMChannelAsync(IOBluetoothDeviceRef btDevice, IOBluetoothRFCOMMChannelRef *newChannel, BluetoothRFCOMMChannelID channelID, IOBluetoothRFCOMMChannelIncomingEventListener eventListener, void *refcon) {
+ return kIOReturnError;
+}
+
+@end