diff --git a/src/attrib-server.c b/src/attrib-server.c
index 5bb0dab..b84b01d 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
struct gatt_channel {
bdaddr_t src;
bdaddr_t dst;
- GSList *notify;
- GSList *indicate;
GAttrib *attrib;
guint mtu;
gboolean le;
static void channel_free(struct gatt_channel *channel)
{
- g_slist_free(channel->notify);
- g_slist_free(channel->indicate);
g_attrib_unref(channel->attrib);
g_free(channel);
return;
}
-static void attrib_notify_clients(struct attribute *attr)
-{
- guint handle = attr->handle;
- GSList *l;
-
- for (l = clients; l; l = l->next) {
- struct gatt_channel *channel = l->data;
-
- /* Notification */
- if (g_slist_find_custom(channel->notify,
- GUINT_TO_POINTER(handle), handle_cmp)) {
- uint8_t pdu[ATT_MAX_MTU];
- uint16_t len;
-
- len = enc_notification(attr->handle, attr->data,
- attr->len, pdu, channel->mtu);
- if (len == 0)
- continue;
-
- g_attrib_send(channel->attrib, 0, pdu[0], pdu, len,
- NULL, NULL, NULL);
- }
-
- /* Indication */
- if (g_slist_find_custom(channel->indicate,
- GUINT_TO_POINTER(handle), handle_cmp)) {
- uint8_t pdu[ATT_MAX_MTU];
- uint16_t len;
-
- len = enc_indication(attr->handle, attr->data,
- attr->len, pdu, channel->mtu);
- if (len == 0)
- return;
-
- g_attrib_send(channel->attrib, 0, pdu[0], pdu, len,
- NULL, NULL, NULL);
- }
- }
-}
-
static gboolean register_core_services(void)
{
uint8_t atval[256];
if (attr)
*attr = a;
- attrib_notify_clients(a);
-
return 0;
}