Package javax.bluetooth

Examples of javax.bluetooth.UUID


    try {
      DiscoveryAgent agent = LocalDevice.getLocalDevice()
          .getDiscoveryAgent();

      connectionString = agent.selectService(new UUID(
          MicrologConstants.DEFAULT_BT_UUID_STRING, false),
          ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false);
    } catch (BluetoothStateException bse) {
      System.err
          .println("Failed to connect to the Bluetooth log server. "
View Full Code Here


        if (!waitingForm.isShown()) {
            int selectedItem = discoveredList.getSelectedIndex();
            // i jesli wcisnieto select
            if (c.getCommandType() == Command.SCREEN) {
                // Tworzymy tablice UUID. Potrzebne do laczenia - info o usludze
                UUID[] uuids = new UUID[]{new UUID(serviceUUID, false)};
                try {
                    // Wyszukujemy uslug, dla urzadzenia ktore zostalo zaznaczone na liscie urzadzen.
                    discoveryAgent.searchServices(serviceAttributes, uuids, (RemoteDevice) discoveredDevices.elementAt(selectedItem), this);
                } catch (BluetoothStateException ex) {
                    System.out.println(ex.getMessage());
View Full Code Here

            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;
                                        }
                                    }
                                }
                            }
View Full Code Here

    public Vector getServiceRecordHandels(DataElement serviceSearchPattern) {
        Vector serviceRecordHandles = new Vector();
        Enumeration elements = (Enumeration)serviceSearchPattern.getValue();
        while (elements.hasMoreElements()) {
            DataElement element = (DataElement)elements.nextElement();
            UUID uuid = (UUID)element.getValue();
            System.out.println("getSRH for " + uuid);
            serviceRecordHandles = (Vector)uuidMap.get(uuid);
            break;
            //TODO this only takes the first UUID into consideration and not all like it's supposed to...
        }
View Full Code Here

            while (elements.hasMoreElements()) {
                DataElement element = (DataElement)elements.nextElement();
                serviceRecordElement.addElement(element);
            }
            serviceRecords.put(serviceHandle, serviceRecordElement.toByteArray());
            UUID serviceUUID = new UUID(serviceUUIDshort);
            Vector serviceHandleVector = (Vector)uuidMap.get(serviceUUID);
            if (serviceHandleVector == null) {
                serviceHandleVector = new Vector();
                uuidMap.put(serviceUUID, serviceHandleVector);
            }
            serviceHandleVector.addElement(serviceHandle);
            UUID browseUUID = new UUID(browseUUIDshort);
            Vector browseHandleVector = (Vector)uuidMap.get(browseUUID);
            if (browseHandleVector == null) {
                browseHandleVector = new Vector();
                uuidMap.put(browseUUID, browseHandleVector);
            }
View Full Code Here

    public Hashtable attributes;

    public SDPLocalServiceRecord(short serviceClassID) {
        this.attributes = new Hashtable();
        DataElement serviceClassIDList = new DataElement(DataElement.DATSEQ);
        UUID serviceClassUUID = new UUID(serviceClassID);
        serviceClassIDList.addElement(new DataElement(DataElement.UUID, new UUID(0x1111)));
        attributes.put(new Integer(1), serviceClassIDList);
        DataElement protocolDescriptorList = new DataElement(DataElement.DATSEQ);
        DataElement l2capDescriptor = new DataElement(DataElement.DATSEQ);
        l2capDescriptor.addElement(new DataElement(DataElement.UUID, new UUID(0x0100)));
        protocolDescriptorList.addElement(l2capDescriptor);
        DataElement rfcommDescriptor = new DataElement(DataElement.DATSEQ);
        rfcommDescriptor.addElement(new DataElement(DataElement.UUID, new UUID(0x0003)));
        rfcommDescriptor.addElement(new DataElement(DataElement.U_INT_1, 1));
        protocolDescriptorList.addElement(rfcommDescriptor);
        attributes.put(new Integer(4), protocolDescriptorList);
        DataElement browseClassIDList = new DataElement(DataElement.DATSEQ);
        UUID browseClassUUID = new UUID(0x1002);
        browseClassIDList.addElement(new DataElement(DataElement.UUID, browseClassUUID));
        attributes.put(new Integer(5), browseClassIDList);
        DataElement languageBaseAttributeIDList = new DataElement(DataElement.DATSEQ);
        languageBaseAttributeIDList.addElement(new DataElement(DataElement.U_INT_2, 25966));
        languageBaseAttributeIDList.addElement(new DataElement(DataElement.U_INT_2, 106));
        languageBaseAttributeIDList.addElement(new DataElement(DataElement.U_INT_2, 256));
        attributes.put(new Integer(6), languageBaseAttributeIDList);
        DataElement profileDescriptorList = new DataElement(DataElement.DATSEQ);
        DataElement profileDescriptor = new DataElement(DataElement.DATSEQ);
        profileDescriptor.addElement(new DataElement(DataElement.UUID, new UUID(0x1111)));
        profileDescriptor.addElement(new DataElement(DataElement.U_INT_2, 256));
        profileDescriptorList.addElement(profileDescriptor);
        attributes.put(new Integer(9), profileDescriptorList);
        attributes.put(new Integer(256), new DataElement(DataElement.STRING, "Tini Service"));
    }
View Full Code Here

            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;
                                        }
                                    }
                                }
                            }
View Full Code Here

    }

    public void listServices(RemoteDevice dev) {
        services.removeAllElements();
        int[] attrIDList = { 0, 1, 4, 256 };
        UUID[] uuidList = { new UUID(0x1002) };
        try { agent.searchServices(attrIDList, uuidList, dev, this); }
        catch (BluetoothStateException e) {
            JOptionPane.showMessageDialog(null, e, "Generic Bluetooth Exception", JOptionPane.ERROR_MESSAGE);
        }
    }
View Full Code Here

        Log.append(t + "\n");
      }
    }
    UUID[] uuidSet = new UUID[1];
    if (ScanForUUID != null)
      uuidSet[0]=new UUID(ScanForUUID, true);
    else
      uuidSet[0]=new UUID("ACDC", true);

    for (int i = 0; i < vecDevices.capacity(); i++)
    {
      RemoteDevice remoteDevice=(RemoteDevice)vecDevices.elementAt(i);
      String t = remoteDevice.getFriendlyName(true);
View Full Code Here

    /**
     * Affecte l'uid au client
     * @param uid : uid
     */
    public void setUUID( int uid ) {
        _client_UUID = new UUID( uid ) ;
        _serverUrl = "btspp://localhost:" + _client_UUID + ";name=SudokuClient;authorize=true";
    }
View Full Code Here

TOP

Related Classes of javax.bluetooth.UUID

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.