4#ifndef QBLUETOOTHSOCKET_H
5#define QBLUETOOTHSOCKET_H
7#include <QtBluetooth/qtbluetoothglobal.h>
9#include <QtBluetooth/qbluetooth.h>
10#include <QtBluetooth/qbluetoothaddress.h>
11#include <QtBluetooth/qbluetoothuuid.h>
12#include <QtBluetooth/qbluetoothserviceinfo.h>
14#include <QtCore/qiodevice.h>
25 Q_DECLARE_PRIVATE(QBluetoothSocketBase)
29 friend class QBluetoothSocketPrivateDarwin;
34 friend class QBluetoothSocketPrivateWin;
53 RemoteHostClosedError,
57 UnsupportedProtocolError,
59 MissingPermissionsError
69 void close()
override;
82 OpenMode
mode = ReadWrite)
86 void disconnectFromService();
104 SocketState socketState = SocketState::ConnectedState,
105 OpenMode openMode = ReadWrite);
106 int socketDescriptor()
const;
109 SocketState
state()
const;
110 SocketError
error()
const;
117 void setPreferredSecurityFlags(QBluetooth::SecurityFlags
flags);
118 QBluetooth::SecurityFlags preferredSecurityFlags()
const;
137 void discoveryFinished();
Protocol
This enum describes the socket protocol used by the service.
void connectToService(const QBluetoothAddress &address, QBluetoothUuid::ServiceClassUuid uuid, OpenMode mode=ReadWrite)
void connected()
This signal is emitted when a connection is established.
void stateChanged(QBluetoothSocket::SocketState state)
This signal is emitted when the socket state changes to state.
void errorOccurred(QBluetoothSocket::SocketError error)
This signal is emitted when an error occurs.
QBluetoothSocketBasePrivate * d_ptr
SocketState
This enum describes the state of the Bluetooth socket.
SocketError
This enum describes Bluetooth socket error types.
void disconnected()
This signal is emitted when the socket is disconnected.
ServiceClassUuid
This enum is a convienience type for Bluetooth service class and profile UUIDs.
\inmodule QtCore \reentrant
virtual bool isSequential() const
Returns true if this device is sequential; otherwise returns false.
virtual qint64 bytesAvailable() const
Returns the number of bytes that are available for reading.
QString errorString() const
Returns a human-readable description of the last device error that occurred.
virtual qint64 writeData(const char *data, qint64 len)=0
Writes up to maxSize bytes from data to the device.
virtual qint64 bytesToWrite() const
For buffered devices, this function returns the number of bytes waiting to be written.
virtual void close()
First emits aboutToClose(), then closes the device and sets its OpenMode to NotOpen.
virtual bool canReadLine() const
Returns true if a complete line of data can be read from the device; otherwise returns false.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
static QT_BEGIN_NAMESPACE const char * socketType(QSocketNotifier::Type type)
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint GLuint64EXT address
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent