42
42
#include "qbluetoothserviceinfo.h"
43
43
#include "qbluetoothserviceinfo_p.h"
45
#include "qrfcommserver_p.h"
46
#include "qrfcommserver.h"
45
#include "qbluetoothserver_p.h"
46
#include "qbluetoothserver.h"
48
QT_BEGIN_NAMESPACE_BLUETOOTH
50
50
QBluetoothServiceInfoPrivate::QBluetoothServiceInfoPrivate()
51
51
: registered(false)
74
void QBluetoothServiceInfoPrivate::setRegisteredAttribute(quint16 attributeId, const QVariant &value) const
76
Q_UNUSED(attributeId);
82
void QBluetoothServiceInfoPrivate::removeRegisteredAttribute(quint16 attributeId) const
84
Q_UNUSED(attributeId);
88
extern QHash<QRfcommServerPrivate*, int> __fakeServerPorts;
90
bool QBluetoothServiceInfoPrivate::registerService() const
92
Q_Q(const QBluetoothServiceInfo);
93
if (q->socketProtocol() != QBluetoothServiceInfo::RfcommProtocol) {
94
qWarning() << Q_FUNC_INFO << "Only SPP services can be registered on QNX";
72
extern QHash<QBluetoothServerPrivate*, int> __fakeServerPorts;
74
bool QBluetoothServiceInfoPrivate::registerService(const QBluetoothAddress& localAdapter)
76
Q_UNUSED(localAdapter); //QNX always uses default local adapter
77
if (protocolDescriptor(QBluetoothUuid::Rfcomm).isEmpty()) {
78
qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "Only SPP services can be registered on QNX";
98
if (q->serverChannel() == -1)
82
if (serverChannel() == -1)
101
if (__fakeServerPorts.key(q->serverChannel()) != 0) {
102
qBBBluetoothDebug() << "Registering server with UUID" <<
103
q->serviceUuid() << " Name" << q->serviceName();
104
qDebug() << "Server is" << __fakeServerPorts.key(q->serverChannel());
105
if (!ppsSendControlMessage("register_server", 0x1101, q->serviceUuid(), QString(), q->serviceName(),
106
__fakeServerPorts.key(q->serverChannel()), BT_SPP_SERVER_SUBTYPE))
85
if (__fakeServerPorts.key(serverChannel()) != 0) {
86
if (!ppsSendControlMessage("register_server", 0x1101, attributes.value(QBluetoothServiceInfo::ServiceId).value<QBluetoothUuid>(), QString(),
87
attributes.value(QBluetoothServiceInfo::ServiceName).toString(),
88
__fakeServerPorts.key(serverChannel()), BT_SPP_SERVER_SUBTYPE))
108
90
//The server needs to know the service name for the socket mount point path
109
__fakeServerPorts.key(q->serverChannel())->m_serviceName = q->serviceName();
91
__fakeServerPorts.key(serverChannel())->m_serviceName = attributes.value(QBluetoothServiceInfo::ServiceName).toString();