Debug message cleanup 50/144250/1
authorinjun.yang <injun.yang@samsung.com>
Wed, 16 Aug 2017 05:19:16 +0000 (14:19 +0900)
committerinjun.yang <injun.yang@samsung.com>
Wed, 16 Aug 2017 05:19:41 +0000 (14:19 +0900)
Change-Id: I96efd109ee0bfe45da05f86ec77fdb35d92dd167
Signed-off-by: injun.yang <injun.yang@samsung.com>
src/bluetooth-common.c
src/bluetooth-gatt.c

index f3a06a256b5d3e54006a21eb2aabdedb74eb985e..e79e2fc12c22695b35452faa4203e74e56e1d421 100644 (file)
@@ -100,222 +100,7 @@ int bt_get_uuid_name(const char *uuid, char **name)
        BT_CHECK_INPUT_PARAMETER(uuid);
        BT_CHECK_INPUT_PARAMETER(name);
 
-       int i;
-       int offset = 0;
-       int uuid_len = 4;
-       static struct {
-               const char *uuid;
-               const char *specification_name;
-       } bt_uuid_name[] = {
-               /* BT Classic Services */
-               {"1101", "Serial Port Service"},
-               {"1102", "LAN Access Using PPP Service"},
-               {"1103", "Dialup Networking Service"},
-               {"1104", "IrMCSync Service"},
-               {"1105", "OBEX Object Push Service"},
-               {"1106", "OBEX File Transfer Service"},
-               {"1107", "IrMC Sync Command Service"},
-               {"1108", "Headset Service"},
-               {"1109", "Cordless Telephony Service"},
-               {"110A", "Audio Source Service"},
-               {"110B", "Audio Sink Service"},
-               {"110C", "AV Remote Control Target Service"},
-               {"110D", "Advanced Audio Distribution Profile"},
-               {"110E", "AV Remote Control Service"},
-               {"110F", "Video Conferencing Service"},
-               {"1110", "Intercom Service"},
-               {"1111", "Fax Service"},
-               {"1112", "Headset Audio Gateway Service"},
-               {"1113", "WAP Service"},
-               {"1114", "WAP Client Service"},
-               {"1115", "PANU Service"},
-               {"1116", "NAP Service"},
-               {"1117", "GN Service"},
-               {"1118", "Direct Printing Service"},
-               {"1119", "Reference Printing Service"},
-               {"111A", "Basic Imaging Profile"},
-               {"111B", "Imaging Responder Service"},
-               {"111C", "Imaging Automatic Archive Service"},
-               {"111D", "Imaging Reference Objects Service"},
-               {"111E", "Handsfree Service"},
-               {"111F", "Handsfree Audio Gateway Service"},
-               {"1120", "Direct Printing Reference Objects Service"},
-               {"1121", "Reflected UI Service"},
-               {"1122", "Basic Printing Profile"},
-               {"1123", "Printing Status Service"},
-               {"1124", "Human Interface Device Service"},
-               {"1125", "Hardcopy Cable Replacement Profile"},
-               {"1126", "HCR Print Service"},
-               {"1127", "HCR Scan Service"},
-               {"112D", "SIM Access Service"},
-               {"112E", "Phonebook Access PCE Service"},
-               {"112F", "Phonebook Access PSE Service"},
-               {"1130", "Phonebook Access Profile"},
-               {"1132", "Message Access Server Service"},
-               {"1133", "Message Notification Server Service"},
-               {"1134", "Message Access Profile"},
-               {"1200", "PnP Information Service"},
-               {"1201", "Generic Networking Service"},
-               {"1202", "Generic File Transfer Service"},
-               {"1203", "Generic Audio Service"},
-               {"1204", "Generic Telephony Service"},
-               {"1205", "UPnP Service"},
-               {"1206", "UPnP Ip Service"},
-               {"1303", "Video Source Service"},
-               {"1304", "Video Sink Service"},
-               {"1305", "Video Distribution Profile"},
-               {"1400", "Health Device Profile"},
-               {"1401", "HDP Source Service"},
-               {"1402", "HDP Sink Service"},
-
-               /* GATT Services */
-               {"1800", "Generic Access"},
-               {"1801", "Generic Attribute"},
-               {"1802", "Immediate Alert"},
-               {"1803", "Link Loss"},
-               {"1804", "Tx Power"},
-               {"1805", "Current Time Service"},
-               {"1806", "Reference Time Update Service"},
-               {"1807", "Next DST Change Service"},
-               {"1808", "Glucose"},
-               {"1809", "Health Thermometer"},
-               {"180A", "Device Information"},
-               {"180D", "Heart Rate"},
-               {"180F", "Battery Service"},
-               {"1810", "Blood Pressure"},
-               {"1811", "Alert Notification Service"},
-               {"1812", "Human Interface Device"},
-               {"1813", "Scan Parameters"},
-               {"1814", "Running Speed and Cadence"},
-               {"1815", "Automation IO"},
-               {"1816", "Cycling Speed and Cadence"},
-               {"1818", "Cycling Power"},
-               {"1819", "Location and Navigation"},
-               {"181A", "Environmental Sensing"},
-               {"181B", "Body Composition"},
-               {"181C", "User Data"},
-               {"181D", "Weight Scale"},
-               {"181E", "Bond Management"},
-               {"181F", "Continuous Glucose Monitoring"},
-
-               /* GATT Declarations */
-               {"2800", "Primary Service Declaration"},
-               {"2801", "Secondary Service Declaration"},
-               {"2802", "Include Declaration"},
-               {"2803", "Characteristic Declaration"},
-
-               /* GATT Descriptors */
-               {"2900", "Characteristic Extended Properties"},
-               {"2901", "Characteristic User Description"},
-               {"2902", "Client Characteristic Configuration"},
-               {"2903", "Server Characteristic Configuration"},
-               {"2904", "Characteristic Format"},
-               {"2905", "Characteristic Aggregate Formate"},
-               {"2906", "Valid Range"},
-               {"2907", "External Report Reference"},
-               {"2908", "Report Reference"},
-
-               /* GATT Characteristics */
-               {"2A00", "Device Name"},
-               {"2A01", "Appearance"},
-               {"2A02", "Peripheral Privacy Flag"},
-               {"2A03", "Reconnection Address"},
-               {"2A04", "Peripheral Preferred Connection Parameters"},
-               {"2A05", "Service Changed"},
-               {"2A06", "Alert Level"},
-               {"2A07", "Tx Power Level"},
-               {"2A08", "Date Time"},
-               {"2A09", "Day of Week"},
-               {"2A0A", "Day Date Time"},
-               {"2A11", "Time with DST"},
-               {"2A12", "Time Accuracy"},
-               {"2A13", "Time Source"},
-               {"2A14", "Reference Time Information"},
-               {"2A16", "Time Update Control Point"},
-               {"2A17", "Time Update State"},
-               {"2A18", "Glucose Measurement"},
-               {"2A19", "Battery Level"},
-               {"2A1C", "Temperature Measurement"},
-               {"2A1D", "Temperature Type"},
-               {"2A1E", "Intermediate Temperature"},
-               {"2A21", "Measurement Interval"},
-               {"2A23", "System ID"},
-               {"2A24", "Model Number String"},
-               {"2A25", "Serial Number String"},
-               {"2A26", "Firmware Revision String"},
-               {"2A27", "Hardware Revision String"},
-               {"2A28", "Software Revision String"},
-               {"2A29", "Manufacturer Name String"},
-               {"2A2A", "IEEE 11073-20601 Regulatory Certification Data List"},
-               {"2A2B", "Current Time"},
-               {"2A34", "Glucose Measurement Context"},
-               {"2A35", "Blood Pressure Measurement"},
-               {"2A37", "Heart Rate Measurement"},
-               {"2A38", "Body Sensor Location"},
-               {"2A39", "Heart Rate Control Point"},
-               {"2A3F", "Alert Status"},
-               {"2A46", "New Alert"},
-               {"2A49", "Blood Pressure Feature"},
-               {"2A4A", "HID Information"},
-               {"2A4C", "HID Control Point"},
-               {"2A50", "PnP ID"},
-               {"2A51", "Glucose Feature"},
-               {"2A52", "Record Access Control Point"},
-               {"2A53", "RSC Measurement"},
-               {"2A54", "RSC Feature"},
-               {"2A55", "SC Control Point"},
-               {"2A56", "Digital"},
-               {"2A58", "Analog"},
-               {"2A5A", "Aggregate"},
-               {"2A5B", "CSC Measurement"},
-               {"2A5C", "CSC Feature"},
-               {"2A5D", "Sensor Location"},
-               {"2A63", "Cycling Power Measurement"},
-               {"2A64", "Cycling Power Vector"},
-               {"2A65", "Cycling Power Feature"},
-               {"2A66", "Cycling Power Control Point"},
-               {"2A67", "Location and Speed"},
-               {"2A68", "Navigation"},
-               {"2A6D", "Pressure"},
-               {"2A6E", "Temperature"},
-
-               /* Custom uuids */
-               {"7905F431-B5CE-4E99-A40F-4B1E122D00D0", "Apple Notification Center Service"},
-               {"9FBF120D-6301-42D9-8C58-25E699A21DBD", "Notifications Source"},
-               {"69D1D8F3-45E1-49A8-9821-9BBDFDAAD9D9", "Control Point"},
-               {"22EAC6E9-24D6-4BB5-BE44-B36ACE7C7BFB", "Data Source"},
-               {"89D3502B-0F36-433A-8EF4-C502AD55F8DC", "Apple Media Service"},
-               {"9B3C81D8-57B1-4A8A-B8DF-0E56F7CA51C2", "Remote Command"},
-               {"2F7CABCE-808D-411F-9A0C-BB92BA96C102", "Entity Update"},
-               {"C6B2F38C-23AB-46D8-A6AB-A3A870BBD5D7", "Entity Attribute"},
-               {"9A3F68E0-86CE-11E5-A309-0002A5D5C51B", "Samsung Gear Manager Service"},
-               {"c2f2cc0f-c085-4dd4-be5a-aca3074bbc72", "Control Point"},
-               {"cece518b-28d7-4171-92d5-76a1e249a3b9", "Notifications Source"},
-               {"32D1955A-E5AA-4A96-9A49-08538DA8B8F6", "Samsung Gear Fit Manager Service"},
-               {"FE53FF98-B259-4337-B56A-0EC9F82C6BAD", "Control Point"},
-               {"C2051EE0-804D-4D50-A12C-15E243852100", "Notifications Source"},
-               {NULL, NULL}
-       };
-
-       if (strlen(uuid) == 36) {
-               if (!g_ascii_strncasecmp(uuid + 9, "0000-1000-8000-00805F9B34FB", 27))
-                       offset = 4;
-               else {
-                       offset = 0;
-                       uuid_len = 36;
-               }
-       } else if (strlen(uuid) >= 8)
-               offset = 4;
-
-       for (i = 0; bt_uuid_name[i].uuid; i++) {
-               if (!g_ascii_strncasecmp(uuid + offset, bt_uuid_name[i].uuid, uuid_len)) {
-                       *name = g_strdup(bt_uuid_name[i].specification_name);
-                       return BT_ERROR_NONE;
-               }
-       }
-
-       *name = g_strdup("Unknown");
-       return BT_ERROR_NONE;
+       return _bt_get_error_code(bluetooth_get_uuid_name(uuid, name));
 }
 
 /*
@@ -2127,7 +1912,6 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                break; /* goto default */
        }
        case BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED:
