Platforms to show: All Mac Windows Linux Cross-Platform
Back to IOBluetoothRFCOMMChannelMBS class.
IOBluetoothRFCOMMChannelMBS.closeChannel
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Bluetooth | MBS Bluetooth Plugin | 18.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Lasterror is set to error code value. 0 if successful.
IOBluetoothRFCOMMChannelMBS.Constructor
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Bluetooth | MBS Bluetooth Plugin | 18.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
IOBluetoothRFCOMMChannelMBS.Destructor
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Bluetooth | MBS Bluetooth Plugin | 18.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
IOBluetoothRFCOMMChannelMBS.openRFCOMMChannelAsync(device as IOBluetoothDeviceMBS, channelID as Integer) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Bluetooth | MBS Bluetooth Plugin | 18.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
channelID: The RFCOMM channel ID for the new channel.
Lasterror is set tokIOReturnSuccess if the open process was successfully started (or if an existing RFCOMM channel was found). The channel must be released when the caller is done with it.
This method 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. The RFCOMM channel object is already retained when this function returns success; the channel must be released when the caller is done with it.
You should verify that the channel you wish to open exists on the remote device before attempting to open it, by performing an SDP query. This is recommended because the service might have been removed from the, remote device or the channel assignments for the service could have changed (this is rare, but it does happen frequently on some devices). This also works around a bug that existed in early Leopard versions in certain situations where the method would return an error; in these instances, the desired RFCOMM channel could not be opened again until the calling app was restarted.
NOTE: This method is only available in macOS 10.2.5 (Bluetooth v1.2) or later.
Some examples using this method:
IOBluetoothRFCOMMChannelMBS.openRFCOMMChannelSync(device as IOBluetoothDeviceMBS, channelID as Integer) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Bluetooth | MBS Bluetooth Plugin | 18.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns only once the channel is open or failed to open.
channelID: The RFCOMM channel ID for the new channel.
Returns kIOReturnSuccess if the open process was successfully started (or if an existing RFCOMM channel was found). The channel must be released when the caller is done with it.
This method 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. The RFCOMM channel object is already retained when this function returns success; the channel must be released when the caller is done with it.
You should verify that the channel you wish to open exists on the remote device before attempting to open it, by performing an SDP query. This is recommended because the service might have been removed from the, remote device or the channel assignments for the service could have changed (this is rare, but it does happen frequently on some devices). This also works around a bug that existed in early Leopard versions in certain situations where the method would return an error; in these instances, the desired RFCOMM channel could not be opened again until the calling app was restarted.
NOTE: This method is only available in macOS 10.2.5 (Bluetooth v1.2) or later.
IOBluetoothRFCOMMChannelMBS.sendRemoteLineStatus(lineStatus as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Bluetooth | MBS Bluetooth Plugin | 18.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
lineStatus: the error type. The error code can be NoError, OverrunError, ParityError or FramingError.
Lasterror is set to an error code value. 0 if successful.
IOBluetoothRFCOMMChannelMBS.setSerialParameters(speed as Integer, dataBits as Integer, parity as Integer, stopBits as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Bluetooth | MBS Bluetooth Plugin | 18.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
speed: the baudrate.
nBits: number of data bits.
parity: the type of parity can be NoParity, OddParity, EvenParity or MaxParity.
bitStop: number of stop bits.
See kParityType* constants.
Lasterror is set to error code value. 0 if successful.
IOBluetoothRFCOMMChannelMBS.writeAsync(data as MemoryBlock, tag as Variant = nil)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Bluetooth | MBS Bluetooth Plugin | 18.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
data: The data buffer to be sent.
Lasterror is set to kIOReturnSuccess if the data was buffered successfully.
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. Once the data has been successfully passed to the hardware to be transmitted, the WriteCompleted event will be called with the tag that was passed to this method.
NOTE: This method is only available in macOS 10.2.5 (Bluetooth v1.2) or later.
Some examples using this method:
IOBluetoothRFCOMMChannelMBS.writeSync(data as MemoryBlock)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Bluetooth | MBS Bluetooth Plugin | 18.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
data The data buffer to be sent.
Lasterror is set to kIOReturnSuccess if the data was written successfully.
Sends data through 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. This method will block until the data has been successfully sent to the hardware for transmission (or until an error occurs).
NOTE: This method is only available in macOS 10.2.5 (Bluetooth v1.2) or later.
The items on this page are in the following plugins: MBS Bluetooth Plugin.
