diff --git a/src/attrib-server.c b/src/attrib-server.c
index fd74953..f635c67 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
GIOChannel *le_io;
uint32_t gatt_sdp_handle;
uint32_t gap_sdp_handle;
- GSList *database;
+ GList *database;
GSList *clients;
uint16_t name_handle;
uint16_t appearance_handle;
static void gatt_server_free(struct gatt_server *server)
{
- g_slist_free_full(server->database, attrib_free);
+ g_list_free_full(server->database, attrib_free);
if (server->l2cap_io != NULL) {
g_io_channel_unref(server->l2cap_io);
{
struct attribute *attrib;
guint h = start;
- GSList *l;
+ GList *l;
if (end == NULL)
return NULL;
- l = g_slist_find_custom(server->database, GUINT_TO_POINTER(h),
+ l = g_list_find_custom(server->database, GUINT_TO_POINTER(h),
handle_cmp);
if (!l)
return NULL;
DBG("handle=0x%04x", handle);
- if (g_slist_find_custom(server->database, GUINT_TO_POINTER(h),
+ if (g_list_find_custom(server->database, GUINT_TO_POINTER(h),
handle_cmp))
return NULL;
a->read_reqs = read_reqs;
a->write_reqs = write_reqs;
- server->database = g_slist_insert_sorted(server->database, a,
+ server->database = g_list_insert_sorted(server->database, a,
attribute_cmp);
return a;
struct att_data_list *adl;
struct attribute *a;
struct group_elem *cur, *old = NULL;
- GSList *l, *groups, *database;
+ GSList *l, *groups;
+ GList *dl, *database;
uint16_t length, last_handle, last_size = 0;
uint8_t status;
int i;
last_handle = end;
database = channel->server->database;
- for (l = database, groups = NULL, cur = NULL; l; l = l->next) {
+ for (dl = database, groups = NULL, cur = NULL; dl; dl = dl->next) {
- a = l->data;
+ a = dl->data;
if (a->handle < start)
continue;
return enc_error_resp(ATT_OP_READ_BY_GROUP_REQ, start,
ATT_ECODE_ATTR_NOT_FOUND, pdu, len);
- if (l == NULL)
+ if (dl == NULL)
cur->end = a->handle;
else
cur->end = last_handle;
uint8_t *pdu, int len)
{
struct att_data_list *adl;
- GSList *l, *types, *database;
+ GSList *l, *types;
+ GList *dl, *database;
struct attribute *a;
uint16_t num, length;
uint8_t status;
ATT_ECODE_INVALID_HANDLE, pdu, len);
database = channel->server->database;
- for (l = database, length = 0, types = NULL; l; l = l->next) {
+ for (dl = database, length = 0, types = NULL; dl; dl = dl->next) {
- a = l->data;
+ a = dl->data;
if (a->handle < start)
continue;
{
struct attribute *a;
struct att_data_list *adl;
- GSList *l, *info, *database;
+ GSList *l, *info;
+ GList *dl, *database;
uint8_t format, last_type = BT_UUID_UNSPEC;
uint16_t length, num;
int i;
ATT_ECODE_INVALID_HANDLE, pdu, len);
database = channel->server->database;
- for (l = database, info = NULL, num = 0; l; l = l->next) {
- a = l->data;
+ for (dl = database, info = NULL, num = 0; dl; dl = dl->next) {
+ a = dl->data;
if (a->handle < start)
continue;
{
struct attribute *a;
struct att_range *range;
- GSList *l, *matches, *database;
+ GSList *matches;
+ GList *dl, *database;
int len;
if (start > end || start == 0x0000)
/* Searching first requested handle number */
database = channel->server->database;
- for (l = database, matches = NULL, range = NULL; l; l = l->next) {
- a = l->data;
+ for (dl = database, matches = NULL, range = NULL; dl; dl = dl->next) {
+ a = dl->data;
if (a->handle < start)
continue;
{
struct attribute *a;
uint8_t status;
- GSList *l;
+ GList *l;
uint16_t cccval;
guint h = handle;
- l = g_slist_find_custom(channel->server->database,
+ l = g_list_find_custom(channel->server->database,
GUINT_TO_POINTER(h), handle_cmp);
if (!l)
return enc_error_resp(ATT_OP_READ_REQ, handle,
{
struct attribute *a;
uint8_t status;
- GSList *l;
+ GList *l;
uint16_t cccval;
guint h = handle;
- l = g_slist_find_custom(channel->server->database,
+ l = g_list_find_custom(channel->server->database,
GUINT_TO_POINTER(h), handle_cmp);
if (!l)
return enc_error_resp(ATT_OP_READ_BLOB_REQ, handle,
{
struct attribute *a;
uint8_t status;
- GSList *l;
+ GList *l;
guint h = handle;
- l = g_slist_find_custom(channel->server->database,
+ l = g_list_find_custom(channel->server->database,
GUINT_TO_POINTER(h), handle_cmp);
if (!l)
return enc_error_resp(ATT_OP_WRITE_REQ, handle,
struct gatt_server *server;
uint16_t handle;
GSList *l;
+ GList *dl;
l = g_slist_find_custom(servers, adapter, adapter_cmp);
if (l == NULL)
if (server->database == NULL)
return 0x0001;
- for (l = server->database, handle = 0x0001; l; l = l->next) {
- struct attribute *a = l->data;
+ for (dl = server->database, handle = 0x0001; dl; dl = dl->next) {
+ struct attribute *a = dl->data;
if ((bt_uuid_cmp(&a->uuid, &prim_uuid) == 0 ||
bt_uuid_cmp(&a->uuid, &snd_uuid) == 0) &&
struct gatt_server *server;
struct attribute *a;
GSList *l;
+ GList *dl;
guint h = handle;
l = g_slist_find_custom(servers, adapter, adapter_cmp);
DBG("handle=0x%04x", handle);
- l = g_slist_find_custom(server->database, GUINT_TO_POINTER(h),
+ dl = g_list_find_custom(server->database, GUINT_TO_POINTER(h),
handle_cmp);
- if (!l)
+ if (dl == NULL)
return -ENOENT;
- a = l->data;
+ a = dl->data;
a->data = g_try_realloc(a->data, len);
if (a->data == NULL)
struct gatt_server *server;
struct attribute *a;
GSList *l;
+ GList *dl;
guint h = handle;
l = g_slist_find_custom(servers, adapter, adapter_cmp);
DBG("handle=0x%04x", handle);
- l = g_slist_find_custom(server->database, GUINT_TO_POINTER(h),
+ dl = g_list_find_custom(server->database, GUINT_TO_POINTER(h),
handle_cmp);
- if (!l)
+ if (dl == NULL)
return -ENOENT;
- a = l->data;
- server->database = g_slist_remove(server->database, a);
+ a = dl->data;
+ server->database = g_list_remove(server->database, a);
g_free(a->data);
g_free(a);