Package javax.bluetooth

Examples of javax.bluetooth.L2CAPConnectionNotifier.acceptAndOpen()


        LocalDevice localDev = LocalDevice.getLocalDevice();
        localDev.setDiscoverable(DiscoveryAgent.GIAC);
        L2CAPConnectionNotifier connNotifier = (L2CAPConnectionNotifier)Connector.open("btl2cap://localhost:3;");
        ServiceRecord serviceRecord = connNotifier.getRecord();
        serviceRecord.setAttributeValue(256, new DataElement(DataElement.STRING, "Tini Demo Service"));
        connNotifier.acceptAndOpen();
    }
}
View Full Code Here


                    // Open a connection and wait for client requests
                    final L2CAPConnectionNotifier service =
                            (L2CAPConnectionNotifier) Connector
                                    .open("btl2cap://localhost:" + uuid
                                            + ";name=" + SERVICE_NAME_L2CAP);
                    connection = service.acceptAndOpen();
                    updateStatus("[SERVER] L2CAP connection established");

                    // Read a message
                    final byte[] buffer = new byte[1024];
                    final int readBytes = connection.receive(buffer);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.