Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
tbs.h File Reference

Public APIs for Bluetooth Telephone Bearer Service. More...

#include <stdint.h>
#include <stdbool.h>
#include <zephyr/bluetooth/conn.h>

Go to the source code of this file.

Data Structures

struct  bt_tbs_cb
 
struct  bt_tbs_client_call_state
 
struct  bt_tbs_client_call
 
struct  bt_tbs_client_cb
 

Macros

#define BT_TBS_CALL_STATE_INCOMING   0x00
 
#define BT_TBS_CALL_STATE_DIALING   0x01
 
#define BT_TBS_CALL_STATE_ALERTING   0x02
 
#define BT_TBS_CALL_STATE_ACTIVE   0x03
 
#define BT_TBS_CALL_STATE_LOCALLY_HELD   0x04
 
#define BT_TBS_CALL_STATE_REMOTELY_HELD   0x05
 
#define BT_TBS_CALL_STATE_LOCALLY_AND_REMOTELY_HELD   0x06
 
#define BT_TBS_REASON_BAD_REMOTE_URI   0x00
 
#define BT_TBS_REASON_CALL_FAILED   0x01
 
#define BT_TBS_REASON_REMOTE_ENDED_CALL   0x02
 
#define BT_TBS_REASON_SERVER_ENDED_CALL   0x03
 
#define BT_TBS_REASON_LINE_BUSY   0x04
 
#define BT_TBS_REASON_NETWORK_CONGESTED   0x05
 
#define BT_TBS_REASON_CLIENT_TERMINATED   0x06
 
#define BT_TBS_REASON_UNSPECIFIED   0x07
 
#define BT_TBS_RESULT_CODE_SUCCESS   0x00
 
#define BT_TBS_RESULT_CODE_OPCODE_NOT_SUPPORTED   0x01
 
#define BT_TBS_RESULT_CODE_OPERATION_NOT_POSSIBLE   0x02
 
#define BT_TBS_RESULT_CODE_INVALID_CALL_INDEX   0x03
 
#define BT_TBS_RESULT_CODE_STATE_MISMATCH   0x04
 
#define BT_TBS_RESULT_CODE_OUT_OF_RESOURCES   0x05
 
#define BT_TBS_RESULT_CODE_INVALID_URI   0x06
 
#define BT_TBS_FEATURE_HOLD   BIT(0)
 
#define BT_TBS_FEATURE_JOIN   BIT(1)
 
#define BT_TBS_CALL_FLAG_SET_INCOMING(flag)   (flag &= ~BIT(0))
 
#define BT_TBS_CALL_FLAG_SET_OUTGOING(flag)   (flag |= BIT(0))
 
#define BT_TBS_SIGNAL_STRENGTH_NO_SERVICE   0
 
#define BT_TBS_SIGNAL_STRENGTH_MAX   100
 
#define BT_TBS_SIGNAL_STRENGTH_UNKNOWN   255
 
#define BT_TBS_TECHNOLOGY_3G   0x01
 
#define BT_TBS_TECHNOLOGY_4G   0x02
 
#define BT_TBS_TECHNOLOGY_LTE   0x03
 
#define BT_TBS_TECHNOLOGY_WIFI   0x04
 
#define BT_TBS_TECHNOLOGY_5G   0x05
 
#define BT_TBS_TECHNOLOGY_GSM   0x06
 
#define BT_TBS_TECHNOLOGY_CDMA   0x07
 
#define BT_TBS_TECHNOLOGY_2G   0x08
 
#define BT_TBS_TECHNOLOGY_WCDMA   0x09
 
#define BT_TBS_TECHNOLOGY_IP   0x0a
 
#define BT_TBS_GTBS_INDEX   0xFF
 The GTBS index denotes whenever a callback is from a Generic Telephone Bearer Service (GTBS) instance, or whenever the client should perform on action on the GTBS instance of the server, rather than any of the specific Telephone Bearer Service instances.
 

Typedefs

typedef bool(* bt_tbs_originate_call_cb) (struct bt_conn *conn, uint8_t call_index, const char *uri)
 Callback function for client originating a call.
 
typedef void(* bt_tbs_terminate_call_cb) (struct bt_conn *conn, uint8_t call_index, uint8_t reason)
 Callback function for client terminating a call.
 
typedef void(* bt_tbs_join_calls_cb) (struct bt_conn *conn, uint8_t call_index_count, const uint8_t *call_indexes)
 Callback function for client joining calls.
 
typedef void(* bt_tbs_call_change_cb) (struct bt_conn *conn, uint8_t call_index)
 Callback function for client request call state change.
 
typedef bool(* bt_tbs_authorize_cb) (struct bt_conn *conn)
 Callback function for authorizing a client.
 
