Class RfcommConnection
java.lang.Object
com.codename1.bluetooth.classic.RfcommConnection
An open RFCOMM (Serial Port Profile style) stream connection to a
classic Bluetooth device, obtained via BluetoothClassic.connect(BluetoothDevice, BluetoothUuid, boolean) or
accepted from an RfcommServer.
The streams block and must be consumed off the EDT; reads/writes
throw plain java.io.IOException on transport failure. Always
close() the connection when done.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRfcommConnection(BluetoothDevice device) Constructed by ports; not application API. -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclose()Closes the connection and both streams.The remote device of this connection.abstract InputStreamThe blocking input stream; consume off the EDT.abstract OutputStreamThe blocking output stream; use off the EDT.abstract booleanisOpen()truewhile the connection is open.
-
Constructor Details
-
RfcommConnection
Constructed by ports; not application API.
-
-
Method Details
-
getInputStream
The blocking input stream; consume off the EDT.- Throws:
IOException
-
getOutputStream
The blocking output stream; use off the EDT.- Throws:
IOException
-
close
Closes the connection and both streams.- Throws:
IOException
-
isOpen
public abstract boolean isOpen()truewhile the connection is open. -
getDevice
The remote device of this connection.
-