mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-26 12:35:25 +00:00
hfp hf emit HFP_SUBEVENT_CALLING_LINE_INDETIFICATION_NOTIFICATION
This commit is contained in:
parent
8db229bdf8
commit
65fd5e57ee
@ -825,7 +825,23 @@ extern "C" {
|
||||
* @param gain
|
||||
*/
|
||||
#define HFP_SUBEVENT_MICROPHONE_VOLUME 0x17
|
||||
|
||||
/**
|
||||
* @format 111T
|
||||
* @param subevent_code
|
||||
* @param status
|
||||
* @param type
|
||||
* @param number
|
||||
*/
|
||||
#define HFP_SUBEVENT_CALL_WAITING_NOTIFICATION 0x18
|
||||
|
||||
/**
|
||||
* @format 111T
|
||||
* @param subevent_code
|
||||
* @param status
|
||||
* @param type
|
||||
* @param number
|
||||
*/
|
||||
#define HFP_SUBEVENT_CALLING_LINE_INDETIFICATION_NOTIFICATION 0x19
|
||||
|
||||
/**
|
||||
|
@ -758,6 +758,7 @@ static hfp_command_t parse_command(const char * line_buffer, int isHandsFree){
|
||||
}
|
||||
|
||||
if (strncmp(line_buffer+offset, HFP_ENABLE_CLIP, strlen(HFP_ENABLE_CLIP)) == 0){
|
||||
if (isHandsFree) return HFP_CMD_AG_SENT_CLIP_INFORMATION;
|
||||
return HFP_CMD_ENABLE_CLIP;
|
||||
}
|
||||
|
||||
@ -892,6 +893,7 @@ static void hfp_parser_next_state(hfp_connection_t * hfp_connection, uint8_t byt
|
||||
switch (hfp_connection->command){
|
||||
case HFP_CMD_AG_SENT_PHONE_NUMBER:
|
||||
case HFP_CMD_AG_SENT_CALL_WAITING_NOTIFICATION_UPDATE:
|
||||
case HFP_CMD_AG_SENT_CLIP_INFORMATION:
|
||||
case HFP_CMD_TRANSFER_AG_INDICATOR_STATUS:
|
||||
case HFP_CMD_QUERY_OPERATOR_SELECTION_NAME:
|
||||
case HFP_CMD_QUERY_OPERATOR_SELECTION_NAME_FORMAT:
|
||||
@ -1034,6 +1036,7 @@ void hfp_parse(hfp_connection_t * hfp_connection, uint8_t byte, int isHandsFree)
|
||||
break;
|
||||
case HFP_CMD_AG_SENT_PHONE_NUMBER:
|
||||
case HFP_CMD_AG_SENT_CALL_WAITING_NOTIFICATION_UPDATE:
|
||||
case HFP_CMD_AG_SENT_CLIP_INFORMATION:
|
||||
hfp_connection->bnip_type = (uint8_t)atoi((char*)hfp_connection->line_buffer);
|
||||
break;
|
||||
default:
|
||||
@ -1272,6 +1275,7 @@ static void parse_sequence(hfp_connection_t * hfp_connection){
|
||||
break;
|
||||
case HFP_CMD_AG_SENT_PHONE_NUMBER:
|
||||
case HFP_CMD_AG_SENT_CALL_WAITING_NOTIFICATION_UPDATE:
|
||||
case HFP_CMD_AG_SENT_CLIP_INFORMATION:
|
||||
strncpy(hfp_connection->bnip_number, (char *)hfp_connection->line_buffer, sizeof(hfp_connection->bnip_number));
|
||||
hfp_connection->bnip_number[sizeof(hfp_connection->bnip_number)-1] = 0;
|
||||
break;
|
||||
|
@ -159,6 +159,7 @@ typedef enum {
|
||||
HFP_CMD_ENABLE_INDIVIDUAL_AG_INDICATOR_STATUS_UPDATE,
|
||||
HFP_CMD_SUPPORT_CALL_HOLD_AND_MULTIPARTY_SERVICES,
|
||||
HFP_CMD_ENABLE_CLIP,
|
||||
HFP_CMD_AG_SENT_CLIP_INFORMATION,
|
||||
HFP_CMD_ENABLE_CALL_WAITING_NOTIFICATION,
|
||||
HFP_CMD_AG_SENT_CALL_WAITING_NOTIFICATION_UPDATE,
|
||||
|
||||
@ -605,7 +606,7 @@ typedef struct hfp_connection {
|
||||
uint8_t clcc_mpty;
|
||||
|
||||
uint8_t call_index;
|
||||
// also used for CLCC, CCWA if set
|
||||
// also used for CLCC, CCWA, CLIP if set
|
||||
uint8_t bnip_type; // 0 == not set
|
||||
char bnip_number[25]; //
|
||||
|
||||
|
@ -998,7 +998,10 @@ static void hfp_handle_rfcomm_event(uint8_t packet_type, uint16_t channel, uint8
|
||||
hfp_connection->command = HFP_CMD_NONE;
|
||||
hfp_hf_emit_type_and_number(hfp_callback, HFP_SUBEVENT_CALL_WAITING_NOTIFICATION, hfp_connection->bnip_type, hfp_connection->bnip_number);
|
||||
break;
|
||||
|
||||
case HFP_CMD_AG_SENT_CLIP_INFORMATION:
|
||||
hfp_connection->command = HFP_CMD_NONE;
|
||||
hfp_hf_emit_type_and_number(hfp_callback, HFP_SUBEVENT_CALLING_LINE_INDETIFICATION_NOTIFICATION, hfp_connection->bnip_type, hfp_connection->bnip_number);
|
||||
break;
|
||||
case HFP_CMD_EXTENDED_AUDIO_GATEWAY_ERROR:
|
||||
hfp_connection->ok_pending = 0;
|
||||
hfp_connection->command = HFP_CMD_NONE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user