Why Ios can't find esp32 on BLE mode
Posted: Mon Feb 19, 2018 4:41 pm
I set esp32 to ble mode, and set all uuid in right way, my android app can find and connect it, but my iphone6s can not find esp32 in ios system bluetooth searching page.
I use some third-party ios app to search esp32, can not find it still.
I try some different UUIDs, used BLE2902 and started BLEAdvertising, all trial not work for iphone, but work well for android.
so, I missing any thing or make any mistake ? thank you.
----- my code ----
//#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b"
//#define CHARACTERISTIC_WRITE_UUID "00001001-0000-1000-8000-00805F9B34FB"
//#define CHARACTERISTIC_READ_UUID "00001002-0000-1000-8000-00805F9B34FB"
#define SERVICE_UUID "713D0000-503E-4C75-BA94-3148F18D941E"
#define CHARACTERISTIC_WRITE_UUID "713D0001-503E-4C75-BA94-3148F18D941E"
#define CHARACTERISTIC_READ_UUID "713D0002-503E-4C75-BA94-3148F18D941E"
BLEDevice::init("MyESP32");
BLEServer *pServer = BLEDevice::createServer();
BLEService *pService = pServer->createService(SERVICE_UUID);
pCharacteristicWrite = pService->createCharacteristic(CHARACTERISTIC_WRITE_UUID, BLECharacteristic::PROPERTY_NOTIFY);
pCharacteristicWrite->addDescriptor(new BLE2902());
pCharacteristicWrite->setBroadcastProperty(true);
pCharacteristicRead = pService->createCharacteristic(CHARACTERISTIC_READ_UUID, BLECharacteristic::PROPERTY_WRITE_NR);
pCharacteristicRead->addDescriptor(new BLE2902());
pCharacteristicRead->setCallbacks(new MyCallbacks());
pCharacteristicRead->setBroadcastProperty(true);
BLEAdvertising *pAdvertising = pServer->getAdvertising();
pAdvertising->start();
pService->start();
I use some third-party ios app to search esp32, can not find it still.
I try some different UUIDs, used BLE2902 and started BLEAdvertising, all trial not work for iphone, but work well for android.
so, I missing any thing or make any mistake ? thank you.
----- my code ----
//#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b"
//#define CHARACTERISTIC_WRITE_UUID "00001001-0000-1000-8000-00805F9B34FB"
//#define CHARACTERISTIC_READ_UUID "00001002-0000-1000-8000-00805F9B34FB"
#define SERVICE_UUID "713D0000-503E-4C75-BA94-3148F18D941E"
#define CHARACTERISTIC_WRITE_UUID "713D0001-503E-4C75-BA94-3148F18D941E"
#define CHARACTERISTIC_READ_UUID "713D0002-503E-4C75-BA94-3148F18D941E"
BLEDevice::init("MyESP32");
BLEServer *pServer = BLEDevice::createServer();
BLEService *pService = pServer->createService(SERVICE_UUID);
pCharacteristicWrite = pService->createCharacteristic(CHARACTERISTIC_WRITE_UUID, BLECharacteristic::PROPERTY_NOTIFY);
pCharacteristicWrite->addDescriptor(new BLE2902());
pCharacteristicWrite->setBroadcastProperty(true);
pCharacteristicRead = pService->createCharacteristic(CHARACTERISTIC_READ_UUID, BLECharacteristic::PROPERTY_WRITE_NR);
pCharacteristicRead->addDescriptor(new BLE2902());
pCharacteristicRead->setCallbacks(new MyCallbacks());
pCharacteristicRead->setBroadcastProperty(true);
BLEAdvertising *pAdvertising = pServer->getAdvertising();
pAdvertising->start();
pService->start();