Skip to content

Commit c468574

Browse files
author
chaotaoyang
committed
[rel][new][hfp] add hf & ag at cmd
redmine: #10095, REDMINE-10095 ext-redmine: #id, REDMINE-10095 [Description in detail] Change-Id: Ie5335eeb8f89ec676ad41bcf75ed86db2bf5eec2
1 parent 5cd5076 commit c468574

File tree

6 files changed

+77
-8
lines changed

6 files changed

+77
-8
lines changed

include/hfp_ag_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ typedef struct
188188
*
189189
******************************************************************************/
190190
void hfp_ag_register(U32 local_features);
191-
191+
void hfp_ag_register_ext(U32 local_features, U16 hf_indicator_mask);
192192
/*******************************************************************************
193193
*
194194
* Function hfp_ag_deregister

include/hfp_hf_api.h

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,21 @@ enum
9494
HFP_HF_AT_BIEV,
9595
HFP_HF_AT_BATT_UPDATE,
9696
HFP_HS_AT_CKPD,
97-
HFP_AT_EXTERN_AT_CMD
97+
HFP_AT_EXTERN_AT_CMD,
98+
HFP_HF_AT_BIND_LIST,
99+
HFP_HF_AT_BIND_STATUS,
98100
};
99101

102+
/*! @brief Assigned numbers for HF indicators as per
103+
https://www.bluetooth.org/en-us/specification/assigned-numbers/hands-free-profile
104+
*/
105+
typedef enum
106+
{
107+
HFP_HF_IND_MASK_NONE = 0x00,
108+
HFP_HF_IND_ENHANCED_SAFETY_MASK = 0x01,
109+
HFP_HF_IND_BATTERY_LEVEL_MASK = 0x02
110+
} BTS2S_HF_INDICATOR_MASK;
111+
100112
typedef struct
101113
{
102114
U16 type;
@@ -416,6 +428,23 @@ typedef struct
416428
U16 supp_feature;
417429
} BTS2S_HF_BRSF_IND;
418430

431+
/*!
432+
@brief Structure containing separate values for each supported indicator
433+
*/
434+
typedef struct
435+
{
436+
unsigned service: 2;
437+
unsigned signal_strength: 2;
438+
unsigned roaming_status: 2;
439+
unsigned battery_charge: 2;
440+
unsigned unused: 8;
441+
} BTS2S_HF_OPTIONAL_INDICATORS;
442+
443+
typedef struct
444+
{
445+
uint8_t assigned_id;
446+
uint8_t value;
447+
} BTS2S_HF_INDICATOR_STATUS;
419448

420449
/*----------------------------------------------------------------------------*
421450
*
@@ -435,7 +464,7 @@ typedef struct
435464
* be received as a confirmation.
436465
*----------------------------------------------------------------------------*/
437466
void hfp_hf_register(U32 supp_featr);
438-
467+
void hfp_hf_register_ext(U32 supp_featr, U16 hf_indicator_mask);
439468
/*----------------------------------------------------------------------------*
440469
*
441470
* DESCRIPTION:
@@ -965,9 +994,9 @@ void hfp_hs_send_at_ckpd_api(uint8_t mux_id, U8 profile_type);
965994
* Message BTS2MU_HF_AT_CMD_CFM with structure HFP_AT_EXTERN_AT_CMD will
966995
* be received as a confirmation.
967996
*----------------------------------------------------------------------------*/
968-
void hfp_hf_at_data_req(uint8_t mux_id, U8 profile_type, U8 *payload, U16 payload_len);
997+
void hfp_hf_at_data_req(uint8_t mux_id, U8 profile_type, U8 *payload, U16 payload_len);
969998

970-
void hfp_hf_send_at_bia_api(uint8_t mux_id, U8 profile_type);//reserve
999+
void hfp_hf_send_at_bia_api(uint8_t mux_id, U8 profile_type, BTS2S_HF_OPTIONAL_INDICATORS *optional_indicators); //reserve
9711000
void hfp_hf_set_wbs(uint8_t mux_id, U8 profile_type, U8 wbs_flag);
9721001

9731002

include/hfp_type_api.h

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ extern "C" {
9191
#define HFP_ERR_NOT_FOR_VOIP 34 /* Not supported on this call type(VoIP) */
9292
#define HFP_ERR_SIP_RESP_CODE 35 /* SIP 3 digit response code */
9393

94-
95-
9694
#define HFP_AG_SDP_FEAT_SPEC \
9795
(HFP_AG_FEAT_3WAY | HFP_AG_FEAT_ECNR | HFP_AG_FEAT_VREC | \
9896
HFP_AG_FEAT_INBAND | HFP_AG_FEAT_VTAG)
9997

98+
/* Max number of peer and local HF indicators */
99+
#define HFP_AG_LOCAL_HF_IND_MAX_NUM 4
100100
/****************************************enum define***************************************/
101101
typedef enum
102102
{
@@ -181,9 +181,17 @@ typedef enum
181181
PHONE_NUMBER_TYPE_UNKNOWN = 0x81,
182182
PHONE_NUMBER_TYPE_INTERNATIONAL = 0x91,
183183
} phone_number_type_t;
184-
185184
/* for clcc_res var end */
186185

186+
typedef enum
187+
{
188+
/*! No HF indicator. */
189+
hfp_indicator_mask_none = 0x00,
190+
/*! Enhanced safety indicator. */
191+
hfp_enhanced_safety_mask = 1 << 0,
192+
/*! Battery level indicator. */
193+
hfp_battery_level_mask = 1 << 1,
194+
} hfp_hf_indicators_mask;
187195
/****************************************struct define***************************************/
188196
typedef struct
189197
{
@@ -196,6 +204,13 @@ typedef struct
196204
U32 supp_featr;
197205
} BTS2S_HFP_ENB_REQ;
198206

207+
typedef struct
208+
{
209+
U16 type;
210+
U32 supp_featr;
211+
U16 hfp_indicators_mask;
212+
} BTS2S_HFP_ENB_REQ_EXT;
213+
199214
typedef struct
200215
{
201216
U16 type;
@@ -280,6 +295,31 @@ typedef struct
280295
U8 batt_val;
281296
} hfp_batt_vaule_t;
282297

298+
#define HFP_HF_IND_ENHANCED_SAFETY 1
299+
#define HFP_HF_IND_BATTERY_LEVEL 2
300+
301+
302+
struct hf_ind_enhanced_safety
303+
{
304+
U8 local_support: 1;
305+
U8 remote_support: 1;
306+
U8 enabled: 1;
307+
U8 value: 5; /* 0 or 1 */
308+
};
309+
310+
struct hf_ind_battery_level
311+
{
312+
U8 local_support: 1;
313+
U8 remote_support: 1;
314+
U8 enabled: 6;
315+
U8 value; /* 0 ~ 100 */
316+
};
317+
318+
typedef struct
319+
{
320+
struct hf_ind_enhanced_safety enhanced_safety;
321+
struct hf_ind_battery_level battery_level;
322+
} hf_indicator_t;
283323
#ifdef __cplusplus
284324
}
285325
#endif

lib/lib_bt_gcc.a

291 KB
Binary file not shown.

lib/lib_bt_rvds.lib

253 KB
Binary file not shown.

lib/lib_bt_rvds_tran_only.lib

76.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)