typedef void(* bt_tbs_client_discover_cb) (struct bt_conn *conn, int err, uint8_t tbs_count, bool gtbs_found)
 Callback function for ccp_discover.
 
typedef void(* bt_tbs_client_write_value_cb) (struct bt_conn *conn, int err, uint8_t inst_index)
 Callback function for writing values to peer device.
 
typedef void(* bt_tbs_client_cp_cb) (struct bt_conn *conn, int err, uint8_t inst_index, uint8_t call_index)
 Callback function for the CCP call control functions.
 
typedef void(* bt_tbs_client_read_string_cb) (struct bt_conn *conn, int err, uint8_t inst_index, const char *value)
 Callback function for functions that read a string value.
 
typedef void(* bt_tbs_client_read_value_cb) (struct bt_conn *conn, int err, uint8_t inst_index, uint32_t value)
 Callback function for functions that read an integer value.
 
typedef void(* bt_tbs_client_termination_reason_cb) (struct bt_conn *conn, int err, uint8_t inst_index, uint8_t call_index, uint8_t reason)
 Callback function for ccp_read_termination_reason.
 
typedef void(* bt_tbs_client_current_calls_cb) (struct bt_conn *conn, int err, uint8_t inst_index, uint8_t call_count, const struct bt_tbs_client_call *calls)
 Callback function for ccp_read_current_calls.
 
typedef void(* bt_tbs_client_call_states_cb) (struct bt_conn *conn, int err, uint8_t inst_index, uint8_t call_count, const struct bt_tbs_client_call_state *call_states)
 Callback function for ccp_read_call_state.
 

Functions

int bt_tbs_accept (uint8_t call_index)
 Accept an alerting call.
 
int bt_tbs_hold (uint8_t call_index)
 Hold a call.
 
int bt_tbs_retrieve (uint8_t call_index)
 Retrieve a call.
 
int bt_tbs_terminate (uint8_t call_index)
 Terminate a call.
 
int bt_tbs_originate (uint8_t bearer_index, char *uri, uint8_t *call_index)
 Originate a call.
 
int bt_tbs_join (uint8_t call_index_cnt, uint8_t *call_indexes)
 Join calls.
 
int bt_tbs_remote_answer (uint8_t call_index)
 Notify the server that the remote party answered the call.
 
int bt_tbs_remote_hold (uint8_t call_index)
 Notify the server that the remote party held the call.
 
int bt_tbs_remote_retrieve (uint8_t call_index)
 Notify the server that the remote party retrieved the call.
 
int bt_tbs_remote_terminate (uint8_t call_index)
 Notify the server that the remote party terminated the call.
 
int bt_tbs_remote_incoming (uint8_t bearer_index, const char *to, const char *from, const char *friendly_name)
 Notify the server of an incoming call.
 
int bt_tbs_set_bearer_provider_name (uint8_t bearer_index, const char *name)
 Set a new bearer provider.
 
int bt_tbs_set_bearer_technology (uint8_t bearer_index, uint8_t new_technology)
 Set a new bearer technology.
 
int bt_tbs_set_signal_strength (uint8_t bearer_index, uint8_t new_signal_strength)
 Update the signal strength reported by the server.
 
int bt_tbs_set_status_flags (uint8_t bearer_index, uint16_t status_flags)
 Sets the feature and status value.
 
int bt_tbs_set_uri_scheme_list (uint8_t bearer_index, const char **uri_list, uint8_t uri_count)
 Sets the URI scheme list of a bearer.
 
void bt_tbs_register_cb (struct bt_tbs_cb *cbs)
 Register the callbacks for TBS.
 
void bt_tbs_dbg_print_calls (void)
 Prints all calls of all services to the debug log.
 
int bt_tbs_client_discover (struct bt_conn *conn)
 Discover TBS for a connection.
 
int bt_tbs_client_set_outgoing_uri (struct bt_conn *conn, uint8_t inst_index, const char *uri)
 Set the outgoing URI for a TBS instance on the peer device.
 
int bt_tbs_client_set_signal_strength_interval (struct bt_conn *conn, uint8_t inst_index, uint8_t interval)
 Set the signal strength reporting interval for a TBS instance.
 
int bt_tbs_client_originate_call (struct bt_conn *conn, uint8_t inst_index, const char *uri)
 Request to originate a call.
 
int bt_tbs_client_terminate_call (struct bt_conn *conn, uint8_t inst_index, uint8_t call_index)
 Request to terminate a call.
 
int bt_tbs_client_hold_call (struct bt_conn *conn, uint8_t inst_index, uint8_t call_index)
 Request to hold a call.
 
int bt_tbs_client_accept_call (struct bt_conn *conn, uint8_t inst_index, uint8_t call_index)
 Accept an incoming call.
 
