Kaydet (Commit) e48b708d authored tarafından Michael Meeks's avatar Michael Meeks

sdremote - cleanup and annotate bluetooth SDP record.

Change-Id: Ie6c3d12387cececce4e169482659cbcbbcfd0975
üst 39e755dd
......@@ -6,7 +6,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "BluetoothServer.hxx"
#include "BluetoothServiceRecord.hxx"
#include <stdio.h>
#include <sal/log.hxx>
......@@ -41,12 +43,6 @@
#define NS_BTH 16
#endif
// FIXME: move this into an external file and look at sharing definitions
// across OS's (i.e. UUID and port ).
// Also look at determining which ports are available.
// Alternatively use the binary sdp record
#define BLUETOOTH_SERVICE_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='0x05' /></sequence></sequence></attribute><attribute id='0x0005'><sequence><uuid value='0x1002' /></sequence></attribute><attribute id='0x0006'><sequence><uint16 value='0x656e' /><uint16 value='0x006a' /><uint16 value='0x0100' /></sequence></attribute><attribute id='0x0009'><sequence><sequence><uuid value='0x1101' /><uint16 value='0x0100' /></sequence></sequence></attribute><attribute id='0x0100'><text value='Serial Port' /></attribute><attribute id='0x0101'><text value='COM Port' /></attribute></record>"
#include "Communicator.hxx"
using namespace sd;
......@@ -280,7 +276,7 @@ void SAL_CALL BluetoothServer::run()
// don't bother as the record is automatically released when LO exits.
guint aHandle;
gboolean aResult = dbus_g_proxy_call( aAdapter, "AddRecord", &aError,
G_TYPE_STRING, BLUETOOTH_SERVICE_RECORD ,
G_TYPE_STRING, bluetooth_service_record,
G_TYPE_INVALID,
G_TYPE_UINT, &aHandle,
G_TYPE_INVALID);
......@@ -440,7 +436,6 @@ void SAL_CALL BluetoothServer::run()
#endif
}
BluetoothServer *sd::BluetoothServer::spServer = NULL;
void BluetoothServer::setup( std::vector<Communicator*>* pCommunicators )
......@@ -452,5 +447,4 @@ void BluetoothServer::setup( std::vector<Communicator*>* pCommunicators )
spServer->create();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef BLUETOOTH_SERVICE_RECORD_HXX
#define BLUETOOTH_SERVICE_RECORD_HXX
// FIXME: look into sharing definitions across OS's (i.e. UUID and port ).
// Look into dynamically determining which ports are available.
// SDP is a Service Description Protocol cf.
// http://developer.bluetooth.org/TechnologyOverview/Pages/DI.aspx
// This is an XML representation, an alternative would be a
// binary SDP record.
static const char *bluetooth_service_record =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<record>"
"<attribute id=\"0x0001\">" // Service class ID list
"<sequence>"
"<uuid value=\"0x1101\"/>"
"</sequence>"
"</attribute>"
"<attribute id=\"0x0004\">" // Protocol Descriptor list
"<sequence>"
"<sequence>"
"<uuid value=\"0x0100\"/>"
"</sequence>"
"<sequence>"
"<uuid value=\"0x0003\"/>" // enumeration value of RFCOMM protocol
"<uint8 value=\"0x05\"/>" // RFCOMM port number
"</sequence>"
"</sequence>"
"</attribute>"
"<attribute id=\"0x0005\">" // Browse Group List
"<sequence>"
"<uuid value=\"0x1002\"/>"
"</sequence>"
"</attribute>"
"<attribute id=\"0x0006\">" // Language Base Attribute ID List
"<sequence>"
"<uint16 value=\"0x656e\"/>"
"<uint16 value=\"0x006a\"/>"
"<uint16 value=\"0x0100\"/>"
"</sequence>"
"</attribute>"
"<attribute id=\"0x0009\">" // Bluetooth Profile Descriptor List
"<sequence>"
"<sequence>"
"<uuid value=\"0x1101\"/>"
"<uint16 value=\"0x0100\"/>"
"</sequence>"
"</sequence>"
"</attribute>"
"<attribute id=\"0x0100\">"
"<text value=\"Serial Port\"/>"
"</attribute>"
"<attribute id=\"0x0101\">"
"<text value=\"COM Port\"/>"
"</attribute>"
"</record>"
;
#endif // BLUETOOTH_SERVICE_RECORD_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment