Skip to content

Commit e458308

Browse files
Thalleykartben
authored andcommitted
Bluetooth: CCP: Introduce new CCP API
The CCP API for the Call Control Profile works on top of the TBS API, and will eventually replace parts of the TBS API. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 05c167e commit e458308

File tree

48 files changed

+1758
-230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1758
-230
lines changed

MAINTAINERS.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ Bluetooth Host:
401401
- doc/connectivity/bluetooth/shell/audio/
402402
- samples/bluetooth/bap*/
403403
- samples/bluetooth/cap*/
404+
- samples/bluetooth/ccp*/
404405
- samples/bluetooth/hap*/
405406
- samples/bluetooth/hci_*/
406407
- samples/bluetooth/pbp*/
@@ -484,6 +485,7 @@ Bluetooth Audio:
484485
- doc/connectivity/bluetooth/shell/audio/
485486
- samples/bluetooth/bap*/
486487
- samples/bluetooth/cap*/
488+
- samples/bluetooth/ccp*/
487489
- samples/bluetooth/hap*/
488490
- samples/bluetooth/pbp*/
489491
- samples/bluetooth/tmap*/

doc/connectivity/bluetooth/api/audio/bluetooth-le-audio-arch.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ GAF and the top layer profiles gave been implemented in Zephyr with the followin
294294
cluster=true;
295295
label="CCP";
296296
style=solid;
297+
CCP_H [label="ccp.h"];
297298
TBS_H [label="tbs.h"];
298299
}
299300
}
@@ -331,6 +332,7 @@ GAF and the top layer profiles gave been implemented in Zephyr with the followin
331332
CAP_H -> MCS_H;
332333
CAP_H -> MCC_H;
333334
CAP_H -> MP_H;
335+
CAP_H -> CCP_H;
334336
CAP_H -> TBS_H;
335337
CAP_H -> BAP_H;
336338
CAP_H -> BAP_PRESET_H;
@@ -341,6 +343,7 @@ GAF and the top layer profiles gave been implemented in Zephyr with the followin
341343
CSIP_H -> MCS_H;
342344
CSIP_H -> MCC_H;
343345
CSIP_H -> MP_H;
346+
CSIP_H -> CCP_H;
344347
CSIP_H -> TBS_H;
345348
CSIP_H -> BAP_H;
346349
CSIP_H -> BAP_PRESET_H;
@@ -719,8 +722,8 @@ Bluetooth Audio Stack.
719722
| | | | | - Shell Module | |
720723
| | | | | - BSIM test | |
721724
+--------+-------------------------------+---------+------------------+-----------------------+--------------------------------------------------+
722-
| CCP | Call Control Server | 1.0 | 3.0 | - Feature complete | - API refactor |
723-
| | | | | - Shell Module | - Sample Application |
725+
| CCP | Call Control Server | 1.0 | 3.0 | - Feature complete | - API refactor (in progress) |
726+
| | | | | - Shell Module | - Sample Application (in progress) |
724727
| | | | | - BSIM test | |
725728
| +-------------------------------+---------+------------------+-----------------------+--------------------------------------------------+
726729
| | Call Control Client | 1.0 | 3.0 | - Feature complete | - API refactor |

doc/connectivity/bluetooth/bluetooth-shell.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ For specific Bluetooth functionality see also the following shell documentation
1919
shell/audio/csip.rst
2020
shell/audio/gmap.rst
2121
shell/audio/mcp.rst
22+
shell/audio/tbs.rst
2223
shell/audio/tmap.rst
2324
shell/audio/pbp.rst
2425
shell/classic/a2dp.rst
Lines changed: 16 additions & 219 deletions
Original file line numberDiff line numberDiff line change
@@ -1,208 +1,24 @@
11
Bluetooth: Call Control Profile Shell
22
#####################################
33

