diff --git a/src/adapter.c b/src/adapter.c
index dd1cb36..7353184 100644
--- a/src/adapter.c
+++ b/src/adapter.c
bool discoverable;
};
-struct watch_client {
+struct discovery_client {
struct btd_adapter *adapter;
DBusMessage *msg;
char *owner;
*/
/* current discovery filter, if any */
struct mgmt_cp_start_service_discovery *current_discovery_filter;
- struct watch_client *client; /* active discovery client */
+ struct discovery_client *client; /* active discovery client */
GSList *discovery_found; /* list of found devices */
guint discovery_idle_timeout; /* timeout between discovery runs */
static void discovery_free(void *user_data)
{
- struct watch_client *client = user_data;
+ struct discovery_client *client = user_data;
DBG("%p", client);
g_free(client);
}
-static void discovery_remove(struct watch_client *client)
+static void discovery_remove(struct discovery_client *client)
{
struct btd_adapter *adapter = client->adapter;
static void trigger_start_discovery(struct btd_adapter *adapter, guint delay);
-static struct watch_client *discovery_complete(struct btd_adapter *adapter,
+static struct discovery_client *discovery_complete(struct btd_adapter *adapter,
uint8_t status)
{
- struct watch_client *client = adapter->client;
+ struct discovery_client *client = adapter->client;
DBusMessage *reply;
if (!client)
const void *param, void *user_data)
{
struct btd_adapter *adapter = user_data;
- struct watch_client *client;
+ struct discovery_client *client;
const struct mgmt_cp_start_discovery *rp = param;
DBG("status 0x%02x", status);
const void *param, void *user_data)
{
struct btd_adapter *adapter = user_data;
- struct watch_client *client;
+ struct discovery_client *client;
DBG("status 0x%02x", status);
static int compare_sender(gconstpointer a, gconstpointer b)
{
- const struct watch_client *client = a;
+ const struct discovery_client *client = a;
const char *sender = b;
return g_strcmp0(client->owner, sender);
bool has_filtered_discovery = false;
for (l = adapter->discovery_list; l != NULL; l = g_slist_next(l)) {
- struct watch_client *client = l->data;
+ struct discovery_client *client = l->data;
struct discovery_filter *item = client->discovery_filter;
if (!item) {
}
for (l = adapter->discovery_list; l; l = g_slist_next(l)) {
- struct watch_client *client = l->data;
+ struct discovery_client *client = l->data;
if (!client->discovery_filter)
continue;
return -EINPROGRESS;
}
-static int discovery_stop(struct watch_client *client)
+static int discovery_stop(struct discovery_client *client)
{
struct btd_adapter *adapter = client->adapter;
struct mgmt_cp_stop_discovery cp;
static void discovery_disconnect(DBusConnection *conn, void *user_data)
{
- struct watch_client *client = user_data;
+ struct discovery_client *client = user_data;
DBG("owner %s", client->owner);
* Returns true if client was already discovering, false otherwise. *client
* will point to discovering client, or client that have pre-set his filter.
*/
-static bool get_discovery_client(struct btd_adapter *adapter,
- const char *owner,
- struct watch_client **client)
+static bool get_discovery_client(struct btd_adapter *adapter, const char *owner,
+ struct discovery_client **client)
{
GSList *list = g_slist_find_custom(adapter->discovery_list, owner,
compare_sender);
{
struct btd_adapter *adapter = user_data;
const char *sender = dbus_message_get_sender(msg);
- struct watch_client *client;
+ struct discovery_client *client;
bool is_discovering;
int err;
goto done;
}
- client = g_new0(struct watch_client, 1);
+ client = g_new0(struct discovery_client, 1);
client->adapter = adapter;
client->owner = g_strdup(sender);
DBusMessage *msg, void *user_data)
{
struct btd_adapter *adapter = user_data;
- struct watch_client *client;
+ struct discovery_client *client;
struct discovery_filter *discovery_filter;
const char *sender = dbus_message_get_sender(msg);
bool is_discovering;
DBG("successfully cleared pre-set filter");
} else if (discovery_filter) {
/* Client pre-setting his filter for first time */
- client = g_new0(struct watch_client, 1);
+ client = g_new0(struct discovery_client, 1);
client->adapter = adapter;
client->owner = g_strdup(sender);
client->discovery_filter = discovery_filter;
{
struct btd_adapter *adapter = user_data;
const char *sender = dbus_message_get_sender(msg);
- struct watch_client *client;
+ struct discovery_client *client;
GSList *list;
int err;
for (l = discovery_filter; l != NULL && got_match != true;
l = g_slist_next(l)) {
- struct watch_client *client = l->data;
+ struct discovery_client *client = l->data;
struct discovery_filter *item = client->discovery_filter;
/*
static void filter_duplicate_data(void *data, void *user_data)
{
- struct watch_client *client = data;
+ struct discovery_client *client = data;
bool *duplicate = user_data;
if (*duplicate || !client->discovery_filter)
/* Do a prefix match for both address and name if pattern is set */
for (l = adapter->discovery_list; l; l = g_slist_next(l)) {
- struct watch_client *client = l->data;
+ struct discovery_client *client = l->data;
struct discovery_filter *filter = client->discovery_filter;
size_t pattern_len;