Hello community,
here is the log from the commit of package bluez-utils
checked in at Fri Aug 10 19:16:59 CEST 2007.
--------
--- bluez-utils/bluez-utils.changes 2007-07-30 11:07:14.000000000 +0200
+++ /mounts/work_src_done/STABLE/bluez-utils/bluez-utils.changes 2007-08-10 18:18:21.000000000 +0200
@@ -1,0 +2,13 @@
+Fri Aug 10 18:15:27 CEST 2007 - tpatzig@suse.de
+
+- update to v3.14:
+ * Add missing signals for the adapter interface.
+ * Add basic commands for Simple Pairing.
+ * Add correct Simple Pairing and EIR interaction.
+ * Add missing properties for remote information.
+ * Add EPoX endian quirk to the input service.
+ * Fix HID descriptor import and storage functions.
+ * Fix handling of adapters in raw mode.
+ * Fix remote device listing methods.
+
+-------------------------------------------------------------------
Old:
----
bluez-utils-3.13.tar.gz
New:
----
bluez-utils-3.14.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ bluez-utils.spec ++++++
--- /var/tmp/diff_new_pack.u18716/_old 2007-08-10 19:16:53.000000000 +0200
+++ /var/tmp/diff_new_pack.u18716/_new 2007-08-10 19:16:53.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package bluez-utils (Version 3.13)
+# spec file for package bluez-utils (Version 3.14)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -13,8 +13,8 @@
Name: bluez-utils
BuildRequires: alsa-devel bluez-libs cups dbus-1-devel fuse-devel libusb openobex-devel pkgconfig resmgr xorg-x11-devel
URL: http://bluez.sourceforge.net
-Version: 3.13
-Release: 5
+Version: 3.14
+Release: 1
Summary: Bluetooth Daemons and Utilities
License: GPL v2 or later
PreReq: %fillup_prereq %insserv_prereq
@@ -279,6 +279,16 @@
%doc %{_defaultdocdir}/bluez-test
%changelog
+* Fri Aug 10 2007 - tpatzig@suse.de
+- update to v3.14:
+ * Add missing signals for the adapter interface.
+ * Add basic commands for Simple Pairing.
+ * Add correct Simple Pairing and EIR interaction.
+ * Add missing properties for remote information.
+ * Add EPoX endian quirk to the input service.
+ * Fix HID descriptor import and storage functions.
+ * Fix handling of adapters in raw mode.
+ * Fix remote device listing methods.
* Mon Jul 30 2007 - dgollub@suse.de
- added dbus-1-python to Requires of bluez-test
* Thu Jul 26 2007 - seife@suse.de
++++++ bluez-utils-3.13.tar.gz -> bluez-utils-3.14.tar.gz ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/audio/a2dp.c new/bluez-utils-3.14/audio/a2dp.c
--- old/bluez-utils-3.13/audio/a2dp.c 1970-01-01 01:00:00.000000000 +0100
+++ new/bluez-utils-3.14/audio/a2dp.c 2007-08-01 21:37:08.000000000 +0200
@@ -0,0 +1,28 @@
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2004-2007 Marcel Holtmann
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include
+#endif
+
+#include "a2dp.h"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/audio/a2dp.h new/bluez-utils-3.14/audio/a2dp.h
--- old/bluez-utils-3.13/audio/a2dp.h 1970-01-01 01:00:00.000000000 +0100
+++ new/bluez-utils-3.14/audio/a2dp.h 2007-08-01 21:37:08.000000000 +0200
@@ -0,0 +1,23 @@
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2004-2007 Marcel Holtmann
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/audio/Makefile.am new/bluez-utils-3.14/audio/Makefile.am
--- old/bluez-utils-3.13/audio/Makefile.am 2007-07-26 09:35:03.000000000 +0200
+++ new/bluez-utils-3.14/audio/Makefile.am 2007-08-08 18:12:16.000000000 +0200
@@ -13,7 +13,7 @@
bluetoothd_service_audio_SOURCES = main.c \
manager.h manager.c headset.h headset.c ipc.h unix.h unix.c \
error.h error.c device.h device.c gateway.h gateway.c \
- sink.c sink.h avdtp.c avdtp.h
+ sink.c sink.h avdtp.c avdtp.h a2dp.c a2dp.h
bluetoothd_service_audio_LDADD = $(top_builddir)/common/libhelper.a \
@GLIB_LIBS@ @DBUS_LIBS@ @BLUEZ_LIBS@
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/audio/Makefile.in new/bluez-utils-3.14/audio/Makefile.in
--- old/bluez-utils-3.13/audio/Makefile.in 2007-07-26 09:38:46.000000000 +0200
+++ new/bluez-utils-3.14/audio/Makefile.in 2007-08-08 18:14:01.000000000 +0200
@@ -87,13 +87,13 @@
am__bluetoothd_service_audio_SOURCES_DIST = main.c manager.h manager.c \
headset.h headset.c ipc.h unix.h unix.c error.h error.c \
device.h device.c gateway.h gateway.c sink.c sink.h avdtp.c \
- avdtp.h
+ avdtp.h a2dp.c a2dp.h
@AUDIOSERVICE_TRUE@am_bluetoothd_service_audio_OBJECTS = \
@AUDIOSERVICE_TRUE@ main.$(OBJEXT) manager.$(OBJEXT) \
@AUDIOSERVICE_TRUE@ headset.$(OBJEXT) unix.$(OBJEXT) \
@AUDIOSERVICE_TRUE@ error.$(OBJEXT) device.$(OBJEXT) \
@AUDIOSERVICE_TRUE@ gateway.$(OBJEXT) sink.$(OBJEXT) \
-@AUDIOSERVICE_TRUE@ avdtp.$(OBJEXT)
+@AUDIOSERVICE_TRUE@ avdtp.$(OBJEXT) a2dp.$(OBJEXT)
bluetoothd_service_audio_OBJECTS = \
$(am_bluetoothd_service_audio_OBJECTS)
@AUDIOSERVICE_TRUE@bluetoothd_service_audio_DEPENDENCIES = \
@@ -252,7 +252,7 @@
@AUDIOSERVICE_TRUE@bluetoothd_service_audio_SOURCES = main.c \
@AUDIOSERVICE_TRUE@ manager.h manager.c headset.h headset.c ipc.h unix.h unix.c \
@AUDIOSERVICE_TRUE@ error.h error.c device.h device.c gateway.h gateway.c \
-@AUDIOSERVICE_TRUE@ sink.c sink.h avdtp.c avdtp.h
+@AUDIOSERVICE_TRUE@ sink.c sink.h avdtp.c avdtp.h a2dp.c a2dp.h
@AUDIOSERVICE_TRUE@bluetoothd_service_audio_LDADD = $(top_builddir)/common/libhelper.a \
@AUDIOSERVICE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ @BLUEZ_LIBS@
@@ -371,6 +371,7 @@
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/a2dp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avdtp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctl_bluetooth.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device.Po@am__quote@
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/ChangeLog new/bluez-utils-3.14/ChangeLog
--- old/bluez-utils-3.13/ChangeLog 2007-07-26 09:35:03.000000000 +0200
+++ new/bluez-utils-3.14/ChangeLog 2007-08-08 18:12:16.000000000 +0200
@@ -1,3 +1,16 @@
+ver 3.14:
+ Add missing signals for the adapter interface.
+ Add basic commands for Simple Pairing.
+ Add correct Simple Pairing and EIR interaction.
+ Add missing properties for remote information.
+ Add EPoX endian quirk to the input service.
+ Fix HID descriptor import and storage functions.
+ Fix handling of adapters in raw mode.
+ Fix remote device listing methods.
+
+ Note:
+ This version needs at least bluez-libs-3.14
+
ver 3.13:
Fix some issues with the headset support.
Fix concurrent pending connection attempts.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/configure new/bluez-utils-3.14/configure
--- old/bluez-utils-3.13/configure 2007-07-26 09:38:57.000000000 +0200
+++ new/bluez-utils-3.14/configure 2007-08-08 18:14:08.000000000 +0200
@@ -2397,7 +2397,7 @@
# Define the identity of the package.
PACKAGE=bluez-utils
- VERSION=3.13
+ VERSION=3.14
cat >>confdefs.h <<_ACEOF
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/configure.in new/bluez-utils-3.14/configure.in
--- old/bluez-utils-3.13/configure.in 2007-07-26 09:35:03.000000000 +0200
+++ new/bluez-utils-3.14/configure.in 2007-08-08 18:12:16.000000000 +0200
@@ -1,7 +1,7 @@
AC_PREREQ(2.50)
AC_INIT()
-AM_INIT_AUTOMAKE(bluez-utils, 3.13)
+AM_INIT_AUTOMAKE(bluez-utils, 3.14)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/hcid/dbus-adapter.c new/bluez-utils-3.14/hcid/dbus-adapter.c
--- old/bluez-utils-3.13/hcid/dbus-adapter.c 2007-06-19 22:15:24.000000000 +0200
+++ new/bluez-utils-3.14/hcid/dbus-adapter.c 2007-08-08 18:12:17.000000000 +0200
@@ -58,6 +58,8 @@
#include "dbus-error.h"
#include "dbus-adapter.h"
+#define NUM_ELEMENTS(table) (sizeof(table)/sizeof(const char *))
+
static const char *service_cls[] = {
"positioning",
"networking",
@@ -1155,8 +1157,12 @@
str2ba(adapter->address, &src);
str2ba(addr_ptr, &dst);
- /* Major/Minor Class */
+ /* Remote device class */
if (read_remote_class(&src, &dst, &class) == 0) {
+
+ dbus_message_iter_append_dict_entry(&dict, "class",
+ DBUS_TYPE_UINT32, &class);
+
ptr = major_class_str(class);
dbus_message_iter_append_dict_entry(&dict, "major_class",
DBUS_TYPE_STRING, &ptr);
@@ -1192,6 +1198,16 @@
dbus_message_iter_append_dict_entry(&dict, "trusted",
DBUS_TYPE_BOOLEAN, &boolean);
+ /* Connected */
+ if (g_slist_find_custom(adapter->active_conn, &dst,
+ active_conn_find_by_bdaddr))
+ boolean = TRUE;
+ else
+ boolean = FALSE;
+
+ dbus_message_iter_append_dict_entry(&dict, "connected",
+ DBUS_TYPE_BOOLEAN, &boolean);
+
/* HCI Revision/Manufacturer/Version */
create_name(filename, PATH_MAX, STORAGEDIR,
adapter->address, "manufacturers");
@@ -2849,12 +2865,12 @@
create_name(filename, PATH_MAX, STORAGEDIR, adapter->address, "linkkeys");
textfile_foreach(filename, list_remote_devices_do_append, ¶m);
- /* Add Last Used devices to the list */
- create_name(filename, PATH_MAX, STORAGEDIR, adapter->address, "lastused");
+ /* Add Trusted devices to the list */
+ create_name(filename, PATH_MAX, STORAGEDIR, adapter->address, "trusts");
textfile_foreach(filename, list_remote_devices_do_append, ¶m);
- /* Add Last Seen devices to the list */
- create_name(filename, PATH_MAX, STORAGEDIR, adapter->address, "lastseen");
+ /* Add Last Used devices to the list */
+ create_name(filename, PATH_MAX, STORAGEDIR, adapter->address, "lastused");
textfile_foreach(filename, list_remote_devices_do_append, ¶m);
reply = dbus_message_new_method_return(msg);
@@ -2874,36 +2890,61 @@
return send_message_and_unref(conn, reply);
}
+static void append_connected(struct active_conn_info *dev, GSList *list)
+{
+ char address[18];
+
+ ba2str(&dev->bdaddr, address);
+ if (g_slist_find_custom(list, address, (GCompareFunc) strcasecmp))
+ return;
+
+ list = g_slist_append(list, g_strdup(address));
+}
+
static DBusHandlerResult adapter_list_recent_remote_devices(DBusConnection *conn,
DBusMessage *msg,
void *data)
{
struct adapter *adapter = data;
- const char *string;
struct tm date;
+ const char *string;
DBusMessageIter iter;
DBusMessageIter array_iter;
DBusMessage *reply;
char filename[PATH_MAX + 1];
struct remote_device_list_t param = { NULL, 0 };
+ int len;
if (!dbus_message_get_args(msg, NULL,
DBUS_TYPE_STRING, &string,
DBUS_TYPE_INVALID))
return error_invalid_arguments(conn, msg);
- if (strptime(string, "%Y-%m-%d %H:%M:%S", &date) == NULL)
+ /* Date format is "YYYY-MM-DD HH:MM:SS GMT" */
+ len = strlen(string);
+ if (len && (strptime(string, "%Y-%m-%d %H:%M:%S", &date) == NULL))
return error_invalid_arguments(conn, msg);
- param.time = mktime(&date);
- /* Add Bonded devices to the list */
+ /* Bonded and trusted: mandatory entries(no matter the date/time) */
create_name(filename, PATH_MAX, STORAGEDIR, adapter->address, "linkkeys");
textfile_foreach(filename, list_remote_devices_do_append, ¶m);
- /* Add Last Used devices to the list */
+ create_name(filename, PATH_MAX, STORAGEDIR, adapter->address, "trusts");
+ textfile_foreach(filename, list_remote_devices_do_append, ¶m);
+
+ /* Last seen/used: append devices since the date informed */
+ if (len)
+ param.time = mktime(&date);
+
+ create_name(filename, PATH_MAX, STORAGEDIR, adapter->address, "lastseen");
+ textfile_foreach(filename, list_remote_devices_do_append, ¶m);
+
create_name(filename, PATH_MAX, STORAGEDIR, adapter->address, "lastused");
textfile_foreach(filename, list_remote_devices_do_append, ¶m);
+ /* connected: force appending connected devices, lastused might not match */
+ g_slist_foreach(adapter->active_conn, (GFunc) append_connected, param.list);
+
reply = dbus_message_new_method_return(msg);
dbus_message_iter_init_append(reply, &iter);
@@ -3021,6 +3062,42 @@
return send_message_and_unref(conn, reply);
}
+static DBusHandlerResult adapter_list_trusts(DBusConnection *conn,
+ DBusMessage *msg,
+ void *data)
+{
+ struct adapter *adapter = data;
+ DBusMessage *reply;
+ GSList *trusts, *l;
+ char **addrs;
+ bdaddr_t local;
+ int len;
+
+ reply = dbus_message_new_method_return(msg);
+ if (!reply)
+ return DBUS_HANDLER_RESULT_NEED_MEMORY;
+
+ str2ba(adapter->address, &local);
+
+ trusts = list_trusts(&local, GLOBAL_TRUST);
+
+ addrs = g_new(char *, g_slist_length(trusts));
+
+ for (l = trusts, len = 0; l; l = l->next, len++)
+ addrs[len] = l->data;
+
+ dbus_message_append_args(reply,
+ DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
+ &addrs, len,
+ DBUS_TYPE_INVALID);
+
+ g_free(addrs);
+ g_slist_foreach(trusts, (GFunc) g_free, NULL);
+ g_slist_free(trusts);
+
+ return send_message_and_unref(conn, reply);
+}
+
const char *major_class_str(uint32_t class)
{
uint8_t index = (class >> 8) & 0x1F;
@@ -3039,19 +3116,33 @@
switch (major_index) {
case 1: /* computer */
minor_index = (class >> 2) & 0x3F;
- return computer_minor_cls[minor_index];
+ if (minor_index < NUM_ELEMENTS(computer_minor_cls))
+ return computer_minor_cls[minor_index];
+ else
+ return "";
case 2: /* phone */
minor_index = (class >> 2) & 0x3F;
- return phone_minor_cls[minor_index];
+ if (minor_index < NUM_ELEMENTS(phone_minor_cls))
+ return phone_minor_cls[minor_index];
+ return "";
case 3: /* access point */
minor_index = (class >> 5) & 0x07;
- return access_point_minor_cls[minor_index];
+ if (minor_index < NUM_ELEMENTS(access_point_minor_cls))
+ return access_point_minor_cls[minor_index];
+ else
+ return "";
case 4: /* audio/video */
minor_index = (class >> 2) & 0x3F;
- return audio_video_minor_cls[minor_index];
+ if (minor_index < NUM_ELEMENTS(audio_video_minor_cls))
+ return audio_video_minor_cls[minor_index];
+ else
+ return "";
case 5: /* peripheral */
minor_index = (class >> 6) & 0x03;
- return peripheral_minor_cls[minor_index];
+ if (minor_index < NUM_ELEMENTS(peripheral_minor_cls))
+ return peripheral_minor_cls[minor_index];
+ else
+ return "";
case 6: /* imaging */
{
uint8_t shift_minor = 0;
@@ -3066,10 +3157,16 @@
break;
case 7: /* wearable */
minor_index = (class >> 2) & 0x3F;
- return wearable_minor_cls[minor_index];
+ if (minor_index < NUM_ELEMENTS(wearable_minor_cls))
+ return wearable_minor_cls[minor_index];
+ else
+ return "";
case 8: /* toy */
minor_index = (class >> 2) & 0x3F;
- return toy_minor_cls[minor_index];
+ if (minor_index < NUM_ELEMENTS(toy_minor_cls))
+ return toy_minor_cls[minor_index];
+ else
+ return "";
}
return "";
@@ -3229,6 +3326,8 @@
"s", "b" },
{ "RemoveTrust", adapter_remove_trust,
"s", "" },
+ { "ListTrusts", adapter_list_trusts,
+ "", "as" },
{ NULL, NULL, NULL, NULL }
};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/hcid/dbus-api.txt new/bluez-utils-3.14/hcid/dbus-api.txt
--- old/bluez-utils-3.13/hcid/dbus-api.txt 2007-07-26 09:35:08.000000000 +0200
+++ new/bluez-utils-3.14/hcid/dbus-api.txt 2007-08-08 18:12:17.000000000 +0200
@@ -851,6 +851,10 @@
Possible errors: org.bluez.Error.InvalidArguments
org.bluez.Error.DoesNotExist
+ array{string} ListTrusts()
+
+ Returns a list of remote devices that are trusted.
+
void DiscoverDevices()
This method starts the device discovery procedure. This
@@ -991,13 +995,16 @@
array{string} ListRemoteDevices()
- List addresses of all known remote devices (seen, used or bonded).
+ List addresses of all known remote devices (bonded,
+ trusted and used).
Possible errors: none
array{string} ListRecentRemoteDevices(string date)
- List addresses of all used or bonded remote devices since date.
+ List addresses of all bonded, trusted, seen or used remote
+ devices since date. Bonded and trusted devices are always
+ included(the date informed is not applied).
date format is "YYYY-MM-DD HH:MM:SS GMT"
@@ -1126,6 +1133,13 @@
Signals that a bonding was removed.
+ void TrustAdded(string address)
+
+ Sent when SetTrusted() is called.
+
+ void TrustRemoved(string address)
+
+ Sent when RemoveTrust() is called.
Service hierarchy
=================
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/hcid/dbus-hci.c new/bluez-utils-3.14/hcid/dbus-hci.c
--- old/bluez-utils-3.13/hcid/dbus-hci.c 2007-06-08 20:48:21.000000000 +0200
+++ new/bluez-utils-3.14/hcid/dbus-hci.c 2007-08-08 18:12:17.000000000 +0200
@@ -1841,7 +1841,7 @@
{
struct adapter *adapter;
char path[MAX_PATH_LENGTH], local_addr[18];
- int id, dd = -1;
+ int id, dd;
uint8_t cls[3];
ba2str(local, local_addr);
@@ -1861,21 +1861,52 @@
dd = hci_open_dev(id);
if (dd < 0) {
error("HCI device open failed: hci%d", id);
- goto failed;
+ return;
}
if (hci_read_class_of_dev(dd, cls, 1000) < 0) {
- error("Can't read class of device on hci%d: %s(%d)",
- id, strerror(errno), errno);
- goto failed;
+ error("Can't read class of device on hci%d: %s (%d)",
+ id, strerror(errno), errno);
+ hci_close_dev(dd);
+ return;
}
write_local_class(local, cls);
memcpy(adapter->class, cls, 3);
-failed:
- if (dd >= 0)
+ hci_close_dev(dd);
+}
+
+void hcid_dbus_write_simple_pairing_mode_complete(bdaddr_t *local)
+{
+ char addr[18];
+ int dev_id, dd;
+ uint8_t mode;
+
+ ba2str(local, addr);
+
+ dev_id = hci_devid(addr);
+ if (dev_id < 0) {
+ error("No matching device id for %s", addr);
+ return;
+ }
+
+ dd = hci_open_dev(dev_id);
+ if (dd < 0) {
+ error("HCI device open failed: hci%d", dev_id);
+ return;
+ }
+
+ if (hci_read_simple_pairing_mode(dd, &mode, 1000) < 0) {
+ error("Can't read class of device on hci%d: %s(%d)",
+ dev_id, strerror(errno), errno);
hci_close_dev(dd);
+ return;
+ }
+
+ set_simple_pairing_mode(dev_id, mode);
+
+ hci_close_dev(dd);
}
void hcid_dbus_pin_code_reply(bdaddr_t *local, void *ptr)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/hcid/dbus-hci.h new/bluez-utils-3.14/hcid/dbus-hci.h
--- old/bluez-utils-3.13/hcid/dbus-hci.h 2007-06-08 20:48:21.000000000 +0200
+++ new/bluez-utils-3.14/hcid/dbus-hci.h 2007-08-08 18:12:17.000000000 +0200
@@ -50,6 +50,7 @@
void hcid_dbus_setname_complete(bdaddr_t *local);
void hcid_dbus_setscan_enable_complete(bdaddr_t *local);
void hcid_dbus_write_class_complete(bdaddr_t *local);
+void hcid_dbus_write_simple_pairing_mode_complete(bdaddr_t *local);
void hcid_dbus_pin_code_reply(bdaddr_t *local, void *ptr);
int unregister_adapter_path(const char *path);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/hcid/dbus-manager.c new/bluez-utils-3.14/hcid/dbus-manager.c
--- old/bluez-utils-3.13/hcid/dbus-manager.c 2007-05-09 08:40:41.000000000 +0200
+++ new/bluez-utils-3.14/hcid/dbus-manager.c 2007-08-08 18:12:17.000000000 +0200
@@ -103,6 +103,7 @@
{
DBusMessage *reply;
char path[MAX_PATH_LENGTH], *path_ptr = path;
+ struct hci_dev_info di;
const char *pattern;
int dev_id;
@@ -115,6 +116,12 @@
if (dev_id < 0)
return error_no_such_adapter(conn, msg);
+ if (hci_devinfo(dev_id, &di) < 0)
+ return error_no_such_adapter(conn, msg);
+
+ if (hci_test_bit(HCI_RAW, &di.flags))
+ return error_no_such_adapter(conn, msg);
+
reply = dbus_message_new_method_return(msg);
if (!reply)
return DBUS_HANDLER_RESULT_NEED_MEMORY;
@@ -177,6 +184,9 @@
if (hci_devinfo(dr->dev_id, &di) < 0)
continue;
+ if (hci_test_bit(HCI_RAW, &di.flags))
+ continue;
+
snprintf(path, sizeof(path), "%s/%s", BASE_PATH, di.name);
dbus_message_iter_append_basic(&array_iter,
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/hcid/device.c new/bluez-utils-3.14/hcid/device.c
--- old/bluez-utils-3.13/hcid/device.c 2007-06-24 00:55:58.000000000 +0200
+++ new/bluez-utils-3.14/hcid/device.c 2007-08-08 18:12:17.000000000 +0200
@@ -80,6 +80,7 @@
uint16_t hci_rev;
uint16_t manufacturer;
+ uint8_t ssp_mode;
uint8_t name[248];
uint8_t class[3];
@@ -106,14 +107,14 @@
dd = hci_open_dev(dev_id);
if (dd < 0) {
error("Can't open device hci%d",
- dev_id, strerror(errno), errno);
+ dev_id, strerror(errno), errno);
return -errno;
}
if (hci_read_bd_addr(dd, bdaddr, 2000) < 0) {
int err = errno;
error("Can't read address for hci%d: %s (%d)",
- dev_id, strerror(errno), errno);
+ dev_id, strerror(errno), errno);
hci_close_dev(dd);
return -err;
}
@@ -145,9 +146,9 @@
if (bacmp(&di.bdaddr, BDADDR_ANY))
bacpy(&dev->bdaddr, &di.bdaddr);
else {
- int ret = device_read_bdaddr(dev_id, &dev->bdaddr);
- if (ret < 0)
- return ret;
+ int err = device_read_bdaddr(dev_id, &dev->bdaddr);
+ if (err < 0)
+ return err;
}
memcpy(dev->features, di.features, 8);
@@ -199,12 +200,40 @@
return 0;
}
+static void update_ext_inquiry_response(int dd, struct hci_dev *dev)
+{
+ uint8_t fec = 0, data[240];
+
+ if (!(dev->features[6] & LMP_EXT_INQ))
+ return;
+
+ memset(data, 0, sizeof(data));
+
+ if (dev->ssp_mode > 0) {
+ int len;
+
+ len = strlen((char *) dev->name);
+ if (len > 48) {
+ len = 48;
+ data[1] = 0x08;
+ } else
+ data[1] = 0x09;
+ data[0] = len + 1;
+ memcpy(data + 2, dev->name, len);
+ }
+
+ if (hci_write_ext_inquiry_response(dd, fec, data, 2000) < 0)
+ error("Can't write extended inquiry response: %s (%d)",
+ strerror(errno), errno);
+}
+
int start_device(uint16_t dev_id)
{
struct hci_dev *dev;
struct hci_version ver;
uint8_t features[8], inqmode;
uint8_t events[8] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00 };
+ char name[249];
int dd, err;
ASSERT_DEV_ID;
@@ -246,24 +275,34 @@
if (hci_read_class_of_dev(dd, dev->class, 1000) < 0) {
err = errno;
- error("Can't read class of device on hci%d: %s(%d)",
- dev_id, strerror(err), err);
+ error("Can't read class of device on hci%d: %s (%d)",
+ dev_id, strerror(err), err);
hci_close_dev(dd);
return -err;
}
- inqmode = get_inquiry_mode(dev);
- if (inqmode < 1)
- goto done;
+ if (hci_read_local_name(dd, sizeof(name), name, 2000) < 0) {
+ err = errno;
+ error("Can't read local name on hci%d: %s (%d)",
+ dev_id, strerror(err), err);
+ hci_close_dev(dd);
+ return -err;
+ }
- if (hci_write_inquiry_mode(dd, inqmode, 1000) < 0) {
- int err = errno;
- error("Can't write inquiry mode for hci%d: %s (%d)",
- dev_id, strerror(errno), errno);
+ memcpy(dev->name, name, 248);
+
+ if (!(features[6] & LMP_SIMPLE_PAIR))
+ goto setup;
+
+ if (hci_read_simple_pairing_mode(dd, &dev->ssp_mode, 1000) < 0) {
+ err = errno;
+ error("Can't read simple pairing mode on hci%d: %s (%d)",
+ dev_id, strerror(err), err);
hci_close_dev(dd);
return -err;
}
+setup:
if (ver.hci_rev > 1) {
if (features[5] & LMP_SNIFF_SUBR)
events[5] |= 0x20;
@@ -280,10 +319,36 @@
if (features[7] & LMP_LSTO)
events[6] |= 0x80;
+ if (features[6] & LMP_SIMPLE_PAIR) {
+ events[6] |= 0x01; /* IO Capability Request */
+ events[6] |= 0x02; /* IO Capability Response */
+ events[6] |= 0x04; /* User Confirmation Request */
+ events[6] |= 0x08; /* User Passkey Request */
+ events[6] |= 0x10; /* Remote OOB Data Request */
+ events[6] |= 0x20; /* Simple Pairing Complete */
+ events[7] |= 0x04; /* User Passkey Notification */
+ events[7] |= 0x08; /* Keypress Notification */
+ events[7] |= 0x10; /* Remote Host Supported Features Notification */
+ }
+
hci_send_cmd(dd, OGF_HOST_CTL, OCF_SET_EVENT_MASK,
sizeof(events), events);
}
+ update_ext_inquiry_response(dd, dev);
+
+ inqmode = get_inquiry_mode(dev);
+ if (inqmode < 1)
+ goto done;
+
+ if (hci_write_inquiry_mode(dd, inqmode, 1000) < 0) {
+ int err = errno;
+ error("Can't write inquiry mode for hci%d: %s (%d)",
+ dev_id, strerror(errno), err);
+ hci_close_dev(dd);
+ return -err;
+ }
+
done:
hci_close_dev(dd);
@@ -450,6 +515,31 @@
return err;
}
+int set_simple_pairing_mode(uint16_t dev_id, uint8_t mode)
+{
+ struct hci_dev *dev;
+ int dd;
+
+ ASSERT_DEV_ID;
+
+ dev = &devices[dev_id];
+
+ dev->ssp_mode = mode;
+
+ dd = hci_open_dev(dev_id);
+ if (dd < 0) {
+ error("Can't open device hci%d",
+ dev_id, strerror(errno), errno);
+ return -errno;
+ }
+
+ update_ext_inquiry_response(dd, dev);
+
+ hci_close_dev(dd);
+
+ return 0;
+}
+
int get_device_name(uint16_t dev_id, char *name, size_t size)
{
char tmp[249];
@@ -505,28 +595,9 @@
return -err;
}
- if (dev->features[6] & LMP_EXT_INQ) {
- uint8_t fec = 0, data[240];
- int len;
+ memcpy(dev->name, name, 248);
- memset(data, 0, sizeof(data));
- len = strlen(name);
- if (len > 48) {
- len = 48;
- data[1] = 0x08;
- } else
- data[1] = 0x09;
- data[0] = len + 1;
- memcpy(data + 2, name, len);
-
- if (hci_write_ext_inquiry_response(dd, fec, data, 2000) < 0) {
- int err = errno;
- error("Can't write extended inquiry response for hci%d: %s (%d)",
- dev_id, strerror(errno), errno);
- hci_close_dev(dd);
- return -err;
- }
- }
+ update_ext_inquiry_response(dd, dev);
hci_close_dev(dd);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/hcid/hcid.h new/bluez-utils-3.14/hcid/hcid.h
--- old/bluez-utils-3.13/hcid/hcid.h 2007-06-08 20:48:21.000000000 +0200
+++ new/bluez-utils-3.14/hcid/hcid.h 2007-08-08 18:12:17.000000000 +0200
@@ -168,6 +168,7 @@
int get_device_manufacturer(uint16_t dev_id, char *manufacturer, size_t size);
int get_device_company(uint16_t dev_id, char *company, size_t size);
+int set_simple_pairing_mode(uint16_t dev_id, uint8_t mode);
int get_device_name(uint16_t dev_id, char *name, size_t size);
int set_device_name(uint16_t dev_id, const char *name);
int get_device_alias(uint16_t dev_id, const bdaddr_t *bdaddr, char *alias, size_t size);
@@ -203,3 +204,4 @@
int read_pin_code(bdaddr_t *local, bdaddr_t *peer, char *pin);
gboolean read_trust(bdaddr_t *local, const char *addr, const char *service);
int write_trust(bdaddr_t *local, const char *addr, const char *service, gboolean trust);
+GSList *list_trusts(bdaddr_t *local, const char *service);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/hcid/main.c new/bluez-utils-3.14/hcid/main.c
--- old/bluez-utils-3.13/hcid/main.c 2007-06-19 22:15:25.000000000 +0200
+++ new/bluez-utils-3.14/hcid/main.c 2007-08-08 18:12:17.000000000 +0200
@@ -159,7 +159,7 @@
if (sock < 0)
goto no_address;
- if (!hci_devinfo(hdev, &di) < 0) {
+ if (hci_devinfo(hdev, &di) < 0) {
close(sock);
goto no_address;
}
@@ -214,7 +214,7 @@
if (sock < 0)
goto no_address;
- if (!hci_devinfo(hdev, &di) < 0) {
+ if (hci_devinfo(hdev, &di) < 0) {
close(sock);
goto no_address;
}
@@ -523,14 +523,14 @@
if (ioctl(dd, HCIDEVUP, dev_id) < 0 && errno != EALREADY) {
error("Can't init device hci%d: %s (%d)",
dev_id, strerror(errno), errno);
- exit(1);
+ goto fail;
}
if (hci_devinfo(dev_id, &di) < 0)
- exit(1);
+ goto fail;
if (hci_test_bit(HCI_RAW, &di.flags))
- exit(0);
+ goto done;
if (hcid.offmode == HCID_OFFMODE_DEVDOWN) {
char mode[16];
@@ -538,20 +538,31 @@
if (read_device_mode(&di.bdaddr, mode, sizeof(mode)) == 0 &&
strcmp(mode, "off") == 0) {
ioctl(dd, HCIDEVDOWN, dev_id);
- exit(0);
+ goto done;
}
}
+done:
hci_close_dev(dd);
-
exit(0);
+
+fail:
+ hci_close_dev(dd);
+ exit(1);
}
static void device_devreg_setup(int dev_id)
{
+ struct hci_dev_info di;
+
if (hcid.auto_init)
init_device(dev_id);
- hcid_dbus_register_device(dev_id);
+
+ if (hci_devinfo(dev_id, &di) < 0)
+ return;
+
+ if (!hci_test_bit(HCI_RAW, &di.flags))
+ hcid_dbus_register_device(dev_id);
}
static void device_devup_setup(int dev_id)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/hcid/security.c new/bluez-utils-3.14/hcid/security.c
--- old/bluez-utils-3.13/hcid/security.c 2007-06-08 20:48:21.000000000 +0200
+++ new/bluez-utils-3.14/hcid/security.c 2007-08-08 18:12:17.000000000 +0200
@@ -304,6 +304,39 @@
}
}
+/* Simple Pairing handling */
+
+static void user_confirm_request(int dev, bdaddr_t *sba, void *ptr)
+{
+ hci_send_cmd(dev, OGF_LINK_CTL, OCF_USER_CONFIRM_NEG_REPLY, 6, ptr);
+}
+
+static void user_passkey_request(int dev, bdaddr_t *sba, void *ptr)
+{
+ hci_send_cmd(dev, OGF_LINK_CTL, OCF_USER_PASSKEY_NEG_REPLY, 6, ptr);
+}
+
+static void remote_oob_data_request(int dev, bdaddr_t *sba, void *ptr)
+{
+ hci_send_cmd(dev, OGF_LINK_CTL, OCF_REMOTE_OOB_DATA_NEG_REPLY, 6, ptr);
+}
+
+static void io_capa_request(int dev, bdaddr_t *sba, bdaddr_t *dba)
+{
+ io_capability_neg_reply_cp cp;
+ char sa[18], da[18];
+
+ ba2str(sba, sa); ba2str(dba, da);
+ info("io_capa_request (sba=%s, dba=%s)", sa, da);
+
+ memset(&cp, 0, sizeof(cp));
+ bacpy(&cp.bdaddr, dba);
+ cp.reason = HCI_PAIRING_NOT_ALLOWED;
+
+ hci_send_cmd(dev, OGF_LINK_CTL, OCF_IO_CAPABILITY_NEG_REPLY,
+ IO_CAPABILITY_NEG_REPLY_CP_SIZE, &cp);
+}
+
/* PIN code handling */
void set_pin_length(bdaddr_t *sba, int length)
@@ -439,6 +472,9 @@
case cmd_opcode_pack(OGF_HOST_CTL, OCF_WRITE_CLASS_OF_DEV):
hcid_dbus_write_class_complete(sba);
break;
+ case cmd_opcode_pack(OGF_HOST_CTL, OCF_WRITE_SIMPLE_PAIRING_MODE):
+ hcid_dbus_write_simple_pairing_mode_complete(sba);
+ break;
case cmd_opcode_pack(OGF_LINK_CTL, OCF_PIN_CODE_REPLY):
case cmd_opcode_pack(OGF_LINK_CTL, OCF_PIN_CODE_NEG_REPLY):
hcid_dbus_pin_code_reply(sba, ptr);
@@ -772,6 +808,22 @@
case EVT_RETURN_LINK_KEYS:
return_link_keys(dev, &di->bdaddr, ptr);
break;
+
+ case EVT_IO_CAPABILITY_REQUEST:
+ io_capa_request(dev, &di->bdaddr, (bdaddr_t *) ptr);
+ break;
+
+ case EVT_USER_CONFIRM_REQUEST:
+ user_confirm_request(dev, &di->bdaddr, ptr);
+ break;
+
+ case EVT_USER_PASSKEY_REQUEST:
+ user_passkey_request(dev, &di->bdaddr, ptr);
+ break;
+
+ case EVT_REMOTE_OOB_DATA_REQUEST:
+ remote_oob_data_request(dev, &di->bdaddr, ptr);
+ break;
}
return TRUE;
@@ -805,17 +857,26 @@
hci_filter_set_event(EVT_LINK_KEY_REQ, &flt);
hci_filter_set_event(EVT_LINK_KEY_NOTIFY, &flt);
hci_filter_set_event(EVT_RETURN_LINK_KEYS, &flt);
+ hci_filter_set_event(EVT_IO_CAPABILITY_REQUEST, &flt);
+ hci_filter_set_event(EVT_IO_CAPABILITY_RESPONSE, &flt);
+ hci_filter_set_event(EVT_USER_CONFIRM_REQUEST, &flt);
+ hci_filter_set_event(EVT_USER_PASSKEY_REQUEST, &flt);
+ hci_filter_set_event(EVT_REMOTE_OOB_DATA_REQUEST, &flt);
+ hci_filter_set_event(EVT_USER_PASSKEY_NOTIFY, &flt);
+ hci_filter_set_event(EVT_KEYPRESS_NOTIFY, &flt);
+ hci_filter_set_event(EVT_SIMPLE_PAIRING_COMPLETE, &flt);
+ hci_filter_set_event(EVT_AUTH_COMPLETE, &flt);
hci_filter_set_event(EVT_REMOTE_NAME_REQ_COMPLETE, &flt);
hci_filter_set_event(EVT_READ_REMOTE_VERSION_COMPLETE, &flt);
hci_filter_set_event(EVT_READ_REMOTE_FEATURES_COMPLETE, &flt);
+ hci_filter_set_event(EVT_REMOTE_HOST_FEATURES_NOTIFY, &flt);
hci_filter_set_event(EVT_INQUIRY_COMPLETE, &flt);
hci_filter_set_event(EVT_INQUIRY_RESULT, &flt);
hci_filter_set_event(EVT_INQUIRY_RESULT_WITH_RSSI, &flt);
hci_filter_set_event(EVT_EXTENDED_INQUIRY_RESULT, &flt);
+ hci_filter_set_event(EVT_CONN_REQUEST, &flt);
hci_filter_set_event(EVT_CONN_COMPLETE, &flt);
hci_filter_set_event(EVT_DISCONN_COMPLETE, &flt);
- hci_filter_set_event(EVT_AUTH_COMPLETE, &flt);
- hci_filter_set_event(EVT_CONN_REQUEST, &flt);
if (setsockopt(dev, SOL_HCI, HCI_FILTER, &flt, sizeof(flt)) < 0) {
error("Can't set filter on hci%d: %s (%d)",
hdev, strerror(errno), errno);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/hcid/storage.c new/bluez-utils-3.14/hcid/storage.c
--- old/bluez-utils-3.13/hcid/storage.c 2007-05-09 08:40:42.000000000 +0200
+++ new/bluez-utils-3.14/hcid/storage.c 2007-08-08 18:12:17.000000000 +0200
@@ -608,3 +608,32 @@
return ret;
}
+
+struct trust_list {
+ GSList *trusts;
+ const char *service;
+};
+
+static void append_trust(char *key, char *value, void *data)
+{
+ struct trust_list *list = data;
+
+ if (strstr(value, list->service))
+ list->trusts = g_slist_append(list->trusts, g_strdup(key));
+}
+
+GSList *list_trusts(bdaddr_t *local, const char *service)
+{
+ char filename[PATH_MAX + 1];
+ struct trust_list list;
+
+ create_filename(filename, PATH_MAX, local, "trusts");
+
+ list.trusts = NULL;
+ list.service = service;
+
+ if (textfile_foreach(filename, append_trust, &list) < 0)
+ return NULL;
+
+ return list.trusts;
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/input/device.c new/bluez-utils-3.14/input/device.c
--- old/bluez-utils-3.13/input/device.c 2007-06-24 00:55:58.000000000 +0200
+++ new/bluez-utils-3.14/input/device.c 2007-08-08 18:12:17.000000000 +0200
@@ -85,10 +85,22 @@
GSList *devices = NULL;
-static struct device *device_new(bdaddr_t *src, bdaddr_t *dst)
+static struct device *device_new(bdaddr_t *src, bdaddr_t *dst, uint8_t subclass)
{
struct device *idev;
uint32_t cls;
+ uint8_t major, minor;
+
+ if (!subclass) {
+ if (read_device_class(src, dst, &cls) < 0)
+ return NULL;
+
+ major = (cls >> 8) & 0x1f;
+ minor = (cls >> 2) & 0x3f;
+ } else {
+ major = 0x05; /* Peripheral */
+ minor = (subclass >> 2) & 0x3f;
+ }
idev = g_new0(struct device, 1);
@@ -96,10 +108,9 @@
bacpy(&idev->dst, dst);
read_device_name(src, dst, &idev->name);
- read_device_class(src, dst, &cls);
- idev->major = (cls >> 8) & 0x1f;
- idev->minor = (cls >> 2) & 0x3f;
+ idev->major = major;
+ idev->minor = minor;
idev->ctrl_sk = -1;
idev->intr_sk = -1;
@@ -941,8 +952,8 @@
{
struct device *idev = data;
DBusMessage *reply;
- const char *pname = idev->name;
-
+ const char *pname = (idev->name ? idev->name : "");
+
reply = dbus_message_new_method_return(msg);
if (!reply)
return DBUS_HANDLER_RESULT_NEED_MEMORY;
@@ -1055,8 +1066,16 @@
const char *path;
int err;
- idev = device_new(src, dst);
+ idev = device_new(src, dst, hid->subclass);
+ if (!idev)
+ return -EINVAL;
+
path = create_input_path(idev->major, idev->minor);
+ if (!path) {
+ device_free(idev);
+ return -EINVAL;
+ }
+
idev->path = g_strdup(path);
idev->product = hid->product;
idev->vendor = hid->vendor;
@@ -1077,8 +1096,16 @@
const char *path;
int err;
- idev = device_new(src, dst);
+ idev = device_new(src, dst, 0);
+ if (!idev)
+ return -EINVAL;
+
path = create_input_path(idev->major, idev->minor);
+ if (!path) {
+ device_free(idev);
+ return -EINVAL;
+ }
+
idev->path = g_strdup(path);
idev->conn = dbus_connection_ref(conn);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/input/manager.c new/bluez-utils-3.14/input/manager.c
--- old/bluez-utils-3.13/input/manager.c 2007-06-24 00:55:58.000000000 +0200
+++ new/bluez-utils-3.14/input/manager.c 2007-08-08 18:12:17.000000000 +0200
@@ -181,6 +181,31 @@
return 0;
}
+static void epox_endian_quirk(unsigned char *data, int size)
+{
+ /* USAGE_PAGE (Keyboard) 05 07
+ * USAGE_MINIMUM (0) 19 00
+ * USAGE_MAXIMUM (65280) 2A 00 FF <= must be FF 00
+ * LOGICAL_MINIMUM (0) 15 00
+ * LOGICAL_MAXIMUM (65280) 26 00 FF <= must be FF 00
+ */
+ unsigned char pattern[] = { 0x05, 0x07, 0x19, 0x00, 0x2a, 0x00, 0xff,
+ 0x15, 0x00, 0x26, 0x00, 0xff };
+ int i;
+
+ if (!data)
+ return;
+
+ for (i = 0; i < size - sizeof(pattern); i++) {
+ if (!memcmp(data + i, pattern, sizeof(pattern))) {
+ data[i + 5] = 0xff;
+ data[i + 6] = 0x00;
+ data[i + 10] = 0xff;
+ data[i + 11] = 0x00;
+ }
+ }
+}
+
static void extract_hid_record(sdp_record_t *rec, struct hidp_connadd_req *req)
{
sdp_data_t *pdlist, *pdlist2;
@@ -233,6 +258,7 @@
memcpy(req->rd_data, (unsigned char *) pdlist->val.str,
pdlist->unitSize);
req->rd_size = pdlist->unitSize;
+ epox_endian_quirk(req->rd_data, req->rd_size);
}
}
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/input/storage.c new/bluez-utils-3.14/input/storage.c
--- old/bluez-utils-3.13/input/storage.c 2007-06-24 00:55:58.000000000 +0200
+++ new/bluez-utils-3.14/input/storage.c 2007-08-08 18:12:17.000000000 +0200
@@ -183,7 +183,7 @@
create_filename(filename, PATH_MAX, src, "input");
- size = 15 + 3 + 3 + 5 + (req->rd_size * 2) + 1 + 9;
+ size = 15 + 3 + 3 + 5 + (req->rd_size * 2) + 2 + 9;
str = g_try_malloc0(size);
if (!str)
return -ENOMEM;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/tools/csr.c new/bluez-utils-3.14/tools/csr.c
--- old/bluez-utils-3.13/tools/csr.c 2007-07-26 09:35:12.000000000 +0200
+++ new/bluez-utils-3.14/tools/csr.c 2007-08-08 18:12:17.000000000 +0200
@@ -353,6 +353,8 @@
{ 4363, "Unified 22c" },
{ 4373, "Unified 22c" },
{ 4374, "Unified 22c" },
+ { 4532, "Unified 22d" },
+ { 4533, "Unified 22d" },
{ 2526, "Marcel 1 (2005-09-26)" },
{ 2543, "Marcel 2 (2005-09-28)" },
{ 2622, "Marcel 3 (2005-10-27)" },
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/tools/hciconfig.8 new/bluez-utils-3.14/tools/hciconfig.8
--- old/bluez-utils-3.13/tools/hciconfig.8 2006-06-01 20:36:20.000000000 +0200
+++ new/bluez-utils-3.14/tools/hciconfig.8 2007-08-08 18:12:17.000000000 +0200
@@ -183,6 +183,12 @@
prints out the current AFH mode. Otherwise, sets AFH mode to
.IR mode .
.TP
+.BI sspmode " [mode]"
+With no
+.IR mode ,
+prints out the current Simple Pairing mode. Otherwise, sets Simple Pairing mode to
+.IR mode .
+.TP
\fBaclmtu\fP \fImtu\fP:\fIpkt\fP
Sets ACL MTU to
to
@@ -208,6 +214,9 @@
.I bdaddr
from the device.
.TP
+.BI oobdata
+Display local OOB data.
+.TP
.BI commands
Display supported commands.
.TP
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/tools/hciconfig.c new/bluez-utils-3.14/tools/hciconfig.c
--- old/bluez-utils-3.13/tools/hciconfig.c 2007-01-28 21:16:48.000000000 +0100
+++ new/bluez-utils-3.14/tools/hciconfig.c 2007-08-08 18:12:17.000000000 +0200
@@ -433,36 +433,11 @@
}
if (opt) {
- uint8_t fec = 0, data[240];
- int len, eir = 0;
-
- if (di.features[6] & LMP_EXT_INQ) {
- if (hci_read_ext_inquiry_response(dd, &fec, data, 1000) == 0)
- eir = 1;
- }
-
- memset(data, 0, sizeof(data));
- len = strlen(opt);
- if (len > 48) {
- len = 48;
- data[1] = 0x08;
- } else
- data[1] = 0x09;
- data[0] = len + 1;
- memcpy(data + 2, opt, len);
-
if (hci_write_local_name(dd, opt, 2000) < 0) {
fprintf(stderr, "Can't change local name on hci%d: %s (%d)\n",
hdev, strerror(errno), errno);
exit(1);
}
-
- if (eir) {
- if (hci_write_ext_inquiry_response(dd, fec, data, 2000) < 0) {
- fprintf(stderr, "Can't set extended inquiry response on hci%d: %s (%d)\n",
- hdev, strerror(errno), errno);
- }
- }
} else {
char name[249];
int i;
@@ -885,6 +860,36 @@
hci_close_dev(dd);
}
+static void cmd_oob_data(int ctl, int hdev, char *opt)
+{
+ uint8_t hash[16], randomizer[16];
+ int i, dd;
+
+ dd = hci_open_dev(hdev);
+ if (dd < 0) {
+ fprintf(stderr, "Can't open device hci%d: %s (%d)\n",
+ hdev, strerror(errno), errno);
+ exit(1);
+ }
+
+ if (hci_read_local_oob_data(dd, hash, randomizer, 1000) < 0) {
+ fprintf(stderr, "Can't read local OOB data on hci%d: %s (%d)\n",
+ hdev, strerror(errno), errno);
+ exit(1);
+ }
+
+ print_dev_hdr(&di);
+ printf("\tOOB Hash: ");
+ for (i = 0; i < 16; i++)
+ printf(" %02x", hash[i]);
+ printf("\n\tRandomizer:");
+ for (i = 0; i < 16; i++)
+ printf(" %02x", randomizer[i]);
+ printf("\n");
+
+ hci_close_dev(dd);
+}
+
static void cmd_commands(int ctl, int hdev, char *opt)
{
uint8_t cmds[64];
@@ -1365,6 +1370,39 @@
}
}
+static void cmd_ssp_mode(int ctl, int hdev, char *opt)
+{
+ int dd;
+
+ dd = hci_open_dev(hdev);
+ if (dd < 0) {
+ fprintf(stderr, "Can't open device hci%d: %s (%d)\n",
+ hdev, strerror(errno), errno);
+ exit(1);
+ }
+
+ if (opt) {
+ uint8_t mode = atoi(opt);
+
+ if (hci_write_simple_pairing_mode(dd, mode, 2000) < 0) {
+ fprintf(stderr, "Can't set Simple Pairing mode on hci%d: %s (%d)\n",
+ hdev, strerror(errno), errno);
+ exit(1);
+ }
+ } else {
+ uint8_t mode;
+
+ if (hci_read_simple_pairing_mode(dd, &mode, 1000) < 0) {
+ fprintf(stderr, "Can't read Simple Pairing mode on hci%d: %s (%d)\n",
+ hdev, strerror(errno), errno);
+ exit(1);
+ }
+
+ print_dev_hdr(&di);
+ printf("\tSimple Pairing mode: %s\n", mode == 1 ? "Enabled" : "Disabled");
+ }
+}
+
static void print_rev_ericsson(int dd)
{
struct hci_request rq;
@@ -1571,10 +1609,12 @@
{ "pageparms", cmd_page_parms, "[win:int]", "Get/Set page scan window and interval" },
{ "pageto", cmd_page_to, "[to]", "Get/Set page timeout" },
{ "afhmode", cmd_afh_mode, "[mode]", "Get/Set AFH mode" },
+ { "sspmode", cmd_ssp_mode, "[mode]", "Get/Set Simple Pairing Mode" },
{ "aclmtu", cmd_aclmtu, "mtu:pkt", "Set ACL MTU and number of packets" },
{ "scomtu", cmd_scomtu, "mtu:pkt", "Set SCO MTU and number of packets" },
{ "putkey", cmd_putkey, "<bdaddr>", "Store link key on the device" },
{ "delkey", cmd_delkey, "<bdaddr>", "Delete link key from the device" },
+ { "oobdata", cmd_oob_data, 0, "Display local OOB data" },
{ "commands", cmd_commands, 0, "Display supported commands" },
{ "features", cmd_features, 0, "Display device features" },
{ "version", cmd_version, 0, "Display version information" },
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bluez-utils-3.13/tools/hcisecfilter.c new/bluez-utils-3.14/tools/hcisecfilter.c
--- old/bluez-utils-3.13/tools/hcisecfilter.c 2007-01-28 21:16:48.000000000 +0100
+++ new/bluez-utils-3.14/tools/hcisecfilter.c 2007-08-08 18:12:17.000000000 +0200
@@ -81,7 +81,7 @@
hci_set_bit(OCF_READ_CLOCK_OFFSET, ocf_mask);
hci_set_bit(OCF_READ_LMP_HANDLE, ocf_mask);
- printf("OGF_LINK_CTL: { 0x%08x, 0x%08x, 0x%06x, 0x%02x }\n",
+ printf("OGF_LINK_CTL: { 0x%08x, 0x%08x, 0x%08x, 0x%02x }\n",
ocf_mask[0], ocf_mask[1], ocf_mask[2], ocf_mask[3]);
/* OGF_LINK_POLICY */
@@ -90,7 +90,7 @@
hci_set_bit(OCF_READ_LINK_POLICY, ocf_mask);
hci_set_bit(OCF_READ_DEFAULT_LINK_POLICY, ocf_mask);
- printf("OGF_LINK_POLICY: { 0x%08x, 0x%08x, 0x%06x, 0x%02x }\n",
+ printf("OGF_LINK_POLICY: { 0x%08x, 0x%08x, 0x%08x, 0x%02x }\n",
ocf_mask[0], ocf_mask[1], ocf_mask[2], ocf_mask[3]);
/* OGF_HOST_CTL */
@@ -120,8 +120,11 @@
hci_set_bit(OCF_READ_PAGE_SCAN_TYPE, ocf_mask);
hci_set_bit(OCF_READ_AFH_MODE, ocf_mask);
hci_set_bit(OCF_READ_EXT_INQUIRY_RESPONSE, ocf_mask);
+ hci_set_bit(OCF_READ_SIMPLE_PAIRING_MODE, ocf_mask);
+ hci_set_bit(OCF_READ_INQUIRY_TRANSMIT_POWER_LEVEL, ocf_mask);
+ hci_set_bit(OCF_READ_DEFAULT_ERROR_DATA_REPORTING, ocf_mask);
- printf("OGF_HOST_CTL: { 0x%08x, 0x%08x, 0x%06x, 0x%02x }\n",
+ printf("OGF_HOST_CTL: { 0x%08x, 0x%08x, 0x%08x, 0x%02x }\n",
ocf_mask[0], ocf_mask[1], ocf_mask[2], ocf_mask[3]);
/* OGF_INFO_PARAM */
@@ -134,7 +137,7 @@
hci_set_bit(OCF_READ_COUNTRY_CODE, ocf_mask);
hci_set_bit(OCF_READ_BD_ADDR, ocf_mask);
- printf("OGF_INFO_PARAM: { 0x%08x, 0x%08x, 0x%06x, 0x%02x }\n",
+ printf("OGF_INFO_PARAM: { 0x%08x, 0x%08x, 0x%08x, 0x%02x }\n",
ocf_mask[0], ocf_mask[1], ocf_mask[2], ocf_mask[3]);
/* OGF_STATUS_PARAM */
@@ -145,7 +148,7 @@
hci_set_bit(OCF_READ_AFH_MAP, ocf_mask);
hci_set_bit(OCF_READ_CLOCK, ocf_mask);
- printf("OGF_STATUS_PARAM: { 0x%08x, 0x%08x, 0x%06x, 0x%02x }\n",
+ printf("OGF_STATUS_PARAM: { 0x%08x, 0x%08x, 0x%08x, 0x%02x }\n",
ocf_mask[0], ocf_mask[1], ocf_mask[2], ocf_mask[3]);
return 0;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org