|
T-Box Basic dev
|
T-Box 语音和 eCall More...
Data Structures | |
| struct | tbox_voice_dial_request_t |
| 拨号请求。 More... | |
| struct | tbox_call_event_t |
| 通话状态事件。 More... | |
| struct | tbox_ecall_request_t |
| eCall 启动请求。 More... | |
| struct | tbox_ecall_event_t |
| eCall 状态事件。 More... | |
| struct | tbox_voice_event_t |
| 语音事件。 More... | |
Macros | |
| #define | TBOX_RIL_PHONE_NUMBER_MAX 32U |
| 包含结尾 NUL 的电话号码容量 | |
| #define | TBOX_RIL_ECALL_MSD_MAX 140U |
| eCall MSD 最大字节数 | |
Typedefs | |
| typedef void(* | tbox_voice_callback_t) (const tbox_voice_event_t *event, void *context) |
| 语音事件回调。 | |
Functions | |
| int | tbox_voice_register_callback (tbox_voice_callback_t callback, void *context) |
| 注册语音事件回调。 | |
| int | tbox_voice_unregister_callback (void) |
| 注销语音事件回调。 | |
| int | tbox_voice_dial (const tbox_voice_dial_request_t *request, uint32_t *call_id) |
| 发起通话。 | |
| int | tbox_voice_answer (uint32_t call_id) |
| 接听通话。 | |
| int | tbox_voice_hangup (uint32_t call_id) |
| 挂断通话。 | |
| int | tbox_voice_switch_active (void) |
| 切换活动通话。 | |
| int | tbox_voice_send_dtmf (char digit) |
| 发送 DTMF。 | |
| int | tbox_voice_set_volume (uint32_t volume) |
| 设置通话音量。 | |
| int | tbox_voice_get_volume (uint32_t *volume) |
| 查询通话音量。 | |
| int | tbox_voice_set_audio_mode (tbox_voice_audio_mode_t mode) |
| 设置音频承载方式。 | |
| int | tbox_voice_get_audio_mode (tbox_voice_audio_mode_t *mode) |
| 查询音频承载方式。 | |
| int | tbox_voice_get_call (uint32_t call_id, tbox_call_event_t *call, size_t *length) |
| 查询指定通话。 | |
| int | tbox_voice_start_ecall (const tbox_ecall_request_t *request) |
| 异步启动 eCall。 | |
| int | tbox_voice_set_ecall_test_number (tbox_ecall_number_type_t type, const char *number) |
| 设置测试 eCall 号码。 | |
| int | tbox_voice_set_ecall_msd (uint32_t call_id, const uint8_t *data, size_t length) |
| 更新指定 eCall 的 MSD。 | |
T-Box 语音和 eCall
接口均为线程安全的同步调用,调用前需通过
| typedef void(* tbox_voice_callback_t) (const tbox_voice_event_t *event, void *context) |
语音事件回调。
event 仅在回调期间有效。回调运行于 RIL 内部事件线程,应尽快返回,不得主动等待、 休眠或执行其他耗时操作;需要后续处理时,应复制事件并交由业务线程执行。
| event | 语音或 eCall 事件。 |
| context | 注册回调时提供的上下文,可为 NULL。 |
| enum tbox_call_status_t |
| enum tbox_call_type_t |
| enum tbox_ecall_status_t |
eCall 状态。
| enum tbox_ecall_trigger_t |
| enum tbox_ecall_variant_t |
| enum tbox_voice_slot_t |
| int tbox_voice_answer | ( | uint32_t | call_id | ) |
接听通话。
| call_id | 通话标识。 |
| int tbox_voice_dial | ( | const tbox_voice_dial_request_t * | request, |
| uint32_t * | call_id ) |
发起通话。
| request | 拨号请求,仅在调用期间借用。 |
| call_id | 输出通话标识。 |
| int tbox_voice_get_audio_mode | ( | tbox_voice_audio_mode_t * | mode | ) |
查询音频承载方式。
| mode | 输出音频承载方式。 |
| int tbox_voice_get_call | ( | uint32_t | call_id, |
| tbox_call_event_t * | call, | ||
| size_t * | length ) |
查询指定通话。
当 call 为 NULL 时,仅返回所需长度。
| call_id | 通话标识。 |
| call | 输出通话状态,可为 NULL。 |
| length | 输入缓冲区长度,输出实际或所需长度。 |
| int tbox_voice_get_volume | ( | uint32_t * | volume | ) |
查询通话音量。
| volume | 输出通话音量。 |
| int tbox_voice_hangup | ( | uint32_t | call_id | ) |
挂断通话。
| call_id | 通话标识。 |
| int tbox_voice_register_callback | ( | tbox_voice_callback_t | callback, |
| void * | context ) |
注册语音事件回调。
每个进程只允许注册一个回调。
| callback | 语音事件回调。 |
| context | 回调上下文,可为 NULL。 |
| int tbox_voice_send_dtmf | ( | char | digit | ) |
发送 DTMF。
| digit | 0 至 9、星号或井号。 |
| int tbox_voice_set_audio_mode | ( | tbox_voice_audio_mode_t | mode | ) |
设置音频承载方式。
| mode | 音频承载方式。 |
| int tbox_voice_set_ecall_msd | ( | uint32_t | call_id, |
| const uint8_t * | data, | ||
| size_t | length ) |
更新指定 eCall 的 MSD。
| call_id | eCall 通话标识。 |
| data | MSD,仅在调用期间借用。 |
| length | MSD 字节数,最大 140 字节。 |
| int tbox_voice_set_ecall_test_number | ( | tbox_ecall_number_type_t | type, |
| const char * | number ) |
设置测试 eCall 号码。
| type | 号码类型。 |
| number | NUL 结尾的测试号码或 URI;空字符串用于清除测试号码。 |
| int tbox_voice_set_volume | ( | uint32_t | volume | ) |
设置通话音量。
| volume | 音量等级,范围 0 至 5。 |
| int tbox_voice_start_ecall | ( | const tbox_ecall_request_t * | request | ) |
异步启动 eCall。
| request | eCall 请求,仅在调用期间借用。 |
| int tbox_voice_switch_active | ( | void | ) |
切换活动通话。
| int tbox_voice_unregister_callback | ( | void | ) |
注销语音事件回调。
返回后不会再启动新的语音事件回调。