Skip to content

Commit e8db5cc

Browse files
committed
[int][new][bt] [add read remote extend feature function]
Project: Bluetooth redmine: #4703, REDMINE-4703 ext-redmine: bug|feat#4703 [Description in detail] Affected branch: [master] Change-Id: I7fb752eb34e3f2f92f9556df2b02ba9a366c8536
1 parent 537c4f3 commit e8db5cc

File tree

6 files changed

+56
-0
lines changed

6 files changed

+56
-0
lines changed

include/gap_api.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,8 @@ void gap_rd_rmt_version_req(U16 tid, BTS2S_BD_ADDR bd);
621621
*----------------------------------------------------------------------------*/
622622
void gap_rd_local_bd_req(U16 tid);
623623

624+
void gap_rd_rmt_ext_featr_req(U16 tid, U8 page_num, BTS2S_BD_ADDR bd);
625+
624626
/*----------------------------------------------------------------------------*
625627
*
626628
* DESCRIPTION:

service/bt/bt_cm/bt_connection_manager.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,6 +1922,18 @@ void bt_cm(uint8_t argc, char **argv)
19221922
bt_spp_set_spp_data_loopback_enable(atoi(argv[2]));
19231923
}
19241924
#endif
1925+
else if (strcmp(argv[1], "rd_ext") == 0)
1926+
{
1927+
bt_cm_env_t *env = bt_cm_get_env();
1928+
uint32_t i;
1929+
for (i = 0; i < BT_CM_MAX_CONN; i++)
1930+
{
1931+
if (env->conn_device[i].state >= BT_CM_STATE_CONNECTED)
1932+
{
1933+
gap_rd_rmt_ext_featr_req(bts2_task_get_app_task_id(), atoi(argv[2]), env->conn_device[i].info.bd_addr);
1934+
}
1935+
}
1936+
}
19251937
}
19261938
}
19271939

service/bt/bt_finsh/bts2_app_generic.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,6 +1550,14 @@ void bt_hdl_gap_msg(bts2_app_stru *bts2_app_data)
15501550
USER_TRACE("res = %d,page_num = %d,max_page_num = %d\n", msg->res, msg->page_num, msg->max_page_num);
15511551
USER_TRACE("ext_lmp_featr[0] = 0x%x,ext_lmp_featr[1] = 0x%x,ext_lmp_featr[2] = 0x%x,ext_lmp_featr[3] = 0x%x\n",
15521552
msg->ext_lmp_featr[0], msg->ext_lmp_featr[1], msg->ext_lmp_featr[2], msg->ext_lmp_featr[3]);
1553+
1554+
bt_notify_rd_extend_feature_resp_t ext_feature_resp_info;
1555+
ext_feature_resp_info.res = msg->res;
1556+
ext_feature_resp_info.page_num = msg->page_num;
1557+
ext_feature_resp_info.max_page_num = msg->max_page_num;
1558+
bmemcpy(ext_feature_resp_info.ext_lmp_featr, msg->ext_lmp_featr, sizeof(ext_feature_resp_info.ext_lmp_featr));
1559+
bt_addr_convert(&msg->bd, ext_feature_resp_info.mac.addr);
1560+
bt_interface_bt_event_notify(BT_NOTIFY_COMMON, BT_NOTIFY_COMMON_RD_EXT_FEATURE_RSP, &ext_feature_resp_info, sizeof(bt_notify_rd_extend_feature_resp_t));
15531561
break;
15541562
}
15551563
case BTS2MU_GAP_RD_INQUIRY_RESP_CFM:

service/bt/bt_finsh/bts2_app_interface.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,15 @@ void bt_interface_rd_inquiry_mode(void)
369369
gap_rd_inquiry_mode_req();
370370
}
371371

372+
void bt_interface_rd_extend_feature(unsigned char *mac, uint8_t page_num)
373+
{
374+
bts2_app_stru *bts2_app_data = bts2g_app_p;
375+
BTS2S_BD_ADDR bd_addr;
376+
bt_addr_convert_to_bts((bd_addr_t *)mac, &bd_addr);
377+
378+
gap_rd_rmt_ext_featr_req(bts2_app_data->phdl, page_num, bd_addr);
379+
}
380+
372381
int8_t bt_interface_cancel_connect_req(unsigned char *mac)
373382
{
374383
BTS2S_BD_ADDR bd_addr;

service/bt/bt_finsh/bts2_app_interface.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,14 @@ void bt_interface_wr_inquiry_mode(U8 mode);
103103
**/
104104
void bt_interface_rd_inquiry_mode(void);
105105

106+
/**
107+
* @brief Read remote extend feature reques
108+
* @param[in]mac Remote device address
109+
* @param[in]page_num The page number of the features required
110+
*
111+
**/
112+
void bt_interface_rd_extend_feature(unsigned char *mac, uint8_t page_num);
113+
106114
/**
107115
* @brief Read local device EIR data
108116
* @param[in] fec_required fec_required mode

service/bt/bt_finsh/bts2_app_interface_type.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ typedef enum
141141
BT_NOTIFY_COMMON_WR_INQUIRY_MODE_RSP,
142142
/// write inquiry mode response event
143143
BT_NOTIFY_COMMON_RD_INQUIRY_MODE_RSP,
144+
/// read remote extend feature event
145+
BT_NOTIFY_COMMON_RD_EXT_FEATURE_RSP,
144146
} bt_notify_common_event_id_t;
145147

146148
/// these type are BT_NOTIFY_HFP_HF event id
@@ -419,6 +421,21 @@ typedef struct
419421
uint8_t eir_data[240];
420422
} bt_notify_rd_inquiry_resp_t;
421423

424+
/// bt read remote extend feature result
425+
typedef struct
426+
{
427+
/// read remote extend feature result
428+
uint8_t res;
429+
//page number
430+
U8 page_num;
431+
//max page number
432+
U8 max_page_num;
433+
//Bit map of requested page of LMP features
434+
U16 ext_lmp_featr[4];
435+
/// remote device mac
436+
bt_notify_device_mac_t mac;
437+
} bt_notify_rd_extend_feature_resp_t;
438+
422439
/// bt read inquiry mode response event
423440
typedef struct
424441
{

0 commit comments

Comments
 (0)