From: Marcel Holtmann <marcel@holtmann.org>
To: Inga Stotland <ingas@codeaurora.org>
Cc: linux-bluetooth@vger.kernel.org, johan.hedberg@gmail.com,
rshaffer@codeaurora.org
Subject: Re: [PATCH 2/3] Update EIR whenever record is added or removed
Date: Thu, 08 Jul 2010 14:21:05 -0300 [thread overview]
Message-ID: <1278609665.10421.34.camel@localhost.localdomain> (raw)
In-Reply-To: <1278540518-18620-3-git-send-email-ingas@codeaurora.org>
Hi Inga,
> index 96280bd..8ec4df4 100644
> --- a/plugins/service.c
> +++ b/plugins/service.c
> @@ -4,6 +4,7 @@
> *
> * Copyright (C) 2006-2010 Nokia Corporation
> * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
> + * Copyright (C) 2010, Code Aurora Forum. All rights reserved.
see my comment from the other email.
> *
> *
> * This program is free software; you can redistribute it and/or modify
> @@ -445,6 +446,8 @@ static DBusMessage *update_record(DBusConnection *conn, DBusMessage *msg,
> strerror(EIO));
> }
>
> + adapter_update_ext_inquiry_response(&src);
> +
> return dbus_message_new_method_return(msg);
> }
>
> @@ -516,6 +519,7 @@ static DBusMessage *add_service_record(DBusConnection *conn,
> const char *sender, *record;
> dbus_uint32_t handle;
> int err;
> + bdaddr_t addr;
Use bdaddr as variable name. In general the addr name is used for the
string version of the address.
> if (dbus_message_get_args(msg, NULL,
> DBUS_TYPE_STRING, &record, DBUS_TYPE_INVALID) == FALSE)
> @@ -526,6 +530,13 @@ static DBusMessage *add_service_record(DBusConnection *conn,
> if (err < 0)
> return failed_strerror(msg, err);
>
> + if (serv_adapter->adapter)
> + adapter_get_address(serv_adapter->adapter, &addr);
> + else
> + bacpy(&addr, BDADDR_ANY);
> +
> + adapter_update_ext_inquiry_response(&addr);
> +
> reply = dbus_message_new_method_return(msg);
> if (!reply)
> return NULL;
> @@ -550,6 +561,7 @@ static DBusMessage *remove_service_record(DBusConnection *conn,
> struct service_adapter *serv_adapter = data;
> dbus_uint32_t handle;
> const char *sender;
> + bdaddr_t addr;
See above.
>
> if (dbus_message_get_args(msg, NULL, DBUS_TYPE_UINT32, &handle,
> DBUS_TYPE_INVALID) == FALSE)
> @@ -560,6 +572,13 @@ static DBusMessage *remove_service_record(DBusConnection *conn,
> if (remove_record(conn, sender, serv_adapter, handle) < 0)
> return not_available(msg);
>
> + if (serv_adapter->adapter)
> + adapter_get_address(serv_adapter->adapter, &addr);
> + else
> + bacpy(&addr, BDADDR_ANY);
> +
> + adapter_update_ext_inquiry_response(&addr);
> +
> return dbus_message_new_method_return(msg);
> }
>
> diff --git a/src/adapter.c b/src/adapter.c
> index 2a6ac18..8a05356 100644
> --- a/src/adapter.c
> +++ b/src/adapter.c
> @@ -4,6 +4,7 @@
> *
> * Copyright (C) 2006-2010 Nokia Corporation
> * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
> + * Copyright (C) 2010, Code Aurora Forum. All rights reserved.
> *
> *
> * This program is free software; you can redistribute it and/or modify
> @@ -820,7 +821,7 @@ static DBusMessage *set_pairable_timeout(DBusConnection *conn,
>
> static void update_ext_inquiry_response(struct btd_adapter *adapter)
> {
> - uint8_t fec = 0, data[240];
> + uint8_t fec = 0, data[EIR_DATA_LENGTH];
> struct hci_dev *dev = &adapter->dev;
> int dd;
>
> @@ -846,6 +847,27 @@ static void update_ext_inquiry_response(struct btd_adapter *adapter)
> hci_close_dev(dd);
> }
>
> +void adapter_update_ext_inquiry_response(const bdaddr_t *src)
Call this adapter_update_eir_data().
Feel free to fix the update_ext_... into update_eir_data() if you want
in a separate patch.
Regards
Marcel
next prev parent reply other threads:[~2010-07-08 17:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-07 22:08 [PATCH v2 0/3] Enhanced support for extended inquiry response Inga Stotland
2010-07-07 22:08 ` [PATCH 1/3] Support for adding UUID128 to " Inga Stotland
2010-07-08 17:17 ` Marcel Holtmann
2010-07-09 17:03 ` Ron Shaffer
2010-07-09 17:35 ` Marcel Holtmann
2010-07-30 19:13 ` Copyrights and Legal header ingas
2010-07-30 21:38 ` Marcel Holtmann
2010-07-07 22:08 ` [PATCH 2/3] Update EIR whenever record is added or removed Inga Stotland
2010-07-08 17:21 ` Marcel Holtmann [this message]
2010-07-07 22:08 ` [PATCH 3/3] Extended support for generating dictionary value of service UUIDs Inga Stotland
2010-07-08 11:36 ` Luiz Augusto von Dentz
2010-07-08 17:23 ` Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1278609665.10421.34.camel@localhost.localdomain \
--to=marcel@holtmann.org \
--cc=ingas@codeaurora.org \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=rshaffer@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.