mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
bluez5: backend-native: Add AT+CLCC support
This allows the HFP HF to retrieve the list of calls with their index, state and remote number (if available). This commit shared the list of calls between modemmanager.c and backend-native.c, and switches call state storage from ModemManager states to CLCC states
This commit is contained in:
parent
55075915ec
commit
20572a1789
3 changed files with 117 additions and 28 deletions
|
|
@ -946,6 +946,28 @@ next_indicator:
|
|||
str++;
|
||||
}
|
||||
|
||||
rfcomm_send_reply(rfcomm, "OK");
|
||||
} else if (spa_strstartswith(buf, "AT+CLCC")) {
|
||||
struct spa_list *calls;
|
||||
struct call *call;
|
||||
unsigned int type;
|
||||
|
||||
if (backend->modemmanager) {
|
||||
calls = mm_get_calls(backend->modemmanager);
|
||||
spa_list_for_each(call, calls, link) {
|
||||
if (!call->number) {
|
||||
rfcomm_send_reply(rfcomm, "+CLCC: %u,%u,%u,0,%u", call->index, call->direction, call->state, call->multiparty);
|
||||
} else {
|
||||
if (spa_strstartswith(call->number, "+"))
|
||||
type = INTERNATIONAL_NUMBER;
|
||||
else
|
||||
type = NATIONAL_NUMBER;
|
||||
rfcomm_send_reply(rfcomm, "+CLCC: %u,%u,%u,0,%u,\"%s\",%d", call->index, call->direction, call->state,
|
||||
call->multiparty, call->number, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rfcomm_send_reply(rfcomm, "OK");
|
||||
} else if (sscanf(buf, "AT+CLIP=%u", &value) == 1) {
|
||||
if (value > 1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue