×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    3

    Bluetooth Service Discovery with different RFCOMM Services

    Hello,
    i want to connect to a PC with my mobile phone via bluetooth. The pc provides different RFCOMM based services. My mobile app always connects to the first found RFCOMM port (which is indeed not my own BT-server but a normal service provided by the BT driver).
    I use the following part of code for finding a RFCOMM service. So its no surprise that I always get the first available.

    Code:
    void SDPInvestigatorImpl::VisitAttributeValueL (CSdpAttrValue &aValue, TSdpElementType aType)
    {  
    	// This will be called for each attribute received. It just waits for attributes
    	// of certain type and parses them. All other attributes are ignored.
    
        switch( aType )
        {
            
        case ETypeUUID:
            m_previousUUID = aValue.UUID( );
            break;
            
        case ETypeUint:
            if( m_previousUUID == KRFCOMM )
            {
                m_port = aValue.Uint();
                m_portFound = TRUE;
            }
            break;
            
        default:
            break;
        }
    }
    In contrast the example chat application of the symbian sdk finds always the right port. It uses a more complicated approach that i dont understand fully with the given information there.
    So finally my question is: How can you differentiate these services? Where do i have to look for more information? Or does the chat application find the right port by accident?

    PS I can not differentiate by UUID or by static port number.
    Shutting down all other services works fine.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,672

    Re: Bluetooth Service Discovery with different RFCOMM Services

    Quote Originally Posted by janwinhuysen View Post
    PS I can not differentiate by UUID
    Why not? That is the usual approach.

  3. #3
    Registered User
    Join Date
    Jul 2007
    Posts
    3

    Re: Bluetooth Service Discovery with different RFCOMM Services

    I think there is no standard UUID for the hardware i must talk with. I can only be sure that it is an RFCOMM connection.

    I'm just wondering that the chat application finds the right port.

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,672

    Re: Bluetooth Service Discovery with different RFCOMM Services

    Quote Originally Posted by janwinhuysen View Post
    I'm just wondering that the chat application finds the right port.
    It searches for SerialPort services, and extracts the channel from the protocol descriptor list of the first one providing a valid RFCOMM descriptor.

  5. #5
    Registered User
    Join Date
    Jul 2007
    Posts
    3

    Re: Bluetooth Service Discovery with different RFCOMM Services

    Thanks for your answers!!!

    So the Chat programm get the right port by accident. But one more Question: Where do i find information how a valid rfcomm descriptor looks like? Our application just uses a very simple approach...

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,672

    Re: Bluetooth Service Discovery with different RFCOMM Services

    You can check the advertiser part of Chat example.
    Basically it is
    {(L2CAP)(RFCOMM,channel)}
    So an one-element DES (containing UUID of L2CAP), and a two-element DES (containing UUID of RFCOMM, and the channel number) embedded in a list.
    Code:
    // from ChatServiceAdvertiser.cpp
        aProtocolDescriptor
          ->StartListL()
            ->BuildDESL()
            ->StartListL()   //  Details of lowest level protocol
            ->BuildUUIDL( KL2CAP )
            ->EndListL()
    
            ->BuildDESL()
            ->StartListL()
            ->BuildUUIDL( KRFCOMM )
            ->BuildUintL( channel )
            ->EndListL()
          ->EndListL();

Similar Threads

  1. Testing RFCOMM over Bluetooth with Java in Nokia 6600
    By DWellu in forum Mobile Java Networking & Messaging & Security
    Replies: 12
    Last Post: 2009-06-09, 14:40
  2. service discovery problem
    By zinxed in forum Bluetooth Technology
    Replies: 3
    Last Post: 2008-08-11, 11:30
  3. Regarding device discovery and service discovery
    By shivaprashanth in forum Bluetooth Technology
    Replies: 0
    Last Post: 2007-09-05, 07:45
  4. Bluetooth Service Discovery
    By h.arald in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2003-12-04, 14:03
  5. Service discovery fails on 6210 connectivity pack
    By Nokia_Archive in forum Bluetooth Technology
    Replies: 1
    Last Post: 2002-05-28, 16:01

Posting Permissions

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