int bt_tbs_client_retrieve_call (struct bt_conn *conn, uint8_t inst_index, uint8_t call_index)
 Retrieve call from (local) hold.
 
int bt_tbs_client_join_calls (struct bt_conn *conn, uint8_t inst_index, const uint8_t *call_indexes, uint8_t count)
 Join multiple calls.
 
int bt_tbs_client_read_bearer_provider_name (struct bt_conn *conn, uint8_t inst_index)
 Read the bearer provider name of a TBS instance.
 
int bt_tbs_client_read_bearer_uci (struct bt_conn *conn, uint8_t inst_index)
 Read the UCI of a TBS instance.
 
int bt_tbs_client_read_technology (struct bt_conn *conn, uint8_t inst_index)
 Read the technology of a TBS instance.
 
int bt_tbs_client_read_uri_list (struct bt_conn *conn, uint8_t inst_index)
 Read the URI schemes list of a TBS instance.
 
int bt_tbs_client_read_signal_strength (struct bt_conn *conn, uint8_t inst_index)
 Read the current signal strength of a TBS instance.
 
int bt_tbs_client_read_signal_interval (struct bt_conn *conn, uint8_t inst_index)
 Read the signal strength reporting interval of a TBS instance.
 
int bt_tbs_client_read_current_calls (struct bt_conn *conn, uint8_t inst_index)
 Read the list of current calls of a TBS instance.
 
int bt_tbs_client_read_ccid (struct bt_conn *conn, uint8_t inst_index)
 Read the content ID of a TBS instance.
 
int bt_tbs_client_read_call_uri (struct bt_conn *conn, uint8_t inst_index)
 Read the call target URI of a TBS instance.
 
int bt_tbs_client_read_status_flags (struct bt_conn *conn, uint8_t inst_index)
 Read the feature and status value of a TBS instance.
 
int bt_tbs_client_read_call_state (struct bt_conn *conn, uint8_t inst_index)
 Read the states of the current calls of a TBS instance.
 
int bt_tbs_client_read_remote_uri (struct bt_conn *conn, uint8_t inst_index)
 Read the remote URI of a TBS instance.
 
int bt_tbs_client_read_friendly_name (struct bt_conn *conn, uint8_t inst_index)
 Read the friendly name of a call for a TBS instance.
 
int bt_tbs_client_read_optional_opcodes (struct bt_conn *conn, uint8_t inst_index)
 Read the supported opcode of a TBS instance.
 
void bt_tbs_client_register_cb (const struct bt_tbs_client_cb *cbs)
 Register the callbacks for CCP.
 
struct bt_tbs_instance * bt_tbs_client_get_by_ccid (const struct bt_conn *conn, uint8_t ccid)
 Look up Telephone Bearer Service instance by CCID.
 

Detailed Description

Public APIs for Bluetooth Telephone Bearer Service.

Copyright (c) 2020 Bose Corporation Copyright (c) 2021 Nordic Semiconductor ASA

SPDX-License-Identifier: Apache-2.0

Macro Definition Documentation

◆ BT_TBS_CALL_FLAG_SET_INCOMING

#define BT_TBS_CALL_FLAG_SET_INCOMING (   flag)    (flag &= ~BIT(0))

◆ BT_TBS_CALL_FLAG_SET_OUTGOING

#define BT_TBS_CALL_FLAG_SET_OUTGOING (   flag)    (flag |= BIT(0))

◆ BT_TBS_CALL_STATE_ACTIVE

#define BT_TBS_CALL_STATE_ACTIVE   0x03

◆ BT_TBS_CALL_STATE_ALERTING

#define BT_TBS_CALL_STATE_ALERTING   0x02

◆ BT_TBS_CALL_STATE_DIALING

#define BT_TBS_CALL_STATE_DIALING   0x01

◆ BT_TBS_CALL_STATE_INCOMING

#define BT_TBS_CALL_STATE_INCOMING   0x00

◆ BT_TBS_CALL_STATE_LOCALLY_AND_REMOTELY_HELD

#define BT_TBS_CALL_STATE_LOCALLY_AND_REMOTELY_HELD   0x06

◆ BT_TBS_CALL_STATE_LOCALLY_HELD

#define BT_TBS_CALL_STATE_LOCALLY_HELD   0x04

◆ BT_TBS_CALL_STATE_REMOTELY_HELD

#define BT_TBS_CALL_STATE_REMOTELY_HELD   0x05

◆ BT_TBS_FEATURE_HOLD

#define BT_TBS_FEATURE_HOLD   BIT(0)

◆ BT_TBS_FEATURE_JOIN

#define BT_TBS_FEATURE_JOIN   BIT(1)

◆ BT_TBS_GTBS_INDEX

#define BT_TBS_GTBS_INDEX   0xFF

