×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    4

    Connect to service without user interaction

    Hello everybody!!

    I am trying to connect to a service on a remote device without interaction with the user. This means I want to search for devices that offer a service like the service of the P2P example and then connect to one of the found devices.

    I am using the RHostResolver::GetByAddress() to get the addresses of the devices in reach and now I need to filter the found devices to get that devices that support the service I am looking for. With my understanding I need to use CSdpAgent to do this!?!
    If I understand right, the GetByAddress Method returns TSockAddr object(s) and the CSdpAgent::NewL() uses TBTDevAddr to search for a service.
    Could someone please explain the difference between a SocketAddress and a DeviceAddress to me (especially within the Bluetooth environment)? And how can I convert or cast a TSocketAddr to a TBTDeviceAddr?

    I tried the following, but I get a BTLIB 0 Error:

    TBTSockAddr socketAddr(entry().iAddr);
    TBTDevAddr devAddr(socketAddr);


    Thank for your help!

  2. #2
    Registered User
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122
    Here's how to convert a TNameEntry to TBTDevAddr:

    Code:
    TBTDevAddr addr = STATIC_CAST(TBTSockAddr, entry().iAddr).BTAddr();
    Lauri

Posting Permissions

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