Compare commits
7 Commits
dev-ai-con
...
dev
| Author | SHA1 | Date |
|---|---|---|
|
|
14c3520569 | |
|
|
20ca12fcda | |
|
|
e54a93a2ee | |
|
|
58e8a7b47c | |
|
|
706e0ecea2 | |
|
|
66a7389de5 | |
|
|
275b97deab |
|
|
@ -46,7 +46,7 @@ The name "Vela" is originated from the Latin term for "sail," which is also the
|
|||
|
||||
- **Standard Compliant and High Portability**
|
||||
|
||||
openvela Kernel is built upon Apache NuttX, which is often referred to as "tiny Linux". With this foundation, openvela achieves a high degree of conformity with the POSIX standard. Our team has been continually enhancing its POSIX compatibility, which has now reached an impressive 88%. Because of this standards conformance, software developed under other standard OSs (such as Linux) can be easily ported to openvela with minimum effort.
|
||||
openvela Kernel is built upon Apache NuttX, which is often referred to as "tiny Linux". With this foundation, openvela achieves a high degree of conformity with the POSIX standard. Our team has been continually enhancing its POSIX compatibility, which has now reached an impressive 89%. Because of this standards conformance, software developed under other standard OSs (such as Linux) can be easily ported to openvela with minimum effort.
|
||||
|
||||
- **Comprehensive Connectivity Suite**
|
||||
|
||||
|
|
@ -155,6 +155,7 @@ If you want to experience openvela, we provide a fully functional emulator that
|
|||
## Developer Documentation
|
||||
|
||||
- [Documentation Center](https://doc.openvela.com/document)
|
||||
- [API Reference](./en/api/index.md) — Complete API specification for kernel, network, and application framework interfaces
|
||||
|
||||
## Application Example Center
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ Vela 的命名源自拉丁语中船帆的含义,也是南方星空中船帆星
|
|||
|
||||
- **标准兼容和高可移植性**
|
||||
|
||||
openvela 内核基于 Apache NuttX ,这个被称为 "Tiny Linux" 的系统为 openvela 提供了高标准的 POSIX 兼容性。通过持续提升其 POSIX 兼容性,openvela 当前已达到 88% 的兼容水平。这种高标准的兼容性意味着在其他标准操作系统(例如 Linux)上开发的软件可以轻松迁移到 openvela,几乎不需要额外的工作。
|
||||
openvela 内核基于 Apache NuttX ,这个被称为 "Tiny Linux" 的系统为 openvela 提供了高标准的 POSIX 兼容性。通过持续提升其 POSIX 兼容性,openvela 当前已达到 89% 的兼容水平。这种高标准的兼容性意味着在其他标准操作系统(例如 Linux)上开发的软件可以轻松迁移到 openvela,几乎不需要额外的工作。
|
||||
|
||||
- **全面的连接套件**
|
||||
|
||||
|
|
@ -156,6 +156,7 @@ openvela 采用双分支模型来平衡系统的创新性与稳定性。请根
|
|||
## 开发者文档
|
||||
|
||||
- [文档中心](https://doc.openvela.com/document)
|
||||
- [API 参考文档](./zh-cn/api/index.md) — 内核接口、网络接口、应用框架 API 完整说明
|
||||
|
||||
## 应用示例中心
|
||||
|
||||
|
|
|
|||
|
|
@ -1,188 +0,0 @@
|
|||
\[ English | [简体中文](../../../../zh-cn/api/framework/bluetooth/bt_avrcp.md) \]
|
||||
|
||||
# Bluetooth AVRCP API
|
||||
|
||||
The openvela Bluetooth AVRCP (Audio/Video Remote Control Profile) interface supports playback control, track information queries, and more.
|
||||
|
||||
Header files: #include "bt_avrcp.h", #include "bt_avrcp_control.h", #include "bt_avrcp_target.h"
|
||||
|
||||
|
||||
## openvela Implementation Notes
|
||||
|
||||
- **Dual-role support**: Controller (control side) and Target (target side)
|
||||
- **Features**: Play/pause/skip tracks, volume control, track information retrieval
|
||||
|
||||
|
||||
## Synchronous Interfaces
|
||||
|
||||
|
||||
### bt_avrcp_control_unregister_callbacks
|
||||
|
||||
```c
|
||||
bool bt_avrcp_control_unregister_callbacks(bt_instance_t* ins, void* cookie);
|
||||
```
|
||||
|
||||
Unregister callback functions and stop receiving state change notifications.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `cookie` User context.
|
||||
|
||||
**Returns**:
|
||||
|
||||
Returns the callback cookie on success, or NULL on failure.
|
||||
|
||||
|
||||
### bt_avrcp_control_get_element_attributes
|
||||
|
||||
```c
|
||||
bt_status_t bt_avrcp_control_get_element_attributes(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
Get media element attributes from the remote device.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `addr` Bluetooth address of the remote device.
|
||||
|
||||
|
||||
**Returns**:
|
||||
|
||||
Returns BT_STATUS_SUCCESS on success, or an error code on failure.
|
||||
|
||||
|
||||
### bt_avrcp_control_send_passthrough_cmd
|
||||
|
||||
```c
|
||||
bt_status_t bt_avrcp_control_send_passthrough_cmd(bt_instance_t* ins, bt_address_t* addr, uint8_t cmd, uint8_t state);
|
||||
```
|
||||
|
||||
Send a passthrough command to the remote device.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `addr` Bluetooth address of the remote device.
|
||||
- `cmd` Command code.
|
||||
- `state` Key state.
|
||||
|
||||
|
||||
### bt_avrcp_control_get_unit_info
|
||||
|
||||
```c
|
||||
bt_status_t bt_avrcp_control_get_unit_info(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
Get unit information from the remote AVRCP device.
|
||||
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `addr` Bluetooth address of the remote device.
|
||||
|
||||
|
||||
### bt_avrcp_control_get_subunit_info
|
||||
|
||||
```c
|
||||
bt_status_t bt_avrcp_control_get_subunit_info(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
Get subunit information from the remote device.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `addr` Bluetooth address of the remote device.
|
||||
|
||||
|
||||
### bt_avrcp_control_get_playback_state
|
||||
|
||||
```c
|
||||
bt_status_t bt_avrcp_control_get_playback_state(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
Get the current playback state of the remote device.
|
||||
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `addr` Bluetooth address of the remote device.
|
||||
|
||||
|
||||
### bt_avrcp_control_register_notification
|
||||
|
||||
```c
|
||||
bt_status_t bt_avrcp_control_register_notification(bt_instance_t* ins, bt_address_t* addr, uint8_t event, uint32_t interval);
|
||||
```
|
||||
|
||||
Register for event notifications from the remote device.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `addr` Bluetooth address of the remote device.
|
||||
- `event` Event type.
|
||||
- `interval` Notification interval.
|
||||
|
||||
|
||||
### bt_avrcp_target_unregister_callbacks
|
||||
|
||||
```c
|
||||
bool bt_avrcp_target_unregister_callbacks(bt_instance_t* ins, void* cookie);
|
||||
```
|
||||
|
||||
Unregister callback functions and stop receiving state change notifications.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `cookie` User context.
|
||||
|
||||
**Returns**:
|
||||
|
||||
Returns the callback cookie on success, or NULL on failure.
|
||||
|
||||
|
||||
### bt_avrcp_target_get_play_status_response
|
||||
|
||||
```c
|
||||
bt_status_t bt_avrcp_target_get_play_status_response(bt_instance_t* ins, bt_address_t* addr, avrcp_play_status_t status, uint32_t song_len, uint32_t song_pos);
|
||||
```
|
||||
|
||||
Respond to a play status query from the remote device.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `addr` Bluetooth address of the peer device.
|
||||
- `status` Play status code.
|
||||
- `song_len` Song length in milliseconds.
|
||||
- `song_pos` Current playback position in milliseconds.
|
||||
|
||||
**Returns**:
|
||||
|
||||
Returns BT_STATUS_SUCCESS on success, or an error code on failure.
|
||||
|
||||
|
||||
### bt_avrcp_target_play_status_notify
|
||||
|
||||
```c
|
||||
bt_status_t bt_avrcp_target_play_status_notify(bt_instance_t* ins, bt_address_t* addr, avrcp_play_status_t status);
|
||||
```
|
||||
|
||||
Notify the remote device of a playback status change.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `addr` Bluetooth address of the remote device.
|
||||
- `status` Play status code.
|
||||
|
||||
|
||||
**Returns**:
|
||||
|
||||
Returns BT_STATUS_SUCCESS on success, or an error code on failure.
|
||||
|
|
@ -0,0 +1,217 @@
|
|||
\[ English | [简体中文](../../../../zh-cn/api/framework/bluetooth/bt_cs.md) \]
|
||||
|
||||
# Bluetooth Channel Sounding API
|
||||
|
||||
The openvela Bluetooth Channel Sounding (CS) interface provides distance measurement and positioning capabilities between Bluetooth devices. Based on the channel sounding technology introduced in the Bluetooth 5.4 specification, it supports centimeter-level ranging accuracy.
|
||||
|
||||
Header file: `#include <bt_cs.h>`
|
||||
|
||||
## openvela Implementation Notes
|
||||
|
||||
- **Ranging methods**: Supports automatic selection (AUTO), RSSI, and CS ranging methods
|
||||
- **Role model**: Supports Initiator and Reflector roles
|
||||
- **RAS features**: Supports real-time ranging data, lost data segment retrieval, abort operation, and data filtering
|
||||
- **Callback notifications**: Ranging start, stop, and result events are delivered asynchronously via callbacks
|
||||
- **Configuration dependency**: Test interface requires `CONFIG_BT_CS_RAS_TEST`
|
||||
|
||||
## Callback Management
|
||||
|
||||
### bt_cs_register_callbacks
|
||||
|
||||
```c
|
||||
void* bt_cs_register_callbacks(bt_instance_t* ins, const cs_callbacks_t* callbacks);
|
||||
```
|
||||
|
||||
Register CS event callback functions. After successful registration, the system notifies the application via callbacks when distance measurement starts, stops, or produces results.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `callbacks` CS event callback function set, see `cs_callbacks_t`.
|
||||
|
||||
**Returns**:
|
||||
|
||||
On success, returns a callback cookie (non-NULL) for later unregistration; on failure, returns NULL.
|
||||
|
||||
### bt_cs_unregister_callbacks
|
||||
|
||||
```c
|
||||
bool bt_cs_unregister_callbacks(bt_instance_t* ins, void* cookie);
|
||||
```
|
||||
|
||||
Unregister previously registered CS event callback functions.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `cookie` Cookie returned during callback registration.
|
||||
|
||||
**Returns**:
|
||||
|
||||
Returns `true` on success, `false` on failure.
|
||||
|
||||
## Distance Measurement
|
||||
|
||||
### bt_cs_start_distance_measurement
|
||||
|
||||
```c
|
||||
bt_status_t bt_cs_start_distance_measurement(bt_instance_t* ins, const bt_distance_measurement_params_t* params);
|
||||
```
|
||||
|
||||
Start distance measurement. Callbacks must be registered via `bt_cs_register_callbacks` before calling this function. Measurement results are delivered through the `cs_distance_measure_result_cb` callback.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `params` Distance measurement parameters, see `bt_distance_measurement_params_t`.
|
||||
|
||||
**Returns**:
|
||||
|
||||
Returns `BT_STATUS_SUCCESS` on success, or an error code on failure.
|
||||
|
||||
### bt_cs_stop_distance_measurement
|
||||
|
||||
```c
|
||||
bt_status_t bt_cs_stop_distance_measurement(bt_instance_t* ins, bt_address_t* addr, uint8_t method, bool timeout);
|
||||
```
|
||||
|
||||
Stop distance measurement.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `addr` Remote device address.
|
||||
- `method` Ranging method (AUTO/RSSI/CS).
|
||||
- `timeout` Whether stopping due to timeout.
|
||||
|
||||
**Returns**:
|
||||
|
||||
Returns `BT_STATUS_SUCCESS` on success, or an error code on failure.
|
||||
|
||||
## Capability Query
|
||||
|
||||
### bt_get_cs_max_supported_security_level
|
||||
|
||||
```c
|
||||
bt_status_t bt_get_cs_max_supported_security_level(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
Get the maximum CS security level supported by the remote device.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `addr` Remote device address.
|
||||
|
||||
**Returns**:
|
||||
|
||||
Returns `BT_STATUS_SUCCESS` on success, or an error code on failure.
|
||||
|
||||
## Configuration Management
|
||||
|
||||
### bt_cs_set_config
|
||||
|
||||
```c
|
||||
bt_status_t bt_cs_set_config(bt_instance_t* ins, bt_address_t* addr, const bt_cs_set_params_t* params);
|
||||
```
|
||||
|
||||
Set CS configuration parameters, including RAS features, role, antenna selection, and maximum transmit power.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `addr` Remote device address.
|
||||
- `params` CS configuration parameters, see `bt_cs_set_params_t`.
|
||||
|
||||
**Returns**:
|
||||
|
||||
Returns `BT_STATUS_SUCCESS` on success, or an error code on failure.
|
||||
|
||||
## Data Structures
|
||||
|
||||
### bt_distance_measurement_params_t
|
||||
|
||||
Distance measurement parameters structure.
|
||||
|
||||
| Field | Type | Description |
|
||||
| -------------------- | -------------- | ------------------------------------- |
|
||||
| `addr` | `bt_address_t` | Remote device address |
|
||||
| `method` | `uint8_t` | Ranging method (0=AUTO, 1=RSSI, 2=CS) |
|
||||
| `role` | `uint8_t` | Role (initiator/reflector) |
|
||||
| `interval_ms` | `uint16_t` | Measurement interval (milliseconds) |
|
||||
| `duration_ms` | `uint16_t` | Measurement duration (milliseconds) |
|
||||
| `submode` | `uint8_t` | CS submode |
|
||||
| `max_steps` | `uint8_t` | Maximum steps |
|
||||
| `mode0_steps` | `uint8_t` | Mode 0 steps |
|
||||
| `rtt_type` | `uint8_t` | RTT type |
|
||||
| `sync_phy` | `uint8_t` | Sync PHY |
|
||||
| `channel_map` | `uint8_t` | Channel map |
|
||||
| `antenna_paths_mask` | `uint8_t` | Antenna paths mask |
|
||||
| `vendor_specific` | `uint8_t` | Vendor-specific parameter |
|
||||
| `debug_flags` | `uint8_t` | Debug flags |
|
||||
|
||||
### bt_distance_measurement_result_t
|
||||
|
||||
Distance measurement result structure.
|
||||
|
||||
| Field | Type | Description |
|
||||
| --------------------------- | --------- | ------------------------------ |
|
||||
| `centimeter` | `uint8_t` | Distance (centimeters) |
|
||||
| `error_centimeter` | `uint8_t` | Distance error (centimeters) |
|
||||
| `azimuth_angle` | `uint8_t` | Azimuth angle |
|
||||
| `error_azimuthAngle` | `uint8_t` | Azimuth angle error |
|
||||
| `altitude_angle` | `uint8_t` | Altitude angle |
|
||||
| `error_altitudeAngle` | `uint8_t` | Altitude angle error |
|
||||
| `elapsed_realtime_nanos` | `long` | Elapsed realtime (nanoseconds) |
|
||||
| `confidence_level` | `uint8_t` | Confidence level |
|
||||
| `delay_spread_meters` | `double` | Delay spread (meters) |
|
||||
| `detected_attack_level` | `uint8_t` | Detected attack level |
|
||||
| `velocity_meters_persecond` | `double` | Velocity (meters/second) |
|
||||
| `method` | `uint8_t` | Ranging method used |
|
||||
|
||||
### bt_cs_set_params_t
|
||||
|
||||
CS configuration parameters structure.
|
||||
|
||||
| Field | Type | Description |
|
||||
| --------------------------- | ---------- | ------------------------------------------------- |
|
||||
| `ras_feature` | `uint32_t` | RAS feature bits (see macro definitions below) |
|
||||
| `role` | `uint8_t` | CS role bits (Bit 0: initiator, Bit 1: reflector) |
|
||||
| `cs_sync_antenna_selection` | `uint8_t` | CS_SYNC antenna selection |
|
||||
| `max_tx_power` | `int8_t` | Maximum TX power (dBm, range -127 to 20) |
|
||||
|
||||
### cs_callbacks_t
|
||||
|
||||
CS event callback function set.
|
||||
|
||||
| Field | Type | Description |
|
||||
| -------------------------------- | ---------------- | ------------------------------------- |
|
||||
| `size` | `size_t` | Structure size |
|
||||
| `cs_distance_measure_started_cb` | Function pointer | Distance measurement started callback |
|
||||
| `cs_distance_measure_stopped_cb` | Function pointer | Distance measurement stopped callback |
|
||||
| `cs_distance_measure_result_cb` | Function pointer | Distance measurement result callback |
|
||||
|
||||
## Macro Definitions
|
||||
|
||||
### RAS Feature Bits
|
||||
|
||||
| Macro | Value | Description |
|
||||
| --------------------------------------- | ----- | ----------------------------------- |
|
||||
| `BT_CS_RAS_REAL_TIME_RANGING_DATA` | 0x01 | Real-time ranging data |
|
||||
| `BT_CS_RAS_RETRIEVE_LOST_DATA_SEGMENTS` | 0x02 | Retrieve lost ranging data segments |
|
||||
| `BT_CS_RAS_ABORT_OPERATION` | 0x04 | Abort operation |
|
||||
| `BT_CS_RAS_FILTER_RANGING_DATA` | 0x08 | Filter ranging data |
|
||||
|
||||
### Antenna Selection
|
||||
|
||||
| Macro | Value | Description |
|
||||
| ---------------------------------- | ----- | ---------------------------------------------- |
|
||||
| `BT_CS_ANTENNA_SEL_1` | 0x01 | Use antenna identifier 1 |
|
||||
| `BT_CS_ANTENNA_SEL_2` | 0x02 | Use antenna identifier 2 |
|
||||
| `BT_CS_ANTENNA_SEL_3` | 0x03 | Use antenna identifier 3 |
|
||||
| `BT_CS_ANTENNA_SEL_4` | 0x04 | Use antenna identifier 4 |
|
||||
| `BT_CS_ANTENNA_SEL_SINGLE_REPEATE` | 0xFD | Antenna identifiers in single repetitive order |
|
||||
| `BT_CS_ANTENNA_SEL_DOUBLE_REPEATE` | 0xFE | Antenna identifiers in double repetitive order |
|
||||
| `BT_CS_ANTENNA_SEL_NO_RECOMMEND` | 0xFF | Host has no recommendation |
|
||||
|
||||
**openvela extension interface.**
|
||||
|
|
@ -1,139 +0,0 @@
|
|||
\[ English | [简体中文](../../../../zh-cn/api/framework/bluetooth/bt_le_advertiser.md) \]
|
||||
|
||||
# Bluetooth BLE Advertising API
|
||||
|
||||
The openvela Bluetooth BLE advertising interface is used to send BLE advertising data and manage advertising instances.
|
||||
|
||||
Header file: `#include "bt_le_advertiser.h"`
|
||||
|
||||
|
||||
## openvela Implementation Notes
|
||||
|
||||
- **Advertising types**: Supports connectable advertising, non-connectable advertising, scan response, etc.
|
||||
- **Advertising data**: Supports custom advertising data and scan response data
|
||||
- **Multiple instances**: Supports running multiple advertising instances simultaneously
|
||||
|
||||
|
||||
## Synchronous Interfaces
|
||||
|
||||
|
||||
### bt_le_stop_advertising
|
||||
|
||||
```c
|
||||
void bt_le_stop_advertising(bt_instance_t* ins, bt_advertiser_t* adver);
|
||||
```
|
||||
|
||||
Stop BLE advertising.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `adver` Advertiser instance.
|
||||
|
||||
**Returns**:
|
||||
|
||||
None.
|
||||
|
||||
|
||||
### bt_le_stop_advertising_id
|
||||
|
||||
```c
|
||||
void bt_le_stop_advertising_id(bt_instance_t* ins, uint8_t adv_id);
|
||||
```
|
||||
|
||||
Stop the BLE advertising instance with the specified ID.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `adv_id` Advertising instance ID.
|
||||
|
||||
|
||||
### bt_le_advertising_is_supported
|
||||
|
||||
```c
|
||||
bool bt_le_advertising_is_supported(bt_instance_t* ins);
|
||||
```
|
||||
|
||||
Query whether BLE advertising is supported.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
|
||||
|
||||
**Returns**:
|
||||
|
||||
Returns true if BLE advertising is supported, false otherwise.
|
||||
|
||||
|
||||
## Asynchronous Interfaces
|
||||
|
||||
|
||||
### bt_le_start_advertising_async
|
||||
|
||||
```c
|
||||
bt_status_t bt_le_start_advertising_async(bt_instance_t* ins, ble_adv_params_t* params, uint8_t* adv_data, uint16_t adv_len, uint8_t* scan_rsp_data, uint16_t scan_rsp_len, advertiser_callback_t* adv_cbs, bt_le_start_adv_callback_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
Start BLE advertising (asynchronous version).
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `params` Advertising parameters structure.
|
||||
- `adv_data` Advertising data.
|
||||
- `adv_len` Advertising data length.
|
||||
- `scan_rsp_data` Scan response data.
|
||||
- `scan_rsp_len` Scan response data length.
|
||||
- `adv_cbs` Advertiser callback function set.
|
||||
- `cb` Completion callback function.
|
||||
- `userdata` User data.
|
||||
|
||||
|
||||
### bt_le_stop_advertising_async
|
||||
|
||||
```c
|
||||
bt_status_t bt_le_stop_advertising_async(bt_instance_t* ins, bt_advertiser_t* adver, bt_status_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
Stop BLE advertising (asynchronous version).
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `adver` Advertiser instance.
|
||||
- `cb` Completion callback function.
|
||||
- `userdata` User data.
|
||||
|
||||
|
||||
|
||||
### bt_le_stop_advertising_id_async
|
||||
|
||||
```c
|
||||
bt_status_t bt_le_stop_advertising_id_async(bt_instance_t* ins, uint8_t adv_id, bt_status_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
Stop BLE advertising by specified ID (asynchronous version).
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `adv_id` Advertising instance ID.
|
||||
- `cb` Completion callback function.
|
||||
- `userdata` User data.
|
||||
|
||||
|
||||
### bt_le_advertising_is_supported_async
|
||||
|
||||
```c
|
||||
bt_status_t bt_le_advertising_is_supported_async(bt_instance_t* ins, bt_bool_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
Query whether BLE advertising is supported (asynchronous version).
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `cb` Completion callback function.
|
||||
- `userdata` User data.
|
||||
|
|
@ -1,141 +0,0 @@
|
|||
\[ English | [简体中文](../../../../zh-cn/api/framework/bluetooth/bt_le_scan.md) \]
|
||||
|
||||
# Bluetooth BLE Scanning API
|
||||
|
||||
The openvela Bluetooth BLE scanning interface is used to discover nearby BLE devices and receive broadcast data.
|
||||
|
||||
Header file: `#include "bt_le_scan.h"`
|
||||
|
||||
|
||||
## openvela Implementation Notes
|
||||
|
||||
- **Scan modes**: Supports passive scanning and active scanning
|
||||
- **Filters**: Supports filtering scan results by name, address, UUID, and other criteria
|
||||
- **Callback notifications**: Scan results are returned asynchronously via callback functions
|
||||
|
||||
|
||||
## Synchronous Interfaces
|
||||
|
||||
|
||||
### bt_le_stop_scan
|
||||
|
||||
```c
|
||||
void bt_le_stop_scan(bt_instance_t* ins, bt_scanner_t* scanner);
|
||||
```
|
||||
|
||||
Stop BLE scanning.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `scanner` Scanner instance.
|
||||
- `ins` Bluetooth client instance.
|
||||
|
||||
**Returns**:
|
||||
|
||||
None.
|
||||
|
||||
|
||||
### bt_le_scan_is_supported
|
||||
|
||||
```c
|
||||
bool bt_le_scan_is_supported(bt_instance_t* ins);
|
||||
```
|
||||
|
||||
Query whether BLE scanning is supported.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
|
||||
|
||||
**Returns**:
|
||||
|
||||
Returns true if BLE scanning is supported, false otherwise.
|
||||
|
||||
|
||||
## Asynchronous Interfaces
|
||||
|
||||
|
||||
### bt_le_start_scan_async
|
||||
|
||||
```c
|
||||
bt_status_t bt_le_start_scan_async(bt_instance_t* ins, const scanner_callbacks_t* scan_cbs, bt_le_start_scan_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
Start BLE scanning (asynchronous version).
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `scan_cbs` Scanner callback function set.
|
||||
- `cb` Completion callback function.
|
||||
- `userdata` User data.
|
||||
|
||||
|
||||
### bt_le_start_scan_settings_async
|
||||
|
||||
```c
|
||||
bt_status_t bt_le_start_scan_settings_async(bt_instance_t* ins, ble_scan_settings_t* settings, const scanner_callbacks_t* scan_cbs, bt_le_start_scan_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
Start BLE scanning with custom settings (asynchronous version).
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `settings` Scan settings.
|
||||
- `scan_cbs` Scanner callback function set.
|
||||
- `cb` Completion callback function.
|
||||
- `userdata` User data.
|
||||
|
||||
|
||||
|
||||
### bt_le_start_scan_with_filters_async
|
||||
|
||||
```c
|
||||
bt_status_t bt_le_start_scan_with_filters_async(bt_instance_t* ins, ble_scan_settings_t* settings, ble_scan_filter_t* filter, const scanner_callbacks_t* scan_cbs, bt_le_start_scan_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
Start BLE scanning with filters (asynchronous version).
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `settings` Scan settings.
|
||||
- `filter` Filter criteria.
|
||||
- `scan_cbs` Scanner callback function set.
|
||||
- `cb` Completion callback function.
|
||||
- `userdata` User data.
|
||||
|
||||
|
||||
### bt_le_stop_scan_async
|
||||
|
||||
```c
|
||||
bt_status_t bt_le_stop_scan_async(bt_instance_t* ins, bt_scanner_t* scanner, bt_le_stop_scan_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
Stop BLE scanning (asynchronous version).
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `scanner` Scanner instance.
|
||||
- `cb` Completion callback function.
|
||||
- `userdata` User data.
|
||||
|
||||
|
||||
|
||||
|
||||
### bt_le_scan_is_supported_async
|
||||
|
||||
```c
|
||||
bt_status_t bt_le_scan_is_supported_async(bt_instance_t* ins, bt_bool_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
Query whether BLE scanning is supported (asynchronous version).
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `ins` Bluetooth client instance.
|
||||
- `cb` Completion callback function.
|
||||
- `userdata` User data.
|
||||
|
|
@ -10,17 +10,15 @@ The openvela Bluetooth framework provides a complete Bluetooth stack interface,
|
|||
- **[GATT](bt_gatt.md)** (Generic Attribute Profile) — BLE data attribute read/write and notifications
|
||||
- **[Device Management](bt_device.md)** — Remote device pairing, connection, and property queries
|
||||
|
||||
## BLE Interfaces
|
||||
|
||||
- **[BLE Scanning](bt_le_scan.md)** — BLE device discovery and broadcast data reception
|
||||
- **[BLE Advertising](bt_le_advertiser.md)** — BLE advertising data transmission and management
|
||||
|
||||
## Audio and Media
|
||||
|
||||
- **[A2DP](bt_a2dp.md)** (Advanced Audio Distribution Profile) — High-quality stereo music streaming
|
||||
- **[AVRCP](bt_avrcp.md)** (Audio/Video Remote Control Profile) — Playback control, track change, volume adjustment
|
||||
- **[HFP](bt_hfp.md)** (Hands-Free Profile) — Bluetooth call functionality
|
||||
|
||||
## Positioning and Ranging
|
||||
|
||||
- **[CS](bt_cs.md)** (Channel Sounding) — Bluetooth channel sounding for distance measurement and positioning
|
||||
|
||||
## Data and Peripherals
|
||||
|
||||
- **[HID](bt_hid.md)** (Human Interface Device) — Keyboards, mice, game controllers
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ Header: `#include <media_utils.h>`
|
|||
## openvela Implementation Notes
|
||||
|
||||
- **DTMF**: Generates DTMF dual-tone multi-frequency signals for `0-9` / `*#ABCD` keys, with a fixed audio format of `format=s16le:sample_rate=8000:ch_layout=mono` (defined by the `MEDIA_TONE_DTMF_FORMAT` macro)
|
||||
- **Debug Interfaces**: `media_graph_dump` and `media_policy_dump` print internal state for troubleshooting
|
||||
- **Debug Interfaces**: `media_graph_dump`, `media_player_dump`, `media_recorder_dump` and `media_policy_dump` print internal state for troubleshooting
|
||||
- **Generic Command**: `media_process_command` sends custom commands to the media server for extended capabilities (e.g., triggering an operation on a specific filter within a graph)
|
||||
- **Event Name Lookup**: `media_event_get_name` converts `MEDIA_EVENT_*` numeric values to human-readable strings for log output
|
||||
|
||||
|
|
@ -103,6 +103,33 @@ Prints the current state of the media policy for debugging.
|
|||
|
||||
- `options` Dump options string.
|
||||
|
||||
|
||||
### media_player_dump
|
||||
|
||||
```c
|
||||
void media_player_dump(const char* options);
|
||||
```
|
||||
|
||||
Prints the internal state of the media player for debugging.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `options` Dump options string.
|
||||
|
||||
|
||||
### media_recorder_dump
|
||||
|
||||
```c
|
||||
void media_recorder_dump(const char* options);
|
||||
```
|
||||
|
||||
Prints the internal state of the media recorder for debugging.
|
||||
|
||||
**Parameters**:
|
||||
|
||||
- `options` Dump options string.
|
||||
|
||||
|
||||
## Generic Command
|
||||
|
||||
### media_process_command
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ TAPI is independent of the openvela telephony core stack. Its internal logic use
|
|||
## openvela Implementation Notes
|
||||
|
||||
- **Architecture**: TAPI encapsulates the Telephony Core Stack (oFono) via D-Bus, exposing standard C interfaces externally
|
||||
- **Multi-SIM support**: Different SIM slots are distinguished via the `slot_id` parameter
|
||||
- **SIM identification**: Different SIM slots are distinguished via the `slot_id` parameter
|
||||
- **Asynchronous model**: Most operations return results asynchronously through callback functions
|
||||
|
||||
## Module Overview
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ Header: `#include <tapi_call.h>`
|
|||
|
||||
## openvela Implementation Notes
|
||||
|
||||
- **Multi-SIM support**: Some interfaces do not take a `slot_id` and use the default slot; use `tapi_call_set_default_slot` to switch when a specific slot is needed
|
||||
- **SIM identification**: Some interfaces do not take a `slot_id` and use the default slot; use `tapi_call_set_default_slot` to switch when a specific slot is needed
|
||||
- **Synchronous/Asynchronous**: Time-consuming operations such as dialing and answering provide both synchronous versions and `_async` versions (callback-style)
|
||||
- **Operate by ID**: Long-lived calls are uniquely identified by the call ID (string) returned; `*_by_id` interfaces operate on the call accordingly
|
||||
- **DTMF**: Keypad tones are triggered via `tapi_call_send_tones` (batch) or `tapi_call_start_dtmf` / `tapi_call_stop_dtmf` (continuous key press)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Header: `#include <tapi_cbs.h>`
|
|||
- **Power control**: Enable/disable cell broadcast reception via `set_cell_broadcast_power_on`
|
||||
- **Topic subscription**: Configure broadcast topic ranges (by channel ID) via `set_cell_broadcast_topics`
|
||||
- **Event callback**: Register event callbacks via `tapi_cbs_register` to receive broadcast messages
|
||||
- **Multi-SIM support**: All interfaces include a `slot_id` parameter for multi-SIM devices
|
||||
- **SIM identification**: All interfaces include a `slot_id` parameter for multi-SIM devices
|
||||
- **Related protocol**: Corresponds to the Cell Broadcast procedure defined in 3GPP TS 23.041
|
||||
|
||||
## Power Control
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Header file: `#include <tapi_data.h>`
|
|||
- **APN context**: Manage APN configurations (add/remove/edit/query) via the `tapi_data_*_apn_context` series of interfaces
|
||||
- **On-demand connection**: `tapi_data_request_network` / `tapi_data_release_network` controls data network establishment and release
|
||||
- **Roaming control**: Explicitly toggle data roaming via `tapi_data_enable_roaming`
|
||||
- **Multi-SIM support**: Operations involving a specific SIM use the `slot_id` parameter; the default data SIM is set via `tapi_data_set_default_slot`
|
||||
- **SIM identification**: Operations involving a specific SIM use the `slot_id` parameter; the default data SIM is set via `tapi_data_set_default_slot`
|
||||
- **State subscription**: `tapi_data_register` / `tapi_data_unregister` for registering/unregistering state change events
|
||||
|
||||
## APN Configuration Management
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Header: `#include <tapi_ims.h>`
|
|||
- **Registration Status**: Queries whether IMS is registered to the network, subscribes to registration state change events
|
||||
- **Service Switch**: `set_service_status` controls enabling of specific services (e.g. voice, video)
|
||||
- **VoLTE Support**: Queries whether the current network supports VoLTE via `is_volte_available`
|
||||
- **Multi-SIM Support**: All interfaces include a `slot_id` parameter
|
||||
- **SIM identification**: All interfaces include a `slot_id` parameter
|
||||
|
||||
## IMS Switch
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ Header: `#include <tapi_manager.h>`
|
|||
## openvela Implementation Notes
|
||||
|
||||
- **D-Bus Based**: TAPI Manager communicates with the Telephony Core Stack (oFono) via D-Bus, exposing standard C interfaces externally
|
||||
- **Multi-SIM Support**: The manager layer does not directly handle SIM slot selection; slot-specific operations use the `slot_id` parameter in submodules such as `tapi_sim`
|
||||
- **SIM identification**: The manager layer does not directly handle SIM slot selection; slot-specific operations use the `slot_id` parameter in submodules such as `tapi_sim`
|
||||
- **Client Handle**: Obtain a `tapi_context` via `tapi_open`; all subsequent calls take this context as the first parameter
|
||||
- **Event Subscription**: Register event callbacks via `tapi_register`, unsubscribe via `tapi_unregister`
|
||||
- **Synchronous vs Asynchronous**: Most interfaces are asynchronous (with callbacks); some provide `*_sync` variants for simple scenarios
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Header: `#include <tapi_network.h>`
|
|||
- **Network selection mode**: Supports automatic selection (`select_auto`) and manual selection (`select_manual`)
|
||||
- **Scanning**: `tapi_network_scan` scans for available network operators
|
||||
- **Cell information**: `get_serving_cellinfos` retrieves the current serving cell, `get_neighbouring_cellinfos` retrieves neighboring cells
|
||||
- **Multi-SIM support**: Most interfaces include a `slot_id` parameter to distinguish network state across different SIM slots
|
||||
- **SIM identification**: Most interfaces include a `slot_id` parameter to distinguish network state across different SIM slots
|
||||
- **Event subscription**: `tapi_network_register` / `tapi_network_unregister` monitor registration state and signal strength changes
|
||||
|
||||
## Network Selection and Scanning
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Header: `#include <tapi_phonebook.h>`
|
|||
- **ADN**: Abbreviated Dialling Numbers, regular numbers stored on the SIM card
|
||||
- **FDN**: Fixed Dialling Numbers; when enabled, the phone can only dial numbers in the FDN list, protected by PIN2
|
||||
- **FDN operations require PIN2**: `insert_fdn_entry` / `delete_fdn_entry` / `update_fdn_entry` calls require PIN2
|
||||
- **Multi-SIM support**: All interfaces include a `slot_id` parameter
|
||||
- **SIM identification**: All interfaces include a `slot_id` parameter
|
||||
- **Asynchronous callbacks**: All operations return results asynchronously via `tapi_async_function`
|
||||
|
||||
## ADN Phonebook
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ Header file: `#include <tapi_sim.h>`
|
|||
|
||||
## openvela Implementation Notes
|
||||
|
||||
- **Multi-SIM support**: All interfaces include `slot_id` to support multi-SIM devices
|
||||
- **SIM management**: All interfaces include `slot_id` parameter for SIM card identification
|
||||
- **PIN management**: Provides `enter_pin` / `change_pin` / `reset_pin` / `lock_pin` / `unlock_pin` for complete PIN/PUK workflows
|
||||
- **APDU channel**: Use `open_logical_channel` / `close_logical_channel` / `transmit_apdu_*` to send APDU commands directly to the SIM card
|
||||
- **UICC switch**: Control SIM card enablement state via `get_uicc_enablement` / `set_uicc_enablement`
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Header file: `#include <tapi_ss.h>`
|
|||
- **CLIR/CLIP**: Calling line identification display and restriction via `calling_line_restriction` and `calling_line_presentation_info` interfaces
|
||||
- **USSD**: `tapi_ss_send_ussd` sends `*#xxxx#` commands, `tapi_ss_cancel_ussd` cancels the session
|
||||
- **FDN**: Fixed Dialing Number switch via `tapi_ss_enable_fdn` / `tapi_ss_query_fdn`
|
||||
- **Multi-SIM support**: All interfaces include `slot_id`
|
||||
- **SIM identification**: All interfaces include `slot_id`
|
||||
- **Asynchronous callback**: All operations use `tapi_async_function`
|
||||
|
||||
## Call Barring
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Header file: `#include <tapi_stk.h>`
|
|||
- **Registration levels**: Supports per-slot Agent (via `tapi_stk_agent_register`) and default Agent (system default UI).
|
||||
- **Main menu**: `tapi_stk_get_main_menu*` queries the main menu structure provided by the SIM card.
|
||||
- **Proactive Command responses**: The `tapi_stk_handle_agent_*` family of interfaces is used to send the Agent's responses to SIM card proactive commands back to the SIM.
|
||||
- **Multi-SIM support**: All interfaces include a `slot_id` parameter.
|
||||
- **SIM identification**: All interfaces include a `slot_id` parameter.
|
||||
|
||||
## Agent Registration
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ Header files: `#include <netutils/dhcpc.h>`, `#include <netutils/dhcp6c.h>`, `#i
|
|||
## openvela Implementation Notes
|
||||
|
||||
- **IPv4 client**: The `dhcpc_*` series encapsulates the complete DHCP client state machine (DISCOVER/OFFER/REQUEST/ACK)
|
||||
- **IPv6 client**: The `dhcp6c_*` series handles the IPv6 SLAAC / DHCPv6 process
|
||||
- **IPv6 client**: The `dhcp6c_*` series implements the DHCPv6 client protocol
|
||||
- **Server**: The `dhcpd_*` series provides simple DHCP server capabilities for IP allocation in hotspot/AP mode
|
||||
- **Asynchronous calls**: The `*_request_async` interfaces provide callback-based invocation to avoid blocking the current thread
|
||||
- **Configuration dependency**: Requires enabling `CONFIG_NETUTILS_DHCPC` / `CONFIG_NETUTILS_DHCP6C` / `CONFIG_NETUTILS_DHCPD`
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ Yes, the community has a contribution incentive mechanism. For detailed reward r
|
|||
|
||||
### 3. When will the IDE be released?
|
||||
|
||||
It is expected to be officially released in early 2026.
|
||||
It has been released. openvela now ships an official VS Code plugin that supports the full development lifecycle on Ubuntu — project creation, build, system debugging, and application development. See the [openvela VS Code Plugin User Guide](../quickstart/vscode_plugin_usage.md) for details.
|
||||
|
||||
### 4. Is there a difference between the Gitee and GitHub versions of the source code repository?
|
||||
|
||||
|
|
@ -147,7 +147,7 @@ Debugging communication business on real machines has a high threshold (requires
|
|||
|
||||
### 24. Can the RPK file generated by Quick App packaging run directly on openvela devices?
|
||||
|
||||
Currently, it cannot. The Quick App framework engine (Runtime) is planned to be open-sourced in library form and integrated into the system around **February 2026**. At this stage, it is recommended to use the simulator for learning and development.
|
||||
Currently, it cannot. The Quick App framework engine (Runtime) is planned to be open-sourced in library form and integrated into the system around **June 2026**. At this stage, it is recommended to use the simulator for learning and development.
|
||||
|
||||
## V. Hardware Adaptation and Porting
|
||||
|
||||
|
|
|
|||
|
|
@ -80,25 +80,11 @@ This openvela trunk-5.5 release brings comprehensive enhancements and improvemen
|
|||
|
||||
### Bluetooth
|
||||
|
||||
#### Connection Manager Rewrite
|
||||
|
||||
- Full refactor of the ACL connection manager
|
||||
- SPP, HID, A2DP, AVRCP, HFP and other profiles adapted to the new connection management API
|
||||
- Profile callback mechanism optimized: from asynchronous dispatch to direct callback
|
||||
- Multi-connection support and stability fixes
|
||||
|
||||
#### Protocol & Profile Upgrades
|
||||
|
||||
- AVRCP upgraded from 3.0 to 4.0
|
||||
- GATT database hash computation and persistent storage (KVDB)
|
||||
- GATT Service Changed indication support
|
||||
- BLE Privacy configurable via Kconfig
|
||||
- SPP `connect_with_option` API
|
||||
- DID Profile build support
|
||||
|
||||
#### Stability
|
||||
|
||||
- Fixes for use-after-free, null pointer dereference, double free, resource leaks, and more
|
||||
- AVRCP version update with support for richer operation commands
|
||||
- GATT caching mechanism, significantly improving connection speed
|
||||
- Support for custom BLE Security Levels
|
||||
- Enhanced SPP, HID, A2DP, HFP, SPP and other protocols, improving compatibility and resolving known issues
|
||||
- Fixed other known issues, enhancing subsystem stability
|
||||
|
||||
### Connectivity Framework
|
||||
|
||||
|
|
@ -260,17 +246,17 @@ This release open-sources the entire QuickApp development stack, covering the JS
|
|||
|
||||
A lightweight JavaScript engine based on an enhanced fork of Fabrice Bellard's QuickJS. It preserves the original lightweight, fast, and high-compatibility characteristics while integrating a set of new features, especially around developer tooling and debugging support, making it a more complete JavaScript runtime environment.
|
||||
|
||||
- [runtime_feature](./../../../../../frameworks_runtimes_feature)
|
||||
- [runtime_feature](../../../../../frameworks_runtimes_feature)
|
||||
|
||||
The QuickApp Feature framework runtime core library and tools. Developed in C/C++ for efficient JavaScript-to-native interoperability. The architecture consists of three core components: a runtime framework that provides a JS-native execution environment, a JIDL (Interface Description Language) and toolchain for auto-generating bi-directional invocation interfaces, and a standardized set of native developer APIs.
|
||||
|
||||
- [runtime_ash](./../../../../../frameworks_runtimes_ash)
|
||||
- [runtime_ash](../../../../../frameworks_runtimes_ash)
|
||||
|
||||
The openvela application Shell runtime environment. A lightweight C++ runtime foundation library for embedded systems, providing efficient and reliable low-level components for resource-constrained environments. The modular design covers: resource management (Bundle), system security (Crash handling), device info abstraction (Device Info), file system wrappers (File), file-descriptor management (Scoped FD), message-loop mechanism (Message Loop), stream processing, string conversion, threading, time/timer, networking, memory management, and debug tracing. Built with the GN build system, with CMake support via `CMakeLists.txt`, and compatible with the Kconfig configuration system, suitable for real-time operating systems such as NuttX.
|
||||
|
||||
### AI Agent
|
||||
|
||||
openvela [AI Agent](./../../../../../packages_ai_agent) is an AI agent engine designed to run on small devices such as watches, speakers, glasses, and earphones. Architecturally, the engine builds a full-stack intelligence pipeline from perception and memory to reasoning and execution, truly enabling devices to make autonomous decisions and deliver proactive services.
|
||||
openvela [AI Agent](../../../../../packages_ai_agent) is an AI agent engine designed to run on small devices such as watches, speakers, glasses, and earphones. Architecturally, the engine builds a full-stack intelligence pipeline from perception and memory to reasoning and execution, truly enabling devices to make autonomous decisions and deliver proactive services.
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
|
|
@ -349,9 +335,9 @@ openvela [AI Agent](./../../../../../packages_ai_agent) is an AI agent engine de
|
|||
|
||||
## Related Links
|
||||
|
||||
- [Main repo](./../../../../../)
|
||||
- [AI Agent](./../../../../../packages_ai_agent)
|
||||
- [QuickJS](./../../../../../apps_interpreters_quickjs)
|
||||
- [Runtime Feature](./../../../../../frameworks_runtimes_feature)
|
||||
- [Runtime ASH](./../../../../../frameworks_runtimes_ash)
|
||||
- [Main repo](../../../../../)
|
||||
- [AI Agent](../../../../../packages_ai_agent)
|
||||
- [QuickJS](../../../../../apps_interpreters_quickjs)
|
||||
- [Runtime Feature](../../../../../frameworks_runtimes_feature)
|
||||
- [Runtime ASH](../../../../../frameworks_runtimes_ash)
|
||||
- [Official documentation](https://doc.openvela.com)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ bool bt_a2dp_sink_unregister_callbacks(bt_instance_t* ins, void* cookie);
|
|||
|
||||
**返回值**:
|
||||
|
||||
成功时返回回调 cookie,失败或已注册时返回 NULL。
|
||||
成功时返回 `true`,失败时返回 `false`。
|
||||
|
||||
|
||||
### bt_a2dp_sink_is_connected
|
||||
|
|
@ -57,16 +57,16 @@ bool bt_a2dp_sink_unregister_callbacks(bt_instance_t* ins, void* cookie);
|
|||
bool bt_a2dp_sink_is_connected(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
发起与远程设备的连接。
|
||||
查询指定设备的 A2DP Sink 是否已连接。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 蓝牙地址 of the peer device.
|
||||
- `addr` 对端设备蓝牙地址。
|
||||
|
||||
**返回值**:
|
||||
|
||||
检查是否已连接。
|
||||
已连接时返回 `true`,未连接时返回 `false`。
|
||||
|
||||
|
||||
### bt_a2dp_sink_is_playing
|
||||
|
|
@ -75,16 +75,16 @@ bool bt_a2dp_sink_is_connected(bt_instance_t* ins, bt_address_t* addr);
|
|||
bool bt_a2dp_sink_is_playing(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
检查是否正在播放。
|
||||
查询指定设备的 A2DP Sink 是否正在播放音频流。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 蓝牙地址 of the peer device.
|
||||
- `addr` 对端设备蓝牙地址。
|
||||
|
||||
**返回值**:
|
||||
|
||||
检查是否正在播放。
|
||||
正在播放时返回 `true`,未播放时返回 `false`。
|
||||
|
||||
|
||||
### bt_a2dp_sink_get_connection_state
|
||||
|
|
@ -93,7 +93,7 @@ bool bt_a2dp_sink_is_playing(bt_instance_t* ins, bt_address_t* addr);
|
|||
profile_connection_state_t bt_a2dp_sink_get_connection_state(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
发起与远程设备的连接。
|
||||
获取指定设备的 A2DP Sink 连接状态。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -103,6 +103,8 @@ profile_connection_state_t bt_a2dp_sink_get_connection_state(bt_instance_t* ins,
|
|||
|
||||
**返回值**:
|
||||
|
||||
返回当前连接状态枚举值,参见 `profile_connection_state_t`。
|
||||
|
||||
|
||||
|
||||
### bt_a2dp_sink_connect
|
||||
|
|
@ -111,16 +113,16 @@ profile_connection_state_t bt_a2dp_sink_get_connection_state(bt_instance_t* ins,
|
|||
bt_status_t bt_a2dp_sink_connect(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
发起与远程设备的连接。
|
||||
发起与远程设备的 A2DP Sink 连接。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 蓝牙地址 of the peer device.
|
||||
- `addr` 对端设备蓝牙地址。
|
||||
|
||||
**返回值**:
|
||||
|
||||
建立连接。
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
||||
|
||||
### bt_a2dp_sink_disconnect
|
||||
|
|
@ -129,16 +131,16 @@ bt_status_t bt_a2dp_sink_connect(bt_instance_t* ins, bt_address_t* addr);
|
|||
bt_status_t bt_a2dp_sink_disconnect(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
断开与远程设备的连接。
|
||||
断开与远程设备的 A2DP Sink 连接。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 蓝牙地址 of the peer device.
|
||||
- `addr` 对端设备蓝牙地址。
|
||||
|
||||
**返回值**:
|
||||
|
||||
断开连接。
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
||||
|
||||
### bt_a2dp_source_unregister_callbacks
|
||||
|
|
@ -157,7 +159,7 @@ bool bt_a2dp_source_unregister_callbacks(bt_instance_t* ins, void* cookie);
|
|||
|
||||
**返回值**:
|
||||
|
||||
成功时返回回调 cookie,失败或已注册时返回 NULL。
|
||||
成功时返回 `true`,失败时返回 `false`。
|
||||
|
||||
|
||||
### bt_a2dp_source_is_connected
|
||||
|
|
@ -166,16 +168,16 @@ bool bt_a2dp_source_unregister_callbacks(bt_instance_t* ins, void* cookie);
|
|||
bool bt_a2dp_source_is_connected(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
发起与远程设备的连接。
|
||||
查询指定设备的 A2DP Source 是否已连接。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 蓝牙地址 of the peer device.
|
||||
- `addr` 对端设备蓝牙地址。
|
||||
|
||||
**返回值**:
|
||||
|
||||
检查是否已连接。
|
||||
已连接时返回 `true`,未连接时返回 `false`。
|
||||
|
||||
|
||||
### bt_a2dp_source_is_playing
|
||||
|
|
@ -184,16 +186,16 @@ bool bt_a2dp_source_is_connected(bt_instance_t* ins, bt_address_t* addr);
|
|||
bool bt_a2dp_source_is_playing(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
检查是否正在播放。
|
||||
查询指定设备的 A2DP Source 是否正在播放音频流。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 蓝牙地址 of the peer device.
|
||||
- `addr` 对端设备蓝牙地址。
|
||||
|
||||
**返回值**:
|
||||
|
||||
检查是否正在播放。
|
||||
正在播放时返回 `true`,未播放时返回 `false`。
|
||||
|
||||
|
||||
### bt_a2dp_source_get_connection_state
|
||||
|
|
@ -202,7 +204,7 @@ bool bt_a2dp_source_is_playing(bt_instance_t* ins, bt_address_t* addr);
|
|||
profile_connection_state_t bt_a2dp_source_get_connection_state(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
发起与远程设备的连接。
|
||||
获取指定设备的 A2DP Source 连接状态。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -212,6 +214,8 @@ profile_connection_state_t bt_a2dp_source_get_connection_state(bt_instance_t* in
|
|||
|
||||
**返回值**:
|
||||
|
||||
返回当前连接状态枚举值,参见 `profile_connection_state_t`。
|
||||
|
||||
|
||||
|
||||
### bt_a2dp_source_connect
|
||||
|
|
@ -220,16 +224,16 @@ profile_connection_state_t bt_a2dp_source_get_connection_state(bt_instance_t* in
|
|||
bt_status_t bt_a2dp_source_connect(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
发起与远程设备的连接。
|
||||
发起与远程设备的 A2DP Source 连接。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 蓝牙地址 of the peer device.
|
||||
- `addr` 对端设备蓝牙地址。
|
||||
|
||||
**返回值**:
|
||||
|
||||
建立连接。
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
||||
|
||||
### bt_a2dp_source_disconnect
|
||||
|
|
|
|||
|
|
@ -1,193 +0,0 @@
|
|||
\[ [English](../../../../en/api/framework/bluetooth/bt_avrcp.md) | 简体中文 \]
|
||||
|
||||
# 蓝牙 AVRCP API
|
||||
|
||||
openvela 蓝牙 AVRCP(音视频远程控制)接口,支持播放控制、曲目信息查询等。
|
||||
|
||||
头文件:#include "bt_avrcp.h"、#include "bt_avrcp_control.h"、#include "bt_avrcp_target.h"
|
||||
|
||||
|
||||
## openvela 实现说明
|
||||
|
||||
- **双角色支持**:Controller(控制端)和 Target(目标端)
|
||||
- **功能**:播放/暂停/切歌、音量控制、曲目信息获取
|
||||
|
||||
|
||||
## 同步接口
|
||||
|
||||
|
||||
### bt_avrcp_control_unregister_callbacks
|
||||
|
||||
```c
|
||||
bool bt_avrcp_control_unregister_callbacks(bt_instance_t* ins, void* cookie);
|
||||
```
|
||||
|
||||
取消注册回调函数,停止接收状态变更通知。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `cookie` 用户上下文。
|
||||
|
||||
**返回值**:
|
||||
|
||||
取消注册回调函数。
|
||||
|
||||
|
||||
### bt_avrcp_control_get_element_attributes
|
||||
|
||||
```c
|
||||
bt_status_t bt_avrcp_control_get_element_attributes(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
获取媒体元素属性。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 远程设备蓝牙地址。
|
||||
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
||||
|
||||
### bt_avrcp_control_send_passthrough_cmd
|
||||
|
||||
```c
|
||||
bt_status_t bt_avrcp_control_send_passthrough_cmd(bt_instance_t* ins, bt_address_t* addr, uint8_t cmd, uint8_t state);
|
||||
```
|
||||
|
||||
发送透传命令。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 远程设备蓝牙地址。
|
||||
- `cmd` 命令。
|
||||
- `state` 状态。
|
||||
|
||||
|
||||
### bt_avrcp_control_get_unit_info
|
||||
|
||||
```c
|
||||
bt_status_t bt_avrcp_control_get_unit_info(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
获取远程 AVRCP 设备的单元信息。
|
||||
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 蓝牙地址。
|
||||
|
||||
|
||||
### bt_avrcp_control_get_subunit_info
|
||||
|
||||
```c
|
||||
bt_status_t bt_avrcp_control_get_subunit_info(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
获取子单元信息。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 远程设备蓝牙地址。
|
||||
|
||||
|
||||
### bt_avrcp_control_get_playback_state
|
||||
|
||||
```c
|
||||
bt_status_t bt_avrcp_control_get_playback_state(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
获取远程设备的当前播放状态。
|
||||
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 蓝牙地址。
|
||||
|
||||
|
||||
### bt_avrcp_control_register_notification
|
||||
|
||||
```c
|
||||
bt_status_t bt_avrcp_control_register_notification(bt_instance_t* ins, bt_address_t* addr, uint8_t event, uint32_t interval);
|
||||
```
|
||||
|
||||
注册事件通知。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 远程设备蓝牙地址。
|
||||
- `event` 事件类型。
|
||||
- `interval` 间隔。
|
||||
|
||||
|
||||
### bt_avrcp_target_unregister_callbacks
|
||||
|
||||
```c
|
||||
bool bt_avrcp_target_unregister_callbacks(bt_instance_t* ins, void* cookie);
|
||||
```
|
||||
|
||||
取消注册回调函数,停止接收状态变更通知。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `cookie` 用户上下文。
|
||||
|
||||
|
||||
|
||||
- `cookie` 用户上下文。
|
||||
- `ins` 蓝牙客户端实例。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回回调 cookie,失败或已注册时返回 NULL。
|
||||
|
||||
|
||||
### bt_avrcp_target_get_play_status_response
|
||||
|
||||
```c
|
||||
bt_status_t bt_avrcp_target_get_play_status_response(bt_instance_t* ins, bt_address_t* addr, avrcp_play_status_t status, uint32_t song_len, uint32_t song_pos);
|
||||
```
|
||||
|
||||
回复播放状态查询。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 蓝牙地址 of the peer device.
|
||||
- `status` 状态码。
|
||||
- `song_len` 歌曲长度(毫秒)。
|
||||
- `song_pos` 当前播放位置(毫秒)。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
||||
|
||||
### bt_avrcp_target_play_status_notify
|
||||
|
||||
```c
|
||||
bt_status_t bt_avrcp_target_play_status_notify(bt_instance_t* ins, bt_address_t* addr, avrcp_play_status_t status);
|
||||
```
|
||||
|
||||
通知播放状态变更。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 远程设备蓝牙地址。
|
||||
- `status` 状态码。
|
||||
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
|
@ -0,0 +1,217 @@
|
|||
\[ [English](../../../../en/api/framework/bluetooth/bt_cs.md) | 简体中文 \]
|
||||
|
||||
# 蓝牙 Channel Sounding API
|
||||
|
||||
openvela 蓝牙 Channel Sounding(CS)接口,用于蓝牙设备间的距离测量和定位功能。CS 基于蓝牙 5.4 规范引入的信道探测技术,支持厘米级精度的测距。
|
||||
|
||||
头文件:`#include <bt_cs.h>`
|
||||
|
||||
## openvela 实现说明
|
||||
|
||||
- **测距方法**:支持自动选择(AUTO)、RSSI 和 CS 三种测距方法
|
||||
- **角色模型**:支持发起方(Initiator)和反射方(Reflector)两种角色
|
||||
- **RAS 特性**:支持实时测距数据、丢失数据段恢复、中止操作和数据过滤
|
||||
- **回调通知**:通过回调函数异步返回测距启动、停止和结果事件
|
||||
- **配置依赖**:测试接口需启用 `CONFIG_BT_CS_RAS_TEST`
|
||||
|
||||
## 回调管理
|
||||
|
||||
### bt_cs_register_callbacks
|
||||
|
||||
```c
|
||||
void* bt_cs_register_callbacks(bt_instance_t* ins, const cs_callbacks_t* callbacks);
|
||||
```
|
||||
|
||||
注册 CS 事件回调函数。注册成功后,当距离测量启动、停止或产生结果时,系统会通过回调函数通知应用。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `callbacks` CS 事件回调函数集合,参见 `cs_callbacks_t`。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回回调 cookie(非 NULL),用于后续注销;失败时返回 NULL。
|
||||
|
||||
### bt_cs_unregister_callbacks
|
||||
|
||||
```c
|
||||
bool bt_cs_unregister_callbacks(bt_instance_t* ins, void* cookie);
|
||||
```
|
||||
|
||||
注销已注册的 CS 事件回调函数。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `cookie` 注册回调时返回的 cookie。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `true`,失败时返回 `false`。
|
||||
|
||||
## 距离测量
|
||||
|
||||
### bt_cs_start_distance_measurement
|
||||
|
||||
```c
|
||||
bt_status_t bt_cs_start_distance_measurement(bt_instance_t* ins, const bt_distance_measurement_params_t* params);
|
||||
```
|
||||
|
||||
启动距离测量。调用前需先通过 `bt_cs_register_callbacks` 注册回调函数,测量结果将通过 `cs_distance_measure_result_cb` 回调返回。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `params` 距离测量参数,参见 `bt_distance_measurement_params_t`。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `BT_STATUS_SUCCESS`,失败时返回错误码。
|
||||
|
||||
### bt_cs_stop_distance_measurement
|
||||
|
||||
```c
|
||||
bt_status_t bt_cs_stop_distance_measurement(bt_instance_t* ins, bt_address_t* addr, uint8_t method, bool timeout);
|
||||
```
|
||||
|
||||
停止距离测量。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 远端设备地址。
|
||||
- `method` 测距方法(AUTO/RSSI/CS)。
|
||||
- `timeout` 是否因超时而停止。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `BT_STATUS_SUCCESS`,失败时返回错误码。
|
||||
|
||||
## 能力查询
|
||||
|
||||
### bt_get_cs_max_supported_security_level
|
||||
|
||||
```c
|
||||
bt_status_t bt_get_cs_max_supported_security_level(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
获取远端设备支持的最大 CS 安全等级。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 远端设备地址。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `BT_STATUS_SUCCESS`,失败时返回错误码。
|
||||
|
||||
## 配置管理
|
||||
|
||||
### bt_cs_set_config
|
||||
|
||||
```c
|
||||
bt_status_t bt_cs_set_config(bt_instance_t* ins, bt_address_t* addr, const bt_cs_set_params_t* params);
|
||||
```
|
||||
|
||||
设置 CS 配置参数,包括 RAS 特性、角色、天线选择和最大发射功率。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 远端设备地址。
|
||||
- `params` CS 配置参数,参见 `bt_cs_set_params_t`。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `BT_STATUS_SUCCESS`,失败时返回错误码。
|
||||
|
||||
## 数据结构
|
||||
|
||||
### bt_distance_measurement_params_t
|
||||
|
||||
距离测量参数结构体。
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| -------------------- | -------------- | -------------------------------- |
|
||||
| `addr` | `bt_address_t` | 远端设备地址 |
|
||||
| `method` | `uint8_t` | 测距方法(0=AUTO, 1=RSSI, 2=CS) |
|
||||
| `role` | `uint8_t` | 角色(发起方/反射方) |
|
||||
| `interval_ms` | `uint16_t` | 测量间隔(毫秒) |
|
||||
| `duration_ms` | `uint16_t` | 测量持续时间(毫秒) |
|
||||
| `submode` | `uint8_t` | CS 子模式 |
|
||||
| `max_steps` | `uint8_t` | 最大步数 |
|
||||
| `mode0_steps` | `uint8_t` | Mode 0 步数 |
|
||||
| `rtt_type` | `uint8_t` | RTT 类型 |
|
||||
| `sync_phy` | `uint8_t` | 同步 PHY |
|
||||
| `channel_map` | `uint8_t` | 信道映射 |
|
||||
| `antenna_paths_mask` | `uint8_t` | 天线路径掩码 |
|
||||
| `vendor_specific` | `uint8_t` | 厂商自定义参数 |
|
||||
| `debug_flags` | `uint8_t` | 调试标志 |
|
||||
|
||||
### bt_distance_measurement_result_t
|
||||
|
||||
距离测量结果结构体。
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| --------------------------- | --------- | ---------------------- |
|
||||
| `centimeter` | `uint8_t` | 距离(厘米) |
|
||||
| `error_centimeter` | `uint8_t` | 距离误差(厘米) |
|
||||
| `azimuth_angle` | `uint8_t` | 方位角 |
|
||||
| `error_azimuthAngle` | `uint8_t` | 方位角误差 |
|
||||
| `altitude_angle` | `uint8_t` | 仰角 |
|
||||
| `error_altitudeAngle` | `uint8_t` | 仰角误差 |
|
||||
| `elapsed_realtime_nanos` | `long` | 经过的实时时间(纳秒) |
|
||||
| `confidence_level` | `uint8_t` | 置信度 |
|
||||
| `delay_spread_meters` | `double` | 延迟扩展(米) |
|
||||
| `detected_attack_level` | `uint8_t` | 检测到的攻击等级 |
|
||||
| `velocity_meters_persecond` | `double` | 速度(米/秒) |
|
||||
| `method` | `uint8_t` | 使用的测距方法 |
|
||||
|
||||
### bt_cs_set_params_t
|
||||
|
||||
CS 配置参数结构体。
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| --------------------------- | ---------- | ----------------------------------------- |
|
||||
| `ras_feature` | `uint32_t` | RAS 特性位(见下方宏定义) |
|
||||
| `role` | `uint8_t` | CS 角色位(Bit 0: 发起方, Bit 1: 反射方) |
|
||||
| `cs_sync_antenna_selection` | `uint8_t` | CS_SYNC 天线选择 |
|
||||
| `max_tx_power` | `int8_t` | 最大发射功率(dBm,范围 -127 到 20) |
|
||||
|
||||
### cs_callbacks_t
|
||||
|
||||
CS 事件回调函数集合。
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
| -------------------------------- | -------- | ---------------- |
|
||||
| `size` | `size_t` | 结构体大小 |
|
||||
| `cs_distance_measure_started_cb` | 函数指针 | 距离测量启动回调 |
|
||||
| `cs_distance_measure_stopped_cb` | 函数指针 | 距离测量停止回调 |
|
||||
| `cs_distance_measure_result_cb` | 函数指针 | 距离测量结果回调 |
|
||||
|
||||
## 宏定义
|
||||
|
||||
### RAS 特性位
|
||||
|
||||
| 宏 | 值 | 说明 |
|
||||
| --------------------------------------- | ---- | -------------------- |
|
||||
| `BT_CS_RAS_REAL_TIME_RANGING_DATA` | 0x01 | 实时测距数据 |
|
||||
| `BT_CS_RAS_RETRIEVE_LOST_DATA_SEGMENTS` | 0x02 | 恢复丢失的测距数据段 |
|
||||
| `BT_CS_RAS_ABORT_OPERATION` | 0x04 | 中止操作 |
|
||||
| `BT_CS_RAS_FILTER_RANGING_DATA` | 0x08 | 过滤测距数据 |
|
||||
|
||||
### 天线选择
|
||||
|
||||
| 宏 | 值 | 说明 |
|
||||
| ---------------------------------- | ---- | ---------------------- |
|
||||
| `BT_CS_ANTENNA_SEL_1` | 0x01 | 使用天线 1 |
|
||||
| `BT_CS_ANTENNA_SEL_2` | 0x02 | 使用天线 2 |
|
||||
| `BT_CS_ANTENNA_SEL_3` | 0x03 | 使用天线 3 |
|
||||
| `BT_CS_ANTENNA_SEL_4` | 0x04 | 使用天线 4 |
|
||||
| `BT_CS_ANTENNA_SEL_SINGLE_REPEATE` | 0xFD | 天线标识符单次重复顺序 |
|
||||
| `BT_CS_ANTENNA_SEL_DOUBLE_REPEATE` | 0xFE | 天线标识符双次重复顺序 |
|
||||
| `BT_CS_ANTENNA_SEL_NO_RECOMMEND` | 0xFF | 主机无推荐 |
|
||||
|
||||
**openvela 扩展接口。**
|
||||
|
|
@ -31,7 +31,7 @@ bt_adapter_state_t bt_adapter_get_state(bt_instance_t* ins);
|
|||
|
||||
**返回值**:
|
||||
|
||||
bt_adapter_get_state 操作。
|
||||
返回当前适配器状态枚举值,参见 `bt_adapter_state_t`。
|
||||
|
||||
|
||||
#### bt_adapter_is_support_le
|
||||
|
|
@ -49,7 +49,7 @@ bool bt_adapter_is_support_le(bt_instance_t* ins);
|
|||
|
||||
**返回值**:
|
||||
|
||||
bt_adapter_is_support_le 操作。
|
||||
支持时返回 `true`,不支持时返回 `false`。
|
||||
|
||||
|
||||
#### bt_adapter_is_support_leaudio
|
||||
|
|
@ -67,7 +67,7 @@ bool bt_adapter_is_support_leaudio(bt_instance_t* ins);
|
|||
|
||||
**返回值**:
|
||||
|
||||
bt_adapter_is_support_leaudio 操作。
|
||||
支持时返回 `true`,不支持时返回 `false`。
|
||||
|
||||
|
||||
## 设备发现
|
||||
|
|
@ -101,7 +101,7 @@ bt_status_t bt_adapter_start_discovery(bt_instance_t* ins, uint32_t timeout);
|
|||
|
||||
**返回值**:
|
||||
|
||||
bt_adapter_start_discovery 操作。
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
||||
|
||||
#### bt_adapter_cancel_discovery
|
||||
|
|
@ -118,7 +118,7 @@ bt_status_t bt_adapter_cancel_discovery(bt_instance_t* ins);
|
|||
|
||||
**返回值**:
|
||||
|
||||
bt_adapter_cancel_discovery 操作。
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
||||
|
||||
#### bt_adapter_is_discovering
|
||||
|
|
@ -136,7 +136,7 @@ bool bt_adapter_is_discovering(bt_instance_t* ins);
|
|||
|
||||
**返回值**:
|
||||
|
||||
bt_adapter_is_discovering 操作。
|
||||
正在发现时返回 `true`,否则返回 `false`。
|
||||
|
||||
|
||||
## 属性管理
|
||||
|
|
@ -171,7 +171,7 @@ bt_status_t bt_adapter_set_name(bt_instance_t* ins, const char* name);
|
|||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回负的错误码。。
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
||||
|
||||
#### bt_adapter_get_name
|
||||
|
|
@ -200,15 +200,13 @@ bt_status_t bt_adapter_set_scan_mode(bt_instance_t* ins, bt_scan_mode_t mode, bo
|
|||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `mode` 模式。
|
||||
- `mode` 扫描模式。
|
||||
- `bondable` 是否可配对。
|
||||
- `name` 输出参数,存储适配器名称。
|
||||
- `length` 缓冲区长度。
|
||||
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回负的错误码。。
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
||||
|
||||
#### bt_adapter_get_scan_mode
|
||||
|
|
@ -226,9 +224,7 @@ bt_scan_mode_t bt_adapter_get_scan_mode(bt_instance_t* ins);
|
|||
|
||||
**返回值**:
|
||||
|
||||
|
||||
|
||||
#### bt_adapter_set_device_class
|
||||
返回扫描模式枚举值,参见 `bt_scan_mode_t`。
|
||||
|
||||
```c
|
||||
bt_status_t bt_adapter_set_device_class(bt_instance_t* ins, uint32_t cod);
|
||||
|
|
@ -262,9 +258,7 @@ uint32_t bt_adapter_get_device_class(bt_instance_t* ins);
|
|||
|
||||
**返回值**:
|
||||
|
||||
|
||||
|
||||
#### bt_adapter_set_debug_mode
|
||||
返回 24 位 Class of Device 值。
|
||||
|
||||
```c
|
||||
bt_status_t bt_adapter_set_debug_mode(bt_instance_t* ins, bt_debug_mode_t mode, uint8_t operation);
|
||||
|
|
@ -290,7 +284,7 @@ bt_status_t bt_adapter_set_le_address(bt_instance_t* ins, bt_address_t* addr);
|
|||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例, 参见 bt_instance_t.
|
||||
- `addr` 指向 the BLE identity address.
|
||||
- `addr` BLE 身份地址。
|
||||
|
||||
|
||||
#### bt_adapter_set_le_appearance
|
||||
|
|
@ -379,18 +373,11 @@ uint32_t bt_adapter_get_le_io_capability(bt_instance_t* ins);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例, 参见 bt_instance_t.- `mode` 调试模式。
|
||||
- `operation` 调试操作。
|
||||
- `appearance` BLE 外观值。
|
||||
- `addr` 设备地址。
|
||||
- `type` 地址类型。
|
||||
- `cap` IO 能力值。
|
||||
- `num` 输出参数,存储设备数量。
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
返回 BLE IO 能力值。
|
||||
|
||||
|
||||
## BLE 管理
|
||||
|
|
@ -411,7 +398,7 @@ bt_status_t bt_adapter_enable(bt_instance_t* ins);
|
|||
|
||||
**返回值**:
|
||||
|
||||
bt_adapter_enable 操作。
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
||||
|
||||
#### bt_adapter_disable
|
||||
|
|
@ -428,7 +415,7 @@ bt_status_t bt_adapter_disable(bt_instance_t* ins);
|
|||
|
||||
**返回值**:
|
||||
|
||||
bt_adapter_disable 操作。
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
||||
|
||||
#### bt_adapter_disable_safe
|
||||
|
|
@ -472,7 +459,7 @@ bool bt_adapter_is_le_enabled(bt_instance_t* ins);
|
|||
|
||||
**返回值**:
|
||||
|
||||
bt_adapter_is_le_enabled 操作。
|
||||
已启用时返回 `true`,未启用时返回 `false`。
|
||||
|
||||
|
||||
#### bt_adapter_le_enable_key_derivation
|
||||
|
|
@ -675,7 +662,7 @@ bt_status_t bt_adapter_get_type_async(bt_instance_t* ins, bt_device_type_cb_t ge
|
|||
bt_status_t bt_adapter_set_discovery_filter_async(bt_instance_t* ins, bt_status_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
Set the discovery filter(异步版本)。
|
||||
设置发现过滤器(异步版本)。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -872,7 +859,7 @@ bt_status_t bt_adapter_get_device_class_async(bt_instance_t* ins, bt_u32_cb_t ge
|
|||
bt_status_t bt_adapter_set_io_capability_async(bt_instance_t* ins, bt_io_capability_t cap, bt_status_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
Set the BR/EDR adapter IO capability(异步版本)。
|
||||
设置 BR/EDR 适配器 IO 能力(异步版本)。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -889,7 +876,7 @@ Set the BR/EDR adapter IO capability(异步版本)。
|
|||
bt_status_t bt_adapter_get_io_capability_async(bt_instance_t* ins, bt_adapter_get_io_capability_cb_t get_ioc_cb, void* userdata);
|
||||
```
|
||||
|
||||
Get the BR/EDR adapter IO capability(异步版本)。
|
||||
获取 BR/EDR 适配器 IO 能力(异步版本)。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -943,7 +930,7 @@ bt_status_t bt_adapter_set_page_scan_parameters_async(bt_instance_t* ins, bt_sca
|
|||
bt_status_t bt_adapter_set_le_io_capability_async(bt_instance_t* ins, uint32_t le_io_cap, bt_status_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
Set the BLE adapter IO capability(异步版本)。
|
||||
设置 BLE 适配器 IO 能力(异步版本)。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -960,7 +947,7 @@ Set the BLE adapter IO capability(异步版本)。
|
|||
bt_status_t bt_adapter_get_le_io_capability_async(bt_instance_t* ins, bt_u32_cb_t get_le_ioc_cb, void* userdata);
|
||||
```
|
||||
|
||||
Get the BLE adapter IO capability(异步版本)。
|
||||
获取 BLE 适配器 IO 能力(异步版本)。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -976,7 +963,7 @@ Get the BLE adapter IO capability(异步版本)。
|
|||
bt_status_t bt_adapter_get_le_address_async(bt_instance_t* ins, bt_adapter_get_le_address_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
Get the BLE adapter address(异步版本)。
|
||||
获取 BLE 适配器地址(异步版本)。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -992,7 +979,7 @@ Get the BLE adapter address(异步版本)。
|
|||
bt_status_t bt_adapter_set_le_address_async(bt_instance_t* ins, bt_address_t* addr, bt_status_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
Set the BLE private address(异步版本)。
|
||||
设置 BLE 私有地址(异步版本)。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -1009,7 +996,7 @@ Set the BLE private address(异步版本)。
|
|||
bt_status_t bt_adapter_set_le_identity_address_async(bt_instance_t* ins, bt_address_t* addr, bool is_public, bt_status_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
Set the BLE identity address(异步版本)。
|
||||
设置 BLE 身份地址(异步版本)。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -1027,7 +1014,7 @@ Set the BLE identity address(异步版本)。
|
|||
bt_status_t bt_adapter_set_le_appearance_async(bt_instance_t* ins, uint16_t appearance, bt_status_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
Set the BLE adapter appearance(异步版本)。
|
||||
设置 BLE 适配器外观值(异步版本)。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -1044,7 +1031,7 @@ Set the BLE adapter appearance(异步版本)。
|
|||
bt_status_t bt_adapter_get_le_appearance_async(bt_instance_t* ins, bt_u16_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
Get the BLE adapter appearance(异步版本)。
|
||||
获取 BLE 适配器外观值(异步版本)。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -1078,7 +1065,7 @@ bt_status_t bt_adapter_le_enable_key_derivation_async(bt_instance_t* ins, bool b
|
|||
bt_status_t bt_adapter_le_add_whitelist_async(bt_instance_t* ins, bt_address_t* addr, bt_status_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
Add a device to the BLE whitelist(异步版本)。
|
||||
添加设备到 BLE 白名单(异步版本)。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
|
|||
|
|
@ -26,12 +26,12 @@ bool bt_hfp_hf_unregister_callbacks(bt_instance_t* ins, void* cookie);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `cookie` 用户上下文。
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `cookie` 用户上下文。
|
||||
|
||||
**返回值**:
|
||||
|
||||
取消注册回调函数。
|
||||
成功时返回 `true`,失败时返回 `false`。
|
||||
|
||||
|
||||
### bt_hfp_hf_is_connected
|
||||
|
|
@ -40,7 +40,7 @@ bool bt_hfp_hf_unregister_callbacks(bt_instance_t* ins, void* cookie);
|
|||
bool bt_hfp_hf_is_connected(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
发起与远程设备的连接。
|
||||
查询与远程设备的 HFP HF 是否已连接。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ bool bt_hfp_hf_is_connected(bt_instance_t* ins, bt_address_t* addr);
|
|||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
已连接时返回 `true`,未连接时返回 `false`。
|
||||
|
||||
|
||||
### bt_hfp_hf_is_audio_connected
|
||||
|
|
@ -59,7 +59,7 @@ bool bt_hfp_hf_is_connected(bt_instance_t* ins, bt_address_t* addr);
|
|||
bool bt_hfp_hf_is_audio_connected(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
发起与远程设备的连接。
|
||||
查询与远程设备的 HFP 音频通道是否已连接。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ bool bt_hfp_hf_is_audio_connected(bt_instance_t* ins, bt_address_t* addr);
|
|||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
音频已连接时返回 `true`,未连接时返回 `false`。
|
||||
|
||||
|
||||
### bt_hfp_hf_get_connection_state
|
||||
|
|
@ -78,7 +78,7 @@ bool bt_hfp_hf_is_audio_connected(bt_instance_t* ins, bt_address_t* addr);
|
|||
profile_connection_state_t bt_hfp_hf_get_connection_state(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
发起与远程设备的连接。
|
||||
获取与远程设备的 HFP HF 连接状态。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -88,6 +88,7 @@ profile_connection_state_t bt_hfp_hf_get_connection_state(bt_instance_t* ins, bt
|
|||
|
||||
**返回值**:
|
||||
|
||||
返回当前连接状态枚举值,参见 `profile_connection_state_t`。
|
||||
|
||||
|
||||
### bt_hfp_hf_connect
|
||||
|
|
@ -96,16 +97,16 @@ profile_connection_state_t bt_hfp_hf_get_connection_state(bt_instance_t* ins, bt
|
|||
bt_status_t bt_hfp_hf_connect(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
发起与远程设备的连接。
|
||||
发起与远程设备的 HFP HF 连接。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 蓝牙地址 of the peer device.
|
||||
- `addr` 对端设备蓝牙地址。
|
||||
|
||||
**返回值**:
|
||||
|
||||
建立连接。
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
||||
|
||||
### bt_hfp_hf_disconnect
|
||||
|
|
@ -391,7 +392,7 @@ bt_status_t bt_hfp_hf_query_current_calls(bt_instance_t* ins, bt_address_t* addr
|
|||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 蓝牙地址 of the peer device.
|
||||
- `addr` 对端设备蓝牙地址。
|
||||
- `allocator` 内存分配函数。- `calls` 输出参数,存储通话信息数组。
|
||||
- `num` 输出参数,存储通话数量。
|
||||
|
||||
|
|
@ -502,16 +503,16 @@ bt_status_t bt_hfp_hf_get_subscriber_number(bt_instance_t* ins, bt_address_t* ad
|
|||
bt_status_t bt_hfp_hf_query_current_calls_with_callback(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
查询当前所有通话的状态信息(CLCC)。
|
||||
查询当前所有通话的状态信息(CLCC),结果通过回调异步返回。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 远程设备蓝牙地址。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
||||
|
||||
### bt_hfp_ag_unregister_callbacks
|
||||
|
|
@ -524,12 +525,12 @@ bool bt_hfp_ag_unregister_callbacks(bt_instance_t* ins, void* cookie);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `cookie` 用户上下文。
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `cookie` 用户上下文。
|
||||
|
||||
**返回值**:
|
||||
|
||||
取消注册回调函数。
|
||||
成功时返回 `true`,失败时返回 `false`。
|
||||
|
||||
|
||||
### bt_hfp_ag_is_connected
|
||||
|
|
@ -538,7 +539,7 @@ bool bt_hfp_ag_unregister_callbacks(bt_instance_t* ins, void* cookie);
|
|||
bool bt_hfp_ag_is_connected(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
发起与远程设备的连接。
|
||||
查询与远程设备的 HFP AG 是否已连接。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -548,7 +549,7 @@ bool bt_hfp_ag_is_connected(bt_instance_t* ins, bt_address_t* addr);
|
|||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
已连接时返回 `true`,未连接时返回 `false`。
|
||||
|
||||
|
||||
### bt_hfp_ag_is_audio_connected
|
||||
|
|
@ -557,7 +558,7 @@ bool bt_hfp_ag_is_connected(bt_instance_t* ins, bt_address_t* addr);
|
|||
bool bt_hfp_ag_is_audio_connected(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
发起与远程设备的连接。
|
||||
查询与远程设备的 HFP AG 音频通道是否已连接。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -567,7 +568,7 @@ bool bt_hfp_ag_is_audio_connected(bt_instance_t* ins, bt_address_t* addr);
|
|||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
音频已连接时返回 `true`,未连接时返回 `false`。
|
||||
|
||||
|
||||
### bt_hfp_ag_get_connection_state
|
||||
|
|
@ -576,7 +577,7 @@ bool bt_hfp_ag_is_audio_connected(bt_instance_t* ins, bt_address_t* addr);
|
|||
profile_connection_state_t bt_hfp_ag_get_connection_state(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
发起与远程设备的连接。
|
||||
获取与远程设备的 HFP AG 连接状态。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -586,6 +587,7 @@ profile_connection_state_t bt_hfp_ag_get_connection_state(bt_instance_t* ins, bt
|
|||
|
||||
**返回值**:
|
||||
|
||||
返回当前连接状态枚举值,参见 `profile_connection_state_t`。
|
||||
|
||||
|
||||
### bt_hfp_ag_connect
|
||||
|
|
@ -594,16 +596,16 @@ profile_connection_state_t bt_hfp_ag_get_connection_state(bt_instance_t* ins, bt
|
|||
bt_status_t bt_hfp_ag_connect(bt_instance_t* ins, bt_address_t* addr);
|
||||
```
|
||||
|
||||
发起与远程设备的连接。
|
||||
发起与远程设备的 HFP AG 连接。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 蓝牙地址 of the peer device.
|
||||
- `addr` 对端设备蓝牙地址。
|
||||
|
||||
**返回值**:
|
||||
|
||||
建立连接。
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
||||
|
||||
### bt_hfp_ag_disconnect
|
||||
|
|
@ -865,9 +867,9 @@ bt_status_t bt_hfp_ag_send_clcc_response(bt_instance_t* ins, bt_address_t* addr,
|
|||
- `dir` 方向(呼入/呼出)。
|
||||
- `state` 状态。
|
||||
- `mode` 模式。
|
||||
- `mpty` 是否 the call is multi party.
|
||||
- `mpty` 是否为多方通话。
|
||||
- `type` 类型。
|
||||
- `number` phone 数量 the call.
|
||||
- `number` 通话号码。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
|
|||
|
|
@ -25,12 +25,12 @@ bool bt_hid_device_unregister_callbacks(bt_instance_t* ins, void* cookie);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `cookie` 用户上下文。
|
||||
- `ins` 蓝牙客户端实例, 参见 bt_instance_t.
|
||||
- `cookie` 用户上下文。
|
||||
|
||||
**返回值**:
|
||||
|
||||
取消注册回调函数。
|
||||
成功时返回 `true`,失败时返回 `false`。
|
||||
|
||||
|
||||
### bt_hid_device_register_app
|
||||
|
|
@ -59,7 +59,7 @@ bt_status_t bt_hid_device_register_app(bt_instance_t* ins, hid_device_sdp_settin
|
|||
bt_status_t bt_hid_device_unregister_app(bt_instance_t* ins);
|
||||
```
|
||||
|
||||
取消注册操作。
|
||||
取消注册 HID 设备应用。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ bt_status_t bt_hid_device_unregister_app(bt_instance_t* ins);
|
|||
|
||||
**返回值**:
|
||||
|
||||
bt_hid_device_unregister_app 操作。
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
||||
|
||||
### bt_hid_device_connect
|
||||
|
|
@ -147,6 +147,10 @@ bt_status_t bt_hid_device_response_report(bt_instance_t* ins, bt_address_t* addr
|
|||
- `rpt_data` HID 报告数据。
|
||||
- `rpt_size` 报告数据大小(字节)。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
||||
|
||||
### bt_hid_device_report_error
|
||||
|
||||
|
|
@ -160,13 +164,11 @@ bt_status_t bt_hid_device_report_error(bt_instance_t* ins, bt_address_t* addr, h
|
|||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 远程设备蓝牙地址。
|
||||
- `error` 错误码。
|
||||
- `error` 错误码,参见 `hid_status_error_t`。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
||||
- `ins` 蓝牙客户端实例, 参见 bt_instance_t.
|
||||
- `addr` Address of the peer device, 参见 bt_address_t.
|
||||
- `error` Error code, 参见 hid_status_error_t.
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
||||
|
||||
### bt_hid_device_virtual_unplug
|
||||
|
|
@ -181,3 +183,7 @@ bt_status_t bt_hid_device_virtual_unplug(bt_instance_t* ins, bt_address_t* addr)
|
|||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `addr` 远程设备蓝牙地址。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
|
|
|||
|
|
@ -1,141 +0,0 @@
|
|||
\[ [English](../../../../en/api/framework/bluetooth/bt_le_advertiser.md) | 简体中文 \]
|
||||
|
||||
# 蓝牙 BLE 广播 API
|
||||
|
||||
openvela 蓝牙 BLE 广播接口,用于发送 BLE 广播数据和管理广播实例。
|
||||
|
||||
头文件:`#include "bt_le_advertiser.h"`
|
||||
|
||||
|
||||
## openvela 实现说明
|
||||
|
||||
- **广播类型**:支持可连接广播、不可连接广播、扫描响应等
|
||||
- **广播数据**:支持自定义广播数据和扫描响应数据
|
||||
- **多实例**:支持同时运行多个广播实例
|
||||
|
||||
|
||||
## 同步接口
|
||||
|
||||
|
||||
### bt_le_stop_advertising
|
||||
|
||||
```c
|
||||
void bt_le_stop_advertising(bt_instance_t* ins, bt_advertiser_t* adver);
|
||||
```
|
||||
|
||||
停止 BLE 广播。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `adver` 广播器实例。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
||||
|
||||
### bt_le_stop_advertising_id
|
||||
|
||||
```c
|
||||
void bt_le_stop_advertising_id(bt_instance_t* ins, uint8_t adv_id);
|
||||
```
|
||||
|
||||
停止指定 ID 的 BLE 广播实例。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `adv_id` 广播实例 ID。
|
||||
|
||||
|
||||
### bt_le_advertising_is_supported
|
||||
|
||||
```c
|
||||
bool bt_le_advertising_is_supported(bt_instance_t* ins);
|
||||
```
|
||||
|
||||
广播数据查询supported。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
|
||||
|
||||
**返回值**:
|
||||
|
||||
bt_le_advertising_is_supported 操作。
|
||||
|
||||
|
||||
## 异步接口
|
||||
|
||||
|
||||
### bt_le_start_advertising_async
|
||||
|
||||
```c
|
||||
bt_status_t bt_le_start_advertising_async(bt_instance_t* ins, ble_adv_params_t* params, uint8_t* adv_data, uint16_t adv_len, uint8_t* scan_rsp_data, uint16_t scan_rsp_len, advertiser_callback_t* adv_cbs, bt_le_start_adv_callback_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
开始 BLE 广播(异步版本)。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `params` 参数结构体。
|
||||
- `adv_data` 广播数据。
|
||||
- `adv_len` 广播数据长度。
|
||||
- `scan_rsp_data` 扫描响应数据。
|
||||
- `scan_rsp_len` 扫描响应数据长度。
|
||||
- `adv_cbs` 广播回调函数集合。
|
||||
- `cb` 回调函数。
|
||||
- `userdata` 用户数据。
|
||||
|
||||
|
||||
### bt_le_stop_advertising_async
|
||||
|
||||
```c
|
||||
bt_status_t bt_le_stop_advertising_async(bt_instance_t* ins, bt_advertiser_t* adver, bt_status_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `adver` 广播器实例。
|
||||
- `cb` 回调函数。
|
||||
- `userdata` 用户数据。
|
||||
|
||||
|
||||
|
||||
### bt_le_stop_advertising_id_async
|
||||
|
||||
```c
|
||||
bt_status_t bt_le_stop_advertising_id_async(bt_instance_t* ins, uint8_t adv_id, bt_status_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
停止BLE 广播(指定 ID)(异步版本)。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `adv_id` 广播实例 ID。
|
||||
- `cb` 回调函数。
|
||||
- `userdata` 用户数据。
|
||||
|
||||
|
||||
### bt_le_advertising_is_supported_async
|
||||
|
||||
```c
|
||||
bt_status_t bt_le_advertising_is_supported_async(bt_instance_t* ins, bt_bool_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
查询是否支持 BLE 广播(异步版本)。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `cb` 回调函数。
|
||||
- `userdata` 用户数据。
|
||||
|
||||
|
|
@ -1,141 +0,0 @@
|
|||
\[ [English](../../../../en/api/framework/bluetooth/bt_le_scan.md) | 简体中文 \]
|
||||
|
||||
# 蓝牙 BLE 扫描 API
|
||||
|
||||
openvela 蓝牙 BLE 扫描接口,用于发现周围的 BLE 设备和广播数据。
|
||||
|
||||
头文件:`#include "bt_le_scan.h"`
|
||||
|
||||
|
||||
## openvela 实现说明
|
||||
|
||||
- **扫描模式**:支持被动扫描和主动扫描
|
||||
- **过滤器**:支持按名称、地址、UUID 等条件过滤扫描结果
|
||||
- **回调通知**:通过回调函数异步返回扫描结果
|
||||
|
||||
|
||||
## 同步接口
|
||||
|
||||
|
||||
### bt_le_stop_scan
|
||||
|
||||
```c
|
||||
void bt_le_stop_scan(bt_instance_t* ins, bt_scanner_t* scanner);
|
||||
```
|
||||
|
||||
停止 BLE 扫描。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `scanner` 扫描器实例。
|
||||
- `ins` 蓝牙客户端实例, 参见 bt_instance_t.
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
||||
|
||||
### bt_le_scan_is_supported
|
||||
|
||||
```c
|
||||
bool bt_le_scan_is_supported(bt_instance_t* ins);
|
||||
```
|
||||
|
||||
查询操作。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
|
||||
|
||||
**返回值**:
|
||||
|
||||
bt_le_scan_is_supported 操作。
|
||||
|
||||
|
||||
## 异步接口
|
||||
|
||||
|
||||
### bt_le_start_scan_async
|
||||
|
||||
```c
|
||||
bt_status_t bt_le_start_scan_async(bt_instance_t* ins, const scanner_callbacks_t* scan_cbs, bt_le_start_scan_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
开始BLE 扫描(异步版本)。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `scan_cbs` 扫描回调函数集合。
|
||||
- `cb` 回调函数。
|
||||
- `userdata` 用户数据。
|
||||
|
||||
|
||||
### bt_le_start_scan_settings_async
|
||||
|
||||
```c
|
||||
bt_status_t bt_le_start_scan_settings_async(bt_instance_t* ins, ble_scan_settings_t* settings, const scanner_callbacks_t* scan_cbs, bt_le_start_scan_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
异步版本。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `settings` 设置。
|
||||
- `scan_cbs` 扫描回调函数集合。
|
||||
- `cb` 回调函数。
|
||||
- `userdata` 用户数据。
|
||||
|
||||
|
||||
|
||||
### bt_le_start_scan_with_filters_async
|
||||
|
||||
```c
|
||||
bt_status_t bt_le_start_scan_with_filters_async(bt_instance_t* ins, ble_scan_settings_t* settings, ble_scan_filter_t* filter, const scanner_callbacks_t* scan_cbs, bt_le_start_scan_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
开始操作(异步版本)。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `settings` 设置。
|
||||
- `filter` 过滤条件。
|
||||
- `scan_cbs` 扫描回调函数集合。
|
||||
- `cb` 回调函数。
|
||||
- `userdata` 用户数据。
|
||||
|
||||
|
||||
### bt_le_stop_scan_async
|
||||
|
||||
```c
|
||||
bt_status_t bt_le_stop_scan_async(bt_instance_t* ins, bt_scanner_t* scanner, bt_le_stop_scan_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
停止扫描(异步版本)。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `scanner` 扫描器实例。
|
||||
- `cb` 回调函数。
|
||||
- `userdata` 用户数据。
|
||||
|
||||
|
||||
|
||||
|
||||
### bt_le_scan_is_supported_async
|
||||
|
||||
```c
|
||||
bt_status_t bt_le_scan_is_supported_async(bt_instance_t* ins, bt_bool_cb_t cb, void* userdata);
|
||||
```
|
||||
|
||||
查询是否支持 BLE 扫描(异步版本)。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `cb` 回调函数。
|
||||
- `userdata` 用户数据。
|
||||
|
||||
|
|
@ -21,16 +21,16 @@ openvela 蓝牙 SPP(串口仿真)接口,用于替代物理串口进行数
|
|||
bt_status_t bt_spp_unregister_app(bt_instance_t* ins, void* handle);
|
||||
```
|
||||
|
||||
取消注册操作。
|
||||
取消注册 SPP 应用。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 句柄。
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `handle` 句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
bt_spp_unregister_app 操作。
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
||||
|
||||
### bt_spp_server_start
|
||||
|
|
@ -102,7 +102,7 @@ bt_status_t bt_spp_connect(bt_instance_t* ins, void* handle, bt_address_t* addr,
|
|||
bt_status_t bt_spp_insecure_connect(bt_instance_t* ins, void* handle, bt_address_t* addr, int16_t scn, bt_uuid_t* uuid, uint16_t* port);
|
||||
```
|
||||
|
||||
发起与远程设备的连接。
|
||||
发起与远程设备的非安全连接(不要求加密)。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -113,6 +113,10 @@ bt_status_t bt_spp_insecure_connect(bt_instance_t* ins, void* handle, bt_address
|
|||
- `uuid` 服务 UUID。
|
||||
- `port` 端口号。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 BT_STATUS_SUCCESS,失败时返回错误码。
|
||||
|
||||
|
||||
### bt_spp_disconnect
|
||||
|
||||
|
|
@ -126,7 +130,7 @@ bt_status_t bt_spp_disconnect(bt_instance_t* ins, void* handle, bt_address_t* ad
|
|||
|
||||
- `ins` 蓝牙客户端实例。
|
||||
- `handle` 句柄。
|
||||
- `addr` 蓝牙地址 of the peer device.
|
||||
- `addr` 对端设备蓝牙地址。
|
||||
- `port` 端口号。
|
||||
|
||||
**返回值**:
|
||||
|
|
|
|||
|
|
@ -10,19 +10,14 @@ openvela 蓝牙框架提供完整的蓝牙协议栈接口,支持经典蓝牙
|
|||
- **[GATT](bt_gatt.md)**(通用属性规范)— BLE 数据属性读写与通知
|
||||
- **[设备管理](bt_device.md)** — 远程设备配对、连接、属性查询
|
||||
|
||||
## BLE 接口
|
||||
|
||||
- **[BLE 扫描](bt_le_scan.md)** — BLE 设备发现与广播数据接收
|
||||
- **[BLE 广播](bt_le_advertiser.md)** — BLE 广播数据发送与管理
|
||||
|
||||
## 音频与媒体
|
||||
## 经典蓝牙规范
|
||||
|
||||
- **[A2DP](bt_a2dp.md)**(高级音频分发)— 高质量立体声音乐传输
|
||||
- **[AVRCP](bt_avrcp.md)**(音视频远程控制)— 播放控制、切歌、音量调节
|
||||
- **[HFP](bt_hfp.md)**(免提规范)— 蓝牙通话功能
|
||||
|
||||
## 数据与外设
|
||||
|
||||
- **[HID](bt_hid.md)**(人机接口设备)— 键盘、鼠标、游戏手柄
|
||||
- **[SPP](bt_spp.md)**(串口仿真)— 数据透传
|
||||
- **[PAN](bt_pan.md)**(个人局域网)— 网络共享与蓝牙组网
|
||||
|
||||
## 低功耗蓝牙规范
|
||||
|
||||
- **[CS](bt_cs.md)**(Channel Sounding)— 蓝牙信道探测测距与定位
|
||||
|
|
|
|||
|
|
@ -30,11 +30,11 @@ void* media_player_open(const char* stream);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `stream` 流类型常量。 不同流类型有不同的路由逻辑.
|
||||
- `stream` 流类型常量,不同流类型有不同的路由逻辑。
|
||||
|
||||
**返回值**:
|
||||
|
||||
void* 播放器句柄, NULL on failure。
|
||||
成功时返回播放器句柄,失败时返回 `NULL`。
|
||||
|
||||
|
||||
### media_player_close
|
||||
|
|
@ -47,7 +47,7 @@ int media_player_close(void* handle, int pending_stop);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄.
|
||||
- `handle` 播放器句柄。
|
||||
- `pending_stop` 关闭前是否等待停止完成:0 表示立即停止并关闭,1 表示等待当前曲目播放完成再关闭。此参数仅对音频播放器有效;视频播放器设置为 1 时不产生等待效果。
|
||||
|
||||
**返回值**:
|
||||
|
|
@ -65,13 +65,13 @@ int media_player_set_event_callback(void* handle, void* event_cookie, media_even
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄.
|
||||
- `event_cookie` 回调参数.
|
||||
- `handle` 播放器句柄。
|
||||
- `event_cookie` 回调上下文参数。
|
||||
- `on_event` 事件回调函数,用于接收流状态变化通知。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_player_prepare
|
||||
|
|
@ -84,13 +84,13 @@ int media_player_prepare(void* handle, const char* url, const char* options);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄.
|
||||
- `handle` 播放器句柄。
|
||||
- `url` 资源路径,支持两种模式:1. URL 模式:`url` 为本地文件路径或网络地址,框架会读取并播放;2. BUFFER 模式:`url` 为 `NULL`,调用方需通过 `media_player_write_data()` 或 `media_player_get_socket()` + `write()` 持续推送数据。
|
||||
- `options` 资源的额外配置参数,通常为描述资源格式的键值对(例如 `"format=s16le,sample_rate=44100,channels=2"`)。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_player_reset
|
||||
|
|
@ -99,16 +99,15 @@ int media_player_prepare(void* handle, const char* url, const char* options);
|
|||
int media_player_reset(void* handle);
|
||||
```
|
||||
|
||||
重置指定类型的播放器。
|
||||
重置播放器到初始状态。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄,由 `media_player_open` 返回。
|
||||
- `handle` 播放器句柄.
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
## 同步接口 - 数据流
|
||||
|
|
@ -123,13 +122,13 @@ ssize_t media_player_write_data(void* handle, const void* data, size_t len);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄.
|
||||
- `data` 缓冲区地址.
|
||||
- `len` 缓冲区长度 to write.
|
||||
- `handle` 播放器句柄。
|
||||
- `data` 数据缓冲区地址。
|
||||
- `len` 要写入的数据长度(字节)。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回发送的字节数,失败时返回负的错误码。
|
||||
成功时返回实际写入的字节数,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_player_get_sockaddr
|
||||
|
|
@ -142,8 +141,8 @@ int media_player_get_sockaddr(void* handle, struct sockaddr_storage* addr);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄
|
||||
- `addr` Socket 地址信息。
|
||||
- `handle` 播放器句柄。
|
||||
- `addr` 用于存储 Socket 地址信息的输出参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -160,7 +159,7 @@ int media_player_get_socket(void* handle);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄.
|
||||
- `handle` 播放器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -177,7 +176,7 @@ void media_player_close_socket(void* handle);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄.
|
||||
- `handle` 播放器句柄。
|
||||
|
||||
|
||||
## 同步接口 - 播放控制
|
||||
|
|
@ -188,15 +187,15 @@ void media_player_close_socket(void* handle);
|
|||
int media_player_start(void* handle);
|
||||
```
|
||||
|
||||
开始/resume playing the re音频源。
|
||||
开始或恢复播放音频源。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄.
|
||||
- `handle` 播放器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_player_stop
|
||||
|
|
@ -205,15 +204,15 @@ int media_player_start(void* handle);
|
|||
int media_player_stop(void* handle);
|
||||
```
|
||||
|
||||
停止 and clear the re音频源。
|
||||
停止播放并清除已准备的音频源。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄.
|
||||
- `handle` 播放器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_player_pause
|
||||
|
|
@ -222,15 +221,15 @@ int media_player_stop(void* handle);
|
|||
int media_player_pause(void* handle);
|
||||
```
|
||||
|
||||
暂停。
|
||||
暂停播放。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄.
|
||||
- `handle` 播放器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_player_seek
|
||||
|
|
@ -239,16 +238,16 @@ int media_player_pause(void* handle);
|
|||
int media_player_seek(void* handle, unsigned int position);
|
||||
```
|
||||
|
||||
跳转 to msec 位置 from begining。
|
||||
跳转到指定的播放位置。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄.
|
||||
- `position` 位置,单位为毫秒。
|
||||
- `handle` 播放器句柄。
|
||||
- `position` 目标位置,单位为毫秒,从起始位置计算。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_player_set_looping
|
||||
|
|
@ -257,36 +256,35 @@ int media_player_seek(void* handle, unsigned int position);
|
|||
int media_player_set_looping(void* handle, int loop);
|
||||
```
|
||||
|
||||
设置 loop times。
|
||||
设置循环播放次数。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄.
|
||||
- `handle` 播放器句柄。
|
||||
- `loop` 循环次数,`-1` 表示无限循环。
|
||||
|
||||
|
||||
## 同步接口 - 状态查询
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `0`,失败时返回负的 errno。
|
||||
|
||||
|
||||
## 同步接口 - 状态查询
|
||||
|
||||
### media_player_is_playing
|
||||
|
||||
```c
|
||||
int media_player_is_playing(void* handle);
|
||||
```
|
||||
|
||||
检查 playing status。
|
||||
查询当前是否正在播放。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄.
|
||||
- `handle` 播放器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
int Positive on playing, zero on in活跃状态, negative on error。
|
||||
正在播放时返回正值,未播放时返回 `0`,出错时返回负的错误码。
|
||||
|
||||
|
||||
### media_player_get_position
|
||||
|
|
@ -295,12 +293,12 @@ int Positive on playing, zero on in活跃状态, negative on error。
|
|||
int media_player_get_position(void* handle, unsigned int* position);
|
||||
```
|
||||
|
||||
Gert current msec 位置 of re音频源。
|
||||
获取当前播放位置。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄.
|
||||
- `position` 位置,单位为毫秒。
|
||||
- `handle` 播放器句柄。
|
||||
- `position` 输出参数,当前播放位置,单位为毫秒。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -313,12 +311,12 @@ Gert current msec 位置 of re音频源。
|
|||
int media_player_get_duration(void* handle, unsigned int* duration);
|
||||
```
|
||||
|
||||
Gert msec 时长 of current re音频源。
|
||||
获取当前音频源的总时长。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄.
|
||||
- `duration` 位置,单位为毫秒。
|
||||
- `handle` 播放器句柄。
|
||||
- `duration` 输出参数,音频源总时长,单位为毫秒。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -331,37 +329,36 @@ Gert msec 时长 of current re音频源。
|
|||
int media_player_get_latency(void* handle, unsigned int* latency);
|
||||
```
|
||||
|
||||
Gert latency of current re音频源。
|
||||
获取当前音频源的播放延迟。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄.
|
||||
- `latency` 延迟帧数。
|
||||
|
||||
|
||||
## 同步接口 - 音量与属性
|
||||
- `handle` 播放器句柄。
|
||||
- `latency` 输出参数,延迟帧数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `0`,失败时返回负的 errno。
|
||||
|
||||
|
||||
## 同步接口 - 音量与属性
|
||||
|
||||
### media_player_set_volume
|
||||
|
||||
```c
|
||||
int media_player_set_volume(void* handle, float volume);
|
||||
```
|
||||
|
||||
设置音量。
|
||||
设置播放音量。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄.
|
||||
- `handle` 播放器句柄。
|
||||
- `volume` 音量值,取值范围 `[0.0, 1.0]`。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_player_get_volume
|
||||
|
|
@ -370,12 +367,12 @@ int media_player_set_volume(void* handle, float volume);
|
|||
int media_player_get_volume(void* handle, float* volume);
|
||||
```
|
||||
|
||||
获取音量。
|
||||
获取当前播放音量。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄.
|
||||
- `volume` 音量值,取值范围 `[0.0, 1.0]`。
|
||||
- `handle` 播放器句柄。
|
||||
- `volume` 输出参数,当前音量值,取值范围 `[0.0, 1.0]`。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -388,14 +385,14 @@ int media_player_get_volume(void* handle, float* volume);
|
|||
int media_player_set_property(void* handle, const char* target, const char* key, const char* value);
|
||||
```
|
||||
|
||||
设置 properties。
|
||||
设置播放器属性。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄。
|
||||
- `target` 目标 filter 名称。
|
||||
- `key` Key
|
||||
- `value` Value
|
||||
- `key` 属性键名。
|
||||
- `value` 属性值。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -408,44 +405,43 @@ int media_player_set_property(void* handle, const char* target, const char* key,
|
|||
int media_player_get_property(void* handle, const char* target, const char* key, char* value, int value_len);
|
||||
```
|
||||
|
||||
获取 properties。
|
||||
获取播放器属性。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄。
|
||||
- `target` 目标 filter 名称。
|
||||
- `key` Key
|
||||
- `value` 输出缓冲区。
|
||||
- `value_len` 缓冲区长度 of value
|
||||
|
||||
|
||||
## 异步接口(基于 libuv)
|
||||
|
||||
以下接口仅在启用 `CONFIG_LIBUV` 时可用,回调在 `uv_loop` 上执行,避免阻塞调用线程。
|
||||
- `key` 属性键名。
|
||||
- `value` 输出缓冲区,用于存储属性值。
|
||||
- `value_len` 输出缓冲区长度。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `0`,失败时返回负的 errno。
|
||||
|
||||
|
||||
## 异步接口(基于 libuv)
|
||||
|
||||
以下接口仅在启用 `CONFIG_LIBUV` 时可用,回调在 `uv_loop` 上执行,避免阻塞调用线程。
|
||||
|
||||
### media_uv_player_open
|
||||
|
||||
```c
|
||||
void* media_uv_player_open(void* loop, const char* stream, media_uv_callback on_open, void* cookie);
|
||||
```
|
||||
|
||||
打开 an async player with given 流 type。
|
||||
打开异步播放器。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `stream` 流类型常量。 . 不同流类型有不同的路由逻辑.
|
||||
- `stream` 流类型常量,不同流类型有不同的路由逻辑。
|
||||
- `on_open` 打开完成后触发的回调函数。
|
||||
- `cookie` 回调上下文,供 `on_open`、`on_event`、`on_connection`、`on_close` 共用。
|
||||
|
||||
**返回值**:
|
||||
|
||||
void* Handle of player, 失败时返回 NULL。
|
||||
成功时返回播放器句柄,失败时返回 `NULL`。
|
||||
|
||||
|
||||
### media_uv_player_listen
|
||||
|
|
@ -454,7 +450,7 @@ void* Handle of player, 失败时返回 NULL。
|
|||
int media_uv_player_listen(void* handle, media_event_callback on_event);
|
||||
```
|
||||
|
||||
Listen to status change 事件 by setting 回调。
|
||||
注册事件监听回调,接收播放状态变化通知。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -472,17 +468,17 @@ Listen to status change 事件 by setting 回调。
|
|||
int media_uv_player_close(void* handle, int pending, media_uv_callback on_close);
|
||||
```
|
||||
|
||||
关闭 the async player。
|
||||
关闭异步播放器。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步播放器句柄。
|
||||
- `pending` 是否以 pending 方式关闭。
|
||||
- `pending` 是否以 pending 方式关闭(等待当前播放完成)。
|
||||
- `on_close` 资源释放完成后触发的回调函数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,无效句柄时返回负的错误码。
|
||||
成功时返回 `0`,无效句柄时返回负的错误码。
|
||||
|
||||
|
||||
### media_uv_player_prepare
|
||||
|
|
@ -491,7 +487,7 @@ int media_uv_player_close(void* handle, int pending, media_uv_callback on_close)
|
|||
int media_uv_player_prepare(void* handle, const char* url, const char* options, media_uv_object_callback on_connection, media_uv_callback on_prepare, void* cookie);
|
||||
```
|
||||
|
||||
准备 re音频源 for playing。
|
||||
准备音频源以供播放。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -499,12 +495,12 @@ int media_uv_player_prepare(void* handle, const char* url, const char* options,
|
|||
- `url` 资源路径,支持两种模式:1. URL 模式:`url` 为本地文件路径或网络地址,框架会读取并播放;2. BUFFER 模式:`url` 为 `NULL`,调用方需通过 `media_player_write_data()` 或 `media_player_get_socket()` + `write()` 持续推送数据。
|
||||
- `options` 资源的额外配置参数,通常为描述资源格式的键值对(例如 `"format=s16le,sample_rate=44100,channels=2"`)。
|
||||
- `on_connection` BUFFER 模式下接收 `uv_pipe_t` 的回调函数。
|
||||
- `on_prepare` 结果回调函数。
|
||||
- `cookie` 回调参数 for `on_prepare`.
|
||||
- `on_prepare` 准备完成后的结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_uv_player_reset
|
||||
|
|
@ -513,13 +509,13 @@ int media_uv_player_prepare(void* handle, const char* url, const char* options,
|
|||
int media_uv_player_reset(void* handle, media_uv_callback on_reset, void* cookie);
|
||||
```
|
||||
|
||||
重置 player。
|
||||
重置播放器到初始状态。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步播放器句柄。
|
||||
- `on_reset` 结果回调函数。
|
||||
- `cookie` 回调参数 for `on_reset`.
|
||||
- `on_reset` 重置完成后的结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -532,14 +528,14 @@ int media_uv_player_reset(void* handle, media_uv_callback on_reset, void* cookie
|
|||
int media_uv_player_start_auto(void* handle, const char* scenario, media_uv_callback on_start, void* cookie);
|
||||
```
|
||||
|
||||
Play or resume the prepared 音频源 with auto 焦点 request。
|
||||
播放或恢复已准备的音频源,并自动请求音频焦点。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步播放器句柄。
|
||||
- `scenario` 场景常量,不同场景对应不同的焦点优先级。
|
||||
- `on_play` 结果确认回调(用于 request/start 操作)。
|
||||
- `cookie` 回调参数 for `on_play`.
|
||||
- `on_start` 播放开始后的结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -557,8 +553,8 @@ int media_uv_player_start(void* handle, media_uv_callback on_start, void* cookie
|
|||
**参数**:
|
||||
|
||||
- `handle` 异步播放器句柄。
|
||||
- `on_start` 结果回调函数。
|
||||
- `cookie` 回调参数 for `on_start`.
|
||||
- `on_start` 播放开始后的结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -571,13 +567,13 @@ int media_uv_player_start(void* handle, media_uv_callback on_start, void* cookie
|
|||
int media_uv_player_pause(void* handle, media_uv_callback on_pause, void* cookie);
|
||||
```
|
||||
|
||||
暂停 the playing。
|
||||
暂停播放。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步播放器句柄。
|
||||
- `on_pause` 结果回调函数。
|
||||
- `cookie` 回调参数 for `on_pause`.
|
||||
- `on_pause` 暂停完成后的结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -590,13 +586,13 @@ int media_uv_player_pause(void* handle, media_uv_callback on_pause, void* cookie
|
|||
int media_uv_player_stop(void* handle, media_uv_callback on_stop, void* cookie);
|
||||
```
|
||||
|
||||
停止 the playing, clear the prepared re音频源 file。
|
||||
停止播放并清除已准备的音频源。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步播放器句柄。
|
||||
- `on_stop` 结果回调函数。
|
||||
- `cookie` 回调参数 for `on_stop`.
|
||||
- `on_stop` 停止完成后的结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -609,18 +605,18 @@ int media_uv_player_stop(void* handle, media_uv_callback on_stop, void* cookie);
|
|||
int media_uv_player_set_volume(void* handle, float volume, media_uv_callback on_volume, void* cookie);
|
||||
```
|
||||
|
||||
设置 player 音量。
|
||||
设置播放音量。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步播放器句柄。
|
||||
- `volume` Volume in [0.0, 1.0].
|
||||
- `on_volume` 结果回调函数。
|
||||
- `cookie` 回调参数 for `on_volume`.
|
||||
- `volume` 音量值,取值范围 `[0.0, 1.0]`。
|
||||
- `on_volume` 设置完成后的结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_uv_player_get_volume
|
||||
|
|
@ -629,14 +625,13 @@ int media_uv_player_set_volume(void* handle, float volume, media_uv_callback on_
|
|||
int media_uv_player_get_volume(void* handle, media_uv_float_callback on_volume, void* cookie);
|
||||
```
|
||||
|
||||
获取 播放器 handle 音量。
|
||||
获取当前播放音量。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步播放器句柄。
|
||||
- `volume` 音量值,取值范围 `0.0 - 1.0`。
|
||||
- `on_volume` 结果回调函数。
|
||||
- `cookie` 回调参数 for `on_volume`.
|
||||
- `on_volume` 结果回调函数,回调参数为当前音量值(范围 `0.0 - 1.0`)。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -649,13 +644,13 @@ int media_uv_player_get_volume(void* handle, media_uv_float_callback on_volume,
|
|||
int media_uv_player_get_playing(void* handle, media_uv_int_callback on_playing, void* cookie);
|
||||
```
|
||||
|
||||
获取 current playing status。
|
||||
获取当前播放状态。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步播放器句柄。
|
||||
- `on_playing` 结果回调函数。
|
||||
- `cookie` 回调参数 for `on_playing`.
|
||||
- `on_playing` 结果回调函数,回调参数为播放状态。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -668,13 +663,13 @@ int media_uv_player_get_playing(void* handle, media_uv_int_callback on_playing,
|
|||
int media_uv_player_get_position(void* handle, media_uv_unsigned_callback on_position, void* cookie);
|
||||
```
|
||||
|
||||
获取 current playing 位置。
|
||||
获取当前播放位置。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步播放器句柄。
|
||||
- `on_position` 结果回调函数。
|
||||
- `cookie` 回调参数 for `on_position`.
|
||||
- `on_position` 结果回调函数,回调参数为当前位置(毫秒)。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -687,13 +682,13 @@ int media_uv_player_get_position(void* handle, media_uv_unsigned_callback on_pos
|
|||
int media_uv_player_get_duration(void* handle, media_uv_unsigned_callback on_duration, void* cookie);
|
||||
```
|
||||
|
||||
获取 时长 of current playing re音频源。
|
||||
获取当前音频源的总时长。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步播放器句柄。
|
||||
- `on_duration` 结果回调函数。
|
||||
- `cookie` 回调参数 for `on_duration`.
|
||||
- `on_duration` 结果回调函数,回调参数为总时长(毫秒)。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -706,13 +701,13 @@ int media_uv_player_get_duration(void* handle, media_uv_unsigned_callback on_dur
|
|||
int media_uv_player_get_latency(void* handle, media_uv_unsigned_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
获取 latency of current playing re音频源。
|
||||
获取当前音频源的播放延迟。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步播放器句柄。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数 for `on_latency`.
|
||||
- `cb` 结果回调函数,回调参数为延迟帧数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -725,14 +720,14 @@ int media_uv_player_get_latency(void* handle, media_uv_unsigned_callback cb, voi
|
|||
int media_uv_player_set_looping(void* handle, int loop, media_uv_callback on_looping, void* cookie);
|
||||
```
|
||||
|
||||
设置 the loop times。
|
||||
设置循环播放次数。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步播放器句柄。
|
||||
- `loop` 循环次数,`-1` 表示无限循环。
|
||||
- `on_looping` 结果回调函数。
|
||||
- `cookie` 回调参数 for `on_looping`.
|
||||
- `on_looping` 设置完成后的结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -745,14 +740,14 @@ int media_uv_player_set_looping(void* handle, int loop, media_uv_callback on_loo
|
|||
int media_uv_player_seek(void* handle, unsigned int position, media_uv_callback on_seek, void* cookie);
|
||||
```
|
||||
|
||||
跳转 to msec 位置 from begining。
|
||||
跳转到指定的播放位置。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步播放器句柄。
|
||||
- `position` 起始位置,单位为毫秒。
|
||||
- `on_seek` 结果回调函数。
|
||||
- `cookie` 回调参数 for `on_seek`.
|
||||
- `position` 目标位置,单位为毫秒,从起始位置计算。
|
||||
- `on_seek` 跳转完成后的结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -765,16 +760,16 @@ int media_uv_player_seek(void* handle, unsigned int position, media_uv_callback
|
|||
int media_uv_player_set_property(void* handle, const char* target, const char* key, const char* value, media_uv_callback on_setprop, void* cookie);
|
||||
```
|
||||
|
||||
设置 properties of 播放器 handle。
|
||||
设置播放器属性。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步播放器句柄。
|
||||
- `target` 目标 filter 名称。
|
||||
- `key` Key
|
||||
- `value` Value
|
||||
- `on_setprop` 结果回调函数。
|
||||
- `cookie` 回调参数 for `on_setprop`.
|
||||
- `key` 属性键名。
|
||||
- `value` 属性值。
|
||||
- `on_setprop` 设置完成后的结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -787,15 +782,15 @@ int media_uv_player_set_property(void* handle, const char* target, const char* k
|
|||
int media_uv_player_get_property(void* handle, const char* target, const char* key, media_uv_string_callback on_getprop, void* cookie);
|
||||
```
|
||||
|
||||
获取 properties of 播放器 handle。
|
||||
获取播放器属性。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步播放器句柄。
|
||||
- `target` 目标 filter 名称。
|
||||
- `key` Key
|
||||
- `on_getprop` 结果回调函数。
|
||||
- `cookie` 回调参数 for `on_getprop`.
|
||||
- `key` 属性键名。
|
||||
- `on_getprop` 结果回调函数,回调参数为属性值字符串。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -808,17 +803,17 @@ int media_uv_player_get_property(void* handle, const char* target, const char* k
|
|||
int media_uv_player_query(void* handle, media_uv_object_callback on_query, void* cookie);
|
||||
```
|
||||
|
||||
Query 元数据 of 播放器 handle。
|
||||
查询播放器元数据。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步播放器句柄。
|
||||
- `on_query` 接收元数据指针的回调函数。
|
||||
- `cookie` 回调参数 for `on_query`.
|
||||
- `on_query` 结果回调函数,回调参数为元数据指针。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_uv_player_close_socket
|
||||
|
|
@ -831,8 +826,8 @@ int media_uv_player_close_socket(void* handle);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄.
|
||||
- `handle` 播放器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
|
|
|||
|
|
@ -48,16 +48,12 @@ int media_policy_get_audio_mode(char* mode, int len);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `mode` 缓冲区地址.
|
||||
- `len` 缓冲区长度.
|
||||
- `mode` 输出缓冲区。
|
||||
- `len` 缓冲区长度。
|
||||
|
||||
|
||||
## 同步接口 - 设备使用
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `0`,失败时返回负的 errno。
|
||||
|
||||
|
||||
### media_policy_set_devices_use
|
||||
|
||||
|
|
@ -69,7 +65,7 @@ int media_policy_set_devices_use(const char* devices);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `devices` 设备常量, 支持多设备,用 "|" 分隔.
|
||||
- `devices` 设备常量,支持多设备,用 "|" 分隔。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -86,7 +82,7 @@ int media_policy_set_devices_unuse(const char* devices);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `devices` 设备常量, 支持多设备,用 "|" 分隔.
|
||||
- `devices` 设备常量,支持多设备,用 "|" 分隔。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -104,7 +100,7 @@ int media_policy_get_devices_use(char* devices, int len);
|
|||
**参数**:
|
||||
|
||||
- `devices` 设备名称字符串,多个设备用 `|` 分隔(例如 `"sco"`、`"sco|mic"`、`"<none>"`)。
|
||||
- `len` 缓冲区长度.
|
||||
- `len` 缓冲区长度。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -121,16 +117,12 @@ int media_policy_is_devices_use(const char* devices, int* use);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `devices` 设备常量, 支持多设备,用 "|" 分隔.
|
||||
- `devices` 设备常量,支持多设备,用 "|" 分隔。
|
||||
- `use` 设备使用状态:0 表示所有设备均未使用,1 表示至少有一个设备正在使用。
|
||||
|
||||
|
||||
## 同步接口 - HFP 采样率与设备可用性
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `0`,失败时返回负的 errno。
|
||||
|
||||
|
||||
### media_policy_set_hfp_samplerate
|
||||
|
||||
|
|
@ -138,7 +130,7 @@ int media_policy_is_devices_use(const char* devices, int* use);
|
|||
int media_policy_set_hfp_samplerate(int rate);
|
||||
```
|
||||
|
||||
设置 HFP 蓝牙通话采样率. * HFP (Hand Free Profile) is based on bt-sco, the samplerate is uncertain before negotiation is done。
|
||||
设置 HFP 蓝牙通话采样率。HFP(Hands-Free Profile)基于 BT-SCO 传输,采样率在协商完成前不确定。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -159,7 +151,7 @@ int media_policy_set_devices_available(const char* devices);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `devices` 设备常量, 支持多设备,用 "|" 分隔.
|
||||
- `devices` 设备常量,支持多设备,用 "|" 分隔。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -176,7 +168,7 @@ int media_policy_set_devices_unavailable(const char* devices);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `devices` 设备常量, 支持多设备,用 "|" 分隔.
|
||||
- `devices` 设备常量,支持多设备,用 "|" 分隔。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -189,7 +181,7 @@ int media_policy_set_devices_unavailable(const char* devices);
|
|||
int media_policy_get_devices_available(char* devices, int len);
|
||||
```
|
||||
|
||||
获取 current 可用 设备s。
|
||||
获取当前可用设备。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -207,21 +199,16 @@ int media_policy_get_devices_available(char* devices, int len);
|
|||
int media_policy_is_devices_available(const char* devices, int* available);
|
||||
```
|
||||
|
||||
检查 whether 设备s are 可用。
|
||||
检查指定设备是否可用。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `devices` 待检查的设备,取值为 `MEDIA_DEVICE_*` 常量。
|
||||
设备 names are separated by "|"。
|
||||
- `devices` 待检查的设备,取值为 `MEDIA_DEVICE_*` 常量,多个设备用 `|` 分隔。
|
||||
- `available` 设备可用性状态:0 表示所有设备均不可用,1 表示至少有一个设备可用。
|
||||
|
||||
|
||||
## 同步接口 - 静音控制
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `0`,失败时返回负的 errno。
|
||||
|
||||
|
||||
### media_policy_set_mute_mode
|
||||
|
||||
|
|
@ -229,7 +216,7 @@ int media_policy_is_devices_available(const char* devices, int* available);
|
|||
int media_policy_set_mute_mode(int mute);
|
||||
```
|
||||
|
||||
设置 静音 mode。
|
||||
设置静音模式。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -246,7 +233,7 @@ int media_policy_set_mute_mode(int mute);
|
|||
int media_policy_get_mute_mode(int* mute);
|
||||
```
|
||||
|
||||
获取 静音 mode。
|
||||
获取当前静音模式。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -255,10 +242,6 @@ int media_policy_get_mute_mode(int* mute);
|
|||
|
||||
## 同步接口 - 音量控制
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `0`,失败时返回负的 errno。
|
||||
|
||||
|
||||
### media_policy_set_stream_volume
|
||||
|
||||
|
|
@ -266,11 +249,11 @@ int media_policy_get_mute_mode(int* mute);
|
|||
int media_policy_set_stream_volume(const char* stream, int volume);
|
||||
```
|
||||
|
||||
设置 流 type 音量 index。
|
||||
设置指定流类型的音量档位。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `stream` MEDIA_STREAM_XXX.
|
||||
- `stream` 流类型常量(`MEDIA_STREAM_*`)。
|
||||
- `volume` 新的音量档位。
|
||||
|
||||
**返回值**:
|
||||
|
|
@ -284,11 +267,11 @@ int media_policy_set_stream_volume(const char* stream, int volume);
|
|||
int media_policy_get_stream_volume(const char* stream, int* volume);
|
||||
```
|
||||
|
||||
获取 流 type 音量 index。
|
||||
获取指定流类型的音量档位。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `stream` MEDIA_STREAM_XXX.
|
||||
- `stream` 流类型常量(`MEDIA_STREAM_*`)。
|
||||
- `volume` 当前音量档位。
|
||||
|
||||
**返回值**:
|
||||
|
|
@ -302,11 +285,11 @@ int media_policy_get_stream_volume(const char* stream, int* volume);
|
|||
int media_policy_increase_stream_volume(const char* stream);
|
||||
```
|
||||
|
||||
Increase 流 type 音量 index by 1。
|
||||
将指定流类型的音量档位加 1。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `stream` MEDIA_STREAM_XXX.
|
||||
- `stream` 流类型常量(`MEDIA_STREAM_*`)。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -319,19 +302,15 @@ Increase 流 type 音量 index by 1。
|
|||
int media_policy_decrease_stream_volume(const char* stream);
|
||||
```
|
||||
|
||||
Decrease 流 type 音量 index by 1。
|
||||
将指定流类型的音量档位减 1。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `stream` MEDIA_STREAM_XXX.
|
||||
- `stream` 流类型常量(`MEDIA_STREAM_*`)。
|
||||
|
||||
|
||||
## 同步接口 - 麦克风静音
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `0`,失败时返回负的 errno。
|
||||
|
||||
|
||||
### media_policy_set_mic_mute
|
||||
|
||||
|
|
@ -348,10 +327,6 @@ int media_policy_set_mic_mute(int mute);
|
|||
|
||||
## 同步接口 - 通用参数读写
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `0`,失败时返回负的 errno。
|
||||
|
||||
|
||||
### media_policy_set_int
|
||||
|
||||
|
|
@ -359,7 +334,7 @@ int media_policy_set_mic_mute(int mute);
|
|||
int media_policy_set_int(const char* name, int value, int apply);
|
||||
```
|
||||
|
||||
设置 numerical value to 策略条件。
|
||||
设置策略条件的数值。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -378,7 +353,7 @@ int media_policy_set_int(const char* name, int value, int apply);
|
|||
int media_policy_get_int(const char* name, int* value);
|
||||
```
|
||||
|
||||
获取 numerical value of 策略条件。
|
||||
获取策略条件的数值。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -396,7 +371,7 @@ int media_policy_get_int(const char* name, int* value);
|
|||
int media_policy_get_range(const char* name, int* min_value, int* max_value);
|
||||
```
|
||||
|
||||
获取 numerical value range of 策略条件。
|
||||
获取策略条件的数值范围。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -415,7 +390,7 @@ int media_policy_get_range(const char* name, int* min_value, int* max_value);
|
|||
int media_policy_set_string(const char* name, const char* value, int apply);
|
||||
```
|
||||
|
||||
设置 literal value to 策略条件。
|
||||
设置策略条件的字符串值。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -434,13 +409,13 @@ int media_policy_set_string(const char* name, const char* value, int apply);
|
|||
int media_policy_get_string(const char* name, char* value, int len);
|
||||
```
|
||||
|
||||
获取 literal value from 策略条件。
|
||||
获取策略条件的字符串值。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `name` 准则名称。
|
||||
- `value` 缓冲区地址.
|
||||
- `len` 缓冲区长度.
|
||||
- `value` 输出缓冲区。
|
||||
- `len` 缓冲区长度。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -491,7 +466,7 @@ int media_policy_exclude(const char* name, const char* values, int apply);
|
|||
int media_policy_contain(const char* name, const char* values, int* result);
|
||||
```
|
||||
|
||||
检查 whether literal values included in InclusiveCriterion。
|
||||
检查字面值是否包含在包含型条件中。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -548,7 +523,7 @@ int media_policy_decrease(const char* name, int apply);
|
|||
void* media_policy_subscribe(const char* name, media_policy_change_callback on_change, void* cookie);
|
||||
```
|
||||
|
||||
Subscribe 策略条件 on change。
|
||||
订阅策略条件变化事件。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -566,7 +541,7 @@ Subscribe 策略条件 on change。
|
|||
int media_policy_unsubscribe(void* handle);
|
||||
```
|
||||
|
||||
Unubscribe 策略条件 on change。
|
||||
取消订阅策略条件变化事件。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -578,10 +553,6 @@ Unubscribe 策略条件 on change。
|
|||
|
||||
以下接口仅在启用 `CONFIG_LIBUV` 时可用。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `0`,失败时返回负的 errno。
|
||||
|
||||
|
||||
### media_uv_policy_set_int
|
||||
|
||||
|
|
@ -589,7 +560,7 @@ Unubscribe 策略条件 on change。
|
|||
int media_uv_policy_set_int(void* loop, const char* name, int value, int apply, media_uv_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
设置 numerical value to a 策略条件。
|
||||
设置策略条件的数值。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -598,7 +569,7 @@ int media_uv_policy_set_int(void* loop, const char* name, int value, int apply,
|
|||
- `value` 要设置的数值。
|
||||
- `apply` 是否将新值应用到策略配置。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -611,14 +582,14 @@ int media_uv_policy_set_int(void* loop, const char* name, int value, int apply,
|
|||
int media_uv_policy_get_int(void* loop, const char* name, media_uv_int_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
获取 numerical value of a 策略条件。
|
||||
获取策略条件的数值。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `name` 准则名称。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -631,7 +602,7 @@ int media_uv_policy_get_int(void* loop, const char* name, media_uv_int_callback
|
|||
int media_uv_policy_increase(void* loop, const char* name, int apply, media_uv_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
Increase numerical value of a 策略条件 by one。
|
||||
将策略条件的数值加 1。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -639,7 +610,7 @@ Increase numerical value of a 策略条件 by one。
|
|||
- `name` 准则名称。
|
||||
- `apply` 是否将新值应用到策略配置。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -652,7 +623,7 @@ Increase numerical value of a 策略条件 by one。
|
|||
int media_uv_policy_set_string(void* loop, const char* name, const char* value, int apply, media_uv_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
设置 literal value to a 策略条件。
|
||||
设置策略条件的字符串值。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -661,7 +632,7 @@ int media_uv_policy_set_string(void* loop, const char* name, const char* value,
|
|||
- `value` 要设置的字符串值。
|
||||
- `apply` 是否将新值应用到策略配置。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -674,14 +645,14 @@ int media_uv_policy_set_string(void* loop, const char* name, const char* value,
|
|||
int media_uv_policy_get_string(void* loop, const char* name, media_uv_string_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
获取 literal value of a 策略条件。
|
||||
获取策略条件的字符串值。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `name` 准则名称。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -694,7 +665,7 @@ int media_uv_policy_get_string(void* loop, const char* name, media_uv_string_cal
|
|||
int media_uv_policy_decrease(void* loop, const char* name, int apply, media_uv_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
Decrease numerical value of a 策略条件 by one。
|
||||
将策略条件的数值减 1。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -702,7 +673,7 @@ Decrease numerical value of a 策略条件 by one。
|
|||
- `name` 准则名称。
|
||||
- `apply` 是否将新值应用到策略配置。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -721,10 +692,10 @@ int media_uv_policy_include(void* loop, const char* name, const char* value, int
|
|||
|
||||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `name` 准则名称。
|
||||
- `value` 字符串值数组。.
|
||||
- `value` 字符串值数组。
|
||||
- `apply` 是否将新值应用到策略配置。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -743,10 +714,10 @@ int media_uv_policy_exclude(void* loop, const char* name, const char* value, int
|
|||
|
||||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `name` 准则名称。
|
||||
- `value` 字符串值数组。.
|
||||
- `value` 字符串值数组。
|
||||
- `apply` 是否将新值应用到策略配置。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -759,15 +730,15 @@ int media_uv_policy_exclude(void* loop, const char* name, const char* value, int
|
|||
int media_uv_policy_contain(void* loop, const char* name, const char* value, media_uv_int_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
检查 whether literal values included in InclusiveCriterion。
|
||||
检查字面值是否包含在包含型条件中。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `name` 准则名称。
|
||||
- `value` 字符串值数组。.
|
||||
- `value` 字符串值数组。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -780,7 +751,7 @@ int media_uv_policy_contain(void* loop, const char* name, const char* value, med
|
|||
int media_uv_policy_set_stream_volume(void* loop, const char* stream, int volume, media_uv_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
设置 音量 of a 流 type。
|
||||
设置指定流类型的音量。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -788,7 +759,7 @@ int media_uv_policy_set_stream_volume(void* loop, const char* stream, int volume
|
|||
- `stream` 流类型,取值为流类型常量。
|
||||
- `volume` 要设置的音量档位。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -801,7 +772,7 @@ int media_uv_policy_set_stream_volume(void* loop, const char* stream, int volume
|
|||
int media_uv_policy_get_stream_volume(void* loop, const char* stream, media_uv_int_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
获取 音量 of a 流 type。
|
||||
获取指定流类型的音量。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -809,7 +780,7 @@ int media_uv_policy_get_stream_volume(void* loop, const char* stream, media_uv_i
|
|||
- `stream` 流类型,取值为流类型常量。
|
||||
- `volume` 要设置的音量档位。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -822,14 +793,14 @@ int media_uv_policy_get_stream_volume(void* loop, const char* stream, media_uv_i
|
|||
int media_uv_policy_increase_stream_volume(void* loop, const char* stream, media_uv_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
Increase 音量 of a 流 type。
|
||||
将指定流类型的音量加 1。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `stream` 流类型,取值为流类型常量。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -842,14 +813,14 @@ Increase 音量 of a 流 type。
|
|||
int media_uv_policy_decrease_stream_volume(void* loop, const char* stream, media_uv_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
Decrease 音量 of a 流 type。
|
||||
将指定流类型的音量减 1。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `stream` 流类型,取值为流类型常量。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -869,7 +840,7 @@ int media_uv_policy_set_audio_mode(void* loop, const char* mode, media_uv_callba
|
|||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `mode` 新的音频模式。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -888,7 +859,7 @@ int media_uv_policy_get_audio_mode(void* loop, media_uv_string_callback cb, void
|
|||
|
||||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -901,7 +872,7 @@ int media_uv_policy_get_audio_mode(void* loop, media_uv_string_callback cb, void
|
|||
int media_uv_policy_set_devices_use(void* loop, const char* devices, bool use, media_uv_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
Force use/unuse 设备s (or protocols)。
|
||||
强制使用或取消使用指定设备(或协议)。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -909,7 +880,7 @@ Force use/unuse 设备s (or protocols)。
|
|||
- `devices` 目标设备。
|
||||
- `use` 将设备设置为使用或未使用状态。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -922,13 +893,13 @@ Force use/unuse 设备s (or protocols)。
|
|||
int media_uv_policy_get_devices_use(void* loop, media_uv_string_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
获取 current force-use 设备s。
|
||||
获取当前强制使用的设备。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -941,14 +912,14 @@ int media_uv_policy_get_devices_use(void* loop, media_uv_string_callback cb, voi
|
|||
int media_uv_policy_is_devices_use(void* loop, const char* devices, media_uv_int_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
检查 whether 设备s are being used。
|
||||
检查指定设备是否正在被使用。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `devices` 待检查的设备。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -961,19 +932,23 @@ int media_uv_policy_is_devices_use(void* loop, const char* devices, media_uv_int
|
|||
int media_uv_policy_set_hfp_samplerate(void* loop, int rate, media_uv_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
设置 hfp(hands free protocol) sampling rate。
|
||||
设置 HFP(Hands-Free Profile)采样率。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `rate` 采样率,CVSD 编码取 8000,mSBC 编码取 16000。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
|
||||
**注意**:
|
||||
|
||||
- 此接口已废弃,`rate` 参数将来会改为 `int` 类型。
|
||||
|
||||
|
||||
### media_uv_policy_set_devices_available
|
||||
|
||||
|
|
@ -981,7 +956,7 @@ int media_uv_policy_set_hfp_samplerate(void* loop, int rate, media_uv_callback c
|
|||
int media_uv_policy_set_devices_available(void* loop, const char* devices, bool available, media_uv_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
设置 设备s 可用 or un可用。
|
||||
设置设备可用或不可用状态。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -989,7 +964,7 @@ int media_uv_policy_set_devices_available(void* loop, const char* devices, bool
|
|||
- `devices` 目标设备。
|
||||
- `available` 将设备设置为可用或不可用状态。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -1002,13 +977,13 @@ int media_uv_policy_set_devices_available(void* loop, const char* devices, bool
|
|||
int media_uv_policy_get_devices_available(void* loop, media_uv_string_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
获取 current 可用 设备s。
|
||||
获取当前可用设备。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -1021,14 +996,14 @@ int media_uv_policy_get_devices_available(void* loop, media_uv_string_callback c
|
|||
int media_uv_policy_is_devices_available(void* loop, const char* devices, media_uv_int_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
检查 whether 设备s are 可用。
|
||||
检查指定设备是否可用。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `devices` 待检查的设备。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -1041,14 +1016,14 @@ int media_uv_policy_is_devices_available(void* loop, const char* devices, media_
|
|||
int media_uv_policy_set_mute_mode(void* loop, int mute, media_uv_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
设置 静音 mode。
|
||||
设置静音模式。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `mute` 新的静音模式。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -1061,13 +1036,13 @@ int media_uv_policy_set_mute_mode(void* loop, int mute, media_uv_callback cb, vo
|
|||
int media_uv_policy_get_mute_mode(void* loop, media_uv_int_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
获取 静音 mode。
|
||||
获取当前静音模式。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -1087,7 +1062,7 @@ int media_uv_policy_set_mic_mute(void* loop, int mute, media_uv_callback cb, voi
|
|||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `mute` 静音模式。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
|
|||
|
|
@ -27,11 +27,11 @@ void* media_recorder_open(const char* params);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `params` 源类型常量。 Usually MEDIA_SOURCE_MIC.
|
||||
- `params` 源类型常量,通常为 `MEDIA_SOURCE_MIC`。
|
||||
|
||||
**返回值**:
|
||||
|
||||
void* 录制器句柄 on success; NULL on failure。
|
||||
成功时返回录制器句柄,失败时返回 `NULL`。
|
||||
|
||||
|
||||
### media_recorder_close
|
||||
|
|
@ -44,7 +44,7 @@ int media_recorder_close(void* handle);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 录制器句柄
|
||||
- `handle` 录制器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -57,13 +57,13 @@ int media_recorder_close(void* handle);
|
|||
int media_recorder_set_event_callback(void* handle, void* cookie, media_event_callback event_cb);
|
||||
```
|
||||
|
||||
设置录制器事件回调, the callback will be called when state changed or something user cares。
|
||||
设置录制器事件回调,当状态变化或发生用户关注的事件时触发回调。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 录制器句柄。
|
||||
- `cookie` 用户数据,在 `event_cb` 触发时回传给用户,通常会被修改。
|
||||
- `on_event` 事件回调函数。
|
||||
- `cookie` 用户数据,在 `event_cb` 触发时回传给用户。
|
||||
- `event_cb` 事件回调函数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ int media_recorder_prepare(void* handle, const char* url, const char* options);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 录制器句柄
|
||||
- `handle` 录制器句柄。
|
||||
- `url` 资源路径,支持两种模式:1. URL 模式:`url` 为本地文件路径,框架会打开并录制到该路径;2. BUFFER 模式:`url` 为 `NULL`,调用方需通过 `media_recorder_read_data()` 或 `media_recorder_get_socket()` + `read()` 持续接收数据。
|
||||
- `options` 额外配置参数,字段包括:format(封装格式,如 opus/wav)、sample_rate(采样率)、ch_layout(声道布局)、b(比特率,如 `"23900"`)、vbr(0=固定码率,1=可变码率)、level(编码复杂度,0-10,默认 10)。示例:`"format=opusraw:sample_rate=16000:ch_layout=mono:b=32000:vbr=0:level=1"`。
|
||||
|
||||
|
|
@ -95,15 +95,15 @@ int media_recorder_prepare(void* handle, const char* url, const char* options);
|
|||
int media_recorder_reset(void* handle);
|
||||
```
|
||||
|
||||
重置录制器。
|
||||
重置录制器到初始状态。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 录制器句柄.
|
||||
- `handle` 录制器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
int 成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
## 同步接口 - 数据流
|
||||
|
|
@ -118,9 +118,9 @@ ssize_t media_recorder_read_data(void* handle, void* data, size_t len);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 录制器句柄.
|
||||
- `data` 缓冲区地址.
|
||||
- `len` 缓冲区长度 to read.
|
||||
- `handle` 录制器句柄。
|
||||
- `data` 数据缓冲区地址。
|
||||
- `len` 要读取的数据长度(字节)。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -137,12 +137,12 @@ int media_recorder_get_sockaddr(void* handle, struct sockaddr_storage* addr);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 录制器句柄.
|
||||
- `addr` Socket 地址信息。
|
||||
- `handle` 录制器句柄。
|
||||
- `addr` 用于存储 Socket 地址信息的输出参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
int 成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_recorder_get_socket
|
||||
|
|
@ -155,11 +155,11 @@ int media_recorder_get_socket(void* handle);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 录制器句柄.
|
||||
- `handle` 录制器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `0`,失败时返回负的 errno。
|
||||
成功时返回 Socket 文件描述符,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_recorder_close_socket
|
||||
|
|
@ -168,11 +168,11 @@ int media_recorder_get_socket(void* handle);
|
|||
void media_recorder_close_socket(void* handle);
|
||||
```
|
||||
|
||||
关闭 Socket fd when recorder finish recving data。
|
||||
关闭录制器数据接收完成后的 Socket 文件描述符。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 录制器句柄.
|
||||
- `handle` 录制器句柄。
|
||||
|
||||
|
||||
## 同步接口 - 录制控制
|
||||
|
|
@ -183,15 +183,15 @@ void media_recorder_close_socket(void* handle);
|
|||
int media_recorder_start(void* handle);
|
||||
```
|
||||
|
||||
开始/resume the recording the re音频源。
|
||||
开始或恢复录制。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 录制器句柄.
|
||||
- `handle` 录制器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
int 成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_recorder_pause
|
||||
|
|
@ -200,15 +200,15 @@ int 成功时返回 0,失败时返回负的错误码。
|
|||
int media_recorder_pause(void* handle);
|
||||
```
|
||||
|
||||
暂停 录制器 after capturing start。
|
||||
暂停录制。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 录制器句柄.
|
||||
- `handle` 录制器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
int 成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_recorder_stop
|
||||
|
|
@ -221,11 +221,11 @@ int media_recorder_stop(void* handle);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 录制器句柄.
|
||||
- `handle` 录制器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
int 成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
## 同步接口 - 属性
|
||||
|
|
@ -236,14 +236,14 @@ int 成功时返回 0,失败时返回负的错误码。
|
|||
int media_recorder_set_property(void* handle, const char* target, const char* key, const char* value);
|
||||
```
|
||||
|
||||
设置 properties of 录制器 path。
|
||||
设置录制器属性。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 录制器句柄。
|
||||
- `target` 目标 filter 名称。.
|
||||
- `key` 要设置的键名。
|
||||
- `value` 要设置的值。
|
||||
- `target` 目标 filter 名称。
|
||||
- `key` 属性键名。
|
||||
- `value` 属性值。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -256,24 +256,23 @@ int media_recorder_set_property(void* handle, const char* target, const char* ke
|
|||
int media_recorder_get_property(void* handle, const char* target, const char* key, char* value, int value_len);
|
||||
```
|
||||
|
||||
获取 properties of 录制器 path。
|
||||
获取录制器属性。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 录制器句柄。
|
||||
- `target` 目标 filter 名称。.
|
||||
- `key` 要设置的键名。
|
||||
- `value` 输出缓冲区。.
|
||||
- `value_len` 缓冲区长度 of value.
|
||||
|
||||
|
||||
## 同步接口 - 图片捕获
|
||||
- `target` 目标 filter 名称。
|
||||
- `key` 属性键名。
|
||||
- `value` 输出缓冲区,用于存储属性值。
|
||||
- `value_len` 输出缓冲区长度。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `0`,失败时返回负的 errno。
|
||||
|
||||
|
||||
## 同步接口 - 图片捕获
|
||||
|
||||
### media_recorder_take_picture
|
||||
|
||||
```c
|
||||
|
|
@ -299,7 +298,7 @@ int media_recorder_take_picture(char* params, char* filename, size_t number);
|
|||
void* media_recorder_start_picture(char* params, char* filename, size_t number, media_event_callback event_cb, void* cookie);
|
||||
```
|
||||
|
||||
开始 taking picture, including open, set_事件_回调, prepare, and start operations。
|
||||
开始拍照,内部依次执行打开、设置事件回调、准备和启动操作。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -320,7 +319,7 @@ void* media_recorder_start_picture(char* params, char* filename, size_t number,
|
|||
int media_recorder_finish_picture(void* handle);
|
||||
```
|
||||
|
||||
关闭 录制器 when taking picture finished。
|
||||
拍照完成后关闭录制器。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -328,7 +327,7 @@ int media_recorder_finish_picture(void* handle);
|
|||
|
||||
**返回值**:
|
||||
|
||||
int 成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
## 异步接口(基于 libuv)
|
||||
|
|
@ -341,7 +340,7 @@ int 成功时返回 0,失败时返回负的错误码。
|
|||
void* media_uv_recorder_open(void* loop, const char* source, media_uv_callback on_open, void* cookie);
|
||||
```
|
||||
|
||||
打开 an async recorder。
|
||||
打开异步录制器。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -352,7 +351,7 @@ void* media_uv_recorder_open(void* loop, const char* source, media_uv_callback o
|
|||
|
||||
**返回值**:
|
||||
|
||||
成功时返回录制器句柄。
|
||||
成功时返回录制器句柄,失败时返回 `NULL`。
|
||||
|
||||
|
||||
### media_uv_recorder_listen
|
||||
|
|
@ -361,7 +360,7 @@ void* media_uv_recorder_open(void* loop, const char* source, media_uv_callback o
|
|||
int media_uv_recorder_listen(void* handle, media_event_callback on_event);
|
||||
```
|
||||
|
||||
Listen to status change 事件 by setting 回调。
|
||||
注册事件监听回调,接收录制状态变化通知。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -379,7 +378,7 @@ Listen to status change 事件 by setting 回调。
|
|||
int media_uv_recorder_close(void* handle, media_uv_callback on_close);
|
||||
```
|
||||
|
||||
关闭 the async recorder。
|
||||
关闭异步录制器。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -397,15 +396,16 @@ int media_uv_recorder_close(void* handle, media_uv_callback on_close);
|
|||
int media_uv_recorder_prepare(void* handle, const char* url, const char* options, media_uv_object_callback on_connection, media_uv_callback on_prepare, void* cookie);
|
||||
```
|
||||
|
||||
准备 destination file。
|
||||
准备录制目标文件。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步录制器句柄。
|
||||
- `url` 目标路径。
|
||||
- `options` 目标配置参数,详见 `media_recorder_prepare`。
|
||||
- `on_connection` * @param[in] on_prepare 结果回调,在 BUFFER 模式下会携带可写入数据的 `uv_pipe_t`。
|
||||
- `cookie` 一次性回调上下文。
|
||||
- `on_connection` BUFFER 模式下接收可写入数据的 `uv_pipe_t` 的回调函数。
|
||||
- `on_prepare` 准备完成后的结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -418,14 +418,14 @@ int media_uv_recorder_prepare(void* handle, const char* url, const char* options
|
|||
int media_uv_recorder_start_auto(void* handle, const char* stream, media_uv_callback on_start, void* cookie);
|
||||
```
|
||||
|
||||
开始 or resume the capturing with auto 焦点 request。
|
||||
开始或恢复录制,并自动请求音频焦点。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步录制器句柄。
|
||||
- `scenario` 场景常量。 in media_defs.h.
|
||||
- `on_start` 结果回调函数。
|
||||
- `cookie` 一次性回调上下文。
|
||||
- `scenario` 场景常量(定义在 `media_defs.h` 中)。
|
||||
- `on_start` 录制开始后的结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -438,13 +438,13 @@ int media_uv_recorder_start_auto(void* handle, const char* stream, media_uv_call
|
|||
int media_uv_recorder_start(void* handle, media_uv_callback on_start, void* cookie);
|
||||
```
|
||||
|
||||
开始 or resume the capturing。
|
||||
开始或恢复录制。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步录制器句柄。
|
||||
- `on_start` 结果回调函数。
|
||||
- `cookie` 一次性回调上下文。
|
||||
- `on_start` 录制开始后的结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -457,13 +457,13 @@ int media_uv_recorder_start(void* handle, media_uv_callback on_start, void* cook
|
|||
int media_uv_recorder_pause(void* handle, media_uv_callback on_pause, void* cookie);
|
||||
```
|
||||
|
||||
暂停 the capturing。
|
||||
暂停录制。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步录制器句柄。
|
||||
- `on_pause` 结果回调函数。
|
||||
- `cookie` 一次性回调上下文。
|
||||
- `on_pause` 暂停完成后的结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -476,13 +476,13 @@ int media_uv_recorder_pause(void* handle, media_uv_callback on_pause, void* cook
|
|||
int media_uv_recorder_stop(void* handle, media_uv_callback on_stop, void* cookie);
|
||||
```
|
||||
|
||||
停止 the capturing, finish the destination file。
|
||||
停止录制并完成目标文件写入。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步录制器句柄。
|
||||
- `on_stop` 结果回调函数。
|
||||
- `cookie` 一次性回调上下文。
|
||||
- `on_stop` 停止完成后的结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -495,16 +495,16 @@ int media_uv_recorder_stop(void* handle, media_uv_callback on_stop, void* cookie
|
|||
int media_uv_recorder_set_property(void* handle, const char* target, const char* key, const char* value, media_uv_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
设置 properties of 录制器。
|
||||
设置录制器属性。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步录制器句柄。
|
||||
- `target` 目标 filter 名称。.
|
||||
- `key` Key.
|
||||
- `value` Value.
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 一次性回调上下文。
|
||||
- `target` 目标 filter 名称。
|
||||
- `key` 属性键名。
|
||||
- `value` 属性值。
|
||||
- `cb` 设置完成后的结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -517,17 +517,15 @@ int media_uv_recorder_set_property(void* handle, const char* target, const char*
|
|||
int media_uv_recorder_get_property(void* handle, const char* target, const char* key, media_uv_string_callback cb, void* cookie);
|
||||
```
|
||||
|
||||
获取 properties of 录制器。
|
||||
获取录制器属性。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步录制器句柄。
|
||||
- `target` 目标 filter 名称。.
|
||||
- `key` Key.
|
||||
- `value` 输出缓冲区。.
|
||||
- `value_len` 缓冲区长度 of value.
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 一次性回调上下文。
|
||||
- `target` 目标 filter 名称。
|
||||
- `key` 属性键名。
|
||||
- `cb` 结果回调函数,回调参数为属性值字符串。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -540,13 +538,13 @@ int media_uv_recorder_get_property(void* handle, const char* target, const char*
|
|||
int media_uv_recorder_reset(void* handle, media_uv_callback on_reset, void* cookie);
|
||||
```
|
||||
|
||||
重置 录制器, clear the origin record and record new one。
|
||||
重置录制器,清除当前录制内容以准备新的录制。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步录制器句柄。
|
||||
- `cb` 结果回调函数。
|
||||
- `cookie` 一次性回调上下文。
|
||||
- `on_reset` 重置完成后的结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -559,7 +557,7 @@ int media_uv_recorder_reset(void* handle, media_uv_callback on_reset, void* cook
|
|||
int media_uv_recorder_take_picture(void* loop, char* params, char* filename, size_t number, media_uv_callback on_complete, void* cookie);
|
||||
```
|
||||
|
||||
从摄像头拍照。
|
||||
从摄像头异步拍照。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -567,11 +565,9 @@ int media_uv_recorder_take_picture(void* loop, char* params, char* filename, siz
|
|||
- `params` 相机打开路径参数。
|
||||
- `filename` 新图片的存储路径。
|
||||
- `number` 拍摄图片的数量。
|
||||
- `on_complete` 处理结果的回调函数。
|
||||
- `cookie` 用户私有数据。
|
||||
- `on_complete` 拍照完成后的结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `0`,失败时返回负的 errno。
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,11 +28,11 @@ void* media_session_open(const char* params);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `params` NULL, 暂未使用.
|
||||
- `params` 暂未使用,传 `NULL`。
|
||||
|
||||
**返回值**:
|
||||
|
||||
void* 控制器句柄, 失败时返回 NULL。
|
||||
成功时返回控制器句柄,失败时返回 `NULL`。
|
||||
|
||||
|
||||
### media_session_close
|
||||
|
|
@ -45,7 +45,7 @@ int media_session_close(void* handle);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 控制器句柄
|
||||
- `handle` 控制器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -62,13 +62,13 @@ int media_session_set_event_callback(void* handle, void* cookie, media_event_cal
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 控制器句柄
|
||||
- `cookie` 回调参数 for `on_event`.
|
||||
- `handle` 控制器句柄。
|
||||
- `cookie` 回调上下文参数。
|
||||
- `on_event` 事件回调函数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
## 控制器接口 - 播放控制
|
||||
|
|
@ -83,7 +83,7 @@ int media_session_start(void* handle);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 控制器句柄.
|
||||
- `handle` 控制器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -100,7 +100,7 @@ int media_session_stop(void* handle);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 控制器句柄.
|
||||
- `handle` 控制器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -117,7 +117,7 @@ int media_session_pause(void* handle);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 控制器句柄.
|
||||
- `handle` 控制器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -134,8 +134,8 @@ int media_session_seek(void* handle, unsigned position);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 控制器句柄.
|
||||
- `position` 起始位置,单位为毫秒。
|
||||
- `handle` 控制器句柄。
|
||||
- `position` 目标位置,单位为毫秒。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -152,7 +152,7 @@ int media_session_prev_song(void* handle);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 控制器句柄.
|
||||
- `handle` 控制器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -169,27 +169,26 @@ int media_session_next_song(void* handle);
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 控制器句柄.
|
||||
|
||||
|
||||
## 控制器接口 - 音量控制
|
||||
- `handle` 控制器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `0`,失败时返回负的 errno。
|
||||
|
||||
|
||||
## 控制器接口 - 音量控制
|
||||
|
||||
### media_session_increase_volume
|
||||
|
||||
```c
|
||||
int media_session_increase_volume(void* handle);
|
||||
```
|
||||
|
||||
请求 increase 音量。
|
||||
请求增大音量。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 控制器句柄.
|
||||
- `handle` 控制器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -202,11 +201,11 @@ int media_session_increase_volume(void* handle);
|
|||
int media_session_decrease_volume(void* handle);
|
||||
```
|
||||
|
||||
请求 decrease 音量。
|
||||
请求减小音量。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 控制器句柄.
|
||||
- `handle` 控制器句柄。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -219,16 +218,20 @@ int media_session_decrease_volume(void* handle);
|
|||
int media_session_set_volume(void* handle, int volume);
|
||||
```
|
||||
|
||||
Rquest set 音量。
|
||||
请求设置音量。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 控制器句柄.
|
||||
- `handle` 控制器句柄。
|
||||
- `volume` 音量档位。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
**注意**:
|
||||
|
||||
- 此接口尚未实现。
|
||||
|
||||
|
||||
## 控制器接口 - 状态查询
|
||||
|
|
@ -239,16 +242,16 @@ Rquest set 音量。
|
|||
int media_session_query(void* handle, const media_metadata_t** data);
|
||||
```
|
||||
|
||||
Query 元数据 from most 活跃状态 controllee。
|
||||
查询当前最活跃被控端的元数据。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 控制器句柄.
|
||||
- `data` 用于接收元数据指针的输出指针。
|
||||
- `handle` 控制器句柄。
|
||||
- `data` 用于接收元数据指针的输出参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_session_get_state
|
||||
|
|
@ -257,16 +260,16 @@ Query 元数据 from most 活跃状态 controllee。
|
|||
int media_session_get_state(void* handle, int* state);
|
||||
```
|
||||
|
||||
获取 all status。
|
||||
获取当前播放状态。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 控制器句柄.
|
||||
- `state` 当前状态。
|
||||
- `handle` 控制器句柄。
|
||||
- `state` 输出参数,当前播放状态。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_session_get_position
|
||||
|
|
@ -275,16 +278,16 @@ int media_session_get_state(void* handle, int* state);
|
|||
int media_session_get_position(void* handle, unsigned* position);
|
||||
```
|
||||
|
||||
获取 msec 位置。
|
||||
获取当前播放位置。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 控制器句柄.
|
||||
- `position` 当前位置,单位为毫秒。
|
||||
- `handle` 控制器句柄。
|
||||
- `position` 输出参数,当前位置,单位为毫秒。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_session_get_duration
|
||||
|
|
@ -293,16 +296,16 @@ int media_session_get_position(void* handle, unsigned* position);
|
|||
int media_session_get_duration(void* handle, unsigned* duration);
|
||||
```
|
||||
|
||||
获取 msec 时长。
|
||||
获取当前音频源的总时长。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 控制器句柄.
|
||||
- `duration` 当前总时长,单位为毫秒。
|
||||
- `handle` 控制器句柄。
|
||||
- `duration` 输出参数,总时长,单位为毫秒。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_session_get_volume
|
||||
|
|
@ -311,16 +314,16 @@ int media_session_get_duration(void* handle, unsigned* duration);
|
|||
int media_session_get_volume(void* handle, int* volume);
|
||||
```
|
||||
|
||||
获取 current 音量 index。
|
||||
获取当前音量。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 控制器句柄.
|
||||
- `volume` 音量档位。
|
||||
- `handle` 控制器句柄。
|
||||
- `volume` 输出参数,当前音量档位。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
## 被控端接口
|
||||
|
|
@ -331,16 +334,16 @@ int media_session_get_volume(void* handle, int* volume);
|
|||
void* media_session_register(void* cookie, media_event_callback on_event);
|
||||
```
|
||||
|
||||
注册 as a session controllee。
|
||||
注册为媒体会话被控端。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `cookie` Callback arguemnt of `on_event`.
|
||||
- `on_event` 事件回调函数。.
|
||||
- `cookie` 回调上下文参数。
|
||||
- `on_event` 事件回调函数,用于接收控制命令。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回被控端句柄,失败时返回 NULL。
|
||||
成功时返回被控端句柄,失败时返回 `NULL`。
|
||||
|
||||
|
||||
### media_session_unregister
|
||||
|
|
@ -349,7 +352,7 @@ void* media_session_register(void* cookie, media_event_callback on_event);
|
|||
int media_session_unregister(void* handle);
|
||||
```
|
||||
|
||||
取消注册 会话 controllee。
|
||||
取消注册被控端。
|
||||
|
||||
**参数**:
|
||||
|
||||
|
|
@ -366,14 +369,14 @@ int media_session_unregister(void* handle);
|
|||
int media_session_notify(void* handle, int event, int result, const char* extra);
|
||||
```
|
||||
|
||||
通知 the result of control message. * After receive MEDIA_EVENT_* from `on_事件`, as controllee you should do something to handle the control message, after you acknowledge the control message, you should call this api to send response to 控制器。
|
||||
通知控制器控制命令的处理结果。被控端收到 `MEDIA_EVENT_*` 事件后,完成相应处理,再调用此接口向控制器发送响应。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 被控端句柄。
|
||||
- `event` MEDIA_EVENT_*
|
||||
- `event` 要响应的事件类型(`MEDIA_EVENT_*`)。
|
||||
- `result` 操作结果,成功时为 `0`,失败时为负的 errno。
|
||||
- `extra` 附加消息。
|
||||
- `extra` 附加消息字符串,不需要时传 `NULL`。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -386,41 +389,40 @@ int media_session_notify(void* handle, int event, int result, const char* extra)
|
|||
int media_session_update(void* handle, const media_metadata_t* data);
|
||||
```
|
||||
|
||||
Update 元数据 to session。
|
||||
向会话更新元数据。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 被控端句柄。
|
||||
- `data` 要更新的元数据。
|
||||
|
||||
|
||||
## 异步接口(基于 libuv)
|
||||
|
||||
以下接口仅在启用 `CONFIG_LIBUV` 时可用,控制器与被控端均有对应异步版本。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `0`,失败时返回负的 errno。
|
||||
|
||||
|
||||
## 异步接口(基于 libuv)
|
||||
|
||||
以下接口仅在启用 `CONFIG_LIBUV` 时可用,控制器与被控端均有对应异步版本。
|
||||
|
||||
### media_uv_session_open
|
||||
|
||||
```c
|
||||
void* media_uv_session_open(void* loop, char* params, media_uv_callback on_open, void* cookie);
|
||||
```
|
||||
|
||||
打开 an async session controller。
|
||||
打开异步会话控制器。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `params` 暂未使用.
|
||||
- `params` 暂未使用,传 `NULL`。
|
||||
- `on_open` 打开完成后触发的回调函数。
|
||||
- `cookie` 回调上下文,供 `on_open`、`on_event`、`on_close` 共用。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回异步控制器句柄。
|
||||
成功时返回异步控制器句柄,失败时返回 `NULL`。
|
||||
|
||||
|
||||
### media_uv_session_close
|
||||
|
|
@ -429,16 +431,16 @@ void* media_uv_session_open(void* loop, char* params, media_uv_callback on_open,
|
|||
int media_uv_session_close(void* handle, media_uv_callback on_close);
|
||||
```
|
||||
|
||||
关闭 the async controller handle。
|
||||
关闭异步控制器。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 待销毁的异步控制器句柄。
|
||||
- `handle` 异步控制器句柄。
|
||||
- `on_close` 关闭完成后触发的回调函数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_uv_session_listen
|
||||
|
|
@ -447,16 +449,16 @@ int media_uv_session_close(void* handle, media_uv_callback on_close);
|
|||
int media_uv_session_listen(void* handle, media_event_callback on_event);
|
||||
```
|
||||
|
||||
Listen to the 事件s from controllee。
|
||||
注册事件监听回调,接收被控端状态变化通知。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` Async 控制器句柄.
|
||||
- `on_event` 事件回调函数。.
|
||||
- `handle` 异步控制器句柄。
|
||||
- `on_event` 事件回调函数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_uv_session_start
|
||||
|
|
@ -469,9 +471,9 @@ int media_uv_session_start(void* handle, media_uv_callback on_start, void* cooki
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` Async 控制器句柄.
|
||||
- `handle` 异步控制器句柄。
|
||||
- `on_start` 结果回调函数。
|
||||
- `cookie` 回调参数 of `on_start`
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -488,9 +490,9 @@ int media_uv_session_stop(void* handle, media_uv_callback on_stop, void* cookie)
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` Async 控制器句柄.
|
||||
- `handle` 异步控制器句柄。
|
||||
- `on_stop` 结果回调函数。
|
||||
- `cookie` 回调参数 of `on_stop`
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -507,9 +509,9 @@ int media_uv_session_pause(void* handle, media_uv_callback on_pause, void* cooki
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` Async 控制器句柄.
|
||||
- `handle` 异步控制器句柄。
|
||||
- `on_pause` 结果回调函数。
|
||||
- `cookie` 回调参数 of `on_pause`
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -526,10 +528,10 @@ int media_uv_session_seek(void* handle, unsigned position, media_uv_callback on_
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` 播放器句柄。
|
||||
- `position` 起始位置,单位为毫秒。
|
||||
- `handle` 异步控制器句柄。
|
||||
- `position` 目标位置,单位为毫秒。
|
||||
- `on_seek` 结果回调函数。
|
||||
- `cookie` 回调参数 of `on_seek`
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -546,9 +548,9 @@ int media_uv_session_prev_song(void* handle, media_uv_callback on_pre_song, void
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` Async 控制器句柄.
|
||||
- `on_prev` 结果回调函数。
|
||||
- `cookie` 回调参数 of `on_prev`
|
||||
- `handle` 异步控制器句柄。
|
||||
- `on_pre_song` 结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -565,9 +567,9 @@ int media_uv_session_next_song(void* handle, media_uv_callback on_next, void* co
|
|||
|
||||
**参数**:
|
||||
|
||||
- `handle` Async 控制器句柄.
|
||||
- `handle` 异步控制器句柄。
|
||||
- `on_next` 结果回调函数。
|
||||
- `cookie` 回调参数 of `on_next`
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -580,13 +582,13 @@ int media_uv_session_next_song(void* handle, media_uv_callback on_next, void* co
|
|||
int media_uv_session_increase_volume(void* handle, media_uv_callback on_increase, void* cookie);
|
||||
```
|
||||
|
||||
请求 increase 音量。
|
||||
请求增大音量。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步控制器句柄。
|
||||
- `on_increase` 结果回调函数。
|
||||
- `cookie` 回调参数 of `on_increase`
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -599,13 +601,13 @@ int media_uv_session_increase_volume(void* handle, media_uv_callback on_increase
|
|||
int media_uv_session_decrease_volume(void* handle, media_uv_callback on_decrease, void* cookie);
|
||||
```
|
||||
|
||||
请求 decrease 音量。
|
||||
请求减小音量。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步控制器句柄。
|
||||
- `on_decrease` 结果回调函数。
|
||||
- `cookie` 回调参数 of `on_decrease`
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -623,13 +625,17 @@ int media_uv_session_set_volume(void* handle, int volume, media_uv_callback on_s
|
|||
**参数**:
|
||||
|
||||
- `handle` 异步控制器句柄。
|
||||
- `Volume` 音量档位。
|
||||
- `on_volume` 结果回调函数。
|
||||
- `cookie` 回调参数 of `on_volume`
|
||||
- `volume` 音量档位。
|
||||
- `on_set_volume` 结果回调函数。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
**注意**:
|
||||
|
||||
- 此接口尚未实现。
|
||||
|
||||
|
||||
### media_uv_session_query
|
||||
|
|
@ -643,12 +649,12 @@ int media_uv_session_query(void* handle, media_uv_object_callback on_query, void
|
|||
**参数**:
|
||||
|
||||
- `handle` 异步控制器句柄。
|
||||
- `on_query` 接收元数据指针的回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `on_query` 结果回调函数,回调参数为元数据指针。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
|
||||
### media_uv_session_get_state
|
||||
|
|
@ -657,17 +663,21 @@ int media_uv_session_query(void* handle, media_uv_object_callback on_query, void
|
|||
int media_uv_session_get_state(void* handle, media_uv_int_callback on_state, void* cookie);
|
||||
```
|
||||
|
||||
获取 current state。
|
||||
获取当前播放状态。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` Async 控制器句柄.
|
||||
- `on_state` 结果回调函数。
|
||||
- `cookie` 回调参数 of `on_state`
|
||||
- `handle` 异步控制器句柄。
|
||||
- `on_state` 结果回调函数,回调参数为当前状态。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
**注意**:
|
||||
|
||||
- 此接口尚未实现,请使用 `media_uv_session_query` 替代。
|
||||
|
||||
|
||||
### media_uv_session_get_position
|
||||
|
|
@ -681,12 +691,16 @@ int media_uv_session_get_position(void* handle, media_uv_unsigned_callback on_po
|
|||
**参数**:
|
||||
|
||||
- `handle` 异步控制器句柄。
|
||||
- `on_position` 结果回调函数。
|
||||
- `cookie` 回调参数 of `on_position`
|
||||
- `on_position` 结果回调函数,回调参数为当前位置(毫秒)。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
**注意**:
|
||||
|
||||
- 此接口尚未实现,请使用 `media_uv_session_query` 替代。
|
||||
|
||||
|
||||
### media_uv_session_get_duration
|
||||
|
|
@ -695,17 +709,21 @@ int media_uv_session_get_position(void* handle, media_uv_unsigned_callback on_po
|
|||
int media_uv_session_get_duration(void* handle, media_uv_unsigned_callback on_duration, void* cookie);
|
||||
```
|
||||
|
||||
获取 current 时长。
|
||||
获取当前音频源的总时长。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步控制器句柄。
|
||||
- `on_duration` 结果回调函数。
|
||||
- `cookie` 回调参数 of `on_duration`
|
||||
- `on_duration` 结果回调函数,回调参数为总时长(毫秒)。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
**注意**:
|
||||
|
||||
- 此接口尚未实现,请使用 `media_uv_session_query` 替代。
|
||||
|
||||
|
||||
### media_uv_session_get_volume
|
||||
|
|
@ -714,17 +732,21 @@ int media_uv_session_get_duration(void* handle, media_uv_unsigned_callback on_du
|
|||
int media_uv_session_get_volume(void* handle, media_uv_int_callback on_get_volume, void* cookie);
|
||||
```
|
||||
|
||||
获取 current 音量。
|
||||
获取当前音量。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步控制器句柄。
|
||||
- `on_volume` 结果回调函数。
|
||||
- `cookie` 回调参数 of `on_volume`
|
||||
- `on_get_volume` 结果回调函数,回调参数为当前音量档位。
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 0,失败时返回负的错误码。
|
||||
成功时返回 `0`,失败时返回负的错误码。
|
||||
|
||||
**注意**:
|
||||
|
||||
- 此接口尚未实现,请使用 `media_uv_session_query` 替代。
|
||||
|
||||
|
||||
### media_uv_session_register
|
||||
|
|
@ -733,18 +755,18 @@ int media_uv_session_get_volume(void* handle, media_uv_int_callback on_get_volum
|
|||
void* media_uv_session_register(void* loop, const char* params, media_event_callback on_event, void* cookie);
|
||||
```
|
||||
|
||||
注册 as a session controllee to receive control message。
|
||||
注册为异步会话被控端,接收控制命令。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `loop` 当前线程的 `uv_loop_t*` 事件循环句柄。
|
||||
- `params` 未使用,请传 `NULL`。
|
||||
- `params` 暂未使用,传 `NULL`。
|
||||
- `on_event` 接收控制消息的回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
void* Async controlee handle, 失败时返回 NULL。
|
||||
成功时返回异步被控端句柄,失败时返回 `NULL`。
|
||||
|
||||
|
||||
### media_uv_session_unregister
|
||||
|
|
@ -753,12 +775,12 @@ void* Async controlee handle, 失败时返回 NULL。
|
|||
int media_uv_session_unregister(void* handle, media_uv_callback on_release);
|
||||
```
|
||||
|
||||
取消注册 self。
|
||||
取消注册被控端。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步被控端句柄。
|
||||
- `on_release` 调用方资源释放回调函数。
|
||||
- `on_release` 资源释放完成后的回调函数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -771,16 +793,16 @@ int media_uv_session_unregister(void* handle, media_uv_callback on_release);
|
|||
int media_uv_session_notify(void* handle, int event, int result, const char* extra, media_uv_callback on_notify, void* cookie);
|
||||
```
|
||||
|
||||
通知 the result of control message. * After receive MEDIA_EVENT_* from `on_事件`, as controllee you should do something to handle the control message, after you acknowledge the control message, you should call this api to send response to 控制器。
|
||||
通知控制器控制命令的处理结果。被控端收到 `MEDIA_EVENT_*` 事件后,完成相应处理,再调用此接口向控制器发送响应。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步被控端句柄。
|
||||
- `event` 要通知的事件。
|
||||
- `result` 事件结果,成功时通常为 `0`,失败时为负的 errno。
|
||||
- `extra` 事件的附加字符串消息,不需要时传 `NULL`。
|
||||
- `event` 要响应的事件类型。
|
||||
- `result` 操作结果,成功时为 `0`,失败时为负的 errno。
|
||||
- `extra` 附加消息字符串,不需要时传 `NULL`。
|
||||
- `on_notify` 通知确认回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
|
|
@ -793,17 +815,15 @@ int media_uv_session_notify(void* handle, int event, int result, const char* ext
|
|||
int media_uv_session_update(void* handle, const media_metadata_t* data, media_uv_callback on_update, void* cookie);
|
||||
```
|
||||
|
||||
Update 元数据 to session。
|
||||
向会话更新元数据。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `handle` 异步被控端句柄。
|
||||
- `data` 要更新的元数据。
|
||||
- `on_update` 更新确认回调函数。
|
||||
- `cookie` 回调参数.
|
||||
- `cookie` 回调上下文参数。
|
||||
|
||||
**返回值**:
|
||||
|
||||
成功时返回 `0`,失败时返回负的 errno。
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
## openvela 实现说明
|
||||
|
||||
- **DTMF**:生成 `0-9` / `*#ABCD` 对应的 DTMF 双音多频信号,音频格式固定为 `format=s16le:sample_rate=8000:ch_layout=mono`(由 `MEDIA_TONE_DTMF_FORMAT` 宏定义)
|
||||
- **调试接口**:`media_graph_dump` 和 `media_policy_dump` 用于打印内部状态,便于问题定位
|
||||
- **调试接口**:`media_graph_dump`、`media_player_dump`、`media_recorder_dump` 和 `media_policy_dump` 用于打印内部状态,便于问题定位
|
||||
- **通用命令**:`media_process_command` 向 media server 发送自定义命令,用于扩展能力(如触发 graph 内某个 filter 的操作)
|
||||
- **事件名查询**:`media_event_get_name` 把 `MEDIA_EVENT_*` 数值转成可读字符串,便于日志输出
|
||||
|
||||
|
|
@ -103,6 +103,33 @@ void media_policy_dump(const char* options);
|
|||
|
||||
- `options` dump 选项字符串。
|
||||
|
||||
|
||||
### media_player_dump
|
||||
|
||||
```c
|
||||
void media_player_dump(const char* options);
|
||||
```
|
||||
|
||||
打印 media player 内部状态,用于调试。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `options` dump 选项字符串。
|
||||
|
||||
|
||||
### media_recorder_dump
|
||||
|
||||
```c
|
||||
void media_recorder_dump(const char* options);
|
||||
```
|
||||
|
||||
打印 media recorder 内部状态,用于调试。
|
||||
|
||||
**参数**:
|
||||
|
||||
- `options` dump 选项字符串。
|
||||
|
||||
|
||||
## 通用命令
|
||||
|
||||
### media_process_command
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ TAPI 独立于 openvela telephony core stack,内部逻辑基于 DBUS LIB 对 C
|
|||
## openvela 实现说明
|
||||
|
||||
- **架构**:TAPI 基于 D-Bus 对 Telephony Core Stack(oFono)进行封装,以标准 C 接口对外提供
|
||||
- **多卡支持**:通过 `slot_id` 参数区分不同 SIM 卡槽
|
||||
- **SIM 卡标识**:通过 `slot_id` 参数区分不同 SIM 卡槽
|
||||
- **异步模型**:大部分操作通过回调函数异步返回结果
|
||||
|
||||
## 模块代码介绍
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
## openvela 实现说明
|
||||
|
||||
- **多卡支持**:部分接口不带 `slot_id`,使用默认卡;需要指定卡时通过 `tapi_call_set_default_slot` 切换
|
||||
- **SIM 卡标识**:部分接口不带 `slot_id`,使用默认卡;需要指定卡时通过 `tapi_call_set_default_slot` 切换
|
||||
- **同步/异步**:拨号、应答等耗时操作同时提供同步版本和 `_async` 版本(回调风格)
|
||||
- **按 ID 操作**:长生命周期通话通过返回的 call ID(字符串)唯一标识,`*_by_id` 接口据此执行操作
|
||||
- **DTMF**:拨号盘按键通过 `tapi_call_send_tones`(批量)或 `tapi_call_start_dtmf` / `tapi_call_stop_dtmf`(持续按键)触发
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Cell Broadcast Service(CBS)是蜂窝网络的小区广播能力,常用于
|
|||
- **开关控制**:通过 `set_cell_broadcast_power_on` 启用/禁用小区广播接收
|
||||
- **主题订阅**:通过 `set_cell_broadcast_topics` 配置要接收的广播主题范围(按频道 ID)
|
||||
- **事件回调**:通过 `tapi_cbs_register` 注册事件回调,接收到的广播消息
|
||||
- **多卡支持**:所有接口带 `slot_id`,支持多 SIM 卡设备
|
||||
- **SIM 卡标识**:所有接口带 `slot_id`,支持多 SIM 卡设备
|
||||
- **相关协议**:底层对应 3GPP TS 23.041 定义的 Cell Broadcast 流程
|
||||
|
||||
## 开关控制
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
- **APN 上下文**:通过 `tapi_data_*_apn_context` 系列接口管理 APN 配置(增删改查)
|
||||
- **按需连接**:`tapi_data_request_network` / `tapi_data_release_network` 控制数据网络的建立与释放
|
||||
- **漫游控制**:通过 `tapi_data_enable_roaming` 显式开关数据漫游
|
||||
- **多卡支持**:涉及特定卡的操作使用 `slot_id` 参数;数据默认卡通过 `tapi_data_set_default_slot` 设置
|
||||
- **SIM 卡标识**:涉及特定卡的操作使用 `slot_id` 参数;数据默认卡通过 `tapi_data_set_default_slot` 设置
|
||||
- **状态订阅**:`tapi_data_register` / `tapi_data_unregister` 用于注册/取消状态变化事件
|
||||
|
||||
## APN 配置管理
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ IP 多媒体子系统(VoLTE/VoWiFi)管理。
|
|||
- **注册状态**:查询 IMS 是否已注册到网络,订阅注册状态变化事件
|
||||
- **业务开关**:`set_service_status` 控制具体业务(如语音、视频)的启用
|
||||
- **VoLTE 支持**:通过 `is_volte_available` 查询当前网络是否支持 VoLTE
|
||||
- **多卡支持**:所有接口带 `slot_id`
|
||||
- **SIM 卡标识**:所有接口带 `slot_id` 参数
|
||||
|
||||
## IMS 开关
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
## openvela 实现说明
|
||||
|
||||
- **基于 D-Bus**:TAPI Manager 通过 D-Bus 与 Telephony Core Stack(oFono)通信,对外以标准 C 接口封装
|
||||
- **多卡支持**:管理器层面不直接涉及 SIM 卡槽选择,涉及特定卡槽的操作在 `tapi_sim` 等子模块中使用 `slot_id` 参数
|
||||
- **SIM 卡标识**:管理器层面不直接涉及 SIM 卡槽选择,涉及特定卡槽的操作在 `tapi_sim` 等子模块中使用 `slot_id` 参数
|
||||
- **客户端句柄**:通过 `tapi_open` 获取 `tapi_context`,所有后续调用均以该 context 作为第一个参数
|
||||
- **事件订阅**:通过 `tapi_register` 注册事件回调,`tapi_unregister` 取消订阅
|
||||
- **同步 vs 异步**:多数接口是异步的(带回调),部分提供 `*_sync` 变体用于简单场景
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
- **选网模式**:支持自动选网(`select_auto`)和手动选网(`select_manual`)
|
||||
- **扫描**:`tapi_network_scan` 扫描可用的网络运营商
|
||||
- **小区信息**:`get_serving_cellinfos` 获取当前服务小区,`get_neighbouring_cellinfos` 获取相邻小区
|
||||
- **多卡支持**:大部分接口带 `slot_id`,区分不同 SIM 卡槽的网络状态
|
||||
- **SIM 卡标识**:大部分接口带 `slot_id`,区分不同 SIM 卡槽的网络状态
|
||||
- **事件订阅**:`tapi_network_register` / `tapi_network_unregister` 监听注册状态/信号强度变化
|
||||
|
||||
## 选网与扫描
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ SIM 卡电话簿管理接口,支持 ADN(普通电话簿)和 FDN(固定
|
|||
- **ADN**:普通电话簿(Abbreviated Dialling Numbers),存储在 SIM 卡上的常规号码
|
||||
- **FDN**:固定拨号号码(Fixed Dialling Numbers),启用后手机只能拨打 FDN 中的号码,受 PIN2 保护
|
||||
- **FDN 操作需要 PIN2**:`insert_fdn_entry` / `delete_fdn_entry` / `update_fdn_entry` 调用时需要传入 PIN2
|
||||
- **多卡支持**:所有接口带 `slot_id`
|
||||
- **SIM 卡标识**:所有接口带 `slot_id`
|
||||
- **异步回调**:所有操作使用 `tapi_async_function` 异步返回结果
|
||||
|
||||
## ADN 电话簿
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ SIM 卡状态查询和管理。
|
|||
|
||||
## openvela 实现说明
|
||||
|
||||
- **多卡支持**:所有接口均带 `slot_id`,支持多 SIM 卡设备
|
||||
- **SIM 卡管理**:所有接口均带 `slot_id` 参数,用于标识 SIM 卡
|
||||
- **PIN 管理**:提供 `enter_pin` / `change_pin` / `reset_pin` / `lock_pin` / `unlock_pin` 完整 PIN/PUK 流程
|
||||
- **APDU 通道**:通过 `open_logical_channel` / `close_logical_channel` / `transmit_apdu_*` 直接向 SIM 卡发送 APDU 命令
|
||||
- **UICC 开关**:通过 `get_uicc_enablement` / `set_uicc_enablement` 控制 SIM 卡的启用状态
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Supplementary Services(补充业务)是 3GPP 蜂窝标准定义的增值通
|
|||
- **CLIR/CLIP**:主叫号码显示与限制,通过 `calling_line_restriction` 和 `calling_line_presentation_info` 接口
|
||||
- **USSD**:`tapi_ss_send_ussd` 发送 `*#xxxx#` 命令,`tapi_ss_cancel_ussd` 取消会话
|
||||
- **FDN**:固定拨号开关通过 `tapi_ss_enable_fdn` / `tapi_ss_query_fdn`
|
||||
- **多卡支持**:所有接口带 `slot_id`
|
||||
- **SIM 卡标识**:所有接口带 `slot_id`
|
||||
- **异步回调**:所有操作使用 `tapi_async_function`
|
||||
|
||||
## 呼叫限制
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ SIM Application Toolkit(STK / CAT)是运营商在 SIM 卡上预置的交互
|
|||
- **注册层级**:支持 per-slot Agent(通过 `tapi_stk_agent_register`)与 default Agent(系统默认 UI)
|
||||
- **主菜单**:`tapi_stk_get_main_menu*` 查询 SIM 卡提供的主菜单结构
|
||||
- **Proactive Command 响应**:`tapi_stk_handle_agent_*` 系列接口用于将 Agent 对 SIM 卡主动命令的响应回传给 SIM
|
||||
- **多卡支持**:所有接口带 `slot_id`
|
||||
- **SIM 卡标识**:所有接口带 `slot_id`
|
||||
|
||||
## Agent 注册
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ DHCP(Dynamic Host Configuration Protocol)客户端与服务器接口,覆
|
|||
## openvela 实现说明
|
||||
|
||||
- **IPv4 客户端**:`dhcpc_*` 系列封装完整的 DHCP 客户端状态机(DISCOVER/OFFER/REQUEST/ACK)
|
||||
- **IPv6 客户端**:`dhcp6c_*` 系列处理 IPv6 的 SLAAC / DHCPv6 流程
|
||||
- **IPv6 客户端**:`dhcp6c_*` 系列实现 DHCPv6 客户端协议流程
|
||||
- **服务器**:`dhcpd_*` 系列提供简单的 DHCP 服务器能力,可在热点/AP 模式下分配 IP
|
||||
- **异步调用**:`*_request_async` 接口提供回调式调用,避免阻塞当前线程
|
||||
- **配置依赖**:需启用 `CONFIG_NETUTILS_DHCPC` / `CONFIG_NETUTILS_DHCP6C` / `CONFIG_NETUTILS_DHCPD`
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ int wapi_freq2chan(int sock, const char *ifname, double freq, int *chan);
|
|||
|
||||
- `sock` 套接字描述符(用于 ioctl 操作)。
|
||||
- `ifname` 网络接口名称。
|
||||
- `freq` 频率, in Hz, to be converted to a 信道编号.
|
||||
- `freq` 频率(Hz),将被转换为信道编号。
|
||||
- `chan` 输出参数。
|
||||
|
||||
### wapi_chan2freq
|
||||
|
|
@ -229,7 +229,7 @@ int wapi_chan2freq(int sock, const char *ifname, int chan, double *freq);
|
|||
|
||||
- `sock` 套接字描述符(用于 ioctl 操作)。
|
||||
- `ifname` 信道。
|
||||
- `chan` 信道 number to be converted to a frequency.
|
||||
- `chan` 信道编号,将被转换为频率。
|
||||
- `freq` 输出参数。
|
||||
|
||||
### wapi_get_essid
|
||||
|
|
@ -487,7 +487,7 @@ int wapi_scan_channel_init(int sock, const char *ifname, const char *essid, uint
|
|||
- `sock` 套接字描述符.
|
||||
- `ifname` 网络接口名称。
|
||||
- `essid` 要扫描的 ESSID。
|
||||
- `channels` 指向 an array of 信道编号s to scan.
|
||||
- `channels` 要扫描的信道编号数组。
|
||||
- `num_channels` 信道。
|
||||
|
||||
**返回值**:
|
||||
|
|
@ -523,7 +523,7 @@ int wapi_escan_channel_init(int sock, const char *ifname, uint8_t scan_type, con
|
|||
- `ifname` 网络接口名称。
|
||||
- `scan_type` 扫描类型。
|
||||
- `essid` 要扫描的 ESSID。
|
||||
- `channels` 指向 an array of 信道编号s to scan.
|
||||
- `channels` 要扫描的信道编号数组。
|
||||
- `num_channels` 信道。
|
||||
|
||||
**返回值**:
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#### 3. IDE 什么时候上线?
|
||||
|
||||
预计于 2026 年初正式上线。
|
||||
已上线。openvela 已正式发布 VS Code 插件,支持 Ubuntu 环境下完成项目创建、编译构建、系统调试与应用开发全流程,详见 [openvela VS Code 插件使用指南](../quickstart/vscode_plugin_usage.md)。
|
||||
|
||||
#### 4. 源码仓库的 Gitee 和 GitHub 版本有区别吗?
|
||||
|
||||
|
|
@ -147,7 +147,7 @@ openvela 操作系统屏蔽了底层架构差异,底层是 A 系列还是 M
|
|||
|
||||
#### 24. 快应用打包生成的 RPK 文件可以直接在 openvela 设备上运行吗?
|
||||
|
||||
目前暂时不行。快应用框架引擎(Runtime)计划于 **2026 年 2 月份** 左右以库的形式开源并集成进入系统。目前阶段建议使用模拟器进行学习和开发。
|
||||
目前暂时不行。快应用框架引擎(Runtime)计划于 **2026 年 6 月份** 左右以库的形式开源并集成进入系统。目前阶段建议使用模拟器进行学习和开发。
|
||||
|
||||
### 五、硬件适配与移植
|
||||
|
||||
|
|
|
|||
|
|
@ -80,25 +80,11 @@
|
|||
|
||||
### 蓝牙
|
||||
|
||||
#### 连接管理器重写
|
||||
|
||||
- ACL 连接管理器全面重构
|
||||
- SPP、HID、A2DP、AVRCP、HFP 等 Profile 适配新连接管理 API
|
||||
- Profile 回调机制优化:从异步分发改为直接回调
|
||||
- 多连接支持与稳定性修复
|
||||
|
||||
#### 协议与 Profile 升级
|
||||
|
||||
- AVRCP 从 3.0 升级到 4.0
|
||||
- GATT 数据库哈希计算与持久化存储(KVDB)
|
||||
- GATT Service Changed indication 支持
|
||||
- BLE Privacy 配置化(Kconfig)
|
||||
- SPP `connect_with_option` API
|
||||
- DID Profile 构建支持
|
||||
|
||||
#### 稳定性
|
||||
|
||||
- Use-after-free、空指针解引用、双重释放、资源泄漏等问题修复
|
||||
- AVRCP 版本更新,支持更丰富的操作指令
|
||||
- GATT 缓存机制,大幅提高连接速度
|
||||
- 允许自定义的 BLE Security Level
|
||||
- SPP、HID、A2DP、HFP、SPP 等协议增强,提升兼容性并解决已知问题
|
||||
- 修复其他已知问题,增强子系统稳定性
|
||||
|
||||
### 连接框架
|
||||
|
||||
|
|
@ -256,21 +242,21 @@
|
|||
|
||||
本次发布将快应用开发全链路开源,覆盖 JS 引擎、Feature 框架和应用 Shell 运行时:
|
||||
|
||||
- [QuickJS](./../../../../../apps_interpreters_quickjs)
|
||||
- [QuickJS](../../../../../apps_interpreters_quickjs)
|
||||
|
||||
QuickJS 轻量级 JS 引擎,基于 Fabrice Bellard 的 QuickJS 引擎的增强版本。保留原有的轻量、快速和高兼容性特点,集成了一系列新功能,特别是在开发者工具和调试支持方面,使其成为功能更完备的 JavaScript 运行时环境。
|
||||
|
||||
- [runtime_feature](./../../../../../frameworks_runtimes_feature)
|
||||
- [runtime_feature](../../../../../frameworks_runtimes_feature)
|
||||
|
||||
快应用 Feature 框架运行时核心库和工具。基于 C/C++ 开发,实现 JavaScript 层与原生代码的高效互操作性。架构包括三大核心组件:提供 JS-Native 执行环境的运行时框架、用于自动生成双向调用接口的 JIDL(接口描述语言)及工具、标准化的 native 开发者 API。
|
||||
|
||||
- [runtime_ash](./../../../../../frameworks_runtimes_ash)
|
||||
- [runtime_ash](../../../../../frameworks_runtimes_ash)
|
||||
|
||||
openvela 应用 Shell 运行时环境。面向嵌入式系统的轻量级 C++ 运行时基础库,为资源受限环境提供高效、可靠的底层组件支持。模块化设计覆盖:资源管理(Bundle)、系统安全(Crash 处理)、设备信息抽象(Device Info)、文件系统封装(File)、文件描述符管理(Scoped FD)、消息循环机制(Message Loop)、流处理、字符串转换、线程、时间、定时器、网络、内存管理和调试追踪等。使用 GN 构建系统,通过 `CMakeLists.txt` 提供 CMake 支持,兼容 Kconfig 配置系统,适用于 NuttX 等实时操作系统环境。
|
||||
|
||||
### AI agent
|
||||
|
||||
openvela [AI Agent](./../../../../../packages_ai_agent) 是一个跑在手表、音箱、眼镜、耳机这类小设备上的 AI 智能体引擎。从架构设计上,该引擎构建了从感知到记忆、从推理到执行的全链路智能化能力,真正让设备具备自主决策与主动服务能力。
|
||||
openvela [AI Agent](../../../../../packages_ai_agent) 是一个跑在手表、音箱、眼镜、耳机这类小设备上的 AI 智能体引擎。从架构设计上,该引擎构建了从感知到记忆、从推理到执行的全链路智能化能力,真正让设备具备自主决策与主动服务能力。
|
||||
|
||||
## 不兼容变更
|
||||
|
||||
|
|
@ -349,9 +335,9 @@ openvela [AI Agent](./../../../../../packages_ai_agent) 是一个跑在手表、
|
|||
|
||||
## 相关链接
|
||||
|
||||
- [主仓库](./../../../../../)
|
||||
- [AI Agent](./../../../../../packages_ai_agent)
|
||||
- [QuickJS](./../../../../../apps_interpreters_quickjs)
|
||||
- [Runtime Feature](./../../../../../frameworks_runtimes_feature)
|
||||
- [Runtime ASH](./../../../../../frameworks_runtimes_ash)
|
||||
- [主仓库](../../../../../)
|
||||
- [AI Agent](../../../../../packages_ai_agent)
|
||||
- [QuickJS](../../../../../apps_interpreters_quickjs)
|
||||
- [Runtime Feature](../../../../../frameworks_runtimes_feature)
|
||||
- [Runtime ASH](../../../../../frameworks_runtimes_ash)
|
||||
- [官方文档](https://doc.openvela.com)
|
||||
|
|
|
|||
Loading…
Reference in New Issue