From 60a1f8b5b960ff13fd4f7e4a8051e73b8d3124f5 Mon Sep 17 00:00:00 2001 From: Cai Xin Ying Date: Mon, 22 May 2023 11:13:48 +0800 Subject: [PATCH] docs: provide CN translation for api-reference/system/esp_err and api-reference/bluetooth/esp_gatts --- docs/en/api-reference/bluetooth/esp_gatts.rst | 14 +++++---- docs/en/api-reference/system/esp_err.rst | 6 ++-- .../api-reference/bluetooth/esp_gatts.rst | 30 ++++++++++++++++++- docs/zh_CN/api-reference/system/esp_err.rst | 17 ++++++++++- 4 files changed, 57 insertions(+), 10 deletions(-) diff --git a/docs/en/api-reference/bluetooth/esp_gatts.rst b/docs/en/api-reference/bluetooth/esp_gatts.rst index eb58060cbf4..80148b051c3 100644 --- a/docs/en/api-reference/bluetooth/esp_gatts.rst +++ b/docs/en/api-reference/bluetooth/esp_gatts.rst @@ -1,22 +1,24 @@ -GATT SERVER API +GATT Server API =============== -Application Example -------------------- +:link_to_translation:`zh_CN:[中文]` + +Application Examples +-------------------- Check :example:`bluetooth/bluedroid/ble` folder in ESP-IDF examples, which contains the following demos and their tutorials: -* This is a GATT sever demo and its tutorial. This demo creates a GATT service with an attribute table, which releases the user from adding attributes one by one. This is the recommended method of adding attributes. +* This is a GATT server demo and its tutorial. This demo creates a GATT service with an attribute table, which releases the user from the operation of adding attributes one by one. This is the recommended method of adding attributes (officially recommended). - :example:`bluetooth/bluedroid/ble/gatt_server_service_table` - :example_file:`GATT Server Service Table Example Walkthrough ` -* This is a GATT server demo and its tutorial. This demo creates a GATT service by adding attributes one by one as defined by Bluedroid. The recommended method of adding attributes is presented in example above. +* This is a GATT server demo and its tutorial. This demo creates a GATT service by adding attributes one by one as defined by Bluedroid. The recommended method of adding attributes is presented in the example below. - :example:`bluetooth/bluedroid/ble/gatt_server` - :example_file:`GATT Server Example Walkthrough ` -* This is a BLE SPP-Like demo. This demo, which acts as a GATT server, can receive data from UART and then send the data to the peer device automatically. +* This is a demo similar to Bluetooth SPP. In this demo, GATT server can receive data from UART and then send the data to the peer device automatically. - :example:`bluetooth/bluedroid/ble/ble_spp_server` diff --git a/docs/en/api-reference/system/esp_err.rst b/docs/en/api-reference/system/esp_err.rst index c7f7b7c3715..3ec940ab3a8 100644 --- a/docs/en/api-reference/system/esp_err.rst +++ b/docs/en/api-reference/system/esp_err.rst @@ -1,11 +1,13 @@ -Error Codes and Helper Functions +Error Code and Helper Functions ================================ +:link_to_translation:`zh_CN:[中文]` + This section lists definitions of common ESP-IDF error codes and several helper functions related to error handling. For general information about error codes in ESP-IDF, see :doc:`Error Handling <../../api-guides/error-handling>`. -For the full list of error codes defined in ESP-IDF, see :doc:`Error Code Reference <../error-codes>`. +For the full list of error codes defined in ESP-IDF, see :doc:`Error Codes Reference <../error-codes>`. API Reference ------------- diff --git a/docs/zh_CN/api-reference/bluetooth/esp_gatts.rst b/docs/zh_CN/api-reference/bluetooth/esp_gatts.rst index 87f8b278e47..4716e68a7c5 100644 --- a/docs/zh_CN/api-reference/bluetooth/esp_gatts.rst +++ b/docs/zh_CN/api-reference/bluetooth/esp_gatts.rst @@ -1 +1,29 @@ -.. include:: ../../../en/api-reference/bluetooth/esp_gatts.rst \ No newline at end of file +GATT 服务器 API +===================== + +:link_to_translation:`en:[English]` + +应用示例 +------------------- + +以下示例及其教程存放在 ESP-IDF 示例的 :example:`bluetooth/bluedroid/ble` 目录下: + +* 以下为 GATT 服务器示例及其教程,该示例创建了一个带有属性表的 GATT 服务器,无需逐个添加属性。建议通过以下方式添加属性(官方推荐)。 + + - :example:`bluetooth/bluedroid/ble/gatt_server_service_table` + - :example_file:`GATT 服务器服务表示例 ` + +* 以下为 GATT 服务器示例及其教程,该示例逐个添加 Bluedroid 定义的属性,创建 GATT 服务。建议通过以下方式添加属性。 + + - :example:`bluetooth/bluedroid/ble/gatt_server` + - :example_file:`GATT 服务器示例 ` + +* 以下示例与 Bluetooth SPP 类似。在该示例中,GATT 服务器可以接收来自 UART 的数据,并将数据自动发送到对端设备。 + + - :example:`bluetooth/bluedroid/ble/ble_spp_server` + +API 参考 +------------- + +.. include-build-file:: inc/esp_gatts_api.inc + diff --git a/docs/zh_CN/api-reference/system/esp_err.rst b/docs/zh_CN/api-reference/system/esp_err.rst index 1edde443d46..597a7459a8f 100644 --- a/docs/zh_CN/api-reference/system/esp_err.rst +++ b/docs/zh_CN/api-reference/system/esp_err.rst @@ -1 +1,16 @@ -.. include:: ../../../en/api-reference/system/esp_err.rst +错误代码和辅助函数 +================================ + +:link_to_translation:`en:[English]` + +本节列出了 ESP-IDF 中常见错误代码的定义,以及部分与错误处理相关的辅助函数。 + +有关 ESP-IDF 中错误代码的基本信息,请参阅 :doc:`错误处理 <../../api-guides/error-handling>`。 + +有关 ESP-IDF 定义的错误代码的完整列表,请参阅 :doc:`错误代码参考 <../error-codes>`。 + +API 参考 +------------- + +.. include-build-file:: inc/esp_check.inc +.. include-build-file:: inc/esp_err.inc