The GTBS index denotes whenever a callback is from a Generic Telephone Bearer Service (GTBS) instance, or whenever the client should perform on action on the GTBS instance of the server, rather than any of the specific Telephone Bearer Service instances.

◆ BT_TBS_REASON_BAD_REMOTE_URI

#define BT_TBS_REASON_BAD_REMOTE_URI   0x00

◆ BT_TBS_REASON_CALL_FAILED

#define BT_TBS_REASON_CALL_FAILED   0x01

◆ BT_TBS_REASON_CLIENT_TERMINATED

#define BT_TBS_REASON_CLIENT_TERMINATED   0x06

◆ BT_TBS_REASON_LINE_BUSY

#define BT_TBS_REASON_LINE_BUSY   0x04

◆ BT_TBS_REASON_NETWORK_CONGESTED

#define BT_TBS_REASON_NETWORK_CONGESTED   0x05

◆ BT_TBS_REASON_REMOTE_ENDED_CALL

#define BT_TBS_REASON_REMOTE_ENDED_CALL   0x02

◆ BT_TBS_REASON_SERVER_ENDED_CALL

#define BT_TBS_REASON_SERVER_ENDED_CALL   0x03

◆ BT_TBS_REASON_UNSPECIFIED

#define BT_TBS_REASON_UNSPECIFIED   0x07

◆ BT_TBS_RESULT_CODE_INVALID_CALL_INDEX

#define BT_TBS_RESULT_CODE_INVALID_CALL_INDEX   0x03

◆ BT_TBS_RESULT_CODE_INVALID_URI

#define BT_TBS_RESULT_CODE_INVALID_URI   0x06

◆ BT_TBS_RESULT_CODE_OPCODE_NOT_SUPPORTED

#define BT_TBS_RESULT_CODE_OPCODE_NOT_SUPPORTED   0x01

◆ BT_TBS_RESULT_CODE_OPERATION_NOT_POSSIBLE

#define BT_TBS_RESULT_CODE_OPERATION_NOT_POSSIBLE   0x02

◆ BT_TBS_RESULT_CODE_OUT_OF_RESOURCES

#define BT_TBS_RESULT_CODE_OUT_OF_RESOURCES   0x05

◆ BT_TBS_RESULT_CODE_STATE_MISMATCH

#define BT_TBS_RESULT_CODE_STATE_MISMATCH   0x04

◆ BT_TBS_RESULT_CODE_SUCCESS

#define BT_TBS_RESULT_CODE_SUCCESS   0x00

◆ BT_TBS_SIGNAL_STRENGTH_MAX

#define BT_TBS_SIGNAL_STRENGTH_MAX   100

◆ BT_TBS_SIGNAL_STRENGTH_NO_SERVICE

#define BT_TBS_SIGNAL_STRENGTH_NO_SERVICE   0

◆ BT_TBS_SIGNAL_STRENGTH_UNKNOWN

#define BT_TBS_SIGNAL_STRENGTH_UNKNOWN   255

◆ BT_TBS_TECHNOLOGY_2G

#define BT_TBS_TECHNOLOGY_2G   0x08

◆ BT_TBS_TECHNOLOGY_3G

#define BT_TBS_TECHNOLOGY_3G   0x01

◆ BT_TBS_TECHNOLOGY_4G

#define BT_TBS_TECHNOLOGY_4G   0x02

◆ BT_TBS_TECHNOLOGY_5G

#define BT_TBS_TECHNOLOGY_5G   0x05

◆ BT_TBS_TECHNOLOGY_CDMA

#define BT_TBS_TECHNOLOGY_CDMA   0x07

◆ BT_TBS_TECHNOLOGY_GSM

#define BT_TBS_TECHNOLOGY_GSM   0x06

◆ BT_TBS_TECHNOLOGY_IP

#define BT_TBS_TECHNOLOGY_IP   0x0a

◆ BT_TBS_TECHNOLOGY_LTE

#define BT_TBS_TECHNOLOGY_LTE   0x03

◆ BT_TBS_TECHNOLOGY_WCDMA

#define BT_TBS_TECHNOLOGY_WCDMA   0x09

◆ BT_TBS_TECHNOLOGY_WIFI

#define BT_TBS_TECHNOLOGY_WIFI   0x04

Typedef Documentation

◆ bt_tbs_authorize_cb

typedef bool(* bt_tbs_authorize_cb) (struct bt_conn *conn)

Callback function for authorizing a client.

Only used if BT_TBS_AUTHORIZATION is enabled.

Parameters
connThe connection used.
Returns
true if authorized, false otherwise

◆ bt_tbs_call_change_cb

typedef void(* bt_tbs_call_change_cb) (struct bt_conn *conn, uint8_t call_index)

Callback function for client request call state change.

