diff --git a/README.md b/README.md index ed0e817..f82cf02 100644 --- a/README.md +++ b/README.md @@ -33,4 +33,17 @@ git clone https://github.com/colour93/esp32-car.git ## BLE 串口通信协议 +其他设备与 ESP32 通信采用 BLE 的 GATT 协议,其服务默认为 Nordic 串口服务,可以在 `src/consts.h` 中修改。 + +```cpp +# 服务与特征 UUID +#define SERVICE_UUID "6E400001-B5A3-F393-E0A9-E50E24DCCA9E" +#define CHARACTERISTIC_UUID_RX "6E400002-B5A3-F393-E0A9-E50E24DCCA9E" +#define CHARACTERISTIC_UUID_TX "6E400003-B5A3-F393-E0A9-E50E24DCCA9E" +``` + +数据分为主动发送和被动接收两种,主动发送的特征值为 `CHARACTERISTIC_UUID_TX`,被动接收的特征值为 `CHARACTERISTIC_UUID_RX`。 + +同时一些状态信息会主动发送。 + [数据包格式](./packet.md) \ No newline at end of file diff --git a/docs/原理图.png b/docs/原理图.png index 86bfecd..31f4540 100644 Binary files a/docs/原理图.png and b/docs/原理图.png differ