From 2c8a33fdec3dc3066485750aee5ca722b4a5ebe7 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 16 Feb 2016 16:21:35 +0100 Subject: [PATCH 1/6] daemon: log retries --- platforms/daemon/src/socket_connection.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/platforms/daemon/src/socket_connection.c b/platforms/daemon/src/socket_connection.c index c04b53859..b89987525 100644 --- a/platforms/daemon/src/socket_connection.c +++ b/platforms/daemon/src/socket_connection.c @@ -267,9 +267,11 @@ void socket_connection_retry_parked(void){ connection_t * conn = (connection_t *) it->next; // dispatch packet !!! connection, type, channel, data, size - log_info("socket_connection_hci_process retry parked %p", conn); - int dispatch_err = (*socket_connection_packet_callback)(conn, READ_BT_16( conn->buffer, 0), READ_BT_16( conn->buffer, 2), - &conn->buffer[sizeof(packet_header_t)], READ_BT_16( conn->buffer, 4)); + uint16_t packet_type = READ_BT_16( conn->buffer, 0); + uint16_t channel = READ_BT_16( conn->buffer, 2); + uint16_t length = READ_BT_16( conn->buffer, 4); + log_info("socket_connection_hci_process retry parked %p (type %u, channel %04x, length %u", conn, packet_type, channel, length); + int dispatch_err = (*socket_connection_packet_callback)(conn, packet_type, channel, &conn->buffer[sizeof(packet_header_t)], length); // "un-park" if successful if (!dispatch_err) { log_info("socket_connection_hci_process dispatch succeeded -> un-park connection %p", conn); From 6c63e7d47b7e03a56292a09ce1ac86f58ee0467f Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Wed, 17 Feb 2016 11:33:15 +0100 Subject: [PATCH 2/6] hsp docu --- docs/manual/update_apis.py | 4 ++ src/hsp_ag.c | 20 +++++---- src/hsp_ag.h | 90 +++++++++++++++++++++++++++++++++----- src/hsp_hs.h | 32 ++++++++++---- 4 files changed, 118 insertions(+), 28 deletions(-) diff --git a/docs/manual/update_apis.py b/docs/manual/update_apis.py index 507acb012..2834150f5 100755 --- a/docs/manual/update_apis.py +++ b/docs/manual/update_apis.py @@ -33,6 +33,10 @@ apis = [ ["src/sdp_query_rfcomm.h", "SDP RFCOMM Query", "sdpQueries"], ["src/sdp_query_util.h","SDP Query Utils","sdpQueryUtil"], ["include/btstack/sdp_util.h","SDP Utils", "sdpUtil"] + ["src/hsp_hf.h","HSP Headset","hspHF"], + ["src/hsp_ag.h","HSP Audio Gateway","hspAG"], + ["src/hsp_hf.h","HFP Headset","hfpHF"], + ["src/hsp_ag.h","HFP Audio Gateway","hfpAG"] ] functions = {} diff --git a/src/hsp_ag.c b/src/hsp_ag.c index ec0169f2c..b2d60e17e 100644 --- a/src/hsp_ag.c +++ b/src/hsp_ag.c @@ -310,18 +310,20 @@ void hsp_ag_set_speaker_gain(uint8_t gain){ hsp_run(); } -static void hsp_timeout_handler(timer_source_t * timer){ +static void hsp_ringing_timeout_handler(timer_source_t * timer){ ag_ring = 1; -} - -static void hsp_timeout_start(void){ - run_loop_remove_timer(&hs_timeout); - run_loop_set_timer_handler(&hs_timeout, hsp_timeout_handler); run_loop_set_timer(&hs_timeout, 2000); // 2 seconds timeout run_loop_add_timer(&hs_timeout); } -static void hsp_timeout_stop(void){ +static void hsp_ringing_timer_start(void){ + run_loop_remove_timer(&hs_timeout); + run_loop_set_timer_handler(&hs_timeout, hsp_ringing_timeout_handler); + run_loop_set_timer(&hs_timeout, 2000); // 2 seconds timeout + run_loop_add_timer(&hs_timeout); +} + +static void hsp_ringing_timer_stop(void){ run_loop_remove_timer(&hs_timeout); } @@ -329,14 +331,14 @@ void hsp_ag_start_ringing(void){ if (hsp_state != HSP_W2_CONNECT_SCO) return; ag_ring = 1; hsp_state = HSP_W4_RING_ANSWER; - hsp_timeout_start(); + hsp_ringing_timer_start(); } void hsp_ag_stop_ringing(void){ ag_ring = 0; ag_num_button_press_received = 0; hsp_state = HSP_W2_CONNECT_SCO; - hsp_timeout_stop(); + hsp_ringing_timer_stop(); } static void hsp_run(void){ diff --git a/src/hsp_ag.h b/src/hsp_ag.h index 9f72d68a9..25a9fa43c 100644 --- a/src/hsp_ag.h +++ b/src/hsp_ag.h @@ -52,39 +52,107 @@ extern "C" { #endif +/* API_START */ + +/** + * @brief Packet handler for HSP Audio Gateway (AG) events. + * + * The HSP AG event has type HCI_EVENT_HSP_META with following subtypes: + * - HSP_SUBEVENT_ERROR + * - HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE + * - HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE + * - HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED + * - HSP_SUBEVENT_SPEAKER_GAIN_CHANGED + * - HSP_SUBEVENT_HS_COMMAND + * + * @param event See include/btstack/hci_cmds.h + * @param event_size + */ typedef void (*hsp_ag_callback_t)(uint8_t * event, uint16_t event_size); - -void hsp_ag_create_sdp_record(uint8_t * service, int rfcomm_channel_nr, const char * name); - - +/** + * @brief Set up HSP AG. + * @param rfcomm_channel_nr + */ void hsp_ag_init(uint8_t rfcomm_channel_nr); -// Register callback (packet handler) for hsp audio gateway +/** + * @brief Create HSP Audio Gateway (AG) SDP service record. + * @param service Empty buffer in which a new service record will be stored. + * @param rfcomm_channel_nr + * @param name + */ +void hsp_ag_create_sdp_record(uint8_t * service, int rfcomm_channel_nr, const char * name); + +/** + * @brief Register packet handler to receive HSP AG events. + * @param callback + */ void hsp_ag_register_packet_handler(hsp_ag_callback_t callback); +/** + * @brief Connect to HSP Headset + * + * Perform SDP query for an RFCOMM service on a remote device, + * and establish an RFCOMM connection if such service is found. The reception of the + * HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE or + * HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE event + * indicate if the connection is successfully established or not. + * + * @param bd_addr + */ void hsp_ag_connect(bd_addr_t bd_addr); +/** + * @brief Disconnect from HSP Headset. + * + * Releases the RFCOMM channel. + * @param bd_addr + */ void hsp_ag_disconnect(void); -// +VGM=[0..15] +/** + * @brief Set microphone gain. + * @param gain Valid range: [0,15] + */ void hsp_ag_set_microphone_gain(uint8_t gain); -// +VGS=[0..15] +/** + * @brief Set speaker gain. + * @param gain Valid range: [0,15] + */ void hsp_ag_set_speaker_gain(uint8_t gain); +/** + * @brief Start ringing because of incoming call. + */ void hsp_ag_start_ringing(void); +/** + * @brief Stop ringing (e.g. call was terminated). + */ void hsp_ag_stop_ringing(void); -// When support custom commands is enabled, AG will emit HSP_SUBEVENT_HS_COMMAND. -// On occurance of this event, client's packet handler must send the result back -// by calling hsp_ag_send_result function. - +/** + * @brief Enable custom AT commands. + * + * Custom commands are disabled by default. + * When enabled, custom AT commands are received via the HSP_SUBEVENT_HS_COMMAND. + * @param enable + */ void hsp_ag_enable_custom_commands(int enable); +/** + * @brief Send a custom AT command to HSP Headset. + * + * On HSP_SUBEVENT_AG_INDICATION, the client needs to respond + * with this function with the result to the custom command. + * @param result + */ int hsp_ag_send_result(char * result); +/* API_END */ + #if defined __cplusplus } #endif diff --git a/src/hsp_hs.h b/src/hsp_hs.h index 914fa400c..289dbc967 100644 --- a/src/hsp_hs.h +++ b/src/hsp_hs.h @@ -55,30 +55,40 @@ extern "C" { /* API_START */ /** - * @brief Packet handler for HSP Headset (HS) events. The HSP HS event has type HCI_EVENT_HSP_META with following subtypes: + * @brief Packet handler for HSP Headset (HS) events. + * + * The HSP HS event has type HCI_EVENT_HSP_META with following subtypes: * - HSP_SUBEVENT_ERROR * - HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE * - HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE * - HSP_SUBEVENT_RING * - HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED * - HSP_SUBEVENT_SPEAKER_GAIN_CHANGED - * - HSP_SUBEVENT_AG_INDICATION + * - HSP_SUBEVENT_AG_INDICATION + * + * @param event See include/btstack/hci_cmds.h + * @param event_size */ typedef void (*hsp_hs_callback_t)(uint8_t * event, uint16_t event_size); /** - * @brief Set up HSP HS + * @brief Set up HSP HS. * @param rfcomm_channel_nr */ void hsp_hs_init(uint8_t rfcomm_channel_nr); /** - * @brief Create HSP Headset (HS) SDP service record. have_remote_audio_control? + * @brief Create HSP Headset (HS) SDP service record. + * @param service Empty buffer in which a new service record will be stored. + * @param rfcomm_channel_nr + * @param name + * @param have_remote_audio_control */ void hsp_hs_create_sdp_record(uint8_t * service, int rfcomm_channel_nr, const char * name, uint8_t have_remote_audio_control); /** * @brief Register packet handler to receive HSP HS events. + * @param callback */ void hsp_hs_register_packet_handler(hsp_hs_callback_t callback); @@ -90,6 +100,8 @@ void hsp_hs_register_packet_handler(hsp_hs_callback_t callback); * HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE or * HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE event * indicate if the connection is successfully established or not. + * + * @param bd_addr */ void hsp_hs_connect(bd_addr_t bd_addr); @@ -97,6 +109,7 @@ void hsp_hs_connect(bd_addr_t bd_addr); * @brief Disconnect from HSP Audio Gateway * * Releases the RFCOMM channel. + * @param bd_addr */ void hsp_hs_disconnect(bd_addr_t bd_addr); @@ -105,7 +118,7 @@ void hsp_hs_disconnect(bd_addr_t bd_addr); * * The new gain value will be confirmed by the HSP Audio Gateway. * A HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED event will be received. - * @param gain - valid range: [0,15] + * @param gain Valid range: [0,15] */ void hsp_hs_set_microphone_gain(uint8_t gain); @@ -120,24 +133,27 @@ void hsp_hs_set_speaker_gain(uint8_t gain); /** * @brief Send button press action. + * @param gain Valid range: [0,15] */ void hsp_hs_send_button_press(void); /** * @brief Enable custom indications * - * Custom indications are disable by default. + * Custom indications are disabled by default. * When enabled, custom indications are received via the HSP_SUBEVENT_AG_INDICATION. + * @param enable */ void hsp_hs_enable_custom_indications(int enable); /** - * @brief Send answer to custom command + * @brief Send answer to custom indication * * On HSP_SUBEVENT_AG_INDICATION, the client needs to respond * with this function with the result to the custom indication + * @param result */ -int hsp_hs_send_result(const char * indication); +int hsp_hs_send_result(const char * result); /* API_END */ From 0ebf25ba5486bed0ed899cd6c1eaab57d75e7bb7 Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Wed, 17 Feb 2016 12:07:24 +0100 Subject: [PATCH 3/6] hsp docu, documented event types in hci_cmds.h --- docs/manual/update_apis.py | 2 +- example/embedded/hsp_hs_test.c | 4 +-- include/btstack/hci_cmds.h | 59 +++++++++++++++++++++++++++++----- src/hsp_ag.c | 7 ++-- src/hsp_ag.h | 3 +- src/hsp_hs.c | 18 ++++++++--- src/hsp_hs.h | 9 +++--- test/pts/hsp_ag_test.c | 4 +-- 8 files changed, 79 insertions(+), 27 deletions(-) diff --git a/docs/manual/update_apis.py b/docs/manual/update_apis.py index 2834150f5..66ad5a2f5 100755 --- a/docs/manual/update_apis.py +++ b/docs/manual/update_apis.py @@ -35,7 +35,7 @@ apis = [ ["include/btstack/sdp_util.h","SDP Utils", "sdpUtil"] ["src/hsp_hf.h","HSP Headset","hspHF"], ["src/hsp_ag.h","HSP Audio Gateway","hspAG"], - ["src/hsp_hf.h","HFP Headset","hfpHF"], + ["src/hsp_hf.h","HFP Hands-Free","hfpHF"], ["src/hsp_ag.h","HFP Audio Gateway","hfpAG"] ] diff --git a/example/embedded/hsp_hs_test.c b/example/embedded/hsp_hs_test.c index b8f372978..6e8538102 100644 --- a/example/embedded/hsp_hs_test.c +++ b/example/embedded/hsp_hs_test.c @@ -203,8 +203,8 @@ static void packet_handler(uint8_t * event, uint16_t event_size){ break; case HSP_SUBEVENT_AG_INDICATION: memset(hs_cmd_buffer, 0, sizeof(hs_cmd_buffer)); - int size = event_size <= sizeof(hs_cmd_buffer)? event_size : sizeof(hs_cmd_buffer); - memcpy(hs_cmd_buffer, &event[3], size - 1); + int size = event[3] <= sizeof(hs_cmd_buffer)? event[3] : sizeof(hs_cmd_buffer); + memcpy(hs_cmd_buffer, &event[4], size - 1); printf("Received custom indication: \"%s\". \nExit code or call hsp_hs_send_result.\n", hs_cmd_buffer); break; default: diff --git a/include/btstack/hci_cmds.h b/include/btstack/hci_cmds.h index 2ac0e0cf4..c352084f3 100644 --- a/include/btstack/hci_cmds.h +++ b/include/btstack/hci_cmds.h @@ -617,14 +617,57 @@ extern "C" { #define HCI_EVENT_HSP_META 0xE8 -#define HSP_SUBEVENT_ERROR 0x01 -#define HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE 0x02 -#define HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE 0x03 -#define HSP_SUBEVENT_RING 0x04 -#define HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED 0x05 -#define HSP_SUBEVENT_SPEAKER_GAIN_CHANGED 0x06 -#define HSP_SUBEVENT_HS_COMMAND 0x07 -#define HSP_SUBEVENT_AG_INDICATION 0x08 +// data: event(8), len(8), subevent(8), status(8) +/** + * @format 11 + * @param subevent_code + * @param status 0 == OK + */ +#define HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE 0x01 + +/** + * @format 11 + * @param subevent_code + * @param status 0 == OK + */ +#define HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE 0x02 + +/** + * @format 1 + * @param subevent_code + */ +#define HSP_SUBEVENT_RING 0x03 + +/** + * @format 11 + * @param subevent_code + * @param gain Valid range: [0,15] + */ +#define HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED 0x04 + +/** + * @format 11 + * @param subevent_code + * @param gain Valid range: [0,15] + */ +#define HSP_SUBEVENT_SPEAKER_GAIN_CHANGED 0x05 + +/** + * @format 1JV + * @param subevent_code + * @param value_length + * @param value + */ +#define HSP_SUBEVENT_HS_COMMAND 0x06 + +/** + * @format 1JV + * @param subevent_code + * @param value_length + * @param value + */ +#define HSP_SUBEVENT_AG_INDICATION 0x07 + #define HCI_EVENT_HFP_META 0xE9 diff --git a/src/hsp_ag.c b/src/hsp_ag.c index b2d60e17e..95c0039c0 100644 --- a/src/hsp_ag.c +++ b/src/hsp_ag.c @@ -470,11 +470,12 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha ag_send_error = 1; if (!hsp_ag_callback) return; // re-use incoming buffer to avoid reserving large buffers - ugly but efficient - uint8_t * event = packet - 3; + uint8_t * event = packet - 4; event[0] = HCI_EVENT_HSP_META; - event[1] = size + 1; + event[1] = size + 2; event[2] = HSP_SUBEVENT_HS_COMMAND; - (*hsp_ag_callback)(event, size+3); + event[3] = size; + (*hsp_ag_callback)(event, size+4); } hsp_run(); diff --git a/src/hsp_ag.h b/src/hsp_ag.h index 25a9fa43c..072240254 100644 --- a/src/hsp_ag.h +++ b/src/hsp_ag.h @@ -57,8 +57,7 @@ extern "C" { /** * @brief Packet handler for HSP Audio Gateway (AG) events. * - * The HSP AG event has type HCI_EVENT_HSP_META with following subtypes: - * - HSP_SUBEVENT_ERROR + * The HSP AG event has type HCI_EVENT_HSP_META with following subtypes: * - HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE * - HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE * - HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED diff --git a/src/hsp_hs.c b/src/hsp_hs.c index 2a6883d12..0ce9ee7cd 100644 --- a/src/hsp_hs.c +++ b/src/hsp_hs.c @@ -132,6 +132,15 @@ static void emit_event(uint8_t event_subtype, uint8_t value){ (*hsp_hs_callback)(event, sizeof(event)); } +static void emit_ring_event(void){ + if (!hsp_hs_callback) return; + uint8_t event[3]; + event[0] = HCI_EVENT_HSP_META; + event[1] = sizeof(event) - 2; + event[2] = HSP_SUBEVENT_RING; + (*hsp_hs_callback)(event, sizeof(event)); +} + static void emit_event_audio_connected(uint8_t status, uint16_t handle){ if (!hsp_hs_callback) return; uint8_t event[6]; @@ -380,7 +389,7 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha packet++; } if (strncmp((char *)packet, HSP_AG_RING, strlen(HSP_AG_RING)) == 0){ - emit_event(HSP_SUBEVENT_RING, 0); + emit_ring_event(); } else if (strncmp((char *)packet, HSP_AG_OK, strlen(HSP_AG_OK)) == 0){ printf("OK RECEIVED\n"); switch (hsp_state){ @@ -409,11 +418,12 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha // add trailing \0 packet[size] = 0; // re-use incoming buffer to avoid reserving large buffers - ugly but efficient - uint8_t * event = packet - 3; + uint8_t * event = packet - 4; event[0] = HCI_EVENT_HSP_META; - event[1] = size + 1; + event[1] = size + 2; event[2] = HSP_SUBEVENT_AG_INDICATION; - (*hsp_hs_callback)(event, size+3); + event[3] = size; + (*hsp_hs_callback)(event, size+4); } hsp_run(); return; diff --git a/src/hsp_hs.h b/src/hsp_hs.h index 289dbc967..e2e97ce28 100644 --- a/src/hsp_hs.h +++ b/src/hsp_hs.h @@ -57,8 +57,7 @@ extern "C" { /** * @brief Packet handler for HSP Headset (HS) events. * - * The HSP HS event has type HCI_EVENT_HSP_META with following subtypes: - * - HSP_SUBEVENT_ERROR + * The HSP HS event has type HCI_EVENT_HSP_META with following subtypes: * - HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE * - HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE * - HSP_SUBEVENT_RING @@ -93,7 +92,7 @@ void hsp_hs_create_sdp_record(uint8_t * service, int rfcomm_channel_nr, const ch void hsp_hs_register_packet_handler(hsp_hs_callback_t callback); /** - * @brief Connect to HSP Audio Gateway + * @brief Connect to HSP Audio Gateway. * * Perform SDP query for an RFCOMM service on a remote device, * and establish an RFCOMM connection if such service is found. The reception of the @@ -138,7 +137,7 @@ void hsp_hs_set_speaker_gain(uint8_t gain); void hsp_hs_send_button_press(void); /** - * @brief Enable custom indications + * @brief Enable custom indications. * * Custom indications are disabled by default. * When enabled, custom indications are received via the HSP_SUBEVENT_AG_INDICATION. @@ -147,7 +146,7 @@ void hsp_hs_send_button_press(void); void hsp_hs_enable_custom_indications(int enable); /** - * @brief Send answer to custom indication + * @brief Send answer to custom indication. * * On HSP_SUBEVENT_AG_INDICATION, the client needs to respond * with this function with the result to the custom indication diff --git a/test/pts/hsp_ag_test.c b/test/pts/hsp_ag_test.c index d9ea3f03a..c963c2be9 100644 --- a/test/pts/hsp_ag_test.c +++ b/test/pts/hsp_ag_test.c @@ -172,8 +172,8 @@ static void packet_handler(uint8_t * event, uint16_t event_size){ break; case HSP_SUBEVENT_HS_COMMAND:{ memset(hs_cmd_buffer, 0, sizeof(hs_cmd_buffer)); - int size = event_size <= sizeof(hs_cmd_buffer)? event_size : sizeof(hs_cmd_buffer); - memcpy(hs_cmd_buffer, &event[3], size - 1); + int size = event[3] <= sizeof(hs_cmd_buffer)? event[3] : sizeof(hs_cmd_buffer); + memcpy(hs_cmd_buffer, &event[4], size - 1); printf("Received custom command: \"%s\". \nExit code or call hsp_ag_send_result.\n", hs_cmd_buffer); break; } From f9431639137de5c5e8536f7290f58f4dcfb400bf Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Wed, 17 Feb 2016 12:09:22 +0100 Subject: [PATCH 4/6] updated hsp test file --- test/pts/hsp_hs_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/pts/hsp_hs_test.c b/test/pts/hsp_hs_test.c index 7fe04ffd6..4a08e94c9 100644 --- a/test/pts/hsp_hs_test.c +++ b/test/pts/hsp_hs_test.c @@ -290,8 +290,8 @@ static void packet_handler(uint8_t * event, uint16_t event_size){ break; case HSP_SUBEVENT_AG_INDICATION: memset(hs_cmd_buffer, 0, sizeof(hs_cmd_buffer)); - int size = event_size <= sizeof(hs_cmd_buffer)? event_size : sizeof(hs_cmd_buffer); - memcpy(hs_cmd_buffer, &event[3], size - 1); + int size = event[3] <= sizeof(hs_cmd_buffer)? event[3] : sizeof(hs_cmd_buffer); + memcpy(hs_cmd_buffer, &event[4], size - 1); printf("Received custom indication: \"%s\". \nExit code or call hsp_hs_send_result.\n", hs_cmd_buffer); break; default: From 204788c830550c8c9ef5b60658c5e261027b5380 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 17 Feb 2016 13:49:09 +0100 Subject: [PATCH 5/6] docs: fix list of HSP/HSP APIs --- docs/manual/update_apis.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/manual/update_apis.py b/docs/manual/update_apis.py index 66ad5a2f5..c8fe3c7b8 100755 --- a/docs/manual/update_apis.py +++ b/docs/manual/update_apis.py @@ -32,11 +32,11 @@ apis = [ ["src/sdp_parser.h","SDP Parser","sdpParser"], ["src/sdp_query_rfcomm.h", "SDP RFCOMM Query", "sdpQueries"], ["src/sdp_query_util.h","SDP Query Utils","sdpQueryUtil"], - ["include/btstack/sdp_util.h","SDP Utils", "sdpUtil"] - ["src/hsp_hf.h","HSP Headset","hspHF"], + ["include/btstack/sdp_util.h","SDP Utils", "sdpUtil"], + ["src/hsp_hs.h","HSP Headset","hspHS"], ["src/hsp_ag.h","HSP Audio Gateway","hspAG"], - ["src/hsp_hf.h","HFP Hands-Free","hfpHF"], - ["src/hsp_ag.h","HFP Audio Gateway","hfpAG"] + ["src/hfp_hf.h","HFP Hands-Free","hfpHF"], + ["src/hfp_ag.h","HFP Audio Gateway","hfpAG"] ] functions = {} From edc5c5fee9f47204695ae52446fd16829479b902 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 17 Feb 2016 13:59:38 +0100 Subject: [PATCH 6/6] java: collect hfp and hsp subevents in seperate lists --- tools/btstack_parser.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/btstack_parser.py b/tools/btstack_parser.py index ed908903e..2c0f0d5cc 100755 --- a/tools/btstack_parser.py +++ b/tools/btstack_parser.py @@ -1,3 +1,4 @@ + #!/usr/bin/env python # BlueKitchen GmbH (c) 2014 @@ -50,6 +51,8 @@ def parse_defines(): def my_parse_events(path): events = [] le_events = [] + hfp_events = [] + hsp_events = [] params = [] event_types = set() format = None @@ -68,6 +71,10 @@ def my_parse_events(path): if format != None: if key.lower().startswith('hci_subevent_'): le_events.append((value, key.lower().replace('hci_subevent_', 'hci_event_'), format, params)) + elif key.lower().startswith('hsp_subevent_'): + hsp_events.append((value, key.lower().replace('hsp_subevent_', 'hsp_event_'), format, params)) + elif key.lower().startswith('hfp_subevent_'): + hfp.append((value, key.lower().replace('hfp_subevent_', 'hfp_event_'), format, params)) else: events.append((value, key, format, params)) event_types.add(key)