* @param psm
* @return
*/
public void connectL2CAPChannel(L2CAPChannel channel, short psm) throws HCIException {
try { send_L2CAP_Connection_Request(channel, psm); }
catch (IOException e) { throw new HCIException("L2CAPChannel Connection Request Failed."); }
int timeout = 0;
while (channel.channelState != L2CAPChannel.OPEN) {
try {
Thread.sleep(1000);
timeout++;
}
catch (InterruptedException e) { }
if (timeout > 50) throw new HCIException("L2CAPChannel Connection Request timed out.");
}
}