-               BT_INFO("BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED");
                char_val = (bt_gatt_char_value_t *)(param->param_data);
 
                if (TIZEN_FEATURE_ENABLE_LEGACY_GATT_CLIENT && _bt_gatt_is_legacy_client_mode()) {
@@ -3155,7 +2939,6 @@ static int __bt_get_bt_adapter_device_discovery_info_s(bt_adapter_device_discove
                                if ((*discovery_info)->service_uuid[i] != NULL)
                                        __bt_convert_lower_to_upper((*discovery_info)->service_uuid[i]);
 
-                               BT_INFO("UUID: %s", (*discovery_info)->service_uuid[i]);
                        }
                }
        } else
index 289fc5ea435b81044cad2d1273370eb6d20369f9..c3d10dc5f3e63c93109fccb0e39dd0a444a31b96 100644 (file)
@@ -86,8 +86,19 @@ static int __get_gatt_handle_by_uuid(GSList *list, const char *uuid,
        }
        g_free(uuid128_a);
 
-       if (!l)
+       if (!l) {
+               char *name = NULL;
+               bt_get_uuid_name(uuid, &name);
+               BT_INFO("Find uuid : %s [%s]", uuid, name);
+               g_free(name);
+               for (l = list; l; l = g_slist_next(l)) {
+                       bt_gatt_common_s *common = (bt_gatt_common_s *)l->data;
+                       bt_get_uuid_name(common->uuid, &name);
+                       BT_INFO("%s %s [%s]", common->path + 38, common->uuid, name);
+                       g_free(name);
+               }
                return BT_ERROR_NO_DATA;
+       }
 
        *gatt_handle = l->data;
 
