summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qnx
diff options
context:
space:
mode:
authorFabian Bumberger <fbumberger@rim.com>2013-05-17 16:10:42 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-01 11:28:07 +0200
commit2011c3f63d5283b34bc1999ad35404cf93e286c9 (patch)
tree220e89e4b876ec1085c5d8b7f4ac5e492792cdda /src/bluetooth/qnx
parenta7d01a4f0d5bdd56749e674e71d32caaa3a065b3 (diff)
QNX Bluetooth adding OPP
Makes it possible to send QFiles over OPP. Other QIODevices do not work yet. Change-Id: I3a85a1f4a95c9059143f20d01c20ac27961e4a09 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/bluetooth/qnx')
-rw-r--r--src/bluetooth/qnx/ppshelpers.cpp15
-rw-r--r--src/bluetooth/qnx/ppshelpers_p.h4
2 files changed, 19 insertions, 0 deletions
diff --git a/src/bluetooth/qnx/ppshelpers.cpp b/src/bluetooth/qnx/ppshelpers.cpp
index 9524fbe3..6225ef0d 100644
--- a/src/bluetooth/qnx/ppshelpers.cpp
+++ b/src/bluetooth/qnx/ppshelpers.cpp
@@ -55,6 +55,7 @@ static QSocketNotifier *ppsCtrlNotifier = 0;
static const char btControlFDPath[] = "/pps/services/bluetooth/public/control";
static const char btSettingsFDPath[] = "/pps/services/bluetooth/settings";
static const char btRemoteDevFDPath[] = "/pps/services/bluetooth/remote_devices/";
+static const char btMediaFDPath[] = "/pps/services/bluetooth/media/control";
static const int ppsBufferSize = 1024;
@@ -267,6 +268,20 @@ void ppsDecodeControlResponse()
}
}
+void ppsSendOpp(const char *msg, const QByteArray &url, const QBluetoothAddress &address, QObject *sender)
+{
+ pps_encoder_t *encoder = beginCtrlMessage(msg, sender);
+
+ pps_encoder_start_object(encoder, "dat");
+ pps_encoder_add_string(encoder, "address", address.toString().toUtf8().constData());
+ pps_encoder_start_array(encoder, "urls");
+ pps_encoder_add_string(encoder, 0, url.constData());
+ pps_encoder_end_array(encoder);
+ pps_encoder_end_object(encoder);
+
+ endCtrlMessage(encoder);
+}
+
QVariant ppsReadSetting(const char *property)
{
int settingsFD;
diff --git a/src/bluetooth/qnx/ppshelpers_p.h b/src/bluetooth/qnx/ppshelpers_p.h
index f4c5a7ce..2809cb28 100644
--- a/src/bluetooth/qnx/ppshelpers_p.h
+++ b/src/bluetooth/qnx/ppshelpers_p.h
@@ -116,6 +116,10 @@ bool ppsSendControlMessage(const char *msg, QObject *sender=0);
void ppsDecodeControlResponse();
+int openOPPControl();
+
+void ppsSendOpp(const char *msg, const QByteArray &filename, const QBluetoothAddress &address, QObject *sender);
+
QVariant ppsReadSetting(const char *property);
QVariant ppsRemoteDeviceStatus(const QByteArray &address, const char *property);