* [PATCH BlueZ 1/5] shared/hfp: Add Call answer support
@ 2025-09-19 8:23 Frédéric Danis
2025-09-19 8:23 ` [PATCH BlueZ 2/5] unit/test-hfp: Add Answer Incoming Call tests for HF Frédéric Danis
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Frédéric Danis @ 2025-09-19 8:23 UTC (permalink / raw)
To: linux-bluetooth
This also manage the +CIEV:<call>,… event to create, remove or update
calls.
---
src/shared/hfp.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++
src/shared/hfp.h | 4 +++
2 files changed, 83 insertions(+)
diff --git a/src/shared/hfp.c b/src/shared/hfp.c
index 29b467ae3..7e35f239a 100644
--- a/src/shared/hfp.c
+++ b/src/shared/hfp.c
@@ -1651,9 +1651,36 @@ static void ciev_service_cb(uint8_t val, void *user_data)
hfp->callbacks_data);
}
+static bool update_call_to_active(struct hfp_hf *hfp)
+{
+ const struct queue_entry *entry;
+ struct hf_call *call;
+
+ for (entry = queue_get_entries(hfp->calls); entry;
+ entry = entry->next) {
+ call = entry->data;
+
+ if (call->status == CALL_STATUS_DIALING ||
+ call->status == CALL_STATUS_ALERTING ||
+ call->status == CALL_STATUS_INCOMING) {
+ call->status = CALL_STATUS_ACTIVE;
+ if (hfp->callbacks &&
+ hfp->callbacks->call_status_updated)
+ hfp->callbacks->call_status_updated(
+ call->id,
+ call->status,
+ hfp->callbacks_data);
+ return true;
+ }
+ }
+
+ return false;
+}
+
static void ciev_call_cb(uint8_t val, void *user_data)
{
struct hfp_hf *hfp = user_data;
+ uint id;
DBG(hfp, "%u", val);
@@ -1662,6 +1689,32 @@ static void ciev_call_cb(uint8_t val, void *user_data)
DBG(hfp, "hf: Incorrect call state: %u", val);
return;
}
+
+ switch (val) {
+ case CIND_CALL_NONE:
+ /* Remove all calls */
+ queue_remove_all(hfp->calls, NULL, hfp, remove_call_cb);
+ break;
+ case CIND_CALL_IN_PROGRESS:
+ {
+ /* Find incoming, dialing or alerting call to change
+ * it to active
+ */
+ if (update_call_to_active(hfp))
+ return;
+
+ /* else create new already active call */
+ id = next_call_index(hfp);
+ if (id == 0) {
+ DBG(hfp, "hf: No new call index available");
+ return;
+ }
+ call_new(hfp, id, CALL_STATUS_ACTIVE, NULL);
+ }
+ break;
+ default:
+ DBG(hfp, "hf: Unsupported call state: %u", val);
+ }
}
static bool call_outgoing_match(const void *data, const void *match_data)
@@ -2367,3 +2420,29 @@ const char *hfp_hf_call_get_number(struct hfp_hf *hfp, uint id)
return call->line_id;
}
+
+bool hfp_hf_call_answer(struct hfp_hf *hfp, uint id,
+ hfp_response_func_t resp_cb,
+ void *user_data)
+{
+ struct hf_call *call;
+
+ DBG(hfp, "");
+
+ if (!hfp)
+ return false;
+
+ call = queue_find(hfp->calls, call_id_match, UINT_TO_PTR(id));
+ if (!call) {
+ DBG(hfp, "hf: no call with id: %u", id);
+ return false;
+ }
+
+ if (call->status != CALL_STATUS_INCOMING) {
+ DBG(hfp, "hf: %d not in incoming call state: %u",
+ call->status);
+ return false;
+ }
+
+ return hfp_hf_send_command(hfp, resp_cb, user_data, "ATA");
+}
diff --git a/src/shared/hfp.h b/src/shared/hfp.h
index fec63c150..c623e48e6 100644
--- a/src/shared/hfp.h
+++ b/src/shared/hfp.h
@@ -236,3 +236,7 @@ bool hfp_hf_session_register(struct hfp_hf *hfp,
bool hfp_hf_session(struct hfp_hf *hfp);
const char *hfp_hf_call_get_number(struct hfp_hf *hfp, uint id);
+
+bool hfp_hf_call_answer(struct hfp_hf *hfp, uint id,
+ hfp_response_func_t resp_cb,
+ void *user_data);
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH BlueZ 2/5] unit/test-hfp: Add Answer Incoming Call tests for HF
2025-09-19 8:23 [PATCH BlueZ 1/5] shared/hfp: Add Call answer support Frédéric Danis
@ 2025-09-19 8:23 ` Frédéric Danis
2025-09-19 8:23 ` [PATCH BlueZ 3/5] shared/hfp: Add Call hangup support Frédéric Danis
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Frédéric Danis @ 2025-09-19 8:23 UTC (permalink / raw)
To: linux-bluetooth
This add the following tests:
- HFP/HF/ICA/BV-04-C
Verify the incoming call is answered from HF, no in-band ring.
- HFP/HF/ICA/BV-06-C
Verify the incoming call is answered from AG, no in-band ring.
---
unit/test-hfp.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 90 insertions(+), 1 deletion(-)
diff --git a/unit/test-hfp.c b/unit/test-hfp.c
index 060230196..adbcfd2fc 100644
--- a/unit/test-hfp.c
+++ b/unit/test-hfp.c
@@ -733,6 +733,12 @@ static void test_hf_robustness(gconstpointer data)
frg_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,
+ void *user_data)
+{
+ g_assert_cmpint(res, ==, HFP_RESULT_OK);
+}
+
static void hf_session_ready_cb(enum hfp_result res, enum hfp_error cme_err,
void *user_data)
{
@@ -822,7 +828,9 @@ static void hf_call_added(uint id, enum hfp_call_status status,
if (tester_use_debug())
tester_debug("call %d added: status %u", id, status);
- if (g_str_equal(test_name, "/HFP/HF/CLI/BV-01-C")) {
+ if (g_str_equal(test_name, "/HFP/HF/CLI/BV-01-C") ||
+ g_str_equal(test_name, "/HFP/HF/ICA/BV-04-C") ||
+ g_str_equal(test_name, "/HFP/HF/ICA/BV-06-C")) {
g_assert_cmpint(id, ==, 1);
g_assert_cmpint(status, ==, CALL_STATUS_INCOMING);
}
@@ -833,6 +841,7 @@ static void hf_call_line_id_updated(uint id, const char *number,
void *user_data)
{
struct context *context = user_data;
+ const char *test_name = context->data->test_name;
const char *str;
if (tester_use_debug())
@@ -843,6 +852,43 @@ static void hf_call_line_id_updated(uint id, const char *number,
g_assert_cmpint(type, ==, 129);
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-04-C")) {
+ bool ret;
+
+ if (tester_use_debug())
+ tester_debug("call %d: answering call", id);
+ ret = hfp_hf_call_answer(context->hfp_hf, id, hf_cmd_complete,
+ context);
+ g_assert(ret);
+ }
+}
+
+static void hf_call_removed(uint id, void *user_data)
+{
+ if (tester_use_debug())
+ tester_debug("call %d removed", id);
+ g_assert_cmpint(id, ==, 1);
+}
+
+static void hf_call_status_updated(uint id, enum hfp_call_status status,
+ void *user_data)
+{
+ struct context *context = user_data;
+ const char *test_name = context->data->test_name;
+
+ if (tester_use_debug())
+ tester_debug("call %d updated: status %u", id, status);
+
+ if (g_str_equal(test_name, "/HFP/HF/ICA/BV-04-C") ||
+ g_str_equal(test_name, "/HFP/HF/ICA/BV-06-C")) {
+ const char *number;
+
+ g_assert_cmpint(id, ==, 1);
+ g_assert_cmpint(status, ==, CALL_STATUS_ACTIVE);
+ number = hfp_hf_call_get_number(context->hfp_hf, id);
+ g_assert_cmpstr(number, ==, "1234567");
+ }
}
static struct hfp_hf_callbacks hf_session_callbacks = {
@@ -850,6 +896,8 @@ static struct hfp_hf_callbacks hf_session_callbacks = {
.update_indicator = hf_update_indicator,
.update_operator = hf_update_operator,
.call_added = hf_call_added,
+ .call_removed = hf_call_removed,
+ .call_status_updated = hf_call_status_updated,
.call_line_id_updated = hf_call_line_id_updated,
};
@@ -1070,6 +1118,47 @@ int main(int argc, char *argv[])
',', '1', '2', '9', ',', ',', '\r', '\n'),
data_end());
+ /* Answer Incoming call on HF, no in-band ring - HF */
+ define_hf_test("/HFP/HF/ICA/BV-04-C", test_hf_session,
+ NULL, test_hf_session_done,
+ MINIMAL_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'),
+ frg_pdu('\r', '\n', '+', 'C', 'I', 'E', 'V', ':', ' ',
+ '2', ',', '0', '\r', '\n'),
+ data_end());
+
+ /* Answer Incoming call on AG, no in-band ring - HF */
+ define_hf_test("/HFP/HF/ICA/BV-06-C", test_hf_session,
+ NULL, test_hf_session_done,
+ MINIMAL_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'),
+ 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'),
+ frg_pdu('\r', '\n', '+', 'C', 'I', 'E', 'V', ':', ' ',
+ '2', ',', '1', '\r', '\n'),
+ frg_pdu('\r', '\n', '+', 'C', 'I', 'E', 'V', ':', ' ',
+ '3', ',', '0', '\r', '\n'),
+ frg_pdu('\r', '\n', '+', 'C', 'I', 'E', 'V', ':', ' ',
+ '2', ',', '0', '\r', '\n'),
+ data_end());
+
/* Transfer Signal Strength Indication - HF */
define_hf_test("/HFP/HF/PSI/BV-01-C", test_hf_session,
NULL, test_hf_session_done,
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH BlueZ 3/5] shared/hfp: Add Call hangup support
2025-09-19 8:23 [PATCH BlueZ 1/5] shared/hfp: Add Call answer support Frédéric Danis
2025-09-19 8:23 ` [PATCH BlueZ 2/5] unit/test-hfp: Add Answer Incoming Call tests for HF Frédéric Danis
@ 2025-09-19 8:23 ` Frédéric Danis
2025-09-19 8:23 ` [PATCH BlueZ 4/5] unit/test-hfp: Add Reject Incoming Call tests for HF Frédéric Danis
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Frédéric Danis @ 2025-09-19 8:23 UTC (permalink / raw)
To: linux-bluetooth
---
src/shared/hfp.c | 25 +++++++++++++++++++++++++
src/shared/hfp.h | 3 +++
2 files changed, 28 insertions(+)
diff --git a/src/shared/hfp.c b/src/shared/hfp.c
index 7e35f239a..133bff248 100644
--- a/src/shared/hfp.c
+++ b/src/shared/hfp.c
@@ -2446,3 +2446,28 @@ bool hfp_hf_call_answer(struct hfp_hf *hfp, uint id,
return hfp_hf_send_command(hfp, resp_cb, user_data, "ATA");
}
+
+bool hfp_hf_call_hangup(struct hfp_hf *hfp, uint id,
+ hfp_response_func_t resp_cb,
+ void *user_data)
+{
+ struct hf_call *call;
+
+ DBG(hfp, "");
+
+ if (!hfp)
+ return false;
+
+ call = queue_find(hfp->calls, call_id_match, UINT_TO_PTR(id));
+ if (!call) {
+ DBG(hfp, "hf: no call with id: %u", id);
+ return false;
+ }
+
+ if (call_setup_match(call, NULL) || call_active_match(call, NULL)) {
+ return hfp_hf_send_command(hfp, resp_cb, user_data,
+ "AT+CHUP");
+ }
+
+ return false;
+}
diff --git a/src/shared/hfp.h b/src/shared/hfp.h
index c623e48e6..4b171ad88 100644
--- a/src/shared/hfp.h
+++ b/src/shared/hfp.h
@@ -240,3 +240,6 @@ const char *hfp_hf_call_get_number(struct hfp_hf *hfp, uint id);
bool hfp_hf_call_answer(struct hfp_hf *hfp, uint id,
hfp_response_func_t resp_cb,
void *user_data);
+bool hfp_hf_call_hangup(struct hfp_hf *hfp, uint id,
+ hfp_response_func_t resp_cb,
+ void *user_data);
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH BlueZ 4/5] unit/test-hfp: Add Reject Incoming Call tests for HF
2025-09-19 8:23 [PATCH BlueZ 1/5] shared/hfp: Add Call answer support Frédéric Danis
2025-09-19 8:23 ` [PATCH BlueZ 2/5] unit/test-hfp: Add Answer Incoming Call tests for HF Frédéric Danis
2025-09-19 8:23 ` [PATCH BlueZ 3/5] shared/hfp: Add Call hangup support Frédéric Danis
@ 2025-09-19 8:23 ` Frédéric Danis
2025-09-19 8:23 ` [PATCH BlueZ 5/5] unit/test-hfp: Add Terminate " Frédéric Danis
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Frédéric Danis @ 2025-09-19 8:23 UTC (permalink / raw)
To: linux-bluetooth
This add the following tests:
- /HFP/HF/ICR/BV-01-C
Verify that the HF can reject an incoming call after being alerted.
- /HFP/HF/ICR/BV-02-C
Verify that the AG, upon the corresponding action, rejects an incoming
call and properly indicates this event to the HF.
---
unit/test-hfp.c | 44 +++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/unit/test-hfp.c b/unit/test-hfp.c
index adbcfd2fc..a0faf98d7 100644
--- a/unit/test-hfp.c
+++ b/unit/test-hfp.c
@@ -830,7 +830,8 @@ static void hf_call_added(uint id, enum hfp_call_status status,
if (g_str_equal(test_name, "/HFP/HF/CLI/BV-01-C") ||
g_str_equal(test_name, "/HFP/HF/ICA/BV-04-C") ||
- g_str_equal(test_name, "/HFP/HF/ICA/BV-06-C")) {
+ g_str_equal(test_name, "/HFP/HF/ICA/BV-06-C") ||
+ g_str_equal(test_name, "/HFP/HF/ICR/BV-01-C")) {
g_assert_cmpint(id, ==, 1);
g_assert_cmpint(status, ==, CALL_STATUS_INCOMING);
}
@@ -861,6 +862,14 @@ static void hf_call_line_id_updated(uint id, const char *number,
ret = hfp_hf_call_answer(context->hfp_hf, id, hf_cmd_complete,
context);
g_assert(ret);
+ } else if (g_str_equal(test_name, "/HFP/HF/ICR/BV-01-C")) {
+ bool ret;
+
+ if (tester_use_debug())
+ tester_debug("call %d: rejecting call", id);
+ ret = hfp_hf_call_hangup(context->hfp_hf, id, hf_cmd_complete,
+ context);
+ g_assert(ret);
}
}
@@ -888,6 +897,10 @@ static void hf_call_status_updated(uint id, enum hfp_call_status status,
g_assert_cmpint(status, ==, CALL_STATUS_ACTIVE);
number = hfp_hf_call_get_number(context->hfp_hf, id);
g_assert_cmpstr(number, ==, "1234567");
+ } else if (g_str_equal(test_name, "/HFP/HF/ICR/BV-01-C")) {
+ if (tester_use_debug())
+ tester_debug("Error: unexpected update");
+ tester_test_failed();
}
}
@@ -1159,6 +1172,35 @@ int main(int argc, char *argv[])
'2', ',', '0', '\r', '\n'),
data_end());
+ /* Initiate rejection of incoming call - HF */
+ define_hf_test("/HFP/HF/ICR/BV-01-C", test_hf_session,
+ NULL, test_hf_session_done,
+ MINIMAL_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', ':', ' ',
+ '3', ',', '0', '\r', '\n'),
+ data_end());
+
+ /* Accept AG rejection of incoming call - HF */
+ define_hf_test("/HFP/HF/ICR/BV-02-C", test_hf_session,
+ NULL, test_hf_session_done,
+ MINIMAL_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'),
+ frg_pdu('\r', '\n', '+', 'C', 'I', 'E', 'V', ':', ' ',
+ '3', ',', '0', '\r', '\n'),
+ data_end());
+
/* Transfer Signal Strength Indication - HF */
define_hf_test("/HFP/HF/PSI/BV-01-C", test_hf_session,
NULL, test_hf_session_done,
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH BlueZ 5/5] unit/test-hfp: Add Terminate Call tests for HF
2025-09-19 8:23 [PATCH BlueZ 1/5] shared/hfp: Add Call answer support Frédéric Danis
` (2 preceding siblings ...)
2025-09-19 8:23 ` [PATCH BlueZ 4/5] unit/test-hfp: Add Reject Incoming Call tests for HF Frédéric Danis
@ 2025-09-19 8:23 ` Frédéric Danis
2025-09-19 9:51 ` [BlueZ,1/5] shared/hfp: Add Call answer support bluez.test.bot
2025-09-30 16:50 ` [PATCH BlueZ 1/5] " patchwork-bot+bluetooth
5 siblings, 0 replies; 7+ messages in thread
From: Frédéric Danis @ 2025-09-19 8:23 UTC (permalink / raw)
To: linux-bluetooth
This add the following tests:
- /HFP/HF/TCA/BV-01-C
Verify that the HF can terminate an ongoing call in the AG.
- /HFP/HF/TCA/BV-02-C
Verify that the AG, upon the corresponding action, terminates an
ongoing call. The AG then indicates this event to the HF.
- /HFP/HF/TCA/BV-04-C
Verify that the HF can release a call after dialing and prior to
call completion.
/HFP/HF/TCA/BV-03-C (Verify that after a call is terminated from the
remote party, the HF receives the proper indication from the AG) is
similar to /HFP/HF/TCA/BV-02-C for the HF side.
---
unit/test-hfp.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 85 insertions(+), 3 deletions(-)
diff --git a/unit/test-hfp.c b/unit/test-hfp.c
index a0faf98d7..190604ba2 100644
--- a/unit/test-hfp.c
+++ b/unit/test-hfp.c
@@ -831,9 +831,22 @@ static void hf_call_added(uint id, enum hfp_call_status status,
if (g_str_equal(test_name, "/HFP/HF/CLI/BV-01-C") ||
g_str_equal(test_name, "/HFP/HF/ICA/BV-04-C") ||
g_str_equal(test_name, "/HFP/HF/ICA/BV-06-C") ||
- g_str_equal(test_name, "/HFP/HF/ICR/BV-01-C")) {
+ g_str_equal(test_name, "/HFP/HF/ICR/BV-01-C") ||
+ g_str_equal(test_name, "/HFP/HF/TCA/BV-01-C") ||
+ g_str_equal(test_name, "/HFP/HF/TCA/BV-02-C")) {
g_assert_cmpint(id, ==, 1);
g_assert_cmpint(status, ==, CALL_STATUS_INCOMING);
+ } else if (g_str_equal(test_name, "/HFP/HF/TCA/BV-04-C")) {
+ bool ret;
+
+ g_assert_cmpint(id, ==, 1);
+ g_assert_cmpint(status, ==, CALL_STATUS_DIALING);
+
+ if (tester_use_debug())
+ tester_debug("call %d: ending call", id);
+ ret = hfp_hf_call_hangup(context->hfp_hf, id, hf_cmd_complete,
+ context);
+ g_assert(ret);
}
}
@@ -854,7 +867,9 @@ 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-04-C")) {
+ if (g_str_equal(test_name, "/HFP/HF/ICA/BV-04-C") ||
+ g_str_equal(test_name, "/HFP/HF/TCA/BV-01-C") ||
+ g_str_equal(test_name, "/HFP/HF/TCA/BV-02-C")) {
bool ret;
if (tester_use_debug())
@@ -890,7 +905,8 @@ static void hf_call_status_updated(uint id, enum hfp_call_status status,
tester_debug("call %d updated: status %u", id, status);
if (g_str_equal(test_name, "/HFP/HF/ICA/BV-04-C") ||
- g_str_equal(test_name, "/HFP/HF/ICA/BV-06-C")) {
+ g_str_equal(test_name, "/HFP/HF/ICA/BV-06-C") ||
+ g_str_equal(test_name, "/HFP/HF/TCA/BV-02-C")) {
const char *number;
g_assert_cmpint(id, ==, 1);
@@ -901,6 +917,20 @@ static void hf_call_status_updated(uint id, enum hfp_call_status status,
if (tester_use_debug())
tester_debug("Error: unexpected update");
tester_test_failed();
+ } else if (g_str_equal(test_name, "/HFP/HF/TCA/BV-01-C")) {
+ const char *number;
+ bool ret;
+
+ g_assert_cmpint(id, ==, 1);
+ g_assert_cmpint(status, ==, CALL_STATUS_ACTIVE);
+ number = hfp_hf_call_get_number(context->hfp_hf, id);
+ g_assert_cmpstr(number, ==, "1234567");
+
+ if (tester_use_debug())
+ tester_debug("call %d: ending call", id);
+ ret = hfp_hf_call_hangup(context->hfp_hf, id, hf_cmd_complete,
+ context);
+ g_assert(ret);
}
}
@@ -1233,6 +1263,58 @@ int main(int argc, char *argv[])
MINIMAL_SLC_SESSION('1', '0', '0', '0'),
data_end());
+ /* Terminate ongoing call - HF */
+ define_hf_test("/HFP/HF/TCA/BV-01-C", test_hf_session,
+ NULL, test_hf_session_done,
+ MINIMAL_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'),
+ raw_pdu('\r', '\n', 'O', 'K', '\r', '\n'),
+ frg_pdu('\r', '\n', '+', 'C', 'I', 'E', 'V', ':', ' ',
+ '2', ',', '0', '\r', '\n'),
+ data_end());
+
+ /* Terminate ongoing call on AG - HF
+ * idem for /HFP/HF/TCA/BV-03-C Remote party terminates the call
+ */
+ define_hf_test("/HFP/HF/TCA/BV-02-C", test_hf_session,
+ NULL, test_hf_session_done,
+ MINIMAL_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'),
+ frg_pdu('\r', '\n', '+', 'C', 'I', 'E', 'V', ':', ' ',
+ '2', ',', '0', '\r', '\n'),
+ data_end());
+
+ /* Abandon outgoing call - HF */
+ define_hf_test("/HFP/HF/TCA/BV-04-C", test_hf_session,
+ NULL, test_hf_session_done,
+ MINIMAL_SLC_SESSION('1', '0', '0', '0'),
+ frg_pdu('\r', '\n', '+', 'C', 'I', 'E', 'V', ':', ' ',
+ '3', ',', '2', '\r', '\n'),
+ raw_pdu('\r', '\n', 'O', 'K', '\r', '\n'),
+ frg_pdu('\r', '\n', '+', 'C', 'I', 'E', 'V', ':', ' ',
+ '3', ',', '0', '\r', '\n'),
+ data_end());
+
/* Transfer Registration Status - HF */
define_hf_test("/HFP/HF/TRS/BV-01-C", test_hf_session,
NULL, test_hf_session_done,
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: [BlueZ,1/5] shared/hfp: Add Call answer support
2025-09-19 8:23 [PATCH BlueZ 1/5] shared/hfp: Add Call answer support Frédéric Danis
` (3 preceding siblings ...)
2025-09-19 8:23 ` [PATCH BlueZ 5/5] unit/test-hfp: Add Terminate " Frédéric Danis
@ 2025-09-19 9:51 ` bluez.test.bot
2025-09-30 16:50 ` [PATCH BlueZ 1/5] " patchwork-bot+bluetooth
5 siblings, 0 replies; 7+ messages in thread
From: bluez.test.bot @ 2025-09-19 9:51 UTC (permalink / raw)
To: linux-bluetooth, frederic.danis
[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]
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=1004133
---Test result---
Test Summary:
CheckPatch PENDING 0.52 seconds
GitLint PENDING 0.32 seconds
BuildEll PASS 20.25 seconds
BluezMake PASS 2679.69 seconds
MakeCheck PASS 20.10 seconds
MakeDistcheck PASS 182.73 seconds
CheckValgrind PASS 234.60 seconds
CheckSmatch PASS 303.29 seconds
bluezmakeextell PASS 125.03 seconds
IncrementalBuild PENDING 0.30 seconds
ScanBuild PASS 920.75 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH BlueZ 1/5] shared/hfp: Add Call answer support
2025-09-19 8:23 [PATCH BlueZ 1/5] shared/hfp: Add Call answer support Frédéric Danis
` (4 preceding siblings ...)
2025-09-19 9:51 ` [BlueZ,1/5] shared/hfp: Add Call answer support bluez.test.bot
@ 2025-09-30 16:50 ` patchwork-bot+bluetooth
5 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+bluetooth @ 2025-09-30 16:50 UTC (permalink / raw)
To: =?utf-8?b?RnLDqWTDqXJpYyBEYW5pcyA8ZnJlZGVyaWMuZGFuaXNAY29sbGFib3JhLmNvbT4=?=
Cc: linux-bluetooth
Hello:
This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Fri, 19 Sep 2025 10:23:30 +0200 you wrote:
> This also manage the +CIEV:<call>,… event to create, remove or update
> calls.
> ---
> src/shared/hfp.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++
> src/shared/hfp.h | 4 +++
> 2 files changed, 83 insertions(+)
Here is the summary with links:
- [BlueZ,1/5] shared/hfp: Add Call answer support
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=df19a94770ed
- [BlueZ,2/5] unit/test-hfp: Add Answer Incoming Call tests for HF
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=aaabb8d75870
- [BlueZ,3/5] shared/hfp: Add Call hangup support
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=5453bb526824
- [BlueZ,4/5] unit/test-hfp: Add Reject Incoming Call tests for HF
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=976d87ba8e02
- [BlueZ,5/5] unit/test-hfp: Add Terminate Call tests for HF
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=c53a401998f7
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-09-30 16:50 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-19 8:23 [PATCH BlueZ 1/5] shared/hfp: Add Call answer support Frédéric Danis
2025-09-19 8:23 ` [PATCH BlueZ 2/5] unit/test-hfp: Add Answer Incoming Call tests for HF Frédéric Danis
2025-09-19 8:23 ` [PATCH BlueZ 3/5] shared/hfp: Add Call hangup support Frédéric Danis
2025-09-19 8:23 ` [PATCH BlueZ 4/5] unit/test-hfp: Add Reject Incoming Call tests for HF Frédéric Danis
2025-09-19 8:23 ` [PATCH BlueZ 5/5] unit/test-hfp: Add Terminate " Frédéric Danis
2025-09-19 9:51 ` [BlueZ,1/5] shared/hfp: Add Call answer support bluez.test.bot
2025-09-30 16:50 ` [PATCH BlueZ 1/5] " patchwork-bot+bluetooth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox