Fix build warnings in bluetooth-frwk 97/181797/2
authorAtul Rai <a.rai@samsung.com>
Mon, 18 Jun 2018 10:15:07 +0000 (15:45 +0530)
committerPyun DoHyun <dh79.pyun@samsung.com>
Tue, 19 Jun 2018 00:43:52 +0000 (00:43 +0000)
Change-Id: I17a391471d2ea4a83bbad3053da836582e926cc9
Signed-off-by: Atul Rai <a.rai@samsung.com>
bt-oal/bluez_hal/src/bt-hal-avrcp-ctrl-dbus-handler.c
bt-oal/bluez_hal/src/bt-hal-dbus-common-utils.h
bt-oal/bluez_hal/src/bt-hal-utils.c
bt-oal/common/oal-utils.c
bt-oal/common/oal-utils.h
bt-oal/hardware/bt_rc.h
bt-oal/oal-gatt.c
bt-service-adaptation/services/adapter/bt-service-core-adapter.c
bt-service-adaptation/services/bt-service-dpm.c
bt-service-adaptation/services/gatt/bt-service-gatt.c
bt-service-adaptation/services/obex/bt-service-obex-agent.c

index 9bc19d1..0d71806 100644 (file)
@@ -339,6 +339,7 @@ static const char *__bt_media_type_to_str(int type)
        return NULL;
 }
 
