Class L2capChannel
java.lang.Object
com.codename1.bluetooth.le.L2capChannel
An open L2CAP connection-oriented channel -- a raw bidirectional byte
stream to a peripheral, obtained via
BlePeripheral.openL2capChannel(int, boolean) on the central side or
accepted from an L2capServer on the peripheral side.
The streams block and must be consumed off the EDT; reads/writes
throw plain java.io.IOException on transport failure. Always
close() the channel when done.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedL2capChannel(int psm) Constructed by ports; not application API. -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclose()Closes the channel and both streams.abstract InputStreamThe blocking input stream of the channel; consume off the EDT.abstract OutputStreamThe blocking output stream of the channel; use off the EDT.intgetPsm()The Protocol/Service Multiplexer this channel is bound to.abstract booleanisOpen()truewhile the channel is open.
-
Constructor Details
-
L2capChannel
protected L2capChannel(int psm) Constructed by ports; not application API.
-
-
Method Details
-
getInputStream
The blocking input stream of the channel; consume off the EDT.- Throws:
IOException
-
getOutputStream
The blocking output stream of the channel; use off the EDT.- Throws:
IOException
-
close
Closes the channel and both streams.- Throws:
IOException
-
isOpen
public abstract boolean isOpen()truewhile the channel is open. -
getPsm
public int getPsm()The Protocol/Service Multiplexer this channel is bound to.
-