docs: update BluFi documentation

This commit is contained in:
liuning
2022-09-19 16:44:31 +08:00
parent 626b87871d
commit dcdae20972
2 changed files with 45 additions and 4 deletions

View File

@@ -292,14 +292,20 @@ The format of Ack Frame8 bit
| | | | 0x03: SoftAP&STA |
+ + + +-----------------------------------------------------------------------+
| | | | data[1]the connection state of the STA device, |
| | | | 0x0 indicates a connection state, |
| | | | and others represent a disconnected state; |
| | | | 0x0 indicates a connection state with IP address, |
| | | | 0x1 represent a disconnected state, |
| | | | 0x2 indicates a connecting state, |
| | | | and 0x3 indicates a connection state but no IP address. |
+ + + +-----------------------------------------------------------------------+
| | | | data[2]the connection state of the SoftAP, |
| | | | that is, how many STA devices have been connected. |
+ + + +-----------------------------------------------------------------------+
| | | | data[3] and the subsequent is in accordance with the |
| | | | format of SSID/BSSID information. |
| | | | If device is in connecting state, |
| | | | maximum Wi-Fi reconnecting time would be included here. |
| | | | If device is in disconnected state, |
| | | | Wi-Fi connection end reason and RSSI would be included here. |
+------------------+----------------------------------------------------+---------------------------------------------------------------+-----------------------------------------------------------------------+
| 0x10 (b010000) | Version | | data[0]= great versiondata[1]= sub version |
+------------------+----------------------------------------------------+---------------------------------------------------------------+-----------------------------------------------------------------------+
@@ -324,10 +330,25 @@ The format of Ack Frame8 bit
| | | | 0x07: read param error |
+ + + +-----------------------------------------------------------------------+
| | | | 0x08: make public error |
+ + + +-----------------------------------------------------------------------+
| | | | 0x09: data format error |
+ + + +-----------------------------------------------------------------------+
| | | | 0x0a: calculate MD5 error |
+ + + +-----------------------------------------------------------------------+
| | | | 0x0b: Wi-Fi scan error |
+------------------+----------------------------------------------------+---------------------------------------------------------------+-----------------------------------------------------------------------+
| 0x13 (b010011) | Custom Data | To send or receive custom data. | The data frame supports to be sent into |
| | | | fragments if the data length is too long. |
+------------------+----------------------------------------------------+---------------------------------------------------------------+-----------------------------------------------------------------------+
| 0x14 (b010100) | Set the maximum Wi-Fi reconnecting time | | data[0] represents the maximum Wi-Fi reconnecting time. |
+------------------+----------------------------------------------------+---------------------------------------------------------------+-----------------------------------------------------------------------+
| 0x15 (b010101) | Set the Wi-Fi connection end reason | | data[0] represents the Wi-Fi connection end reason, |
| | | | whose type shall be same with struct `wifi_err_reason_t`. |
+------------------+----------------------------------------------------+---------------------------------------------------------------+-----------------------------------------------------------------------+
| 0x16 (b010110) | Set the RSSI at Wi-Fi connection end | | data[0] represents the RSSI at Wi-Fi connection end. |
| | | | If there is no meaningful RSSI in the connection end, |
| | | | this value shall be the meaningless one, which is `-128`. |
+------------------+----------------------------------------------------+---------------------------------------------------------------+-----------------------------------------------------------------------+
2. Frame Control

View File

@@ -295,12 +295,17 @@ Ack 帧格式8 bit
+ + + +------------------------------------------------------+
| | | | data[1]STA 的连接状态, |
| | | | 0x0 表示处于连接状态, |
| | | | 其他表示处于非连接状态 |
| | | | 0x1 表示处于非连接状态, |
| | | | 0x2 表示处于正在连接状态, |
| | | | 0x3 表示处于连接状态但未获得 IP 地址。 |
+ + + +------------------------------------------------------+
| | | | data[2]SoftAP 的连接状态, |
| | | | 即表示有多少 STA 已经连接。 |
+ + + +------------------------------------------------------+
| | | | data[3] 及以后:为按照本协议格式 SSID\BSSID 等信息。 |
| | | | 如果 Wi-Fi 处于正在连接状态,这里将会有最大重连次数;|
| | | | 如果 Wi-Fi 处于非连接状态, |
| | | | 这里将会包含 Wi-Fi 断开连接原因和 RSSI 信息。 |
+---------------+----------------------------------------+------------------------------------------------+------------------------------------------------------+
| 0x10 b010000 | Version. | | data[0]= great version |
+ + + +------------------------------------------------------+
@@ -326,9 +331,24 @@ Ack 帧格式8 bit
| | | | 0x07: read param error; |
+ + + +------------------------------------------------------+
| | | | 0x08: make public error. |
+ + + +------------------------------------------------------+
| | | | 0x09: data format error |
+ + + +------------------------------------------------------+
| | | | 0x0a: calculate MD5 error |
+ + + +------------------------------------------------------+
| | | | 0x0b: Wi-Fi scan error |
+---------------+----------------------------------------+------------------------------------------------+------------------------------------------------------+
|0x13 (b010011)| Custom data. | 用户发送或者接收自定义数据。 | 数据较长时可分片发送。 |
+---------------+----------------------------------------+------------------------------------------------+------------------------------------------------------+
|0x14 (b010100)| Set the max Wi-Fi reconnecting time. | | data[0] 表示 Wi-Fi 最大重连次数。 |
+---------------+----------------------------------------+------------------------------------------------+------------------------------------------------------+
|0x15 (b010101)| Set the Wi-Fi connection end reason. | | data[0] 表示 Wi-Fi 连接失败原因, |
| | | | 它的类型应该和 `wifi_err_reason_t` 一致。 |
+---------------+----------------------------------------+------------------------------------------------+------------------------------------------------------+
|0x16 (b010110)| Set the RSSI at Wi-Fi connection end. | | data[0] 表示在 Wi-Fi 连接失败时的 RSSI。 |
| | | | 如果在连接结束时没有有意义的 RSSI , |
| | | | 这个值应该为一个无意义值 `-128`。 |
+---------------+----------------------------------------+------------------------------------------------+------------------------------------------------------+
2. Frame Control
@@ -448,4 +468,4 @@ BluFi Service UUID 0xFFFF16 bit
BluFi (手机 -> ESP32 特性0xFF01主要权限可写
BluFi ESP32 -> 手机) 特性0xFF02主要权限可读可通知
BluFi ESP32 -> 手机) 特性0xFF02主要权限可读可通知