4-
This document describes how to run the call control functionality, both as
5-
a client and as a (telephone bearer service (TBS)) server. Note that in the
6-
examples below, some lines of debug have been removed to make this shorter
7-
and provide a better overview.
4+
Call Control Server
5+
*******************
6+
The Call Control Server is a role that typically resides on devices that can make calls,
7+
including calls from apps such as Skype, e.g. (smart)phones and PCs,
8+
which are typically GAP Central devices.
89

9-
Telephone Bearer Service Client
10-
*******************************
11-
12-
The telephone bearer service client will typically exist on a resource
13-
restricted device, such as headphones, but may also exist on e.g. phones or
14-
laptops. The call control client will also thus typically be the advertiser.
15-
The client can control the states of calls on a server using the call control
16-
point.
17-
18-
It is necessary to have :kconfig:option:`CONFIG_BT_TBS_CLIENT_LOG_LEVEL_DBG`
19-
enabled for using the client interactively.
20-
21-
Using the telephone bearer service client
22-
=========================================
23-
24-
When the Bluetooth stack has been initialized (:code:`bt init`),
25-
and a device has been connected, the telephone bearer service client can
26-
discover TBS on the connected device calling :code:`tbs_client discover`, which
27-
will start a discovery for the TBS UUIDs and store the handles, and optionally
28-
subscribe to all notifications (default is to subscribe to all).
29-
30-
Since a server may have multiple TBS instances, most of the tbs_client commands
31-
will take an index (starting from 0) as input. Joining calls require at least 2
32-
call IDs, and all call indexes shall be on the same TBS instance.
33-
34-
A server will also have a GTBS instance, which is an abstraction layer for all
35-
the telephone bearers on the server. If the server has both GTBS and TBS,
36-
the client may subscribe and use either when sending requests if
37-
:code:`BT_TBS_CLIENT_GTBS` is enabled.
38-
39-
.. code-block:: console
40-
41-
tbs_client --help
42-
tbs_client - Bluetooth TBS_CLIENT shell commands
43-
Subcommands:
44-
discover :Discover TBS [subscribe]
45-
set_signal_reporting_interval :Set the signal reporting interval
46-
[<{instance_index, gtbs}>] <interval>
47-
originate :Originate a call [<{instance_index, gtbs}>]
48-
<uri>
49-
terminate :terminate a call [<{instance_index, gtbs}>]
50-
<id>
51-
accept :Accept a call [<{instance_index, gtbs}>] <id>
52-
hold :Place a call on hold [<{instance_index,
53-
gtbs}>] <id>
54-
retrieve :Retrieve a held call [<{instance_index,
55-
gtbs}>] <id>
56-
read_provider_name :Read the bearer name [<{instance_index,
57-
gtbs}>]
58-
read_bearer_uci :Read the bearer UCI [<{instance_index, gtbs}>]
59-
read_technology :Read the bearer technology [<{instance_index,
60-
gtbs}>]
61-
read_uri_list :Read the bearer's supported URI list
62-
[<{instance_index, gtbs}>]
63-
read_signal_strength :Read the bearer signal strength
64-
[<{instance_index, gtbs}>]
65-
read_signal_interval :Read the bearer signal strength reporting
66-
interval [<{instance_index, gtbs}>]
67-
read_current_calls :Read the current calls [<{instance_index,
68-
gtbs}>]
69-
read_ccid :Read the CCID [<{instance_index, gtbs}>]
70-
read_status_flags :Read the in feature and status value
71-
[<{instance_index, gtbs}>]
72-
read_uri :Read the incoming call target URI
73-
[<{instance_index, gtbs}>]
74-
read_call_state :Read the call state [<{instance_index, gtbs}>]
75-
read_remote_uri :Read the incoming remote URI
76-
[<{instance_index, gtbs}>]
77-
read_friendly_name :Read the friendly name of an incoming call
78-
[<{instance_index, gtbs}>]
79-
read_optional_opcodes :Read the optional opcodes [<{instance_index,
80-
gtbs}>]
81-
82-
83-
In the following examples, notifications from GTBS is ignored, unless otherwise
84-
specified.
85-
86-
Example usage
87-
=============
88-
89-
Setup
90-
-----
91-
92-
.. code-block:: console
93-
94-
uart:~$ bt init
95-
uart:~$ bt advertise on
96-
Advertising started
97-
98-
When connected
99-
--------------
100-
101-
Placing a call:
102-
103-
.. code-block:: console
104-
105-
uart:~$ tbs_client discover
106-
<dbg> bt_tbs_client.primary_discover_func: Discover complete, found 1 instances (GTBS found)
107-
<dbg> bt_tbs_client.discover_func: Setup complete for 1 / 1 TBS
108-
<dbg> bt_tbs_client.discover_func: Setup complete GTBS
109-
uart:~$ tbs_client originate 0 tel:123
110-
<dbg> bt_tbs_client.notify_handler: Index 0
111-
<dbg> bt_tbs_client.current_calls_notify_handler: Call 0x01 is in the dialing state with URI tel:123
112-
<dbg> bt_tbs_client.call_cp_notify_handler: Status: success for the originate opcode for call 0x00
113-
<dbg> bt_tbs_client.notify_handler: Index 0
114-
<dbg> bt_tbs_client.current_calls_notify_handler: Call 0x01 is in the alerting state with URI tel:123
115-
<call answered by peer device, and status notified by TBS server>
116-
<dbg> bt_tbs_client.notify_handler: Index 0
117-
<dbg> bt_tbs_client.current_calls_notify_handler: Call 0x01 is in the active state with URI tel:123
118-
119-
Placing a call on GTBS:
120-
121-
.. code-block:: console
122-
123-
uart:~$ tbs_client originate 0 tel:123
124-
<dbg> bt_tbs_client.notify_handler: Index 0
125-
<dbg> bt_tbs_client.current_calls_notify_handler: Call 0x01 is in the dialing state with URI tel:123
126-
<dbg> bt_tbs_client.call_cp_notify_handler: Status: success for the originate opcode for call 0x00
127-
<dbg> bt_tbs_client.notify_handler: Index 0
128-
<dbg> bt_tbs_client.current_calls_notify_handler: Call 0x01 is in the alerting state with URI tel:123
129-
<call answered by peer device, and status notified by TBS server>
130-
<dbg> bt_tbs_client.notify_handler: Index 0
131-
<dbg> bt_tbs_client.current_calls_notify_handler: Call 0x01 is in the active state with URI tel:123
132-
133-
It is necessary to set an outgoing caller ID before placing a call.
134-
135-
Accepting incoming call from peer device:
136-
137-
.. code-block:: console
138-
139-
<dbg> bt_tbs_client.incoming_uri_notify_handler: tel:123
140-
<dbg> bt_tbs_client.in_call_notify_handler: tel:456
141-
<dbg> bt_tbs_client.friendly_name_notify_handler: Peter
142-
<dbg> bt_tbs_client.current_calls_notify_handler: Call 0x05 is in the incoming state with URI tel:456
143-
uart:~$ tbs_client accept 0 5
144-
<dbg> bt_tbs_client.call_cp_callback_handler: Status: success for the accept opcode for call 0x05
145-
<dbg> bt_tbs_client.current_calls_notify_handler: Call 0x05 is in the active state with URI tel
146-
147-
148-
Terminate call:
149-
150-
.. code-block:: console
151-
152-
uart:~$ tbs_client terminate 0 5
153-
<dbg> bt_tbs_client.termination_reason_notify_handler: ID 0x05, reason 0x06
154-
<dbg> bt_tbs_client.call_cp_notify_handler: Status: success for the terminate opcode for call 0x05
155-
<dbg> bt_tbs_client.current_calls_notify_handler:
156-
157-
Telephone Bearer Service (TBS)
158-
******************************
159-
The telephone bearer service is a service that typically resides on devices that
160-
can make calls, including calls from apps such as Skype, e.g. (smart)phones and
161-
PCs.
162-
163-
It is necessary to have :kconfig:option:`CONFIG_BT_TBS_LOG_LEVEL_DBG` enabled
164-
for using the TBS server interactively.
165-
166-
Using the telephone bearer service
167-
==================================
168-
TBS can be controlled locally, or by a remote device (when in a call). For
169-
example a remote device may initiate a call to the device with the TBS server,
170-
or the TBS server may initiate a call to remote device, without a TBS_CLIENT client.
171-
The TBS implementation is capable of fully controlling any call.
172-
Omitting an index for commands where a :code:`<instance_index>` can be supplied, defaults to the
173-
GTBS bearer.
10+
Using the Call Control Server
11+
=============================
12+
The Server can be controlled locally, or by a remote device (when in a call). For
13+
example a remote device may initiate a call to the server,
14+
or the Server may initiate a call to remote device, without a client.
17415

