diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2011-11-07 10:59:56 -0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2011-11-14 20:48:02 +0200 |
commit | 2878b49b8afcd2b05f355c9f22796bdf06e29c11 (patch) | |
tree | 26d60c1ea26974f4a400905f52120dff61af1af4 /src/attrib-server.c | |
parent | 31247e9a68d3fc60c456a1fd3c654ae063ce8ed5 (diff) | |
download | bluez-2878b49b8afcd2b05f355c9f22796bdf06e29c11.tar.gz |
Remove notification and indication from server
Upper layer should handle notification and indication since there are
profiles especific constraints including timeouts and attributes values
that should read only before sending it.
Diffstat (limited to 'src/attrib-server.c')
-rw-r--r-- | src/attrib-server.c | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/attrib-server.c b/src/attrib-server.c index 5bb0dabe1..b84b01dfc 100644 --- a/src/attrib-server.c +++ b/src/attrib-server.c @@ -53,8 +53,6 @@ static GSList *database = NULL; struct gatt_channel { bdaddr_t src; bdaddr_t dst; - GSList *notify; - GSList *indicate; GAttrib *attrib; guint mtu; gboolean le; @@ -697,8 +695,6 @@ static void attrib_free(void *data) 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); @@ -937,46 +933,6 @@ static void confirm_event(GIOChannel *io, void *user_data) 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]; @@ -1237,8 +1193,6 @@ int attrib_db_update(uint16_t handle, bt_uuid_t *uuid, const uint8_t *value, if (attr) *attr = a; - attrib_notify_clients(a); - return 0; } |