Parameters
connThe connection used.
call_indexThe call index.

◆ bt_tbs_client_call_states_cb

typedef void(* bt_tbs_client_call_states_cb) (struct bt_conn *conn, int err, uint8_t inst_index, uint8_t call_count, const struct bt_tbs_client_call_state *call_states)

Callback function for ccp_read_call_state.

Parameters
connThe connection used in the function.
errError value. BT_TBS_CLIENT_RESULT_CODE_*, GATT error or errno value.
inst_indexThe index of the TBS instance that was updated.
call_countNumber of call states read.
call_statesArray of call states. The array is not kept by the client, so must be copied to be saved.

◆ bt_tbs_client_cp_cb

typedef void(* bt_tbs_client_cp_cb) (struct bt_conn *conn, int err, uint8_t inst_index, uint8_t call_index)

Callback function for the CCP call control functions.

Parameters
connThe connection used in the function.
errError value. BT_TBS_CLIENT_RESULT_CODE_*, GATT error or errno value.
inst_indexThe index of the TBS instance that was updated.
call_indexThe call index. For bt_tbs_client_originate_call this will always be 0, and does not reflect the actual call index.

◆ bt_tbs_client_current_calls_cb

typedef void(* bt_tbs_client_current_calls_cb) (struct bt_conn *conn, int err, uint8_t inst_index, uint8_t call_count, const struct bt_tbs_client_call *calls)

Callback function for ccp_read_current_calls.

Parameters
connThe connection used in the function.
errError value. BT_TBS_CLIENT_RESULT_CODE_*, GATT error or errno value.
inst_indexThe index of the TBS instance that was updated.
call_countNumber of calls read.
callsArray of calls. The array is not kept by the client, so must be copied to be saved.

◆ bt_tbs_client_discover_cb

typedef void(* bt_tbs_client_discover_cb) (struct bt_conn *conn, int err, uint8_t tbs_count, bool gtbs_found)

Callback function for ccp_discover.

Parameters
connThe connection that was used to discover CCP for a device.
errError value. BT_TBS_CLIENT_RESULT_CODE_*, GATT error or errno value.
tbs_countNumber of TBS instances on peer device.
gtbs_foundWhether or not the server has a Generic TBS instance.

◆ bt_tbs_client_read_string_cb

typedef void(* bt_tbs_client_read_string_cb) (struct bt_conn *conn, int err, uint8_t inst_index, const char *value)

Callback function for functions that read a string value.

Parameters
connThe connection used in the function.
errError value. BT_TBS_CLIENT_RESULT_CODE_*, GATT error or errno value.
inst_indexThe index of the TBS instance that was updated.
valueThe Null-terminated string value. The value is not kept by the client, so must be copied to be saved.

◆ bt_tbs_client_read_value_cb

typedef void(* bt_tbs_client_read_value_cb) (struct bt_conn *conn, int err, uint8_t inst_index, uint32_t value)

Callback function for functions that read an integer value.

Parameters
connThe connection used in the function.
errError value. BT_TBS_CLIENT_RESULT_CODE_*, GATT error or errno value.
inst_indexThe index of the TBS instance that was updated.
valueThe integer value.

◆ bt_tbs_client_termination_reason_cb

typedef void(* bt_tbs_client_termination_reason_cb) (struct bt_conn *conn, int err, uint8_t inst_index, uint8_t call_index, uint8_t reason)

Callback function for ccp_read_termination_reason.

Parameters
connThe connection used in the function.
errError value. BT_TBS_CLIENT_RESULT_CODE_*, GATT error or errno value.
inst_indexThe index of the TBS instance that was updated.
call_indexThe call index.
reasonThe termination reason.

◆ bt_tbs_client_write_value_cb

typedef void(* bt_tbs_client_write_value_cb) (struct bt_conn *conn, int err, uint8_t inst_index)

Callback function for writing values to peer device.

Parameters
connThe connection used in the function.
errError value. BT_TBS_CLIENT_RESULT_CODE_*, GATT error or errno value.
inst_indexThe index of the TBS instance that was updated.

◆ bt_tbs_join_calls_cb

typedef void(* bt_tbs_join_calls_cb) (struct bt_conn *conn, uint8_t call_index_count, const uint8_t *call_indexes)

Callback function for client joining calls.

Parameters
connThe connection used.
call_index_countThe number of call indexes to join.
call_indexesThe call indexes.

◆ bt_tbs_originate_call_cb

typedef bool(* bt_tbs_originate_call_cb) (struct bt_conn *conn, uint8_t call_index, const char *uri)

Callback function for client originating a call.

Parameters
connThe connection used.
call_indexThe call index.
uriThe URI. The value may change, so should be copied if persistence is wanted.
Returns
true if the call request was accepted and remote party is alerted.

