But a friend reports that he has not been able to connect with his iOS devices (phone, tablet). The BLE server is not visible.
I don't have any iOS devices to test with.
Is there anything special about iOS devices that needs to be taken care of ? This is the ble-uart initialization code
Code: Select all
#include <esp_gap_ble_api.h>
#include <esp_gattc_api.h>
#include <esp_gatt_defs.h>
#include <esp_bt_main.h>
#include <esp_gatt_common_api.h>
#include "config.h"
#include "ble_uart.h"
#define SERVICE_UUID "6E400001-B5A3-F393-E0A9-E50E24DCCA9E" // UART service UUID
#define CHARACTERISTIC_UUID_RX "6E400002-B5A3-F393-E0A9-E50E24DCCA9E"
#define CHARACTERISTIC_UUID_TX "6E400003-B5A3-F393-E0A9-E50E24DCCA9E"
NimBLEServer* pBLEServer = NULL;
NimBLEService* pService = NULL;
NimBLECharacteristic* pTxCharacteristic = NULL;
NimBLECharacteristic* pRxCharacteristic = NULL;
static uint8_t ble_uart_nmea_checksum(const char *szNMEA);
void ble_uart_init() {
NimBLEDevice::init("BLE-Vario");
NimBLEDevice::setMTU(46);
NimBLEDevice::setPower(ESP_PWR_LVL_N27);
NimBLEDevice::setSecurityAuth(true, true, true);
NimBLEDevice::setSecurityPasskey(123456);
NimBLEDevice::setSecurityIOCap(BLE_HS_IO_DISPLAY_ONLY);
pBLEServer = NimBLEDevice::createServer();
pService = pBLEServer->createService(SERVICE_UUID);
pTxCharacteristic = pService->createCharacteristic(CHARACTERISTIC_UUID_TX, NIMBLE_PROPERTY::NOTIFY);
pRxCharacteristic = pService->createCharacteristic(
CHARACTERISTIC_UUID_RX,
NIMBLE_PROPERTY::WRITE | NIMBLE_PROPERTY::WRITE_ENC | NIMBLE_PROPERTY::WRITE_AUTHEN);
pService->start();
pBLEServer->getAdvertising()->start();
}