moki 1 долоо хоног өмнө
parent
commit
346564e488

+ 4 - 4
firmware/ai_light/ai_light.ino

@@ -45,8 +45,8 @@
 // =====================================================
 const char* BLE_DEVICE_NAME = "AI-Light";
 #define SERVICE_UUID        "b8b7e001-7a6b-4f4f-9a8b-11c0ffee0001"
-#define MODE_CHAR_UUID      "b8b7e002-7a6b-4f4f-9a8b-11c0ffee0001"
-#define CONFIG_CHAR_UUID    "b8b7e003-7a6b-4f4f-9a8b-11c0ffee0001"
+#define MODE_CHAR_UUID      "0002"
+#define CONFIG_CHAR_UUID    "0003"
 
 // =====================================================
 // 引脚定义(V2 版本:红黄互换 + 黄绿互换)
@@ -486,13 +486,13 @@ void setupBLE() {
   pServer->setCallbacks(new ServerCallbacks());
   BLEService* pService = pServer->createService(BLEUUID(SERVICE_UUID), 20);
 
-  pModeCharacteristic = pService->createCharacteristic(MODE_CHAR_UUID,
+  pModeCharacteristic = pService->createCharacteristic(BLEUUID((uint16_t)0x0002),
     BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_NOTIFY);
   pModeCharacteristic->setCallbacks(new ModeCharCallbacks());
   pModeCharacteristic->setValue(currentMode.c_str());
   pModeCharacteristic->addDescriptor(new BLE2902());
 
-  pConfigCharacteristic = pService->createCharacteristic(CONFIG_CHAR_UUID,
+  pConfigCharacteristic = pService->createCharacteristic(BLEUUID((uint16_t)0x0003),
     BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE);
   pConfigCharacteristic->setCallbacks(new ConfigCharCallbacks());