◆ bt_tbs_terminate_call_cb

typedef void(* bt_tbs_terminate_call_cb) (struct bt_conn *conn, uint8_t call_index, uint8_t reason)

Callback function for client terminating a call.

The call may be either terminated by the client or the server.

Parameters
connThe connection used.
call_indexThe call index.
reasonThe termination BT_TBS_REASON_* reason.

Function Documentation

◆ bt_tbs_accept()

int bt_tbs_accept ( uint8_t  call_index)

Accept an alerting call.

Parameters
call_indexThe index of the call that will be accepted.
Returns
int BT_TBS_RESULT_CODE_* if positive or 0, errno value if negative.

◆ bt_tbs_client_accept_call()

int bt_tbs_client_accept_call ( struct bt_conn *  conn,
uint8_t  inst_index,
uint8_t  call_index 
)

Accept an incoming call.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
call_indexThe call index to accept.
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_ACCEPT_CALL must be set for this function to be effective.

◆ bt_tbs_client_discover()

int bt_tbs_client_discover ( struct bt_conn *  conn)

Discover TBS for a connection.

This will start a GATT discover and setup handles and subscriptions.

Parameters
connThe connection to discover TBS for.
Returns
int 0 on success, GATT error value on fail.

◆ bt_tbs_client_get_by_ccid()

struct bt_tbs_instance * bt_tbs_client_get_by_ccid ( const struct bt_conn *  conn,
uint8_t  ccid 
)

Look up Telephone Bearer Service instance by CCID.

Parameters
connThe connection to the TBS server.
ccidThe CCID to lookup a service instance for.
Returns
Pointer to a Telephone Bearer Service instance if found else NULL.
Note
CONFIG_BT_TBS_CLIENT_CCID must be set for this function to be effective.

◆ bt_tbs_client_hold_call()

int bt_tbs_client_hold_call ( struct bt_conn *  conn,
uint8_t  inst_index,
uint8_t  call_index 
)

Request to hold a call.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
call_indexThe call index to place on hold.
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_HOLD_CALL must be set for this function to be effective.

◆ bt_tbs_client_join_calls()

int bt_tbs_client_join_calls ( struct bt_conn *  conn,
uint8_t  inst_index,
const uint8_t call_indexes,
uint8_t  count 
)

Join multiple calls.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
call_indexesArray of call indexes.
countNumber of call indexes in the call_indexes array.
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_JOIN_CALLS must be set for this function to be effective.

◆ bt_tbs_client_originate_call()

int bt_tbs_client_originate_call ( struct bt_conn *  conn,
uint8_t  inst_index,
const char *  uri 
)

Request to originate a call.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
uriThe URI of the callee.
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_ORIGINATE_CALL must be set for this function to be effective.

◆ bt_tbs_client_read_bearer_provider_name()

int bt_tbs_client_read_bearer_provider_name ( struct bt_conn *  conn,
uint8_t  inst_index 
)

Read the bearer provider name of a TBS instance.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_BEARER_PROVIDER_NAME must be set for this function to be effective.

◆ bt_tbs_client_read_bearer_uci()

int bt_tbs_client_read_bearer_uci ( struct bt_conn *  conn,
uint8_t  inst_index 
)

Read the UCI of a TBS instance.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_BEARER_UCI must be set for this function to be effective.

◆ bt_tbs_client_read_call_state()

int bt_tbs_client_read_call_state ( struct bt_conn *  conn,
uint8_t  inst_index 
)

Read the states of the current calls of a TBS instance.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
Returns
int 0 on success, errno value on fail.

◆ bt_tbs_client_read_call_uri()

int bt_tbs_client_read_call_uri ( struct bt_conn *  conn,
uint8_t  inst_index 
)

Read the call target URI of a TBS instance.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_INCOMING_URI must be set for this function to be effective.

◆ bt_tbs_client_read_ccid()

int bt_tbs_client_read_ccid ( struct bt_conn *  conn,
uint8_t  inst_index 
)

Read the content ID of a TBS instance.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_CCID must be set for this function to be effective.

◆ bt_tbs_client_read_current_calls()

int bt_tbs_client_read_current_calls ( struct bt_conn *  conn,
uint8_t  inst_index 
)

Read the list of current calls of a TBS instance.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_BEARER_LIST_CURRENT_CALLS must be set for this function to be effective.

◆ bt_tbs_client_read_friendly_name()

int bt_tbs_client_read_friendly_name ( struct bt_conn *  conn,
uint8_t  inst_index 
)

Read the friendly name of a call for a TBS instance.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_CALL_FRIENDLY_NAME must be set for this function to be effective.

◆ bt_tbs_client_read_optional_opcodes()

