Change-Id: I327169a22292034f33a5122de7f84837d9b85066
Signed-off-by: dh79pyun <dh79.pyun@samsung.com>
bt_gatt_client_h _bt_gatt_get_client(const char *remote_addr);
+bt_gatt_client_h _bt_gatt_get_default_client(void);
+
const GSList* _bt_gatt_get_server_list(void);
#ifdef TIZEN_GATT_CLIENT
device_addr = NULL;
if (client == NULL) {
- BT_ERR("There is NO matched client");
- break;
+ client = _bt_gatt_get_default_client();
+
+ if (client == NULL) {
+ BT_ERR("There is NO matched client");
+ break;
+ }
}
if (service_change->change_type == BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD) {
return NULL;
}
+bt_gatt_client_h _bt_gatt_get_default_client(void)
+{
+ GSList *l;
+
+ for (l = gatt_client_list; l; l = g_slist_next(l)) {
+ bt_gatt_client_s *client_s = l->data;
+
+ if (client_s == NULL)
+ continue;
+
+ return (bt_gatt_client_h)client_s;
+ }
+
+ return NULL;
+}
+
const GSList* _bt_gatt_get_server_list(void)
{
return gatt_server_list;