Home · All Classes · Grouped Classes · Annotated · Functions

QBluetoothAbstractService Class Reference

The QBluetoothAbstractService class provides a base interface class for Bluetooth services within Qtopia. More...

    #include <QBluetoothAbstractService>

Inherits QObject.

Inherited by QBluetoothHandsfreeService, QBluetoothHeadsetService, and QBluetoothSerialPortService.

Public Functions

Signals

Protected Functions

Additional Inherited Members


Detailed Description

The QBluetoothAbstractService class provides a base interface class for Bluetooth services within Qtopia.

To create a Qtopia Bluetooth service, subclass QBluetoothAbstractService and implement the start(), stop() and setSecurityOptions() methods. Your service will automatically be registered and accessible as a Bluetooth service within Qtopia. This means the service will be accessible to external parties through QBluetoothServiceController. It will also be shown in the list of local services in Qtopia's Bluetooth settings application, allowing end users to modify the service's settings.

Naturally, it is possible to implement Bluetooth services outside of Qtopia by using the BlueZ libraries and standard Linux tools. However, such services will not be accessible through Qtopia.

See also Tutorial: Creating a Bluetooth service.


Member Function Documentation

QBluetoothAbstractService::QBluetoothAbstractService ( const QString & name, const QString & displayName, QObject * parent = 0 )

Constructs a Bluetooth service. The name is a unique name that identifies the service, and displayName is a user-friendly, internationalized name for this service that can be displayed to the end user. The parent is the QObject parent for this service.

QBluetoothAbstractService::~QBluetoothAbstractService ()   [virtual]

Destroys a Bluetooth service.

QString QBluetoothAbstractService::displayName () const

Returns the user-friendly, internationalized name for this service that can be displayed to the end user.

QString QBluetoothAbstractService::name () const

Returns the unique name that identifies this service.

quint32 QBluetoothAbstractService::registerRecord ( const QBluetoothSdpRecord & record )   [protected]

Registers the SDP service record record for this Bluetooth service and returns the service record handle of the newly registered service. Returns zero if the registration failed.

See also unregisterRecord().

quint32 QBluetoothAbstractService::registerRecord ( const QString & filename )   [protected]

This is an overloaded member function, provided for convenience.

Uses the XML data from the file filename to register the SDP service record for this Bluetooth service and returns the service record handle of the newly registered service. Returns zero if the registration failed.

See Using a XML-formatted SDP record for details on how to generate a XML-formatted SDP reord.

Warning: The given file must be UTF-8 encoded to be parsed correctly.

See also unregisterRecord().

void QBluetoothAbstractService::setSecurityOptions ( QBluetooth::SecurityOptions options )   [pure virtual]

Sets the security options for this service to the given options.

This method will be called by Qtopia when the security options should be changed.

Subclasses must override this to set the security options for this service.

void QBluetoothAbstractService::start ()   [pure virtual]

Starts this service.

This method will be called by Qtopia when the service should be started. This may be because an external party has required that the service be started (for example, through QBluetoothServiceController, or through the Bluetooth Settings application) or because Qtopia has been configured to start the service automatically.

Subclasses must override this to start the service appropriately. The subclass must emit started() when the service has started, or failed while trying to start, to announce the result of the start() invocation.

Warning: This function must be implementated in such a way that any intermediate objects (which have been created up to the point where the error occurred) are cleaned up before the error signal is emitted.

See also started() and stop().

void QBluetoothAbstractService::started ( bool error, const QString & description )   [signal]

When implementing the start() function, this signal must be emitted by the subclass when the service has started or failed while attempting to start, to announce the result of the start() invocation.

If the service failed to start, error should be true and description should be a human-readable description of the error. Otherwise, error should be false and description should be a null QString.

See also start() and stopped().

void QBluetoothAbstractService::stop ()   [pure virtual]

Stops this service.

This method will be called by Qtopia when the service should be stopped.

Subclasses must override this to stop the service appropriately. The subclass must emit stopped() to announce that the service has stopped.

See also stopped() and start().

void QBluetoothAbstractService::stopped ()   [signal]

This signal must be emitted by the subclass inside the implementation of the stop() function, to announce that the service has stopped.

See also started() and stop().

bool QBluetoothAbstractService::unregisterRecord ( quint32 handle )   [protected]

Unregisters the SDP service record with the service record handle handle.

Returns whether the record was successfully unregistered.

See also registerRecord().


Copyright © 2008 Nokia Trademarks
Qtopia 4.3.3