added service record for spp
authorKevron Rees <kevron.m.rees@intel.com>
Mon, 19 May 2014 23:36:54 +0000 (16:36 -0700)
committerKevron Rees <kevron.m.rees@intel.com>
Mon, 19 May 2014 23:36:54 +0000 (16:36 -0700)
plugins/bluetooth/bluetoothplugin.cpp

index 5c1679c..b92e3f2 100644 (file)
@@ -33,6 +33,29 @@ using namespace std;
 
 #include "debugout.h"
 
 
 #include "debugout.h"
 
+QString SPP_RECORD = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
+                                                                                                                  "<record>"
+                                                                                                                        "<attribute id=\"0x0001\">"
+                                                                                                                          "<sequence>"
+                                                                                                                                "<uuid value=\"0x1101\"/>"
+                                                                                                                          "</sequence>"
+                                                                                                                        "</attribute>"
+                                                                                                                        "<attribute id=\"0x0004\">"
+                                                                                                                          "<sequence>"
+                                                                                                                                "<sequence>"
+                                                                                                                                  "<uuid value=\"0x0100\"/>"
+                                                                                                                                "</sequence>"
+                                                                                                                                "<sequence>"
+                                                                                                                                  "<uuid value=\"0x0003\"/>"
+                                                                                                                                  "<uint8 value=\"23\" name=\"channel\"/>"
+                                                                                                                                "</sequence>"
+                                                                                                                          "</sequence>"
+                                                                                                                        "</attribute>"
+                                                                                                                        "<attribute id=\"0x0100\">"
+                                                                                                                          "<text value=\"COM5\" name=\"name\"/>"
+                                                                                                                        "</attribute>"
+                                                                                                                  "</record>";
+
 BluetoothSinkPlugin::BluetoothSinkPlugin(AbstractRoutingEngine* re, map<string, string> config)
 :AbstractSink(re, config)
 {
 BluetoothSinkPlugin::BluetoothSinkPlugin(AbstractRoutingEngine* re, map<string, string> config)
 :AbstractSink(re, config)
 {
@@ -47,8 +70,10 @@ BluetoothSinkPlugin::BluetoothSinkPlugin(AbstractRoutingEngine* re, map<string,
        QDBusInterface profileManagerIface("org.bluez", "/org/bluez", "org.bluez.ProfileManager1", QDBusConnection::systemBus());
 
        QVariantMap options;
        QDBusInterface profileManagerIface("org.bluez", "/org/bluez", "org.bluez.ProfileManager1", QDBusConnection::systemBus());
 
        QVariantMap options;
-       options["Name"] = "spp";
+       options["Name"] = "AMB spp server";
        options["Role"] = "server";
        options["Role"] = "server";
+       options["ServiceRecord"] = SPP_RECORD;
+       options["Channel"] = 23;
 
        QDBusReply<void> reply = profileManagerIface.call("RegisterProfile", qVariantFromValue(QDBusObjectPath("/org/bluez/spp")), "00001101-0000-1000-8000-00805F9B34FB", options);
 
 
        QDBusReply<void> reply = profileManagerIface.call("RegisterProfile", qVariantFromValue(QDBusObjectPath("/org/bluez/spp")), "00001101-0000-1000-8000-00805F9B34FB", options);