int bt_tbs_client_read_optional_opcodes ( struct bt_conn *  conn,
uint8_t  inst_index 
)

Read the supported opcode of a TBS instance.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_OPTIONAL_OPCODES must be set for this function to be effective.

◆ bt_tbs_client_read_remote_uri()

int bt_tbs_client_read_remote_uri ( struct bt_conn *  conn,
uint8_t  inst_index 
)

Read the remote URI of a TBS instance.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_INCOMING_CALL must be set for this function to be effective.

◆ bt_tbs_client_read_signal_interval()

int bt_tbs_client_read_signal_interval ( struct bt_conn *  conn,
uint8_t  inst_index 
)

Read the signal strength reporting interval of a TBS instance.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_READ_BEARER_SIGNAL_INTERVAL must be set for this function to be effective.

◆ bt_tbs_client_read_signal_strength()

int bt_tbs_client_read_signal_strength ( struct bt_conn *  conn,
uint8_t  inst_index 
)

Read the current signal strength of a TBS instance.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_BEARER_SIGNAL_STRENGTH must be set for this function to be effective.

◆ bt_tbs_client_read_status_flags()

int bt_tbs_client_read_status_flags ( struct bt_conn *  conn,
uint8_t  inst_index 
)

Read the feature and status value of a TBS instance.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_STATUS_FLAGS must be set for this function to be effective.

◆ bt_tbs_client_read_technology()

int bt_tbs_client_read_technology ( struct bt_conn *  conn,
uint8_t  inst_index 
)

Read the technology of a TBS instance.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_BEARER_TECHNOLOGY must be set for this function to be effective.

◆ bt_tbs_client_read_uri_list()

int bt_tbs_client_read_uri_list ( struct bt_conn *  conn,
uint8_t  inst_index 
)

Read the URI schemes list of a TBS instance.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_BEARER_URI_SCHEMES_SUPPORTED_LIST must be set for this function to be effective.

◆ bt_tbs_client_register_cb()

void bt_tbs_client_register_cb ( const struct bt_tbs_client_cb cbs)

Register the callbacks for CCP.

Parameters
cbsPointer to the callback structure.

◆ bt_tbs_client_retrieve_call()

int bt_tbs_client_retrieve_call ( struct bt_conn *  conn,
uint8_t  inst_index,
uint8_t  call_index 
)

Retrieve call from (local) hold.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
call_indexThe call index to retrieve.
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_RETRIEVE_CALL must be set for this function to be effective.

◆ bt_tbs_client_set_outgoing_uri()

int bt_tbs_client_set_outgoing_uri ( struct bt_conn *  conn,
uint8_t  inst_index,
const char *  uri 
)

Set the outgoing URI for a TBS instance on the peer device.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
uriThe Null-terminated URI string.
Returns
int 0 on success, errno value on fail.

◆ bt_tbs_client_set_signal_strength_interval()

int bt_tbs_client_set_signal_strength_interval ( struct bt_conn *  conn,
uint8_t  inst_index,
uint8_t  interval 
)

Set the signal strength reporting interval for a TBS instance.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
intervalThe interval to write (0-255 seconds).
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_SET_BEARER_SIGNAL_INTERVAL must be set for this function to be effective.

◆ bt_tbs_client_terminate_call()

int bt_tbs_client_terminate_call ( struct bt_conn *  conn,
uint8_t  inst_index,
uint8_t  call_index 
)

Request to terminate a call.

Parameters
connThe connection to the TBS server.
inst_indexThe index of the TBS instance.
call_indexThe call index to terminate.
Returns
int 0 on success, errno value on fail.
Note
CONFIG_BT_TBS_CLIENT_TERMINATE_CALL must be set for this function to be effective.

◆ bt_tbs_dbg_print_calls()

void bt_tbs_dbg_print_calls ( void  )

Prints all calls of all services to the debug log.

◆ bt_tbs_hold()

int bt_tbs_hold ( uint8_t  call_index)

Hold a call.

Parameters
call_indexThe index of the call that will be held.
Returns
int BT_TBS_RESULT_CODE_* if positive or 0, errno value if negative.

◆ bt_tbs_join()

int bt_tbs_join ( uint8_t  call_index_cnt,
uint8_t call_indexes 
)

Join calls.

Parameters
call_index_cntThe number of call indexes to join
call_indexesArray of call indexes to join.
Returns
int BT_TBS_RESULT_CODE_* if positive or 0, errno value if negative.

◆ bt_tbs_originate()

int bt_tbs_originate ( uint8_t  bearer_index,
char *  uri,
uint8_t call_index 
)

Originate a call.

Parameters
[in]bearer_indexThe index of the Telephone Bearer.
[in]uriThe remote URI.
[out]call_indexPointer to a value where the new call_index will be stored.
Returns
int A call index on success (positive value), errno value on fail.

