Package org.javabluetooth.stack.sdp

Examples of org.javabluetooth.stack.sdp.SDPClientChannel


        if (remoteDevice != null) { //System.out.println("bdAddr:"+remoteDevice.getBluetoothAddress());
            //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); }
        for (int i = 0; i < serviceRecords.length; i++) {
            System.out.println("  " + serviceRecords[i]);
            int[] attrIDs = { 0xff00 }; //reversed the values for range... this avoids ranges starting with 00 to be tructated.
View Full Code Here


        HCIDriver.init(new UARTTransport("serial0"));
        BluetoothStack.init(new BluetoothStackLocal());
        BluetoothLocalStack blue = new BluetoothLocalStack();
        while (remoteDevice == null) { Thread.sleep(1000); }
        System.out.println("Remote Name is " + remoteDevice.getFriendlyName(false));
        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 (true) { Thread.sleep(600); }
    }
View Full Code Here

            DataElement uuidListElement = new DataElement(DataElement.DATSEQ);
            for (int i = 0; i < uuidSet.length; i++) uuidListElement.addElement(new DataElement(DataElement.UUID, uuidSet[i]));
            DataElement attributeListElement = new DataElement(DataElement.DATSEQ);
            for (int i = 0; i < attrSet.length; i++)
                attributeListElement.addElement(new DataElement(DataElement.U_INT_2, attrSet[i]));
            SDPClientChannel sdpChannel = new SDPClientChannel(btDev, discListener);
            try {
                bluetoothStack.connectL2CAPChannel(sdpChannel, btDev, (short)0x0001);
                sdpChannel.send_SDP_ServiceSearchAttributeRequest((short)transID, (short)0xffff, uuidListElement,
                    attributeListElement);
            }
            catch (HCIException e) { throw new BluetoothStateException(e.toString()); }
            catch (IOException e) { throw new BluetoothStateException(e.toString()); }
            return transID;
View Full Code Here

TOP

Related Classes of org.javabluetooth.stack.sdp.SDPClientChannel

Copyright © 2018 www.massapicom. 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.