diff -r 48780e181b38 -r 578be2adaf3e Symbian3/PDK/Source/GUID-834BD3BB-B39C-5EE9-8A62-9DC435930F95.dita --- a/Symbian3/PDK/Source/GUID-834BD3BB-B39C-5EE9-8A62-9DC435930F95.dita Tue Jul 20 12:00:49 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-834BD3BB-B39C-5EE9-8A62-9DC435930F95.dita Fri Aug 13 16:47:46 2010 +0100 @@ -1,56 +1,56 @@ - - - - - -Handling -the Local Device Name -

Each Bluetooth device has a name for identifying the device to users or -applications. This document shows you how to get or set device names.

-
How to get -and set the local device name

The local device name is read and -set through the RHostResolver functions GetHostName() and SetHostName() respectively.

Getting the Local Device Name

The following code shows how -to get the local name:

    -
  1. Link against the following -libraries:

    esock.lib -bluetooth.lib -sdpdatabase.lib -
  2. -
  3. Connect to the socket -server

    RSocketServ socketServ; -User::LeaveIfError(socketServ.Connect()); -TProtocolDesc pInfo; -_LIT(KL2Cap, "L2CAP"); -User::LeaveIfError(socketServ.FindProtocol(KL2Cap,pInfo));
  4. -
  5. Create and initialise -an RHostResolver

    RHostResolver hr; -User::LeaveIfError(hr.Open(socketServ,pInfo.iAddrFamily,pInfo.iProtocol));
  6. -
  7. Get the local device -name

    THostName name; -TInt ret=hr.GetHostName(name);
  8. -

Setting -the Local Device Name

Setting the device name differs only in -the final step, where you will use the RHostResolver::SetHostName() function.

_LIT(KDeviceName,"myDeviceName"); -TInt ret=hr.SetHostName(KDeviceName); THostName is -a descriptor buffer of a suitable minimum size.
-
Where Next?

This -tutorial set takes you through all the steps involved in setting up and communicating -over a Bluetooth connection.

    -
  • Listening -for Incoming Bluetooth Connections

  • -
  • Handling the Local -Device Name - This document

  • -
  • Performing -Low-level Configuration

  • -
  • Debugging -the Host Controller

  • -
  • Disconnecting -ACL links

  • -
+ + + + + +Handling +the Local Device Name +

Each Bluetooth device has a name for identifying the device to users or +applications. This document shows you how to get or set device names.

+
How to get +and set the local device name

The local device name is read and +set through the RHostResolver functions GetHostName() and SetHostName() respectively.

Getting the Local Device Name

The following code shows how +to get the local name:

    +
  1. Link against the following +libraries:

    esock.lib +bluetooth.lib +sdpdatabase.lib +
  2. +
  3. Connect to the socket +server

    RSocketServ socketServ; +User::LeaveIfError(socketServ.Connect()); +TProtocolDesc pInfo; +_LIT(KL2Cap, "L2CAP"); +User::LeaveIfError(socketServ.FindProtocol(KL2Cap,pInfo));
  4. +
  5. Create and initialise +an RHostResolver

    RHostResolver hr; +User::LeaveIfError(hr.Open(socketServ,pInfo.iAddrFamily,pInfo.iProtocol));
  6. +
  7. Get the local device +name

    THostName name; +TInt ret=hr.GetHostName(name);
  8. +

Setting +the Local Device Name

Setting the device name differs only in +the final step, where you will use the RHostResolver::SetHostName() function.

_LIT(KDeviceName,"myDeviceName"); +TInt ret=hr.SetHostName(KDeviceName); THostName is +a descriptor buffer of a suitable minimum size.
+
Where Next?

This +tutorial set takes you through all the steps involved in setting up and communicating +over a Bluetooth connection.

    +
  • Listening +for Incoming Bluetooth Connections

  • +
  • Handling the Local +Device Name - This document

  • +
  • Performing +Low-level Configuration

  • +
  • Debugging +the Host Controller

  • +
  • Disconnecting +ACL links

  • +
\ No newline at end of file