From d18fc62ae63b14094cdc3b834554e3087372e26a Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Tue, 14 Jan 2025 13:47:17 +0100 Subject: [PATCH] hfp_hf: return ERROR_CODE_COMMAND_DISALLOWED if indicator is not enabled --- src/classic/hfp_hf.c | 3 +++ src/classic/hfp_hf.h | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/classic/hfp_hf.c b/src/classic/hfp_hf.c index 97958812a..2883f49d3 100644 --- a/src/classic/hfp_hf.c +++ b/src/classic/hfp_hf.c @@ -2313,6 +2313,9 @@ uint8_t hfp_hf_set_hf_indicator(hci_con_handle_t acl_handle, int assigned_number // send update hfp_hf_run_for_context(hfp_connection); break; + } else { + // return command disallowed as indicator disabled + return ERROR_CODE_COMMAND_DISALLOWED; } } } diff --git a/src/classic/hfp_hf.h b/src/classic/hfp_hf.h index d14182e2f..c0da9fc0b 100644 --- a/src/classic/hfp_hf.h +++ b/src/classic/hfp_hf.h @@ -536,7 +536,9 @@ uint8_t hfp_hf_query_subscriber_number(hci_con_handle_t acl_handle); * @param acl_handle * @param assigned_number * @param value - * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist + * @return status ERROR_CODE_SUCCESS if successful, otherwise: + * - ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist, or + * - ERROR_CODE_COMMAND_DISALLOWED if indicator is either not found or not enabled */ uint8_t hfp_hf_set_hf_indicator(hci_con_handle_t acl_handle, int assigned_number, int value);