From: Bruna Moreira <bruna.moreira@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Cc: Bruna Moreira <bruna.moreira@openbossa.org>
Subject: [PATCH 2/2] Remove le_advertising_info struct from adapter.c
Date: Mon, 20 Dec 2010 14:16:45 -0400 [thread overview]
Message-ID: <1292869005-12391-2-git-send-email-bruna.moreira@openbossa.org> (raw)
In-Reply-To: <1292869005-12391-1-git-send-email-bruna.moreira@openbossa.org>
---
src/adapter.c | 13 ++++---------
src/adapter.h | 6 +++---
src/event.c | 6 +++++-
3 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/src/adapter.c b/src/adapter.c
index db3649f..5cdf4c2 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2763,23 +2763,18 @@ static void remove_same_uuid(gpointer data, gpointer user_data)
}
void adapter_update_device_from_info(struct btd_adapter *adapter,
- le_advertising_info *info,
- char *name, GSList *services,
- uint8_t flags)
+ bdaddr_t bdaddr, int8_t rssi,
+ uint8_t evt_type, char *name,
+ GSList *services, uint8_t flags)
{
struct remote_dev_info *dev;
- bdaddr_t bdaddr;
gboolean new_dev;
- int8_t rssi;
-
- rssi = *(info->data + info->length);
- bdaddr = info->bdaddr;
dev = get_found_dev(adapter, &bdaddr, &new_dev);
if (new_dev) {
dev->le = TRUE;
- dev->evt_type = info->evt_type;
+ dev->evt_type = evt_type;
} else if (dev->rssi == rssi)
return;
diff --git a/src/adapter.h b/src/adapter.h
index a390088..039c30b 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -136,9 +136,9 @@ int adapter_get_discover_type(struct btd_adapter *adapter);
struct remote_dev_info *adapter_search_found_devices(struct btd_adapter *adapter,
struct remote_dev_info *match);
void adapter_update_device_from_info(struct btd_adapter *adapter,
- le_advertising_info *info,
- char *name, GSList *services,
- uint8_t flags);
+ bdaddr_t bdaddr, int8_t rssi,
+ uint8_t evt_type, char *name,
+ GSList *services, uint8_t flags);
void adapter_update_found_devices(struct btd_adapter *adapter, bdaddr_t *bdaddr,
int8_t rssi, uint32_t class, const char *name,
const char *alias, gboolean legacy,
diff --git a/src/event.c b/src/event.c
index 3603643..55a83c2 100644
--- a/src/event.c
+++ b/src/event.c
@@ -435,6 +435,7 @@ void btd_event_advertising_report(bdaddr_t *local, le_advertising_info *info)
{
struct btd_adapter *adapter;
struct eir_data eir_data;
+ int8_t rssi;
int err;
adapter = manager_find_adapter(local);
@@ -450,7 +451,10 @@ void btd_event_advertising_report(bdaddr_t *local, le_advertising_info *info)
error("Error parsing advertising data: %s (%d)",
strerror(-err), -err);
- adapter_update_device_from_info(adapter, info, eir_data.name,
+ rssi = *(info->data + info->length);
+
+ adapter_update_device_from_info(adapter, info->bdaddr, rssi,
+ info->evt_type, eir_data.name,
eir_data.services, eir_data.flags);
}
--
1.7.0.4
next prev parent reply other threads:[~2010-12-20 18:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-20 18:16 [PATCH 1/2] Move EIR flags definitions to adapter.c Bruna Moreira
2010-12-20 18:16 ` Bruna Moreira [this message]
2010-12-20 18:54 ` Gustavo F. Padovan
2010-12-20 20:10 ` Bruna Moreira
2010-12-20 22:43 ` Johan Hedberg
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=1292869005-12391-2-git-send-email-bruna.moreira@openbossa.org \
--to=bruna.moreira@openbossa.org \
--cc=linux-bluetooth@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox