shared/hfp: Add extended response code enabling command
PATCH 1/3 shared/hfp: Add extended response code enabling command
--- src/shared/hfp.c | 36 ++++++++++++++++++++++++++++++++++-- unit/test-hfp.c | 1 + 2 files changed, 35 insertions(+), 2 deletions(-)
src/shared/hfp.c +34 -2
@@ -1996,7 +1996,7 @@ static void clip_cb(struct hfp_context *context, void *user_data) hfp->callbacks_data); } -static void clip_resp (enum hfp_result result,enum hfp_error cme_err, +static void cmee_resp (enum hfp_result result,enum hfp_error cme_err,void *user_data) {struct hfp_hf *hfp = user_data;
@@ -2004,7 +2004,7 @@ static void clip_resp(enum hfp_result result, enum hfp_error cme_err,DBG (hfp,"" );if (result !=HFP_RESULT_OK ) { -DBG (hfp,"hf: CLIP error: %d" , result); +DBG (hfp,"hf: CMEE error: %d" , result); goto failed; }
@@ -2020,6 +2020,38 @@ failed: hfp->callbacks_data); } +static void clip_resp (enum hfp_result result,enum hfp_error cme_err, +void *user_data) +{ +struct hfp_hf *hfp = user_data; + +DBG (hfp,"" ); + +if (result !=HFP_RESULT_OK ) { +DBG (hfp,"hf: CLIP error: %d" , result); + goto failed; + } + +if (!(hfp->features &HFP_AG_FEAT_EXTENDED_RES_CODE )) { +/* Jump to next setup state */ +cmee_resp (HFP_RESULT_OK , cme_err, user_data); +return ; + } + +if (!hfp_hf_send_command (hfp, cmee_resp, hfp,"AT+CMEE=1" )) { +DBG (hfp,"hf: Could not send AT+CMEE=1" ); + result =HFP_RESULT_ERROR ; + goto failed; + } + +return ; + +failed: +if (hfp->callbacks->session_ready) + hfp->callbacks->session_ready (result, cme_err, + hfp->callbacks_data); +} +static void cops_resp (enum hfp_result result,enum hfp_error cme_err,void *user_data) {
unit/test-hfp.c +1 -0
@@ -762,6 +762,7 @@ static void test_hf_robustness(gconstpointer data)raw_pdu ('\r' ,'\n' ,'+' ,'C' ,'O' ,'P' ,'S' ,':' ,' ' ,'0' ,',' , \'0' ,',' ,'\"' ,'T' ,'E' ,'S' ,'T' ,'\"' ,'\r' ,'\n' ), \frg_pdu ('\r' ,'\n' ,'O' ,'K' ,'\r' ,'\n' ), \ +raw_pdu ('\r' ,'\n' ,'O' ,'K' ,'\r' ,'\n' ), \ raw_pdu('\r', '\n', 'O', 'K', '\r', '\n') static void hf_cmd_complete(enum hfp_result res, enum hfp_error cme_err,
Signature · 1 line
2.43.0
PATCH 2/3 shared/hfp: Add NREC disable command
--- src/shared/hfp.c | 42 +++++++++++++++++++++++++++++++++++++++--- unit/test-hfp.c | 1 + 2 files changed, 40 insertions(+), 3 deletions(-)
src/shared/hfp.c +39 -3
@@ -30,7 +30,11 @@ hfp_debug(_hfp->debug_callback, _hfp->debug_data, "%s:%s() " fmt, \ __FILE__, __func__, ## arg) -#define HFP_HF_FEATURES (HFP_HF_FEAT_CLIP | HFP_HF_FEAT_ESCO_S4_T2) +#define HFP_HF_FEATURES ( \ + HFP_HF_FEAT_ECNR | \ + HFP_HF_FEAT_CLIP | \ + HFP_HF_FEAT_ESCO_S4_T2 \ +) struct hfp_gw { int ref_count;
@@ -1996,7 +2000,7 @@ static void clip_cb(struct hfp_context *context, void *user_data) hfp->callbacks_data); } -static void cmee_resp (enum hfp_result result,enum hfp_error cme_err, +static void nrec_resp (enum hfp_result result,enum hfp_error cme_err,void *user_data) {struct hfp_hf *hfp = user_data;
@@ -2004,7 +2008,7 @@ static void cmee_resp(enum hfp_result result, enum hfp_error cme_err,DBG (hfp,"" );if (result !=HFP_RESULT_OK ) { -DBG (hfp,"hf: CMEE error: %d" , result); +DBG (hfp,"hf: NREC error: %d" , result); goto failed; }
@@ -2020,6 +2024,38 @@ failed: hfp->callbacks_data); } +static void cmee_resp (enum hfp_result result,enum hfp_error cme_err, +void *user_data) +{ +struct hfp_hf *hfp = user_data; + +DBG (hfp,"" ); + +if (result !=HFP_RESULT_OK ) { +DBG (hfp,"hf: CMEE error: %d" , result); + goto failed; + } + +if (!(hfp->features &HFP_AG_FEAT_ECNR )) { +/* Jump to next setup state */ +nrec_resp (HFP_RESULT_OK , cme_err, user_data); +return ; + } + +if (!hfp_hf_send_command (hfp, nrec_resp, hfp,"AT+NREC=0" )) { +DBG (hfp,"hf: Could not send AT+NREC=0" ); + result =HFP_RESULT_ERROR ; + goto failed; + } + +return ; + +failed: +if (hfp->callbacks->session_ready) + hfp->callbacks->session_ready (result, cme_err, + hfp->callbacks_data); +} +static void clip_resp (enum hfp_result result,enum hfp_error cme_err,void *user_data) {
unit/test-hfp.c +1 -0
@@ -763,6 +763,7 @@ static void test_hf_robustness(gconstpointer data) '0', ',', '\"', 'T', 'E', 'S', 'T', '\"', '\r', '\n'), \ frg_pdu('\r', '\n', 'O', 'K', '\r', '\n'), \ raw_pdu('\r', '\n', 'O', 'K', '\r', '\n'), \ + raw_pdu('\r', '\n', 'O', 'K', '\r', '\n'), \ raw_pdu('\r', '\n', 'O', 'K', '\r', '\n') static void hf_cmd_complete(enum hfp_result res, enum hfp_error cme_err,
Signature · 1 line
2.43.0
PATCH 3/3 unit/test-hfp: Add ECNR off test
In reply to Frédéric DanisThis add the following test:
- /HFP/HF/ENO/BV-01-C
Verify that the HF can disable the EC/NR function of the AG.
--- unit/test-hfp.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)
unit/test-hfp.c +22 -1
@@ -787,6 +787,9 @@ static void hf_session_ready_cb(enum hfp_result res, enum hfp_error cme_err, g_assert_cmpint(res, ==, HFP_RESULT_OK); context->session.completed = true; +if (tester_use_debug ()) +tester_debug ("HF session ready" ); +if (g_str_equal (test_name,"/HFP/HF/OCL/BV-01-C" )) {bool ret;
@@ -998,7 +1001,8 @@ static void hf_call_line_id_updated(uint id, const char *number, str =hfp_hf_call_get_number (context->hfp_hf, id); g_assert_cmpstr(number, ==, str); - if (g_str_equal(test_name, "/HFP/HF/ICA/BV-01-C") || + if (g_str_equal(test_name, "/HFP/HF/ENO/BV-01-C") || + g_str_equal(test_name, "/HFP/HF/ICA/BV-01-C") || g_str_equal(test_name, "/HFP/HF/ICA/BV-02-C") || g_str_equal(test_name, "/HFP/HF/ICA/BV-03-C") || g_str_equal(test_name, "/HFP/HF/ICA/BV-04-C") ||
@@ -1368,6 +1372,23 @@ int main(int argc, char *argv[]) ',', '1', '2', '9', ',', ',', '\r', '\n'), data_end()); +/* Disable EC/NR on the AG - HF */ +define_hf_test ("/HFP/HF/ENO/BV-01-C" , test_hf_session, +NULL , test_hf_session_done, +FULL_SLC_SESSION ('1' ,'0' ,'0' ,'0' ), +frg_pdu ('\r' ,'\n' ,'+' ,'C' ,'I' ,'E' ,'V' ,':' ,' ' , +'3' ,',' ,'1' ,'\r' ,'\n' ), +frg_pdu ('\r' ,'\n' ,'R' ,'I' ,'N' ,'G' ,'\r' ,'\n' ), +frg_pdu ('\r' ,'\n' ,'+' ,'C' ,'L' ,'I' ,'P' ,':' , +'\"' ,'1' ,'2' ,'3' ,'4' ,'5' ,'6' ,'7' ,'\"' , +',' ,'1' ,'2' ,'9' ,',' ,',' ,'\r' ,'\n' ), +raw_pdu ('\r' ,'\n' ,'O' ,'K' ,'\r' ,'\n' ), +frg_pdu ('\r' ,'\n' ,'+' ,'C' ,'I' ,'E' ,'V' ,':' ,' ' , +'2' ,',' ,'1' ,'\r' ,'\n' ), +frg_pdu ('\r' ,'\n' ,'+' ,'C' ,'I' ,'E' ,'V' ,':' ,' ' , +'3' ,',' ,'0' ,'\r' ,'\n' ), +data_end ()); +/* Incoming call, in-band ring - HF */ define_hf_test("/HFP/HF/ICA/BV-01-C", test_hf_session, NULL, test_hf_session_done,
Signature · 1 line
2.43.0
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1019334
---Test result---
Test Summary:
CheckPatch PENDING 0.34 seconds GitLint PENDING 0.37 seconds BuildEll PASS 20.22 seconds BluezMake PASS 2690.71 seconds MakeCheck PASS 20.39 seconds MakeDistcheck PASS 190.55 seconds CheckValgrind PASS 239.37 seconds CheckSmatch PASS 314.89 seconds bluezmakeextell PASS 132.16 seconds IncrementalBuild PENDING 0.33 seconds ScanBuild PASS 950.76 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series Output:
---
Regards,
Linux Bluetooth
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Hello:
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Quoted 4 lines · On Tue, 4 Nov 2025 10:28:06 +0100 you wrote:
--- src/shared/hfp.c | 36 ++++++++++++++++++++++++++++++++++-- unit/test-hfp.c | 1 + 2 files changed, 35 insertions(+), 2 deletions(-)
Here is the summary with links:
- [BlueZ,1/3] shared/hfp: Add extended response code enabling command
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=b0db5e1c330a - [BlueZ,2/3] shared/hfp: Add NREC disable command https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=f3904a8f1c2c - [BlueZ,3/3] unit/test-hfp: Add ECNR off test https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=654c4f5755e7
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html