Code clean up
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / oal-gatt.c
index 400f662..bf4a07b 100644 (file)
@@ -1409,13 +1409,10 @@ static void cb_gattc_register_app(int status, int clientIf, bt_uuid_t *app_uuid)
        char uuid_str[BT_UUID_STRING_MAX];
        event_gattc_register_t *event;
 
-       BT_INFO("+");
-
        /* Check if GATT client registered for Default GATT client UUID */
        uuid_to_string((service_uuid_t *)app_uuid, uuid_str);
-       BT_INFO("UUID:%s", uuid_str);
 
-       BT_INFO("BTGATT CLIENT REGISTER APP CB, status:%d, clientIf:%d", status, clientIf);
+       BT_INFO("GATT CLIENT REGISTER APP CB, status:%d, clientIf:%d, %s", status, clientIf, uuid_str);
        event = g_new0(event_gattc_register_t, 1);
        event->client_if = clientIf;
        event->status = (status == 0 ? OAL_STATUS_SUCCESS : OAL_STATUS_INTERNAL_ERROR);
@@ -1479,7 +1476,7 @@ static void cb_gattc_search_result(int conn_id, btgatt_srvc_id_t *srvc_id)
        BT_INFO("BTGATT Client Service Search Result cb, conn_id:%d", conn_id);
 
        uuid_to_stringname((oal_uuid_t *)&(srvc_id->id.uuid), uuid_str);