@@ -200,8 +211,6 @@ int _bt_gatt_client_update_services(bt_gatt_client_h client)
        }
 
        for (i = 0; i < prim_svc.count; i++) {
-               BT_INFO("Service handle[%d] %s", i, prim_svc.handle[i]);
-
                if (!_bt_gatt_client_add_service(client, prim_svc.handle[i]))
                        BT_ERR("_bt_gatt_client_add_service is failed [%s]",
                                        prim_svc.handle[i]);
@@ -605,7 +614,7 @@ int bt_gatt_watch_characteristic_changes(bt_gatt_attribute_h service)
        BT_CHECK_INIT_STATUS();
        BT_CHECK_INPUT_PARAMETER(service);
 
-       ret = _bt_get_error_code(bluetooth_gatt_watch_characteristics((const char *)service)); /* LCOV_EXCL_LINE */
+       ret = _bt_get_error_code(bluetooth_gatt_watch_characteristics((const char *)service), NULL); /* LCOV_EXCL_LINE */
 
        if (ret != BT_ERROR_NONE) /* LCOV_EXCL_LINE */
                BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret),
@@ -3090,8 +3099,6 @@ static gboolean __get_bdaddr_from_path(const char *path, char *addr)
        }
        addr[i] = '\0';
 
-       BT_DBG("path : %s, addr : %s", path, addr);
-
        return TRUE;
 }
 
