From 2e3335af42bf5c530402413e57f3313756188484 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 29 Nov 2021 14:43:11 +0100 Subject: [PATCH] example/hsp: update examples --- example/hsp_ag_demo.c | 9 ++------- example/hsp_hs_demo.c | 11 +++-------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/example/hsp_ag_demo.c b/example/hsp_ag_demo.c index e4cc0d016..03a0948f9 100644 --- a/example/hsp_ag_demo.c +++ b/example/hsp_ag_demo.c @@ -217,19 +217,14 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even #endif break; case HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE: - status = hsp_subevent_rfcomm_disconnection_complete_get_status(event); - if (status != ERROR_CODE_SUCCESS){ - printf("RFCOMM disconnection failed with status %u.\n", status); - } else { - printf("RFCOMM disconnected.\n"); - } + printf("RFCOMM disconnected.\n"); break; case HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE: status = hsp_subevent_audio_connection_complete_get_status(event); if (status != ERROR_CODE_SUCCESS){ printf("Audio connection establishment failed with status %u\n", status); } else { - sco_handle = hsp_subevent_audio_connection_complete_get_handle(event); + sco_handle = hsp_subevent_audio_connection_complete_get_sco_handle(event); printf("Audio connection established with SCO handle 0x%04x.\n", sco_handle); hci_request_sco_can_send_now_event(); } diff --git a/example/hsp_hs_demo.c b/example/hsp_hs_demo.c index 615e003a8..a1f770870 100644 --- a/example/hsp_hs_demo.c +++ b/example/hsp_hs_demo.c @@ -198,25 +198,20 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even case HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE: status = hsp_subevent_rfcomm_connection_complete_get_status(event); if (status != ERROR_CODE_SUCCESS){ - printf("RFCOMM connection establishement failed with status %u\n", status); + printf("RFCOMM connection establishment failed with status %u\n", status); } else { printf("RFCOMM connection established.\n"); } break; case HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE: - status = hsp_subevent_rfcomm_disconnection_complete_get_status(event); - if (status != ERROR_CODE_SUCCESS){ - printf("RFCOMM disconnection failed with status %u.\n", status); - } else { - printf("RFCOMM disconnected.\n"); - } + printf("RFCOMM disconnected.\n"); break; case HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE: status = hsp_subevent_audio_connection_complete_get_status(event); if (status != ERROR_CODE_SUCCESS){ printf("Audio connection establishment failed with status %u\n", status); } else { - sco_handle = hsp_subevent_audio_connection_complete_get_handle(event); + sco_handle = hsp_subevent_audio_connection_complete_get_sco_handle(event); printf("Audio connection established with SCO handle 0x%04x.\n", sco_handle); hci_request_sco_can_send_now_event(); }