+#if 0
 static const char *__bt_transport_type_to_str(int type)
 {
        switch (type) {
@@ -352,6 +353,7 @@ static const char *__bt_transport_type_to_str(int type)
 
        return NULL;
 }
+#endif
 
 bt_status_t _bt_hal_dbus_handler_avrcp_ctrl_set_property(bt_bdaddr_t *bd_addr, uint8_t type, uint8_t value)
 {
index 3e63c12..f738f3b 100644 (file)
@@ -435,6 +435,7 @@ extern "C" {
        GDBusProxy *_bt_hal_get_profile_proxy(void);
        GDBusProxy *_bt_hal_get_avrcp_ctrl_proxy(bt_bdaddr_t *bd_addr);
        GDBusProxy *_bt_hal_get_avrcp_ctrl_properties_proxy(bt_bdaddr_t *bd_addr);
+       GDBusProxy *_bt_hal_get_avrcp_transport_properties_proxy(bt_bdaddr_t *bd_addr);
        char *_bt_hal_get_adapter_path(void);
        gboolean _bt_hal_is_adapter_powered(gboolean *powered);
 
index ce17e91..9891830 100644 (file)
@@ -789,7 +789,7 @@ const char *btproperty2str(const bt_property_t *property)
                break;
        case BT_PROPERTY_SERVICE_RECORD:
                rec = property->val;
-               ret = snprintf(p, "{%s, %d, %s}", btuuid2str(rec->uuid.uu),
+               ret = snprintf(p, buf_len, "{%s, %d, %s}", btuuid2str(rec->uuid.uu),
                                rec->channel, rec->name);
                if (0 > ret) {
                        ERR("snprintf failed with %d", ret);
index 94ad2ca..4cec7a5 100755 (executable)
@@ -186,7 +186,7 @@ int hex2bin(const char *s)
        return ret;
 }
 
-void convert_str_2_hex(char out[], char in[])
+void convert_str_2_hex(unsigned char out[], char in[])
 {
        int i = 0;
        for (i = 0; i < 62; i++) {
@@ -195,7 +195,7 @@ void convert_str_2_hex(char out[], char in[])
        }
 }
 
-void convert_hex_2_str(char * hex, int len, char * str_out)
+void convert_hex_2_str(unsigned char * hex, int len, char * str_out)
 {
        int i = 0;
 
index 9120019..7c3a782 100755 (executable)
@@ -432,8 +432,8 @@ void oal_convert_addr_string_to_type(unsigned char *addr, const char *address);
 int oal_is_address_zero(unsigned char *addr1);
 void print_bt_properties(int num_properties, bt_property_t *properties);
 
-void convert_str_2_hex(char out[], char in[]);
-void convert_hex_2_str(char * hex, int len, char * str_out);
+void convert_str_2_hex(unsigned char out[], char in[]);
+void convert_hex_2_str(unsigned char *hex, int len, char *str_out);
 char* convert_bt_property_2_str(const bt_property_t *property);
 char* convert_property_type_2_str(bt_property_type_t prop_type);
 char* convert_scan_mode_2_str(bt_scan_mode_t scan_mode);
index 5ec59bc..6c38d02 100644 (file)
@@ -638,7 +638,7 @@ typedef struct {
 
        /** send command to set delay, volume to target */
        bt_status_t (*set_transport_setting_cmd) (bt_bdaddr_t *bd_addr, uint8_t num_attrib,
-                       uint8_t* attrib_ids, uint8_t* attrib_vals);
+                       int* attrib_ids, uint32_t* attrib_vals);
 
        /** send command to play a particular item */
        bt_status_t (*play_item_cmd) (
index 51f1343..38637ad 100644 (file)
@@ -128,9 +128,6 @@ static const btgatt_interface_t * gatt_api;
 static gboolean cur_adv_state[NUM_SERVER_INST];
 static gatt_server_t gatt_servers[NUM_SERVER_INST];
 
-static int default_client_id = -1;
-static int pending_gattc_req = OAL_REQ_NONE;
-
 /* Forward declarations of GATT Server callbacks */
 static void cb_gatts_register_app(int status, int server_if, bt_uuid_t *uuid);
 static void cb_gatts_multi_adv_enable(int server_if, int status);
@@ -599,12 +596,12 @@ oal_status_t gatts_multi_adv_set_inst_data(int instance_id,
        adv_setup.server_if = gatt_servers[instance_id - 1].server_id;
        if (adv_setup.manufacturer_data_len > 0 && adv_setup.manufacturer_data != NULL) {
                BT_INFO("Manufacture data.....\n");
-               PRINT_ADV_DATA(adv_setup.manufacturer_data_len, adv_setup.manufacturer_data, adv_setup.set_scan_rsp);
+               PRINT_ADV_DATA(adv_setup.manufacturer_data_len, (unsigned char *)adv_setup.manufacturer_data, adv_setup.set_scan_rsp);
        }
 
        if (adv_setup.service_uuid_len > 0 && adv_setup.service_uuid != NULL) {
                BT_INFO("Service uuid.....\n");
-               PRINT_ADV_DATA(adv_setup.service_uuid_len, adv_setup.service_uuid, FALSE);
+               PRINT_ADV_DATA(adv_setup.service_uuid_len, (unsigned char*)adv_setup.service_uuid, FALSE);
        }
 
 
@@ -1614,31 +1611,6 @@ static void cb_gattc_read_descriptor(int conn_id, int status, btgatt_read_params
        send_event(OAL_EVENT_GATTC_READ_DESCR, event, sizeof(*event));
 }
 
-
-/* Register default gatt client to be used in LE scan etc. */
-static oal_status_t __register_default_gatt_client(void)
-{
-       bt_uuid_t uuid;
-       int ret;
-
-       API_TRACE("GATT client register");
-       CHECK_OAL_GATT_ENABLED();
-
-       if (default_client_id >= 0) {
-               BT_ERR("Client Already registered");
-               return OAL_STATUS_ALREADY_DONE;
-       }
-
-       string_to_uuid(DEFAULT_GATT_CLIENT_UUID, (service_uuid_t *)&uuid);
-       ret = gatt_api->client->register_client(&uuid);
-       if (ret != BT_STATUS_SUCCESS) {
-               BT_ERR("GATT client register failed: %s", status2string(ret));
-               return convert_to_oal_status(ret);
-       }
-
-       return OAL_STATUS_SUCCESS;
-}
-
 oal_status_t gattc_start_le_discovery(int client_id)
 {
 
index 545063a..2134858 100644 (file)
@@ -548,15 +548,21 @@ int _bt_set_discoverable_mode(int discoverable_mode, int timeout)
 
        if (discoverable_mode == BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE) {
                ret = _bt_stop_visibility_timer();
+               if (BLUETOOTH_ERROR_NONE != ret)
+                       BT_ERR("_bt_stop_visibility_timer failed");
                if (!TIZEN_PROFILE_WEARABLE) {
                        if (vconf_set_int(BT_FILE_VISIBLE_TIME, -1) != 0)
                                 BT_ERR("Set vconf failed");
                }
        } else if (discoverable_mode == BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE) {
                ret = _bt_start_visibility_timer(timeout);
+               if (BLUETOOTH_ERROR_NONE != ret)
+                       BT_ERR("_bt_start_visibility_timer failed");
 
        } else {
                ret = _bt_stop_visibility_timer();
+               if (BLUETOOTH_ERROR_NONE != ret)
+                       BT_ERR("_bt_stop_visibility_timer failed");
        }
 
        BT_DBG("-");
@@ -1662,7 +1668,6 @@ void _bt_set_disabled(int result)
        if (vconf_set_int(VCONFKEY_BT_DEVICE, VCONFKEY_BT_DEVICE_NONE) != 0)
                BT_ERR("Set vconf failed\n");
 
-       _bt_cancel_queued_transfers();
        _bt_adapter_set_status(BT_DEACTIVATED);
        __bt_adapter_update_discovery_status(ADAPTER_DISCOVERY_STOPPED);
 
index 7cc21b8..d8b27d4 100644 (file)
@@ -289,7 +289,7 @@ int _bt_dpm_add_bluetooth_uuids_to_blacklist(const char *uuid)
 
        /* Disconnect if connected blacklist uuid is existing */
        addr_list = g_array_new(FALSE, FALSE, sizeof(gchar));
-       _bt_get_profile_connected_devices(uuid, &addr_list);
+       _bt_get_profile_connected_devices((char *)uuid, &addr_list);
        for (i = 0; i < (addr_list->len / sizeof(bluetooth_device_address_t)); i++) {
                char address[BT_ADDRESS_STRING_SIZE];
 
@@ -596,6 +596,9 @@ int _bt_dpm_set_bluetooth_profile_state(dpm_profile_t profile, dpm_status_t valu
                case DPM_POLICY_BLUETOOTH_SPP_PROFILE_STATE:
                        uuid = BT_SPP_UUID;
                        break;
+               default:
+                       BT_ERR("Unknown profile %d", profile);
+                       return BLUETOOTH_ERROR_INTERNAL;
                }
 
                addr_list = g_array_new(FALSE, FALSE, sizeof(gchar));
index 18f5ddf..365bb55 100644 (file)
@@ -2390,17 +2390,6 @@ int _bt_get_att_mtu(bluetooth_device_address_t *address,
 }
 
 #ifdef TIZEN_GATT_CLIENT
-static void __bt_convert_byte_ordering(char *data, int data_len,
-               char *converted_data)
-{
-       int i, j;
-       char temp[BLUETOOTH_UUID_HEX_MAX_LEN];
-
-       memcpy(&temp, data, data_len);
-       for (i = 0, j = data_len - 1; i < data_len; i++, j--)
-               converted_data[i] = temp[j];
-}
-
 /* GATT Client utility static functions */
 static bt_gatt_service_info_list_t * __bt_get_service_info_list(int conn_id)
 {
index b1d1ee2..03343f0 100755 (executable)
@@ -188,7 +188,7 @@ static void __new_connection_method(GDBusConnection *connection,
                        goto fail;
 
                if (info->name == NULL) {
-                       info->name = sender;
+                       info->name = (char *)sender;
                } else {
                        if (g_strcmp0(sender, info->name) != 0)
                                goto fail;