@@ -3106,8 +3113,6 @@ static void __value_changed_cb(char *char_path,
        bt_gatt_characteristic_s *chr;
        char remote_address[BT_ADDR_STR_LEN + 1] = { 0, };
 
-       BT_DBG("%s", char_path);
-
        if (__get_bdaddr_from_path(char_path, remote_address) == FALSE) {
                BT_ERR("Cannot get addr from path : %s", char_path);
                return;
@@ -3142,6 +3147,7 @@ int bt_gatt_client_set_characteristic_value_changed_cb(bt_gatt_h characteristic,
                void *user_data)
 {
        int ret;
+       char *name = NULL;
        bt_gatt_characteristic_s *chr = (bt_gatt_characteristic_s *)characteristic;
 
        BT_CHECK_GATT_SUPPORT();
@@ -3149,13 +3155,17 @@ int bt_gatt_client_set_characteristic_value_changed_cb(bt_gatt_h characteristic,
        BT_CHECK_INPUT_PARAMETER(characteristic);
        BT_CHECK_INPUT_PARAMETER(callback);
 
+       bt_gatt_service_s *svc = (bt_gatt_service_s *)chr->parent;
+
        chr->value_changed_cb = callback;
        chr->value_changed_user_data = user_data;
 
        if (chr->properties &
                (BT_GATT_PROPERTY_NOTIFY | BT_GATT_PROPERTY_INDICATE)) {
+               bt_get_uuid_name(svc->uuid, &name);
                ret = _bt_get_error_code(bluetooth_gatt_watch_characteristics(
-                                       chr->path));
+                                       chr->path, name));
+               g_free(name);
                if (ret != BT_ERROR_NONE)
                        BT_ERR("%s(0x%08x)",
                                _bt_convert_error_to_string(ret), ret);