◆ bt_tbs_register_cb()

void bt_tbs_register_cb ( struct bt_tbs_cb cbs)

Register the callbacks for TBS.

Parameters
cbsPointer to the callback structure.

◆ bt_tbs_remote_answer()

int bt_tbs_remote_answer ( uint8_t  call_index)

Notify the server that the remote party answered the call.

Parameters
call_indexThe index of the call that was answered.
Returns
int BT_TBS_RESULT_CODE_* if positive or 0, errno value if negative.

◆ bt_tbs_remote_hold()

int bt_tbs_remote_hold ( uint8_t  call_index)

Notify the server that the remote party held the call.

Parameters
call_indexThe index of the call that was held.
Returns
int BT_TBS_RESULT_CODE_* if positive or 0, errno value if negative.

◆ bt_tbs_remote_incoming()

int bt_tbs_remote_incoming ( uint8_t  bearer_index,
const char *  to,
const char *  from,
const char *  friendly_name 
)

Notify the server of an incoming call.

Parameters
bearer_indexThe index of the Telephone Bearer.
toThe URI that is receiving the call.
fromThe URI of the remote caller.
friendly_nameThe friendly name of the remote caller.
Returns
int New call index if positive or 0, errno value if negative.

◆ bt_tbs_remote_retrieve()

int bt_tbs_remote_retrieve ( uint8_t  call_index)

Notify the server that the remote party retrieved the call.

Parameters
call_indexThe index of the call that was retrieved.
Returns
int BT_TBS_RESULT_CODE_* if positive or 0, errno value if negative.

◆ bt_tbs_remote_terminate()

int bt_tbs_remote_terminate ( uint8_t  call_index)

Notify the server that the remote party terminated the call.

Parameters
call_indexThe index of the call that was terminated.
Returns
int BT_TBS_RESULT_CODE_* if positive or 0, errno value if negative.

◆ bt_tbs_retrieve()

int bt_tbs_retrieve ( uint8_t  call_index)

Retrieve a call.

Parameters
call_indexThe index of the call that will be retrieved.
Returns
int BT_TBS_RESULT_CODE_* if positive or 0, errno value if negative.

◆ bt_tbs_set_bearer_provider_name()

int bt_tbs_set_bearer_provider_name ( uint8_t  bearer_index,
const char *  name 
)

Set a new bearer provider.

Parameters
bearer_indexThe index of the Telephone Bearer or BT_TBS_GTBS_INDEX for GTBS.
nameThe new bearer provider name.
Returns
int BT_TBS_RESULT_CODE_* if positive or 0, errno value if negative.

◆ bt_tbs_set_bearer_technology()

int bt_tbs_set_bearer_technology ( uint8_t  bearer_index,
uint8_t  new_technology 
)

Set a new bearer technology.

Parameters
bearer_indexThe index of the Telephone Bearer or BT_TBS_GTBS_INDEX for GTBS.
new_technologyThe new bearer technology.
Returns
int BT_TBS_RESULT_CODE_* if positive or 0, errno value if negative.

◆ bt_tbs_set_signal_strength()

int bt_tbs_set_signal_strength ( uint8_t  bearer_index,
uint8_t  new_signal_strength 
)

Update the signal strength reported by the server.

Parameters
bearer_indexThe index of the Telephone Bearer or BT_TBS_GTBS_INDEX for GTBS.
new_signal_strengthThe new signal strength.
Returns
int BT_TBS_RESULT_CODE_* if positive or 0, errno value if negative.

◆ bt_tbs_set_status_flags()

int bt_tbs_set_status_flags ( uint8_t  bearer_index,
uint16_t  status_flags 
)

Sets the feature and status value.

Parameters
bearer_indexThe index of the Telephone Bearer or BT_TBS_GTBS_INDEX for GTBS.
status_flagsThe new feature and status value.
Returns
int BT_TBS_RESULT_CODE_* if positive or 0, errno value if negative.

◆ bt_tbs_set_uri_scheme_list()

int bt_tbs_set_uri_scheme_list ( uint8_t  bearer_index,
const char **  uri_list,
uint8_t  uri_count 
)

Sets the URI scheme list of a bearer.

Parameters
bearer_indexThe index of the Telephone Bearer.
uri_listList of URI prefixes (e.g. {"skype", "tel"}).
uri_countNumber of URI prefixies in uri_list.
Returns
BT_TBS_RESULT_CODE_* if positive or 0, errno value if negative.

◆ bt_tbs_terminate()

int bt_tbs_terminate ( uint8_t  call_index)

Terminate a call.

Parameters
call_indexThe index of the call that will be terminated.
Returns
int BT_TBS_RESULT_CODE_* if positive or 0, errno value if negative.