Skip to content

Commit 1bdb577

Browse files
committed
[int][new][bt] Resolve compilation errors
Project: SiFliSDK redmine: #4160, REDMINE-4160 ext-redmine: bug|feat#id [Description in detail] Affected branch: [main] Change-Id: Ice1b53efdf83d3114b24caddd56bcf132854f404
1 parent 6d60cf8 commit 1bdb577

14 files changed

+204
-106
lines changed

lib/lib_bt_gcc.a

1.1 KB
Binary file not shown.

lib/lib_bt_msvc.lib

166 Bytes
Binary file not shown.

lib/lib_bt_rvds.lib

64 Bytes
Binary file not shown.

lib/lib_bt_rvds_tran_only.lib

0 Bytes
Binary file not shown.

service/bt/bt_cm/bt_connection_manager.c

Lines changed: 78 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static uint8_t bt_cm_get_link_type_by_profile_role(uint8_t profile, uint8_t role
9898
}
9999
case BT_NOTIFY_A2DP_PROFILE:
100100
{
101-
if (role == BT_NOTIFY_A2DP_ROLE_SOURCE)
101+
if (role == BT_NOTIFY_A2DP_ROLE_SOURCE)
102102
{
103103
link_type = BT_LINK_EARPHONE;
104104
}
@@ -305,7 +305,7 @@ bt_cm_dev_acl_info_t *bt_cm_conn_alloc(bt_cm_device_manager_t *env, BTS2S_BD_ADD
305305
for (uint8_t i = 0; i < BT_CM_DEVICE_MAX_CONN; i++)
306306
{
307307

308-
bt_cm_dev_acl_info_t * conn = &env->bt_devices[i];
308+
bt_cm_dev_acl_info_t *conn = &env->bt_devices[i];
309309
memset(conn, 0, sizeof(bt_cm_dev_acl_info_t));
310310
if (!conn->is_use)
311311
{
@@ -434,7 +434,7 @@ uint8_t bt_close_bt_request(void)
434434
{
435435
env->bt_devices[i].state = BT_CM_ACL_STATE_DISCONNECTED;
436436
}
437-
// Cal AVRCP
437+
// Cal AVRCP
438438
bt_interface_bt_event_notify(BT_NOTIFY_COMMON, BT_NOTIFY_COMMON_CLOSE_COMPLETE, NULL, 0);
439439
}
440440

@@ -481,7 +481,7 @@ static int bt_cm_update_profile_bit_mask(bt_cm_dev_acl_info_t *conn, uint32_t pr
481481
uint32_t profile_type = bt_cm_conn_get_next_profile(conn, conn->info.link_type);
482482
if (profile_type != 0)
483483
{
484-
bt_cm_profile_connect(profile_type, &conn->info.bd_addr,conn->info.link_type);
484+
bt_cm_profile_connect(profile_type, &conn->info.bd_addr, conn->info.link_type);
485485
}
486486
}
487487
return 0;
@@ -706,53 +706,53 @@ void bt_profile_update_connection_state(uint16_t type, uint16_t event_id, bt_not
706706
#ifdef BT_AUTO_CONNECT_LAST_DEVICE
707707
switch (type)
708708
{
709-
case BT_NOTIFY_HFP_HF:
710-
{
711-
bt_hfp_hf_profile_state_hdl(event_id, profile_state);
712-
break;
713-
}
714-
case BT_NOTIFY_HFP_AG:
715-
{
716-
bt_hfp_ag_profile_state_hdl(event_id, profile_state);
717-
break;
718-
}
719-
case BT_NOTIFY_A2DP:
720-
{
721-
bt_a2dp_profile_state_hdl(event_id, profile_state);
722-
break;
723-
}
724-
case BT_NOTIFY_AVRCP:
725-
{
726-
bt_avrcp_profile_state_hdl(event_id, profile_state);
727-
break;
728-
}
729-
case BT_NOTIFY_HID:
730-
{
731-
bt_hid_profile_state_hdl(event_id, profile_state);
732-
break;
733-
}
734-
case BT_NOTIFY_PAN:
735-
{
736-
bt_pan_profile_state_hdl(event_id, profile_state);
737-
break;
738-
}
739-
case BT_NOTIFY_SPP:
740-
{
741-
bt_spp_profile_state_hdl(event_id, profile_state);
742-
break;
743-
}
744-
case BT_NOTIFY_GATT:
745-
{
746-
bt_gatt_profile_state_hdl(event_id, profile_state);
747-
break;
748-
}
749-
case BT_NOTIFY_PBAP:
750-
{
751-
bt_pabp_profile_state_hdl(event_id, profile_state);
752-
break;
753-
}
754-
default:
755-
break;
709+
case BT_NOTIFY_HFP_HF:
710+
{
711+
bt_hfp_hf_profile_state_hdl(event_id, profile_state);
712+
break;
713+
}
714+
case BT_NOTIFY_HFP_AG:
715+
{
716+
bt_hfp_ag_profile_state_hdl(event_id, profile_state);
717+
break;
718+
}
719+
case BT_NOTIFY_A2DP:
720+
{
721+
bt_a2dp_profile_state_hdl(event_id, profile_state);
722+
break;
723+
}
724+
case BT_NOTIFY_AVRCP:
725+
{
726+
bt_avrcp_profile_state_hdl(event_id, profile_state);
727+
break;
728+
}
729+
case BT_NOTIFY_HID:
730+
{
731+
bt_hid_profile_state_hdl(event_id, profile_state);
732+
break;
733+
}
734+
case BT_NOTIFY_PAN:
735+
{
736+
bt_pan_profile_state_hdl(event_id, profile_state);
737+
break;
738+
}
739+
case BT_NOTIFY_SPP:
740+
{
741+
bt_spp_profile_state_hdl(event_id, profile_state);
742+
break;
743+
}
744+
case BT_NOTIFY_GATT:
745+
{
746+
bt_gatt_profile_state_hdl(event_id, profile_state);
747+
break;
748+
}
749+
case BT_NOTIFY_PBAP:
750+
{
751+
bt_pabp_profile_state_hdl(event_id, profile_state);
752+
break;
753+
}
754+
default:
755+
break;
756756
}
757757
#endif
758758
}
@@ -831,9 +831,9 @@ static void bt_cm_app_init_ready_hdl(void *msg)
831831

832832
if (idx < BT_CM_MAX_BOND)
833833
{
834-
bt_cm_dev_info_t * device_info = bonded_list->info + idx;
834+
bt_cm_dev_info_t *device_info = bonded_list->info + idx;
835835
uint8_t link_type1 = device_info->link_type;
836-
LOG_I("bt_cm_app_init_ready_hdl ,idx %d link_type %d",idx, device_info->link_type);
836+
LOG_I("bt_cm_app_init_ready_hdl ,idx %d link_type %d", idx, device_info->link_type);
837837

838838
if (!bd_is_empty(&device_info->bd_addr))
839839
{
@@ -846,10 +846,10 @@ static void bt_cm_app_init_ready_hdl(void *msg)
846846
}
847847
else
848848
#endif // BT_AUTO_CONNECT_LAST_DEVICE
849-
if ((BT_CM_OPENED == env->close_process) && (bt_cm_get_conn_num(env) < BT_CM_DEVICE_MAX_CONN))
850-
{
851-
gap_wr_scan_enb_req(bts2_task_get_app_task_id(), TRUE, TRUE);
852-
}
849+
if ((BT_CM_OPENED == env->close_process) && (bt_cm_get_conn_num(env) < BT_CM_DEVICE_MAX_CONN))
850+
{
851+
gap_wr_scan_enb_req(bts2_task_get_app_task_id(), TRUE, TRUE);
852+
}
853853

854854
}
855855

@@ -876,7 +876,7 @@ int bt_cm_gap_event_handler(uint16_t event_id, uint8_t *msg)
876876

877877
if (conn)
878878
{
879-
if (conn->link_status_update&& ind->st != HCI_SUCC)
879+
if (conn->link_status_update && ind->st != HCI_SUCC)
880880
{
881881
LOG_E("Adjust sniff failed");
882882
conn->link_status_update = 0;
@@ -908,7 +908,7 @@ int bt_cm_gap_event_handler(uint16_t event_id, uint8_t *msg)
908908
{
909909
conn->link_interval = (float)ind->interval * 5 / 8;
910910
LOG_D("%s mode st: %d, inv: %.2f", mod_str[ind->mode], ind->st, conn->link_interval);
911-
}
911+
}
912912
}
913913
break;
914914
}
@@ -968,13 +968,13 @@ static void bt_cm_hci_acl_connect_complete_event_hdl(BTS2S_DM_EN_ACL_OPENED_IND
968968
conn->info.dev_cls = ind->dev_cls;
969969
conn->link_dir = ind->incoming;
970970
conn->state = BT_CM_ACL_STATE_CONNECTED;
971-
hcia_wr_lp_settings_keep_sniff_interval(&ind->bd, HCI_LINK_POLICY_NO_CHANGE, BT_CM_SNIFF_ENTER_TIME,
971+
hcia_wr_lp_settings_keep_sniff_interval(&ind->bd, HCI_LINK_POLICY_NO_CHANGE, BT_CM_SNIFF_ENTER_TIME,
972972
BT_CM_SNIFF_INV, BT_CM_SNIFF_INV, BT_CM_SNIFF_ATTEMPT, BT_CM_SNIFF_TIMEOUT, NULL);
973973
}
974974

975975
else if (conn && (ind->st != HCI_SUCC || (BT_CM_OPENED != env->close_process)))
976976
{
977-
bt_cm_conn_dealloc(env, conn);
977+
bt_cm_conn_dealloc(env, conn);
978978
}
979979

980980
if ((bt_cm_get_conn_num(env) + 1) > BT_CM_DEVICE_MAX_CONN)
@@ -1131,7 +1131,7 @@ int bt_cm_sc_event_handler(uint16_t event_id, uint8_t *msg)
11311131
bt_cm_device_manager_t *env = bt_cm_get_env();
11321132
if (ind->res == 0)
11331133
{
1134-
LOG_I("BTS2S_SC_PAIR_IND cod:0x%2x",ind->cod);
1134+
LOG_I("BTS2S_SC_PAIR_IND cod:0x%2x", ind->cod);
11351135
bt_cm_dev_acl_info_t *conn = bt_cm_get_conn_by_addr(env, &ind->bd);
11361136
bt_cm_add_bonded_dev(&conn->info, 1);
11371137
//to add bonded device
@@ -1303,7 +1303,7 @@ bt_err_t bt_interface_profile_connect_request(unsigned char *mac, uint8_t profil
13031303
}
13041304

13051305
bt_cm_device_manager_t *env = bt_cm_get_env();
1306-
bt_cm_dev_acl_info_t *conn = bt_cm_get_conn_by_addr(env,&bd_addr);
1306+
bt_cm_dev_acl_info_t *conn = bt_cm_get_conn_by_addr(env, &bd_addr);
13071307

13081308
if (conn == NULL)
13091309
{
@@ -1337,7 +1337,7 @@ bt_err_t bt_interface_profile_connect_request(unsigned char *mac, uint8_t profil
13371337
#ifdef CFG_AVRCP
13381338
case BT_NOTIFY_AVRCP_PROFILE:
13391339
{
1340-
if(role == BT_NOTIFY_AVRCP_ROLE_CT)
1340+
if (role == BT_NOTIFY_AVRCP_ROLE_CT)
13411341
{
13421342
err = bt_avrcp_controller_connect_request(&bd_addr);
13431343
}
@@ -1351,13 +1351,21 @@ bt_err_t bt_interface_profile_connect_request(unsigned char *mac, uint8_t profil
13511351
#ifdef CFG_AV
13521352
case BT_NOTIFY_A2DP_PROFILE:
13531353
{
1354-
if(role == BT_NOTIFY_A2DP_ROLE_SINK)
1354+
if (role == BT_NOTIFY_A2DP_ROLE_SOURCE)
13551355
{
1356+
#ifdef CFG_AV_SRC
13561357
err = bt_a2dp_sink_connect_request(&bd_addr);
1358+
#else
1359+
LOG_I("WARRING,not enabled AV source");
1360+
#endif
13571361
}
1358-
else if (role == BT_NOTIFY_A2DP_ROLE_SOURCE)
1362+
else if (role == BT_NOTIFY_A2DP_ROLE_SINK)
13591363
{
1364+
#ifdef CFG_AV_SNK
13601365
err = bt_a2dp_source_connect_request(&bd_addr);
1366+
#else
1367+
LOG_I("WARRING,not enabled AV sink");
1368+
#endif
13611369
}
13621370
break;
13631371
}
@@ -1430,12 +1438,12 @@ bt_cm_err_t bt_cm_profile_connect(uint32_t profile_bit, BTS2S_BD_ADDR *bd_addr,
14301438
uint8_t role = 0xff;
14311439
uint8_t profile = 0xff;
14321440

1433-
switch(profile_bit)
1441+
switch (profile_bit)
14341442
{
14351443
case BT_CM_HFP:
14361444
{
14371445
profile = BT_NOTIFY_HFP_PROFILE;
1438-
1446+
14391447
if (link_type == BT_LINK_PHONE)
14401448
{
14411449
role = BT_NOTIFY_HFP_ROLE_HF;
@@ -1525,7 +1533,7 @@ bt_cm_err_t bt_cm_connect_req(BTS2S_BD_ADDR *bd_addr, bt_cm_link_type_t link_typ
15251533
{
15261534
bt_cm_err_t ret = bt_cm_profile_connect(profile_bit, bd_addr, link_type);
15271535
LOG_I("Reconnect ret %d link_type 0x%2x", ret, link_type);
1528-
1536+
15291537
if (ret != BT_CM_ERR_NO_ERR)
15301538
{
15311539
err = BT_CM_ERR_INVALID_PARA;
@@ -1715,7 +1723,7 @@ void bt_cm(uint8_t argc, char **argv)
17151723
{
17161724
uint8_t mod_str[3][7] = {"Active", "Hold", "Sniff"};
17171725
bt_cm_device_manager_t *env = bt_cm_get_env();
1718-
for (uint8_t i = 0; i < BT_CM_MAX_BOND; i++)
1726+
for (uint8_t i = 0; i < BT_CM_MAX_BOND; i++)
17191727
{
17201728
bt_cm_dev_acl_info_t *conn = &env->bt_devices[i];
17211729
if (conn->state >= BT_CM_ACL_STATE_CONNECTED)

service/bt/bt_finsh/bts2_app_avrcp.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,12 @@ U8 bt_avrcp_get_role_by_addr(bts2_app_stru *bts2_app_data, BTS2S_BD_ADDR *bd_add
159159

160160
int bt_avrcp_target_connect_request(BTS2S_BD_ADDR *bd)
161161
{
162-
return bt_avrcp_conn_2_dev(bd,TRUE);
162+
return bt_avrcp_conn_2_dev(bd, TRUE);
163163
}
164164

165165
int bt_avrcp_controller_connect_request(BTS2S_BD_ADDR *bd)
166166
{
167-
return bt_avrcp_conn_2_dev(bd,FALSE);
167+
return bt_avrcp_conn_2_dev(bd, FALSE);
168168
}
169169
/*----------------------------------------------------------------------------*
170170
*
@@ -1330,9 +1330,9 @@ static void bt_avrcp_get_element_attributes_confirm(bts2_app_stru *bts2_app_data
13301330
}
13311331
case AVRCP_MEDIA_ATTRIBUTES_ARTIST:
13321332
{
1333-
if (value_length > BT_MAX_SINGER_NAME_LEN)
1333+
if (value_length > AVRCP_MAX_SINGER_NAME_LEN)
13341334
{
1335-
value_length = BT_MAX_SINGER_NAME_LEN;
1335+
value_length = AVRCP_MAX_SINGER_NAME_LEN;
13361336
}
13371337

13381338
if (value_length != 0)
@@ -1359,9 +1359,9 @@ static void bt_avrcp_get_element_attributes_confirm(bts2_app_stru *bts2_app_data
13591359
}
13601360
case AVRCP_MEDIA_ATTRIBUTES_ALBUM:
13611361
{
1362-
if (value_length > BT_MAX_ALBUM_INFO_LEN)
1362+
if (value_length > AVRCP_MAX_ALBUM_INFO_LEN)
13631363
{
1364-
value_length = BT_MAX_ALBUM_INFO_LEN;
1364+
value_length = AVRCP_MAX_ALBUM_INFO_LEN;
13651365
}
13661366

13671367
if (value_length != 0)
@@ -1387,9 +1387,9 @@ static void bt_avrcp_get_element_attributes_confirm(bts2_app_stru *bts2_app_data
13871387
}
13881388
case AVRCP_MEDIA_ATTRIBUTES_TITLE:
13891389
{
1390-
if (value_length > BT_MAX_SONG_NAME_LEN)
1390+
if (value_length > AVRCP_MAX_SONG_NAME_LEN)
13911391
{
1392-
value_length = BT_MAX_SONG_NAME_LEN;
1392+
value_length = AVRCP_MAX_SONG_NAME_LEN;
13931393
}
13941394

13951395
if (value_length != 0)
@@ -1415,9 +1415,9 @@ static void bt_avrcp_get_element_attributes_confirm(bts2_app_stru *bts2_app_data
14151415
}
14161416
case AVRCP_MEDIA_ATTRIBUTES_PLAYTIME:
14171417
{
1418-
if (value_length > BT_MAX_PLAY_TIME_LEN)
1418+
if (value_length > AVRCP_MAX_PLAY_TIME_LEN)
14191419
{
1420-
value_length = BT_MAX_PLAY_TIME_LEN;
1420+
value_length = AVRCP_MAX_PLAY_TIME_LEN;
14211421
}
14221422

14231423
if (value_length != 0)
@@ -1446,7 +1446,7 @@ static void bt_avrcp_get_element_attributes_confirm(bts2_app_stru *bts2_app_data
14461446
}
14471447
USER_TRACE("URC BT music detail end %x\n", music_detail_info.track_id);
14481448
#if defined(CFG_AVRCP)
1449-
bt_interface_bt_event_notify(BT_NOTIFY_AVRCP, BT_NOTIFY_AVRCP_MUSIC_DETAIL_INFO, &music_detail_info.detail_info, sizeof(bt_notify_avrcp_music_detail_t));
1449+
bt_interface_bt_event_notify(BT_NOTIFY_AVRCP, BT_NOTIFY_AVRCP_MUSIC_DETAIL_INFO, &music_detail_info, sizeof(bt_notify_avrcp_music_detail_t));
14501450
#endif
14511451
break;
14521452
}

service/bt/bt_finsh/bts2_app_avrcp.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ extern "C" {
4040
#define FORWARD_PASS_THROUGH (0x4b)
4141
#define BACKWARD_PASS_THROUGH (0x4c)
4242

43+
#define AVRCP_MAX_SONG_NAME_LEN (128)
44+
#define AVRCP_MAX_SINGER_NAME_LEN (128)
45+
#define AVRCP_MAX_ALBUM_INFO_LEN (128)
46+
#define AVRCP_MAX_PLAY_TIME_LEN (8)
47+
4348
#ifdef CFG_MS
4449
_CTRLLER_EXPORT int AVRCP_ctrl_API(WORD n_cmd_code, LPVOID lp_param);
4550

@@ -58,26 +63,26 @@ typedef enum
5863
typedef struct
5964
{
6065
uint32_t size;
61-
uint8_t song_name[BT_MAX_SONG_NAME_LEN];
66+
uint8_t song_name[AVRCP_MAX_SONG_NAME_LEN];
6267
} bt_avrcp_music_song_name_t;
6368

6469
typedef struct
6570
{
6671
uint32_t size;
67-
uint8_t singer_name[BT_MAX_SINGER_NAME_LEN];
72+
uint8_t singer_name[AVRCP_MAX_SINGER_NAME_LEN];
6873
} bt_avrcp_music_singer_name_t;
6974

7075

7176
typedef struct
7277
{
7378
uint32_t size;
74-
uint8_t album_name[BT_MAX_ALBUM_INFO_LEN];
79+
uint8_t album_name[AVRCP_MAX_ALBUM_INFO_LEN];
7580
} bt_avrcp_music_album_info_t;
7681

7782
typedef struct
7883
{
7984
uint32_t size;
80-
uint8_t play_time[BT_MAX_PLAY_TIME_LEN];//ascii code ,unit:ms
85+
uint8_t play_time[AVRCP_MAX_PLAY_TIME_LEN];//ascii code ,unit:ms
8186
} bt_avrcp_music_play_time_t;
8287

8388
typedef struct

0 commit comments

Comments
 (0)