/** @param packet */
private void processL2CAP_Packet(byte[] packet) {
Debug.println(7, "BluetoothTCPServer: Received L2CAP Packet from BluetoothTCPClient.");
short channelHandel = (short)((((short)packet[3]) & 0xff) | (((short)packet[4]) & 0xff) << 8);
int length = ((packet[1] & 0xff) | (packet[2] & 0xff) << 8) - 2;
L2CAPChannel channel = channels[channelHandel];
if (channel != null) {
byte[] l2capPacket = new byte[length];
System.arraycopy(packet, 5, l2capPacket, 0, l2capPacket.length);
try { channel.sendL2CAPPacket(l2capPacket); }
catch (IOException e) { System.err.println("BluetoothTCPServerThread: Error while sending L2CAP Packet: " + e); }
}
}