-       BT_INFO("Service=> UUID: [%s], Inst_id: [%u], Type: [%s]",
+       BT_INFO("Service=> [%s], Inst_id [%u], Type [%s]",
                uuid_str, srvc_id->id.inst_id, srvc_id->is_primary ? "Primary" : "Secondary");
 
        event_gattc_service_result_t *event = g_new0(event_gattc_service_result_t, 1);
@@ -1509,9 +1506,10 @@ static void cb_gattc_get_characteristics(int conn_id, int status, btgatt_srvc_id
        char uuid_str1[2*BT_UUID_STRING_MAX];
        char uuid_str2[2*BT_UUID_STRING_MAX];
        char str[50];
+
        BT_INFO("BTGATT Client Get Characteristic Callback, conn_id:%d, status:%d", conn_id, status);
        uuid_to_stringname((oal_uuid_t *)&(srvc_id->id.uuid), uuid_str1);
-       BT_INFO("Service=> UUID: [%s], Inst_id: [%u], Type: [%s]",
+       BT_INFO("Service=> [%s], Inst_id [%u], Type [%s]",
                uuid_str1, srvc_id->id.inst_id, srvc_id->is_primary ? "Primary" : "Secondary");
 
        event_gattc_characteristic_result_t *event = g_new0(event_gattc_characteristic_result_t, 1);
@@ -1521,7 +1519,7 @@ static void cb_gattc_get_characteristics(int conn_id, int status, btgatt_srvc_id
 
        if (status == 0) {
                uuid_to_stringname((oal_uuid_t *)&(char_id->uuid), uuid_str2);
-               BT_INFO("Charac=> UUID: [%s], Inst_id: [%u], Prop: [%s]",
+               BT_INFO("Charac => [%s], Inst_id [%u], Prop [%s]",
                        uuid_str2, char_id->inst_id, char_prop_to_string(char_prop, str));
                event->char_prop = char_prop;
                memcpy(&(event->char_id), char_id, sizeof(oal_gatt_id_t));
@@ -1539,9 +1537,9 @@ static void cb_gattc_get_descriptor(int conn_id, int status, btgatt_srvc_id_t *s
        BT_INFO("BTGATT Client Get Descriptor Callback, conn_id:%d, status:%d", conn_id, status);
        uuid_to_stringname((oal_uuid_t *)&(srvc_id->id.uuid), uuid_str1);
        uuid_to_stringname((oal_uuid_t *)&(char_id->uuid), uuid_str2);
-       BT_INFO("Service=> UUID: [%s], Inst_id: [%u], Type: [%s]",
+       BT_INFO("Service=> [%s], Inst_id [%u], Type [%s]",
                uuid_str1, srvc_id->id.inst_id, srvc_id->is_primary ? "Primary" : "Secondary");
-       BT_INFO("Charac=> UUID: [%s], Inst_id: [%u]", uuid_str2, char_id->inst_id);
+       BT_INFO("Charac => [%s], Inst_id [%u]", uuid_str2, char_id->inst_id);
 
        event_gattc_descriptor_result_t *event = g_new0(event_gattc_descriptor_result_t, 1);
        event->conn_status.conn_id = conn_id;
@@ -1551,7 +1549,7 @@ static void cb_gattc_get_descriptor(int conn_id, int status, btgatt_srvc_id_t *s
 
        if (status == 0) {
                uuid_to_stringname((oal_uuid_t *)&(descr_id->uuid), uuid_str3);
-               BT_INFO("Desc=> UUID: [%s], Inst_id: [%u]", uuid_str3, descr_id->inst_id);
+               BT_INFO("Desc   => [%s], Inst_id [%u]", uuid_str3, descr_id->inst_id);
                memcpy(&(event->descr_id), descr_id, sizeof(oal_gatt_id_t));
        }
        send_event(OAL_EVENT_GATTC_DESC_SERACH_RESULT, event, sizeof(*event));
@@ -1565,8 +1563,8 @@ static void cb_gattc_register_for_notification(int client_if, int registered, in
                client_if, status, registered == 1 ? "REGISTERED" : "DEREGISTERED");
        uuid_to_stringname((oal_uuid_t *)&(srvc_id->id.uuid), uuid_str1);
        uuid_to_stringname((oal_uuid_t *)&(char_id->uuid), uuid_str2);
-       BT_INFO("Service=> UUID: [%s], Inst_id: [%u], Type: [%s]", uuid_str1, srvc_id->id.inst_id, srvc_id->is_primary ? "Primary" : "Secondary");
-       BT_INFO("Charac=> UUID: [%s], Inst_id: [%u]", uuid_str2, char_id->inst_id);
+       BT_INFO("Service=> [%s], Inst_id [%u], Type [%s]", uuid_str1, srvc_id->id.inst_id, srvc_id->is_primary ? "Primary" : "Secondary");
+       BT_INFO("Charac => [%s], Inst_id [%u]", uuid_str2, char_id->inst_id);
 
        event_gattc_regdereg_notify_t *event = g_new0(event_gattc_regdereg_notify_t, 1);
        oal_event_t event_type = (registered == 1 ? OAL_EVENT_GATTC_NOTIFICATION_REGISTERED : OAL_EVENT_GATTC_NOTIFICATION_DEREGISTERED);
@@ -1591,9 +1589,9 @@ static void cb_gattc_notify(int conn_id, btgatt_notify_params_t *p_data)
        uuid_to_stringname((oal_uuid_t *)&(p_data->srvc_id.id.uuid), uuid_str1);
        uuid_to_stringname((oal_uuid_t *)&(p_data->char_id.uuid), uuid_str2);
 
-       BT_INFO("Service=> UUID: [%s], Inst_id: [%u], Type: [%s]",
+       BT_INFO("Service=> [%s], Inst_id [%u], Type [%s]",
                uuid_str1, p_data->srvc_id.id.inst_id, p_data->srvc_id.is_primary ? "Primary" : "Secondary");
-       BT_INFO("Charac=> UUID: [%s], Inst_id: [%u]", uuid_str2, p_data->char_id.inst_id);
+       BT_INFO("Charac => [%s], Inst_id [%u]", uuid_str2, p_data->char_id.inst_id);
 
        if (p_data->len > 0) {
                char *data = NULL;
@@ -1645,10 +1643,10 @@ static void cb_gattc_read_characteristic(int conn_id, int status, btgatt_read_pa
        if (status == 0) {
                uuid_to_stringname((oal_uuid_t *)&(p_data->srvc_id.id.uuid), uuid_str1);
                uuid_to_stringname((oal_uuid_t *)&(p_data->char_id.uuid), uuid_str2);
-               BT_INFO("Service=> UUID: [%s], Inst_id: [%u], Type: [%s]", uuid_str1,
+               BT_INFO("Service=> [%s], Inst_id [%u], Type [%s]", uuid_str1,
                        p_data->srvc_id.id.inst_id, p_data->srvc_id.is_primary ? "Primary" : "Secondary");
-               BT_INFO("Charac=> UUID: [%s], Inst_id: [%u]", uuid_str2, p_data->char_id.inst_id);
-               BT_INFO("Len: %u, value_type: %u", p_data->value.len, p_data->value_type);
+               BT_INFO("Charac => [%s], Inst_id [%u]", uuid_str2, p_data->char_id.inst_id);
+               BT_DBG("Len: %u, value_type: %u", p_data->value.len, p_data->value_type);
                if (p_data->value.len > 0 && event->value_type == GATTC_READ_VALUE_TYPE_VALUE) {
                        char *data = NULL;
                        data = g_malloc(3*p_data->value.len+1);
@@ -1658,7 +1656,7 @@ static void cb_gattc_read_characteristic(int conn_id, int status, btgatt_read_pa
                                return;
                        }
                        convert_hex_2_str((unsigned char *)p_data->value.value, p_data->value.len, data);
-                       BT_INFO("Read Data: [%s]", data);
+                       BT_DBG("Read Data: [%s]", data);
                        event->data_len = p_data->value.len;
                        memcpy(&(event->data), &(p_data->value.value), event->data_len);
                        g_free(data);
@@ -1681,9 +1679,9 @@ static void cb_gattc_write_characteristic(int conn_id, int status, btgatt_write_
        if (status == 0) {
                uuid_to_stringname((oal_uuid_t *)&(p_data->srvc_id.id.uuid), uuid_str1);
                uuid_to_stringname((oal_uuid_t *)&(p_data->char_id.uuid), uuid_str2);
-               BT_INFO("Service=> UUID: [%s], Inst_id: [%u], Type: [%s]", uuid_str1,
+               BT_INFO("Service=> [%s], Inst_id [%u], Type [%s]", uuid_str1,
                        p_data->srvc_id.id.inst_id, p_data->srvc_id.is_primary ? "Primary" : "Secondary");
-               BT_INFO("Charac=> UUID: [%s], Inst_id: [%u]", uuid_str2, p_data->char_id.inst_id);
+               BT_INFO("Charac => [%s], Inst_id [%u]", uuid_str2, p_data->char_id.inst_id);
        }
        send_event(OAL_EVENT_GATTC_WRITE_CHARAC, event, sizeof(*event));
 }
@@ -1705,10 +1703,10 @@ static void cb_gattc_write_descriptor(int conn_id, int status, btgatt_write_para
                uuid_to_stringname((oal_uuid_t *)&(p_data->srvc_id.id.uuid), uuid_str1);
                uuid_to_stringname((oal_uuid_t *)&(p_data->char_id.uuid), uuid_str2);
                uuid_to_stringname((oal_uuid_t *)&(p_data->descr_id.uuid), uuid_str3);
-               BT_INFO("Service=> UUID: [%s], Inst_id: [%u], Type: [%s]", uuid_str1,
+               BT_INFO("Service=> [%s], Inst_id [%u], Type [%s]", uuid_str1,
                        p_data->srvc_id.id.inst_id, p_data->srvc_id.is_primary ? "Primary" : "Secondary");
-               BT_INFO("Charac=> UUID: [%s], Inst_id: [%u]", uuid_str2, p_data->char_id.inst_id);
-               BT_INFO("Desc=> UUID: [%s], Inst_id: [%u]", uuid_str3, p_data->descr_id.inst_id);
+               BT_INFO("Charac => [%s], Inst_id [%u]", uuid_str2, p_data->char_id.inst_id);
+               BT_INFO("Desc   => [%s], Inst_id [%u]", uuid_str3, p_data->descr_id.inst_id);
        }
        send_event(OAL_EVENT_GATTC_WRITE_DESCR, event, sizeof(*event));
 }
@@ -1734,11 +1732,11 @@ static void cb_gattc_read_descriptor(int conn_id, int status, btgatt_read_params
                uuid_to_stringname((oal_uuid_t *)&(p_data->srvc_id.id.uuid), uuid_str1);
                uuid_to_stringname((oal_uuid_t *)&(p_data->char_id.uuid), uuid_str2);
                uuid_to_stringname((oal_uuid_t *)&(p_data->descr_id.uuid), uuid_str3);
-               BT_INFO("Service=> UUID: [%s], Inst_id: [%u], Type: [%s]", uuid_str1,
+               BT_INFO("Service=> [%s], Inst_id [%u], Type [%s]", uuid_str1,
                        p_data->srvc_id.id.inst_id, p_data->srvc_id.is_primary ? "Primary" : "Secondary");
-               BT_INFO("Charac=> UUID: [%s], Inst_id: [%u]", uuid_str2, p_data->char_id.inst_id);
-               BT_INFO("Desc=> UUID: [%s], Inst_id: [%u]", uuid_str3, p_data->descr_id.inst_id);
-               BT_INFO("Len: %u, value_type: %u", p_data->value.len, p_data->value_type);
+               BT_INFO("Charac => [%s], Inst_id [%u]", uuid_str2, p_data->char_id.inst_id);
+               BT_INFO("Desc   => [%s], Inst_id [%u]", uuid_str3, p_data->descr_id.inst_id);
+               BT_DBG("Len: %u, value_type: %u", p_data->value.len, p_data->value_type);
                if (p_data->value.len > 0 && event->value_type == GATTC_READ_VALUE_TYPE_VALUE) {
                        char *data = NULL;
                        data = g_malloc(3*p_data->value.len+1);
@@ -1748,7 +1746,7 @@ static void cb_gattc_read_descriptor(int conn_id, int status, btgatt_read_params
                                return;
                        }
                        convert_hex_2_str((unsigned char *)p_data->value.value, p_data->value.len, data);
-                       BT_INFO("Read Data: [%s]", data);
+                       BT_DBG("Read Data: [%s]", data);
                        event->data_len = p_data->value.len;
                        memcpy(&(event->data), &(p_data->value.value), event->data_len);
                        g_free(data);