17516
.. code-block:: console
17617
177-
tbs --help
178-
tbs - Bluetooth TBS shell commands
18+
ccp_call_control_server --help
19+
ccp_call_control_server - Bluetooth CCP Call Control Server shell commands
17920
Subcommands:
180-
init :Initialize TBS
181-
authorize :Authorize the current connection
182-
accept :Accept call <call_index>
183-
terminate :Terminate call <call_index>
184-
hold :Hold call <call_index>
185-
retrieve :Retrieve call <call_index>
186-
originate :Originate call [<instance_index>] <uri>
187-
join :Join calls <id> <id> [<id> [<id> [...]]]
188-
incoming :Simulate incoming remote call [<{instance_index,
189-
gtbs}>] <local_uri> <remote_uri>
190-
<remote_friendly_name>
191-
remote_answer :Simulate remote answer outgoing call <call_index>
192-
remote_retrieve :Simulate remote retrieve <call_index>
193-
remote_terminate :Simulate remote terminate <call_index>
194-
remote_hold :Simulate remote hold <call_index>
195-
set_bearer_provider_name :Set the bearer provider name [<{instance_index,
196-
gtbs}>] <name>
197-
set_bearer_technology :Set the bearer technology [<{instance_index,
198-
gtbs}>] <technology>
199-
set_bearer_signal_strength :Set the bearer signal strength [<{instance_index,
200-
gtbs}>] <strength>
201-
set_status_flags :Set the bearer feature and status value
202-
[<{instance_index, gtbs}>] <feature_and_status>
203-
set_uri_scheme :Set the URI prefix list <bearer_idx> <uri1 [uri2
204-
[uri3 [...]]]>
205-
print_calls :Output all calls in the debug log
21+
init : Initialize CCP Call Control Server
20622
20723
Example Usage
20824
=============
@@ -213,26 +29,7 @@ Setup
21329
.. code-block:: console
21430
21531
uart:~$ bt init
32+
uart:~$ ccp_call_control_server init
33+
Registered GTBS bearer
34+
Registered bearer[1]
21635
uart:~$ bt connect xx:xx:xx:xx:xx:xx public
217-
218-
When connected
219-
--------------
220-
221-
Answering a call for a peer device originated by a client:
222-
223-
.. code-block:: console
224-
225-
<dbg> bt_tbs.write_call_cp: Index 0: Processing the originate opcode
226-
<dbg> bt_tbs.originate_call: New call with call index 1
227-
<dbg> bt_tbs.write_call_cp: Index 0: Processed the originate opcode with status success for call index 1
228-
uart:~$ tbs remote_answer 1
229-
TBS succeeded for call_id: 1
230-
231-
Incoming call from a peer device, accepted by client:
232-
233-
.. code-block:: console
234-
235-
uart:~$ tbs incoming 0 tel:123 tel:456 Peter
236-
TBS succeeded for call_id: 4
237-
<dbg> bt_tbs.bt_tbs_remote_incoming: New call with call index 4
238-
<dbg> bt_tbs.write_call_cp: Index 0: Processed the accept opcode with status success for call index 4

0 commit comments

Comments
 (0)