static int assigned_id = 0;
static gboolean instance_id_used[BT_GATTS_MAX];
static guint manager_id[BT_GATTS_MAX];
+static int start_notify_pending_count = 0;
static int acquire_notify_pending_count = 0;
static int write_value_pending_count = 0;
svc_info = __bt_gatt_find_gatt_service_from_char(object_path, &char_hdl);
conn_info = __bt_find_remote_gatt_client_info(addr);
+ if (conn_info == NULL) {
+ ERR("Client info not found. This method call will be called again shortly");
+ if (start_notify_pending_count > 5) {
+ ERR("Client info still not found (count %d). Ignoring this method call", start_notify_pending_count);
+ start_notify_pending_count = 0;
+ goto done;
+ }
- if (svc_info == NULL || conn_info == NULL
- || event_cb == NULL)
+ struct method_call_info *info = g_malloc0(sizeof(struct method_call_info));
+ info->connection = connection;
+ info->sender = g_strdup(sender);
+ info->object_path = g_strdup(object_path);
+ info->interface_name = g_strdup(interface_name);
+ info->method_name = g_strdup(method_name);
+ info->parameters = g_variant_ref(parameters);
+ info->invocation = invocation;
+ info->user_data = user_data;
+
+ g_timeout_add(100, __bt_pending_method_call, info);
+ start_notify_pending_count++;
+ return;
+ }
+ start_notify_pending_count = 0;
+
+ if (svc_info == NULL || event_cb == NULL)
return;
/* Send HAL event */
struct method_call_info *info = data;
DBG("The method call was called again");
+ if (g_strcmp0(info->method_name, "StartNotify") == 0)
+ DBG("StartNotify pending count [%d]", start_notify_pending_count);
if (g_strcmp0(info->method_name, "WriteValue") == 0)
DBG("WriteValue pending count [%d]", write_value_pending_count);
if (g_strcmp0(info->method_name, "AcquireNotify") == 0)