dispatch l2cap and rfcomm packets in java client

This commit is contained in:
matthias.ringwald@gmail.com 2014-12-09 23:44:34 +00:00
parent 25bf58726a
commit 7c07076ad3

View File

@ -77,11 +77,20 @@ public class BTstackClient {
packetHandler.handlePacket(new BTstackEventDaemonDisconnect());
return;
}
if (packet.getPacketType() == Packet.HCI_EVENT_PACKET){
switch (packet.getPacketType()){
case Packet.HCI_EVENT_PACKET:
packetHandler.handlePacket(EventFactory.eventForPacket(packet));
continue;
}
break;
case Packet.L2CAP_DATA_PACKET:
packetHandler.handlePacket(new L2CAPDataPacket(packet));
break;
case Packet.RFCOMM_DATA_PACKET:
packetHandler.handlePacket(new RFCOMMDataPacket(packet));
break;
default:
packetHandler.handlePacket(packet);
break;
}
}
System.out.println("Rx Thread: Interrupted");
}