From 2041c08681043c6d6136aaaf702d385f0a867c14 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Fri, 11 May 2018 11:08:58 +0200 Subject: [PATCH] Bluedroid: remove warnings about discarding "const" for "const char*" --- components/bt/bluedroid/bta/dm/bta_dm_api.c | 2 +- components/bt/bluedroid/bta/include/bta/bta_api.h | 2 +- components/bt/bluedroid/bta/jv/bta_jv_act.c | 6 +++--- components/bt/bluedroid/btc/core/btc_dm.c | 2 +- components/bt/bluedroid/stack/gap/gap_conn.c | 2 +- components/bt/bluedroid/stack/include/stack/gap_api.h | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/bt/bluedroid/bta/dm/bta_dm_api.c b/components/bt/bluedroid/bta/dm/bta_dm_api.c index fdd5f97a93..6564adc824 100644 --- a/components/bt/bluedroid/bta/dm/bta_dm_api.c +++ b/components/bt/bluedroid/bta/dm/bta_dm_api.c @@ -166,7 +166,7 @@ void BTA_DisableTestMode(void) ** Returns void ** *******************************************************************************/ -void BTA_DmSetDeviceName(char *p_name) +void BTA_DmSetDeviceName(const char *p_name) { tBTA_DM_API_SET_NAME *p_msg; diff --git a/components/bt/bluedroid/bta/include/bta/bta_api.h b/components/bt/bluedroid/bta/include/bta/bta_api.h index b2ef0ecd3a..ae645f5753 100644 --- a/components/bt/bluedroid/bta/include/bta/bta_api.h +++ b/components/bt/bluedroid/bta/include/bta/bta_api.h @@ -1416,7 +1416,7 @@ extern void BTA_DisableTestMode(void); ** Returns void ** *******************************************************************************/ -extern void BTA_DmSetDeviceName(char *p_name); +extern void BTA_DmSetDeviceName(const char *p_name); extern void BTA_DmUpdateWhiteList(BOOLEAN add_remove, BD_ADDR remote_addr, tBTA_ADD_WHITELIST_CBACK *add_wl_cb); diff --git a/components/bt/bluedroid/bta/jv/bta_jv_act.c b/components/bt/bluedroid/bta/jv/bta_jv_act.c index 9ce6677456..12dfd13b25 100644 --- a/components/bt/bluedroid/bta/jv/bta_jv_act.c +++ b/components/bt/bluedroid/bta/jv/bta_jv_act.c @@ -951,7 +951,7 @@ static bool create_base_record(const uint32_t sdp_handle, const char *name, cons proto_list[2].num_params = 0; } - char *stage = "protocol_list"; + const char *stage = "protocol_list"; if (!SDP_AddProtocolList(sdp_handle, num_proto_elements, proto_list)){ APPL_TRACE_ERROR("create_base_record: failed to create base service " "record, stage: %s, scn: %d, name: %s, with_obex: %d", @@ -1000,7 +1000,7 @@ static int add_spp_sdp(const char *name, const int channel) { } // Create the base SDP record. - char *stage = "create_base_record"; + const char *stage = "create_base_record"; if (!create_base_record(handle, name, channel, FALSE /* with_obex */)){ SDP_DeleteRecord(handle); APPL_TRACE_ERROR("add_spp_sdp: failed to register SPP service, " @@ -2769,4 +2769,4 @@ extern void bta_jv_l2cap_close_fixed (tBTA_JV_MSG *p_data) } -#endif ///defined BTA_JV_INCLUDED && BTA_JV_INCLUDED == TRUE \ No newline at end of file +#endif ///defined BTA_JV_INCLUDED && BTA_JV_INCLUDED == TRUE diff --git a/components/bt/bluedroid/btc/core/btc_dm.c b/components/bt/bluedroid/btc/core/btc_dm.c index d6d41e2346..8bc2370ad4 100644 --- a/components/bt/bluedroid/btc/core/btc_dm.c +++ b/components/bt/bluedroid/btc/core/btc_dm.c @@ -454,7 +454,7 @@ void btc_dm_sec_cb_handler(btc_msg_t *msg) /* Set initial device name, it can be overwritten later */ if (p_data->enable.status == BTA_SUCCESS) { - char *initial_device_name = "ESP32"; + const char *initial_device_name = "ESP32"; BTA_DmSetDeviceName(initial_device_name); } btc_enable_bluetooth_evt(p_data->enable.status); diff --git a/components/bt/bluedroid/stack/gap/gap_conn.c b/components/bt/bluedroid/stack/gap/gap_conn.c index 3ca81d082c..ecb7b726f5 100644 --- a/components/bt/bluedroid/stack/gap/gap_conn.c +++ b/components/bt/bluedroid/stack/gap/gap_conn.c @@ -123,7 +123,7 @@ void gap_conn_init (void) ** Returns handle of the connection if successful, else GAP_INVALID_HANDLE ** *******************************************************************************/ -UINT16 GAP_ConnOpen (char *p_serv_name, UINT8 service_id, BOOLEAN is_server, +UINT16 GAP_ConnOpen (const char *p_serv_name, UINT8 service_id, BOOLEAN is_server, BD_ADDR p_rem_bda, UINT16 psm, tL2CAP_CFG_INFO *p_cfg, tL2CAP_ERTM_INFO *ertm_info, UINT16 security, UINT8 chan_mode_mask, tGAP_CONN_CALLBACK *p_cb) diff --git a/components/bt/bluedroid/stack/include/stack/gap_api.h b/components/bt/bluedroid/stack/include/stack/gap_api.h index 031247f7c0..5d8d87645d 100644 --- a/components/bt/bluedroid/stack/include/stack/gap_api.h +++ b/components/bt/bluedroid/stack/include/stack/gap_api.h @@ -140,7 +140,7 @@ typedef void (tGAP_BLE_CMPL_CBACK)(BOOLEAN status, BD_ADDR addr, UINT16 length, ** Returns handle of the connection if successful, else GAP_INVALID_HANDLE ** *******************************************************************************/ -extern UINT16 GAP_ConnOpen (char *p_serv_name, UINT8 service_id, BOOLEAN is_server, +extern UINT16 GAP_ConnOpen (const char *p_serv_name, UINT8 service_id, BOOLEAN is_server, BD_ADDR p_rem_bda, UINT16 psm, tL2CAP_CFG_INFO *p_cfg, tL2CAP_ERTM_INFO *ertm_info, UINT16 security, UINT8 chan_mode_mask, tGAP_CONN_CALLBACK *p_cb);