Package org.javabluetooth.stack

Examples of org.javabluetooth.stack.BluetoothStack.connectL2CAPChannel()


    public boolean populateRecord(int[] attrIDs) throws IOException {
        BluetoothStack bluetooth;
        try {
            bluetooth = BluetoothStack.getBluetoothStack();
            SDPClientChannel sdpChannel = new SDPClientChannel(remoteDevice, null);
            bluetooth.connectL2CAPChannel(sdpChannel, remoteDevice, (short)0x0001);
            //TODO fill propper attrIDs this ignores the parameter and gets all available
            byte[] attributeList = { 0x35, 0x05, 0x0a, 0x00, 0x00, (byte)0xff, (byte)0xff };
            DataElement attributeListElement = new DataElement(attributeList);
            isPopulated = false;
            sdpChannel.send_SDP_ServiceAttributeRequest((short)0x00, (short)0xff, serviceRecordHandle, attributeListElement);
View Full Code Here


            //System.out.println("Name:"+remoteDevice.getFriendlyName(false));
            //System.out.println("major dev class :"+remoteDevice.deviceClass.getMajorDeviceClass());
            //System.out.println("minor dev class :"+remoteDevice.deviceClass.getMinorDeviceClass());
            //System.out.println("service classes :"+remoteDevice.deviceClass.getServiceClasses());
            SDPClientChannel sdpChannel = new SDPClientChannel(remoteDevice, blue);
            bluetooth.connectL2CAPChannel(sdpChannel, remoteDevice, (short)0x0001);
            byte[] uuidList = { 0x35, 0x03, 0x19, 0x10, 0x02 };
            DataElement uuidListElement = new DataElement(uuidList);
            sdpChannel.send_SDP_ServiceSearchRequest((short)1, (short)14, uuidListElement);
        }
        while (serviceRecords == null) { Thread.sleep(1000); }
View Full Code Here

                LocalDevice localDev      = LocalDevice.getLocalDevice();
                DiscoveryAgent discovery  = localDev.getDiscoveryAgent();
                RemoteDevice remoteDevice = discovery.getRemoteDevice(remoteAddrLong);
                if (remoteDevice != null) {
                    JSR82Channel channel = new JSR82Channel();
                    bluetooth.connectL2CAPChannel(channel, remoteDevice, psm);
                    return channel;
                }
                else throw new IllegalArgumentException("Unable to locate Bluetooth Device.");
            }
        }
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.