Discussion Board

Results 1 to 2 of 2

Hybrid View

  1. #1
    Registered User
    Join Date
    Sep 2006

    Bluetooth / Change the RFCOMM server channel number


    When I create a RFCOMM server the channel is automatically set by the system. I'd like to choose it myself, but for now I can't manage to do it !

    I have this exception raised :

    Bluetooth Server Running Error: javax.bluetooth.ServiceRegistrationException: wrong protocol description list attribue

    Here is a block of code I have used to try changing the channel :

    ServiceRecord sr = localDevice.getRecord(notifier);
    DataElement protocolDescriptorList = sr.getAttributeValue(0x0004);
    Enumeration protocolDescriptorListElems = (Enumeration)protocolDescriptorList.getValue();

    DataElement newProtocolDescriptorList = new DataElement (DataElement.DATSEQ);
    DataElement newRFCOMM = new DataElement (DataElement.DATSEQ);

    DataElement deL2CAP = (DataElement)protocolDescriptorListElems.nextElement();

    DataElement deRFCOMM = (DataElement)protocolDescriptorListElems.nextElement();
    Enumeration deRFCOMMElems = (Enumeration)deRFCOMM.getValue();
    DataElement deRFCOMMUUID = (DataElement)deRFCOMMElems.nextElement();
    DataElement deRFCOMMChannel = (DataElement)deRFCOMMElems.nextElement();
    DataElement deRFCOMMChannelNew = new DataElement(DataElement.U_INT_1, 14); // I try to change to channel 14
    // here if I do newRFCOMM.addElement(deRFCOMMChannel); everything works fine

    sr.setAttributeValue(0x0004, newProtocolDescriptorList);

    Thanks a lot to anybody would have an idea !!!

  2. #2
    Registered User
    Join Date
    Jul 2008

    Re: Bluetooth / Change the RFCOMM server channel number


    were you able to set the server rfcomm channel as you required?
    I have the same problem and I don't know how to solve it.


Similar Threads

  1. unable to connect.maximum number of bluetooth connections in use
    By plmanikandan in forum Bluetooth Technology
    Replies: 2
    Last Post: 2008-11-25, 12:08
  2. Replies: 4
    Last Post: 2007-09-04, 17:14
  3. How to close Bluetooth server properly ?
    By kakoskin in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2004-12-28, 19:17
  4. Bluetooth server close problem :) on Nokia 6600
    By obiwk in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2004-12-28, 08:35
  5. S60 emulator problem
    By petokala in forum Bluetooth Technology
    Replies: 5
    Last Post: 2002-12-20, 13:21

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts