Code clean up
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / bluez_hal / src / bt-hal-bluetooth.c
index 7c7dd44..1cba249 100644 (file)
@@ -223,7 +223,6 @@ static int cancel_discovery(void)
 
 static int create_bond(const bt_bdaddr_t *bd_addr, int transport)
 {
-       DBG("+");
        return _bt_hal_device_create_bond(bd_addr, transport);
 }
 
@@ -234,7 +233,6 @@ static int cancel_bond(const bt_bdaddr_t *bd_addr)
 
 static int remove_bond(const bt_bdaddr_t *bd_addr)
 {
-       DBG("+");
        return _bt_hal_device_remove_bond(bd_addr);
 }
 
@@ -346,13 +344,11 @@ static int read_energy_info(void)
 static int authorize_response(const bt_bdaddr_t *bd_addr, bt_service_id_t service_id,
                uint8_t authorize, uint8_t save_settings)
 {
-       DBG("+");
        return _bt_hal_device_authorize_response(bd_addr, service_id, authorize, save_settings);
 }
 
 int set_authorization(bt_bdaddr_t *bd_addr, uint8_t auth)
 {
-       DBG("+");
        return _bt_hal_device_set_trust(bd_addr, auth);
 }
 
@@ -424,7 +420,6 @@ static int set_hal_le_request_state(int enable)
 
 static int dev_disconnect(const bt_bdaddr_t *bd_addr)
 {
-       DBG("+");
        return _bt_hal_device_disconnect(bd_addr);
 }
 #endif
@@ -609,10 +604,7 @@ static void __bt_device_props_to_hal(bt_property_t *send_props,
        void *buf = prop;
        uint8_t i;
 
-       DBG("+");
-
        for (i = 0; i < num_props; i++) {
-
                if (sizeof(*prop) + prop->len > len) {
                        ERR("invalid device properties (%zu > %u), cant process further properties!!!",
                                        sizeof(*prop) + prop->len, len);
@@ -621,8 +613,6 @@ static void __bt_device_props_to_hal(bt_property_t *send_props,
 
                send_props[i].type = prop->type;
 
-               DBG("HAL prop Type [%d]", prop->type);
-
                switch (prop->type) {
                case HAL_PROP_DEVICE_TYPE:
                {
@@ -672,7 +662,6 @@ static void __bt_device_props_to_hal(bt_property_t *send_props,
        }
 
        if (!len) {
-               DBG("-");
                return;
        }
 
@@ -683,7 +672,6 @@ static void __bt_hal_handle_adapter_property_changed(void *buf, uint16_t len)
 {
        struct hal_ev_adapter_props_changed *ev = (struct hal_ev_adapter_props_changed *)buf;
        bt_property_t props[ev->num_props];
-       DBG("+");
 
        if (!bt_hal_cbacks->adapter_properties_cb)
                return;
@@ -699,8 +687,6 @@ static void __bt_hal_handle_adapter_discovery_state_changed(void *buf, uint16_t
 {
        struct hal_ev_discovery_state_changed *ev = (struct hal_ev_discovery_state_changed *)buf;
 
-       DBG("+");
-
        if (bt_hal_cbacks->discovery_state_changed_cb)
                bt_hal_cbacks->discovery_state_changed_cb(ev->state);
 }
@@ -709,7 +695,6 @@ static void __bt_hal_handle_device_found_event(void *buf, uint16_t len)
 {
        struct hal_ev_device_found *ev =  (struct hal_ev_device_found *) buf;
        bt_property_t props[ev->num_props];
-       DBG("+");
 
        if (!bt_hal_cbacks->device_found_cb)
                return;
@@ -726,8 +711,6 @@ static void __bt_hal_handle_remote_device_properties_event(void *buf, uint16_t l
        bt_bdaddr_t bd_addr;
        bt_property_t props[ev->num_props];
 
-       DBG("+");
-
        if (!bt_hal_cbacks->remote_device_properties_cb)
                return;
 
@@ -736,7 +719,6 @@ static void __bt_hal_handle_remote_device_properties_event(void *buf, uint16_t l
        memcpy(bd_addr.address, ev->bdaddr, 6);
        bt_hal_cbacks->remote_device_properties_cb(
                        ev->status, &bd_addr, ev->num_props, props);
-       DBG("-");
 }
 
 static void __bt_hal_handle_bond_state_changed_event(void *buf, uint16_t len)
@@ -744,16 +726,8 @@ static void __bt_hal_handle_bond_state_changed_event(void *buf, uint16_t len)
 
        struct hal_ev_bond_state_changed *ev = (struct hal_ev_bond_state_changed *)buf;
        bt_bdaddr_t bd_addr;
-       DBG("+");
 
        memcpy(bd_addr.address, ev->bdaddr, 6);
-       /* BD address*/
-       DBG("[0x%x]", bd_addr.address[0]);
-       DBG("[0x%x]", bd_addr.address[1]);
-       DBG("[0x%x]", bd_addr.address[2]);
-       DBG("[0x%x]", bd_addr.address[3]);
-       DBG("[0x%x]", bd_addr.address[4]);
-       DBG("[0x%x]", bd_addr.address[5]);
 
        DBG("Bonding  State changed Status [0x%x]", ev->status);
        DBG("Bonding  State [0x%x]", ev->state);
@@ -764,26 +738,15 @@ static void __bt_hal_handle_bond_state_changed_event(void *buf, uint16_t len)
        }
 
        bt_hal_cbacks->bond_state_changed_cb(ev->status, &bd_addr, ev->state);
-       DBG("-");
 }
 
 static void __bt_hal_handle_device_acl_state_changed_event(void *buf, uint16_t len)
 {
        struct hal_ev_acl_state_changed *ev = (struct hal_ev_acl_state_changed*)buf;
        bt_bdaddr_t bd_addr;
-       DBG("+");
 
        memcpy(bd_addr.address, ev->bdaddr, 6);
-       /* BD address*/
-       DBG("[0x%x]", bd_addr.address[0]);
-       DBG("[0x%x]", bd_addr.address[1]);
-       DBG("[0x%x]", bd_addr.address[2]);
-       DBG("[0x%x]", bd_addr.address[3]);
-       DBG("[0x%x]", bd_addr.address[4]);
-       DBG("[0x%x]", bd_addr.address[5]);
-
-       DBG("ACL Status [0x%x]", ev->status);
-       DBG("ACL State  [0x%x]", ev->state);
+       INFO("ACL status[0x%x], state[0x%x]: XX:XX:XX:XX:XX:%02X", ev->status, ev->state, bd_addr.address[5]);
 
        if (!bt_hal_cbacks->acl_state_changed_cb) {
                ERR("HAL User acl_state_changed_cb is not set!!");
@@ -791,14 +754,12 @@ static void __bt_hal_handle_device_acl_state_changed_event(void *buf, uint16_t l
        }
 
        bt_hal_cbacks->acl_state_changed_cb(ev->status, &bd_addr, ev->state);
-       DBG("-");
 }
 
 static void __bt_hal_handle_device_le_conn_state_changed_event(void *buf, uint16_t len)
 {
        struct hal_ev_acl_state_changed *ev = (struct hal_ev_acl_state_changed*)buf;
        bt_bdaddr_t bd_addr;
-       DBG("+");
 
        memcpy(bd_addr.address, ev->bdaddr, 6);
        /* BD address */
@@ -816,7 +777,6 @@ static void __bt_hal_handle_device_le_conn_state_changed_event(void *buf, uint16
 
        bt_hal_cbacks->le_conn_state_changed_cb(ev->status, &bd_addr, ev->state);
 #endif
-       DBG("-");
 }
 
 static void __bt_hal_handle_authorize_request_event(void *buf, uint16_t len)
@@ -824,8 +784,6 @@ static void __bt_hal_handle_authorize_request_event(void *buf, uint16_t len)
        struct hal_ev_authorize_request *ev = (struct hal_ev_authorize_request *)buf;
        bt_bdaddr_t bd_addr;
 
-       DBG("+");
-
        memcpy(bd_addr.address, ev->bdaddr, 6);
 
        /* BD address*/
@@ -844,7 +802,6 @@ static void __bt_hal_handle_authorize_request_event(void *buf, uint16_t len)
        }
 
        bt_hal_cbacks->authorize_request_cb(&bd_addr, ev->service_id);
-       DBG("-");
 }
 
 #ifdef TIZEN_BT_HAL
@@ -857,8 +814,6 @@ static void __bt_hal_handle_socket_authorize_request_event(void *buf, uint16_t l
        uint8_t path[249] = {0, };
        uint32_t fd;
 
-       DBG("+");
-
        memcpy(bd_addr.address, ev->bdaddr, 6);
        memcpy(uuid.uu, ev->uuid, 16);
        memcpy(name, ev->name, sizeof(name) - 1);
@@ -871,7 +826,6 @@ static void __bt_hal_handle_socket_authorize_request_event(void *buf, uint16_t l
        }
 
        bt_hal_cbacks->socket_authorize_request_cb(&bd_addr, &uuid, name, path, fd);
-       DBG("-");
 }
 #endif
 
@@ -880,7 +834,6 @@ static void __bt_hal_handle_ssp_request_event(void *buf, uint16_t len)
        struct hal_ev_ssp_request *ev = (struct hal_ev_ssp_request *)buf;
        bt_bdaddr_t bd_addr;
        bt_bdname_t bd_name;
-       DBG("+");
 
        memcpy(bd_addr.address, ev->bdaddr, 6);
        memcpy(bd_name.name, ev->name, 248);
@@ -905,7 +858,6 @@ static void __bt_hal_handle_ssp_request_event(void *buf, uint16_t len)
        bt_hal_cbacks->ssp_request_cb(&bd_addr, &bd_name,
                        ev->class_of_dev,
                        ev->pairing_variant, ev->passkey);
-       DBG("-");
 }
 
 static void __bt_hal_handle_pin_request_event(void *buf, uint16_t len)
@@ -913,7 +865,6 @@ static void __bt_hal_handle_pin_request_event(void *buf, uint16_t len)
        struct hal_ev_pin_request *ev = (struct hal_ev_pin_request *)buf;
        bt_bdaddr_t bd_addr;
        bt_bdname_t bd_name;
-       DBG("+");
 
        memcpy(bd_addr.address, ev->bdaddr, 6);
        memcpy(bd_name.name, ev->name, 248);
@@ -935,14 +886,12 @@ static void __bt_hal_handle_pin_request_event(void *buf, uint16_t len)
 
        bt_hal_cbacks->pin_request_cb(&bd_addr, &bd_name,
                        ev->class_of_dev);
-       DBG("-");
 }
 
 static void __bt_hal_handle_device_trust_state_changed_event(void *buf, uint16_t len)
 {
        struct hal_ev_device_trust_state_changed *ev = (struct hal_ev_device_trust_state_changed*)buf;
        bt_bdaddr_t bd_addr;
-       DBG("+");
 
        memcpy(bd_addr.address, ev->bdaddr, 6);
        /* BD address*/
@@ -961,7 +910,6 @@ static void __bt_hal_handle_device_trust_state_changed_event(void *buf, uint16_t
        }
 
        bt_hal_cbacks->device_trust_state_changed_cb(&bd_addr, ev->trust);
-       DBG("-");
 }
 
 static void __bt_hal_handle_device_trusted_profiles_changed_event(void *buf, uint16_t len)
@@ -969,7 +917,6 @@ static void __bt_hal_handle_device_trusted_profiles_changed_event(void *buf, uin
        struct hal_ev_device_trusted_profiles_changed *ev = buf;
        bt_bdaddr_t bd_addr;
 
-       DBG("+");
 #ifdef TIZEN_BT_HAL
        memcpy(bd_addr.address, ev->bdaddr, 6);
        DBG("[0x%02X:%02X:%02X:%02X:%02X:%02X]",
@@ -984,7 +931,6 @@ static void __bt_hal_handle_device_trusted_profiles_changed_event(void *buf, uin
 
        bt_hal_cbacks->device_trusted_profiles_changed_cb(&bd_addr, ev->trust_val);
 #endif
-       DBG("-");
 }
 
 static void __bt_handle_rssi_monitor_state_changed(void *buf, uint16_t len)
@@ -992,7 +938,6 @@ static void __bt_handle_rssi_monitor_state_changed(void *buf, uint16_t len)
        struct hal_ev_rssi_monitor_state_changed *ev = buf;
        bt_bdaddr_t bd_addr;
 
-       DBG("+");
 #ifdef TIZEN_BT_HAL
        memcpy(bd_addr.address, ev->bdaddr, 6);
        DBG("[0x%02X:%02X:%02X:%02X:%02X:%02X]",
@@ -1004,7 +949,6 @@ static void __bt_handle_rssi_monitor_state_changed(void *buf, uint16_t len)
                bt_hal_cbacks->rssi_monitor_state_changed_cb(
                                &bd_addr, ev->link_type, ev->state);
 #endif
-       DBG("-");
 }
 
 static void __bt_handle_rssi_alert_recieved(void *buf, uint16_t len)
@@ -1012,7 +956,6 @@ static void __bt_handle_rssi_alert_recieved(void *buf, uint16_t len)
        struct hal_ev_rssi_alert_recieved *ev = buf;
        bt_bdaddr_t bd_addr;
 
-       DBG("+");
 #ifdef TIZEN_BT_HAL
        memcpy(bd_addr.address, ev->bdaddr, 6);
        DBG("[0x%02X:%02X:%02X:%02X:%02X:%02X]",
@@ -1024,7 +967,6 @@ static void __bt_handle_rssi_alert_recieved(void *buf, uint16_t len)
                bt_hal_cbacks->rssi_alert_cb(
                                &bd_addr, ev->link_type, ev->alert_type, ev->rssi);
 #endif
-       DBG("-");
 }
 
 static void __bt_handle_raw_rssi_recieved(void *buf, uint16_t len)
@@ -1032,7 +974,6 @@ static void __bt_handle_raw_rssi_recieved(void *buf, uint16_t len)
        struct hal_ev_raw_rssi_recieved *ev = buf;
        bt_bdaddr_t bd_addr;
 
-       DBG("+");
 #ifdef TIZEN_BT_HAL
        memcpy(bd_addr.address, ev->bdaddr, 6);
        DBG("[0x%02X:%02X:%02X:%02X:%02X:%02X]",
@@ -1044,25 +985,21 @@ static void __bt_handle_raw_rssi_recieved(void *buf, uint16_t len)
                bt_hal_cbacks->raw_rssi_received_cb(
                                &bd_addr, ev->link_type, ev->rssi);
 #endif
-       DBG("-");
 }
 
 static void __bt_handle_dbfw_plus_info_recieved(void *buf, uint16_t len)
 {
        struct hal_ev_dbfw_plus_info_recieved *info = buf;
 
-       DBG("+");
 #ifdef TIZEN_BT_HAL
        if (bt_hal_cbacks->dbfw_plus_info_received_cb)
                bt_hal_cbacks->dbfw_plus_info_received_cb(
                                info->data, info->data_len, info->event_code);
 #endif
-       DBG("-");
 }
 
 static void __bt_hal_handle_stack_messages(int message, void *buf, uint16_t len)
 {
-       DBG("+");
        switch (message) {
        case HAL_EV_ADAPTER_STATE_CHANGED:
                DBG("Event: HAL_EV_ADAPTER_STATE_CHANGED");
@@ -1146,5 +1083,4 @@ static void __bt_hal_handle_stack_messages(int message, void *buf, uint16_t len)
                DBG("Event Currently not handled!!");
                break;
        }
-       DBG("-");
 }