Examples of DataElement


Examples of javax.bluetooth.DataElement

        catch (BluetoothStateException e) {
            e.printStackTrace();
            return null;
        }
        String url = "btl2cap://" + localDev.getBluetoothAddress() + ":";
        DataElement protocolDescriptorListElement = (DataElement)attributes.get(new Integer(4));
        if (protocolDescriptorListElement == null)
            throw new IllegalArgumentException("Service Record is not propperly populated. Protocol Descriptor is missing.");
        Enumeration protocolDescriptorList = (Enumeration)protocolDescriptorListElement.getValue();
        while (protocolDescriptorList.hasMoreElements()) {
            DataElement protocolDescriptorElement = (DataElement)protocolDescriptorList.nextElement();
            if (protocolDescriptorElement == null)
                throw new IllegalArgumentException("Service Record is not propperly populated. Protocol Descriptor is missing.");
            Enumeration protocolParameterList = (Enumeration)protocolDescriptorElement.getValue();
            if (protocolParameterList.hasMoreElements()) {
                DataElement protocolDescriptor = (DataElement)protocolParameterList.nextElement();
                if (protocolDescriptor != null) {
                    if (protocolDescriptor.getDataType() == DataElement.UUID) {
                        UUID protocolDescriptorUUID = (UUID)protocolDescriptor.getValue();
                        if (protocolDescriptorUUID.toLong() == 0x0100) //is L2CAP
                        {
                            if (protocolParameterList.hasMoreElements()) {
                                DataElement protocolPSMElement = (DataElement)protocolParameterList.nextElement();
                                {
                                    if (protocolPSMElement != null) {
                                        if (protocolPSMElement.getDataType() == DataElement.UUID) {
                                            UUID psm = (UUID)protocolPSMElement.getValue();
                                            url += psm.toString() + ";";
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                        else //is not L2CAP
                        {
                            url += protocolDescriptorUUID.toString() + ";";
                            while (protocolParameterList.hasMoreElements()) {
                                DataElement parameter = (DataElement)protocolParameterList.nextElement();
                                url += parameter.toString() + ";";
                            }
                            break;
                        }
                    }
                }
View Full Code Here

Examples of javax.bluetooth.DataElement

        attributes.put(new Integer(attrID), attrValue);
        return true;
    }

    public byte[] toByteArray() {
        DataElement resultAttributes = new DataElement(DataElement.DATSEQ);
        Enumeration keys = attributes.keys();
        while (keys.hasMoreElements()) {
            Integer key = (Integer)keys.nextElement();
            DataElement value = (DataElement)attributes.get(key);
            resultAttributes.addElement(new DataElement(DataElement.U_INT_2, key.intValue()));
            resultAttributes.addElement(value);
        }
        return resultAttributes.toByteArray();
    }
View Full Code Here

Examples of javax.bluetooth.DataElement

            //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]);
View Full Code Here

Examples of javax.bluetooth.DataElement

        BluetoothStack.init(new BluetoothTCPClient("192.168.10.2", 2600));
        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

Examples of javax.bluetooth.DataElement

        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

Examples of javax.bluetooth.DataElement

        this.record = record;
    }

    public void mouseEntered(MouseEvent e) {
        bluetoothBrowser.mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        DataElement connectionInfo = record.getAttributeValue(4);
        if (connectionInfo != null) { bluetoothBrowser.statusLabel.setText(connectionInfo.toString()); }
    }
View Full Code Here

Examples of javax.bluetooth.DataElement

        top.removeAll();
        for (int i = 0; i < services.size(); i++) {
            ServiceRecord record = (ServiceRecord)services.get(i);
            JLabel devLabel = new JLabel(serviceIcon);
            devLabel.addMouseListener(new ServiceRecordMouseListener(devLabel, this, record));
            DataElement nameElement = record.getAttributeValue(256);
            if (nameElement != null) {
                String serviceName = (String)nameElement.getValue();
                devLabel.setText(serviceName);
            }
            top.add(devLabel);
        }
        top.revalidate();
View Full Code Here

Examples of org.jitterbit.integration.debug.client.de.DataElement

            public boolean isCellEditable(int row, int column) {
                TableColumnMetaData md = tableModel.getColumnDescriptor(column);
                if (md == DataElementTableModel.NAME) {
                    return false;
                }
                DataElement de = tableModel.getRowObjectAt(row);
                return de.getScope() == DataElementScope.GLOBAL || sourceDataElementValuesEditable;
            }
        };
        table.setAutoCreateRowSorter(true);
        TableStyles.wide().makeOver(table);
        table.setShowVerticalLines(true);
View Full Code Here

Examples of org.jitterbit.integration.debug.client.de.DataElement

    private void ensureDataElementValueIsNotNull(int row) {
        String deValue = (String) getValueAt(row, VALUE);
        if (deValue == null) {
            deValue = "";
        }
        DataElement de = getRowObjectAt(row);
        de.setValue(deValue);
    }
View Full Code Here

Examples of org.jitterbit.integration.debug.client.de.DataElement

            globalDataElementStore.updateReferences(source, deRefs);
        }

        private void updateScriptModelWithGlobalDataElements(Set<DataElementReference> deRefs) {
            for (DataElementReference r : deRefs) {
                DataElement de = dataElementFactory.create(r.getDataElement(), DataElementScope.GLOBAL);
                if (de != null) {
                    dataElements.add(de);
                }
            }
        }
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.