Examples of connectL2CAPChannel()


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

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

            //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

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

                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

Examples of org.javabluetooth.stack.l2cap.L2CAPLink.connectL2CAPChannel()

    /** @see org.javabluetooth.stack.BluetoothStack#open_L2CAPChannel(long, short) */
    public void connectL2CAPChannel(L2CAPChannel channel, RemoteDevice remoteDevice, short psm) throws HCIException {
        L2CAPLink link = hciTransport.getL2CAPLink(remoteDevice.bdAddrLong, remoteDevice.pageScanRepMode,
            remoteDevice.pageScanMode, remoteDevice.clockOffset);
        link.connectL2CAPChannel(channel, psm);
    }

    /**
     * @see org.javabluetooth.stack.BluetoothStack#openL2CAPService(org.javabluetooth.stack.l2cap.L2CAPChannel, short,
     * short, byte[])
View Full Code Here

Examples of org.javabluetooth.stack.l2cap.L2CAPLink.connectL2CAPChannel()

        BluetoothTCPChannel l2capChannel = new BluetoothTCPChannel(this, channelHandel);
        if (channels[channelHandel] != null) channels[channelHandel].close();
        channels[channelHandel] = l2capChannel;
        try {
            L2CAPLink link = hciTransport.getL2CAPLink(remoteAddress, pageScanRepMode, pageScanMode, clockOffset);
            link.connectL2CAPChannel(l2capChannel, psm);
        }
        catch (HCIException e) {
            l2capChannel.channelState = L2CAPChannel.FAILED;
            System.err.println("BluetoothTCPServerThread: Failed to Connect L2CAP Channel. " + e);
        }
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.