QtMobility Reference Documentation

QML BluetoothSocket Element

The BluetoothSocket element represents a single bluetooth client socket. More...

This element was introduced in Mobility 1.2.


Detailed Description

The BluetoothSocket element is part of the QtMobility.connectivity 1.2 module.

It allows a QML class easily connect to another bluetooth device and send and received QString's from the device. Data is sent and received via a QDataStream allowing type safe transfer of string data. QDataStream is a well known format and maybe decoded by non-Qt applications.

Connections to remove devices can be over rfcomm or l2cap. Either the remote port or service UUID is required. This is specified by creating a BluetoothService, or passing in the service return from BluetoothDiscoveryModel.

See also QBluetoothSocket and QDataStream.

Property Documentation

connected : bool

This property holds the connection state of the socket. If the socket is connected to peer it returns true. It can be set true of false to control the connection. When set true the property will not return true until the connection is established.

This property group was introduced in Mobility 1.2.

read-onlyerror : string

This property holds the string for the last reported error This property is read only.

This property group was introduced in Mobility 1.2.

This property holds the details of the remote service to connect too. It can be set to a static BluetoothService with a fixed description, or a service returned by service discovery.

This property group was introduced in Mobility 1.2.

stringData : string

This property receives or sends data to remote bluetooth device. Arrival of data is signaled through the dataAvailable signal and can be read by stringData. Calling sendStringData will transmit the string to the far side. If excessive amounts of data are sent the function may block. Reading will never block.

This property group was introduced in Mobility 1.2.


Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.