Shutting down the SDP database
When a client application has finished with its Bluetooth services, it should disconnect from the SDP database. This is done when the client application calls the Close function for both the Session and the database objects iSdpDatabase.Close iSdpSession.Close Symbian OS keeps track of all sessions that are connected to servers. Once a server has no longer any sessions accessing it, the operating system will shut down the server, thus conserving the limited system resources available on a...
SendAs UI component for Sending a File via Bluetooth
DisplaysendMenuitemL function of the CsendAppUi class adds a menu item with desired bearer options Bluetooth, IR, SMS, MMS . It is an easy-to-use sending facility for applications where a simple file sending functionality initiated by the user is sufficient. When the user selects the menu item, Bluetooth Device Selection Notifier Plugin is called and the list of remote devices is displayed. The file will then be sent via Bluetooth Object Push Profile using OBEX protocol to the device the user...
Setting the Inquiry Access Code IAC
In the Bluetooth Specification there are two different inquiry access codes for different use cases. The default case is that the inquiring device finds all the devices that are discoverable in the neighborhood. In this case the searching device is inquiring with the Generic Inquiry Access Code GIAC . However, this can take a considerably long time to complete. Therefore you can also set the scanning devices into Limited-Discoverable mode. When making a device inquiry with Limited Inquiry...
Checking Bluetooth Power Mode
On the client side, when you start searching for devices, the power status will be automatically checked and the user is prompted to switch Bluetooth on if it is off. On the server side this check has to be done using a constant as follows In Series 60 Developer Platform 1.0 and the Nokia 6600 const TUid KPowerModesettingNotifierUid 0x100059E2 In Series 80 Developer Platform 2.0 and the Nokia 7710 const TUid KBTPowerstateNotifierUid 0x101F808E From the Series 60 2nd Edition, Feature Pack 1...
Bluetooth API Overview
Like many other communications technologies, Bluetooth is composed of a hierarchy of components, referred to as a stack. The stack is shown in Figure 1 Figure 1 Bluetooth stack architecture Figure 1 Bluetooth stack architecture The Bluetooth Host Controller components provide the lower level of the stack. The Host Controller components are normally implemented in the hardware. Applications do not have direct access to this layer. The Bluetooth Host components allow applications to send or...
Creating a service record
As previously stated, there is no explicit service record in the Symbian OS architecture. Instead, the SDP database manages a collection of service handles and their associated attributes that make up a service record. The following line of code, taken from the same function CBTAdvertiserAppView StartAdvertiserL , illustrates how to create a service record in the database. The iRecord TSdpServRecordHandle is passed by value and will contain the service handle of the newly created service...
Device discovery in the Bluetooth PointToMultipoint example
The following code excerpts are taken from the Bluetooth Point-To-Multipoint PMP example that is available in the Symbian Code and Examples section at http www.forum.nokia.com . The example has been written for Series 60 but the parts related to the Bluetooth functionality are applicable to other platforms as well. In the PMP example the CBluetoothPMPExampleEngine class in lt installation src BluetoothPMPExampleEngine.cpp manages listening operations, discoveries, connections, data sending, and...
Bluetooth discovery example
The Series 60 SDK provides a Bluetooth service discovery example. It is in the SDK installation directory at lt installation In this example, the CBTDiscoverer actually implements the MsdpAgentNotifier interface. This is defined in the lt installation directory gt 7.0s series60 header file. CBTDiscoverer both implements the MsdpAgentNotifier interface and encapsulates the CsdpAgent object. CBTDiscoverer is responsible for both issuing the search requests and handling the operating system...
Bluetooth Security Manager 1
The Symbian OS API provides a Bluetooth Security Manager. As the name suggests, this component manages the security for Bluetooth connections. It allows a client application to specify a set of security settings. The security settings determine if user authorization, authentication, or encryption is required when establishing a connection. These security settings are applied to a specific server, protocol, and channel. The Bluetooth Security Manager ensures that incoming connections adhere to...
Development Tools and Code Examples
To develop Bluetooth applications in Symbian C , you need to download and install an SDK compatible with the Developer Platform you are developing for. For SDKs for Series 60 and Series 80 Developer Platforms, and for the Nokia 7710, please visit http www.forum.nokia.com tools where you can download C SDKs free of charge. The SDKs include all the key functionality required for application development documentation, API reference, add-on tools, device emulator, and target compiler except for an...
Setting Up a Transmitting RFCOMM Socket
Setting up a transmitting socket is performed in a manner similar to the receiving example shown before. In the point-to-point example provided with the Series 60 SDK, the CMessageClient class sets up the RFCOMM socket. Its implementation can be found in the lt installation directory gt 7.0s series60 series60Ex BTPointToPoint src MessageClient.cpp file. void CMessageClient ConnectToserverL iLog.LogL L Connecting to service The CMessageClient class connects and opens a socket on the RFCOMM...
Setting Up the Listening RFCOMM Socket
The CMessageServer StartL function in the lt installation cpp file performs all the work of starting up the RFCOMM service. Initially, it starts the Bluetooth sockets protocol and initializes an RFCOMM port. To open a server socket, the device must first connect to the socket server with RSocketServ, and then open a connection to this server with an RSocket object. When the client application calls the Open function on the RSocket object, it must specify the protocol it wishes to use. In this...
How to Advertise a Service
The following section describes how a client application can advertise its own set of Bluetooth services. This document will reference code from Bluetooth examples of the Series 60 SDK. In particular, this section will reference the Bluetooth Advertiser example, which is located under the SDK directory at Advertiser lt installation The example is partly described in the help file that accompanies the Series 60 SDK at lt installation 4.2.1 The SDP database All Bluetooth services are represented...
TObexBluetoothProtocolInfo
This class provides a way for a client application to specify the underlying Bluetooth protocol it wishes OBEX to use. The class is based on the TObexProtocolInfo base class. Its full public interface is as follows class TObexBluetoothProtocolInfo public TObexProtocolInfo TBuf lt 60 gt iTransport from TObexProtocollnfo Note that the previous code does not actually represent the real implementation of the class, merely its public interface. When using the TRfcommSockAddr object to set up a...
Using the Bluetooth Device Selection UI
The Device Selection UI does all the work of searching for available Bluetooth devices and presenting them to users. It is provided as a plug-in to the RNotifier class. The RNotifier class is a generic class that allows the use of several plug-in UI elements provided by the OS. It is defined in the E32STD.H header file. Its public interface is shown in the following code class RNotifier public RSessionBase IMPORT_C RNotifier IMPORT_C TInt Connect IMPORT_C TInt StartNotifier TUid...
CObexClient
CObexClient provides a client application with the necessary functionality to transmit to, and request from, an OBEX server. This is evident from the class's public interface, a portion of which is shown in the following code example iMPORT_C static CObexClient Newl TObexProtocolinfo amp aObexProtocolinfoPtr iMPORT_C void Connect TRequestStatus amp aStatus iMPORT_C void Put CObexBaseObject amp aObject, TRequestStatus amp aStatus iMPORT_C void Get CObexBaseObject amp aObject, TRequestStatus amp...
