diff options
author | Santiago Carot-Nemesio <sancane@gmail.com> | 2011-12-28 11:24:44 +0100 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2011-12-30 13:00:00 +0200 |
commit | 6a1e46afaf40704177239ee2451bea5826119c4d (patch) | |
tree | 7805bc206e05e2b5d62c5a9b1ea95ce24301fa34 /src/attrib-server.c | |
parent | bbc34269b061c75946b9b3e3bcc056d10bdabd8d (diff) | |
download | bluez-6a1e46afaf40704177239ee2451bea5826119c4d.tar.gz |
attrib-server: Add adapter in attrib_db_add
Because of there can be many adapters plugged, the GATT servers must
provide the adapter in which the attributes will be registered.
Diffstat (limited to 'src/attrib-server.c')
-rw-r--r-- | src/attrib-server.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/attrib-server.c b/src/attrib-server.c index ccb7b34ec..0ddcf4989 100644 --- a/src/attrib-server.c +++ b/src/attrib-server.c @@ -1316,18 +1316,17 @@ uint16_t attrib_db_find_avail(struct btd_adapter *adapter, uint16_t nitems) return 0; } -struct attribute *attrib_db_add(uint16_t handle, bt_uuid_t *uuid, int read_reqs, - int write_reqs, const uint8_t *value, int len) +struct attribute *attrib_db_add(struct btd_adapter *adapter, uint16_t handle, + bt_uuid_t *uuid, int read_reqs, int write_reqs, + const uint8_t *value, int len) { - struct gatt_server *server; - - DBG("Deprecated function!"); + GSList *l; - server = get_default_gatt_server(); - if (server == NULL) + l = g_slist_find_custom(servers, adapter, adapter_cmp); + if (l == NULL) return NULL; - return attrib_db_add_new(server, handle, uuid, read_reqs, write_reqs, + return attrib_db_add_new(l->data, handle, uuid, read_reqs, write_reqs, value, len); } |