From e48b708da6556b63408084e37f83a4777c4dabfd Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Tue, 12 Feb 2013 11:02:47 +0000 Subject: sdremote - cleanup and annotate bluetooth SDP record. Change-Id: Ie6c3d12387cececce4e169482659cbcbbcfd0975 --- sd/source/ui/remotecontrol/BluetoothServer.cxx | 12 +--- .../ui/remotecontrol/BluetoothServiceRecord.hxx | 70 ++++++++++++++++++++++ 2 files changed, 73 insertions(+), 9 deletions(-) create mode 100644 sd/source/ui/remotecontrol/BluetoothServiceRecord.hxx diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx index f222628987b1..30c9c7de4bb8 100644 --- a/sd/source/ui/remotecontrol/BluetoothServer.cxx +++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx @@ -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 #include @@ -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 "" - #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* pCommunicators ) @@ -452,5 +447,4 @@ void BluetoothServer::setup( std::vector* pCommunicators ) spServer->create(); } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/remotecontrol/BluetoothServiceRecord.hxx b/sd/source/ui/remotecontrol/BluetoothServiceRecord.hxx new file mode 100644 index 000000000000..5249d904dea2 --- /dev/null +++ b/sd/source/ui/remotecontrol/BluetoothServiceRecord.hxx @@ -0,0 +1,70 @@ +/* -*- 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 = + "" + "" + "" // Service class ID list + "" + "" + "" + "" + "" // Protocol Descriptor list + "" + "" + "" + "" + "" + "" // enumeration value of RFCOMM protocol + "" // RFCOMM port number + "" + "" + "" + "" // Browse Group List + "" + "" + "" + "" + "" // Language Base Attribute ID List + "" + "" + "" + "" + "" + "" + "" // Bluetooth Profile Descriptor List + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + ; + +#endif // BLUETOOTH_SERVICE_RECORD_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit