From e6606e1fc18e87deced3b7ac662b0ab746914bbf Mon Sep 17 00:00:00 2001
From: "matthias.ringwald@gmail.com"
 <matthias.ringwald@gmail.com@1a0a8af8-31b5-11de-8e0c-53a27eea117e>
Date: Thu, 30 Jan 2014 14:08:10 +0000
Subject: [PATCH] don't send again after indication timeout

---
 ble/att_server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ble/att_server.c b/ble/att_server.c
index 1d1fc6b8f..2d5702414 100644
--- a/ble/att_server.c
+++ b/ble/att_server.c
@@ -102,7 +102,6 @@ static void att_handle_value_indication_notify_client(uint8_t status, uint16_t c
 
 static void att_handle_value_indication_timeout(timer_source_t *ts){
     uint16_t att_handle = att_handle_value_indication_handle;
-    att_handle_value_indication_handle = 0;    
     att_handle_value_indication_notify_client(ATT_HANDLE_VALUE_INDICATION_TIMEOUT, att_request_handle, att_handle);
 }
 
@@ -148,6 +147,7 @@ static void att_event_packet_handler (uint8_t packet_type, uint16_t channel, uin
                     // -> avoid sending advertise enable a second time before command complete was received 
                     att_server_state = ATT_SERVER_IDLE;
                     att_request_handle = 0;
+                    att_handle_value_indication_handle = 0; // reset error state
                     break;
                     
                 case SM_IDENTITY_RESOLVING_STARTED: