summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-device.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-02-25 01:11:29 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-02-25 01:11:29 +0000
commitd854c2fb020019c7ff50e53c5e4df01dfb233a6c (patch)
tree7f7430817dfb19962c0f0a83a214d6a9d90437e9 /hcid/dbus-device.c
parent42e4202d2c8deed9a6d869f8b8b5e9902bf008bd (diff)
Add support for the remote company name
Diffstat (limited to 'hcid/dbus-device.c')
-rw-r--r--hcid/dbus-device.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/hcid/dbus-device.c b/hcid/dbus-device.c
index d44c1cfc..9310bd8a 100644
--- a/hcid/dbus-device.c
+++ b/hcid/dbus-device.c
@@ -40,6 +40,7 @@
#include "dbus.h"
#include "textfile.h"
+#include "oui.h"
static const char *service_cls[] = {
"positioning",
@@ -841,8 +842,28 @@ static DBusMessage *handle_dev_get_remote_manufacturer_req(DBusMessage *msg, voi
static DBusMessage *handle_dev_get_remote_company_req(DBusMessage *msg, void *data)
{
- /*FIXME: */
- return bluez_new_failure_msg(msg, BLUEZ_EDBUS_NOT_IMPLEMENTED);
+ DBusMessage *reply;
+ bdaddr_t bdaddr;
+ char oui[9], *str_bdaddr, *tmp;
+
+ dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &str_bdaddr,
+ DBUS_TYPE_INVALID);
+
+ str2ba(str_bdaddr, &bdaddr);
+ ba2oui(&bdaddr, oui);
+
+ tmp = ouitocomp(oui);
+ if (!tmp)
+ return bluez_new_failure_msg(msg, BLUEZ_EDBUS_RECORD_NOT_FOUND);
+
+ reply = dbus_message_new_method_return(msg);
+
+ dbus_message_append_args(reply, DBUS_TYPE_STRING, &tmp,
+ DBUS_TYPE_INVALID);
+
+ free(tmp);
+
+ return reply;
}
static DBusMessage *handle_dev_create_bonding_req(DBusMessage *msg, void *data)