hfp: report RING in HF test

This commit is contained in:
Matthias Ringwald 2015-11-27 14:29:41 +01:00
parent 78747ec155
commit 44c3bf3b21
5 changed files with 13 additions and 1 deletions

View File

@ -624,7 +624,6 @@ extern "C" {
#define HSP_SUBEVENT_HS_COMMAND 0x05
#define HSP_SUBEVENT_AG_INDICATION 0x06
#define HSP_SUBEVENT_ERROR 0x07
#define HSP_SUBEVENT_RING 0x08
#define HCI_EVENT_HFP_META 0xE9
@ -647,6 +646,7 @@ extern "C" {
#define HFP_SUBEVENT_TRANSMIT_STATUS_OF_CURRENT_CALL 0x11
#define HFP_SUBEVENT_CALL_ANSWERED 0x12
#define HFP_SUBEVENT_CONFERENCE_CALL 0x13
#define HFP_SUBEVENT_RING 0x14
// ANCS Client
#define ANCS_CLIENT_CONNECTED 0xF0

View File

@ -686,6 +686,10 @@ static hfp_command_t parse_command(const char * line_buffer, int isHandsFree){
return HFP_CMD_ERROR;
}
if (strncmp(line_buffer+offset, HFP_RING, strlen(HFP_RING)) == 0){
return HFP_CMD_RING;
}
if (isHandsFree && strncmp(line_buffer+offset, HFP_OK, strlen(HFP_OK)) == 0){
return HFP_CMD_OK;
}

View File

@ -137,6 +137,7 @@ extern "C" {
#define HFP_OK "OK"
#define HFP_ERROR "ERROR"
#define HFP_RING "RING"
// Codecs
#define HFP_CODEC_CVSD 0x01
@ -147,6 +148,7 @@ typedef enum {
HFP_CMD_ERROR,
HFP_CMD_UNKNOWN,
HFP_CMD_OK,
HFP_CMD_RING,
HFP_CMD_SUPPORTED_FEATURES,
HFP_CMD_AVAILABLE_CODECS,

View File

@ -647,6 +647,9 @@ static void hfp_handle_rfcomm_event(uint8_t packet_type, uint16_t channel, uint8
case HFP_CMD_OK:
hfp_hf_switch_on_ok(context);
break;
case HFP_CMD_RING:
hfp_emit_event(hfp_callback, HFP_SUBEVENT_RING, 0);
break;
default:
break;
}

View File

@ -241,6 +241,9 @@ static void packet_handler(uint8_t * event, uint16_t event_size){
if (event[4])
printf("EXTENDED_AUDIO_GATEWAY_ERROR_REPORT, status : %d\n", event[3]);
break;
case HFP_SUBEVENT_RING:
printf("** Ring **\n");
break;
default:
printf("event not handled %u\n", event[2]);
break;