Skip to main content

BLE JSON channel

iotmer_ble exposes a NimBLE GATT service for UTF-8 JSON between a central (phone/PC) and the device.

Transport only — provisioning and commands are defined as JSON on top. See BLE JSON provisioning.

Registry: iotmertech/iotmer_ble

GATT

ItemUUIDProperties
Service1d14d6ee-1001-4000-8024-b5a3c0ffee01Primary
RX1d14d6ee-1002-4000-8024-b5a3c0ffee01Write
TX1d14d6ee-1003-4000-8024-b5a3c0ffee01Notify, Read

Advertising

Service UUID in the advertising PDU; GAP name in scan response (31-byte limit).

Centrals should filter by service UUID, not device name.

Security

KconfigEffect
IOTMER_BLE_REQUIRE_ENC=yPairing required before RX writes
IOTMER_BLE_SMP_IO_CAPIO capability (default: Just Works)

MTU

Max notification payload: att_mtu - 3

Common MTU values: 23, 185, 247. Size long JSON responses to the negotiated MTU or chunk at the application layer.

API

esp_err_t iotmer_ble_init(const iotmer_ble_cfg_t *cfg);
esp_err_t iotmer_ble_start(void);
esp_err_t iotmer_ble_stop(void);
void iotmer_ble_deinit(void);
esp_err_t iotmer_ble_send_json(const uint8_t *data, size_t len);
esp_err_t iotmer_ble_send_json_str(const char *json_str);
bool iotmer_ble_is_connected(void);
uint16_t iotmer_ble_get_att_mtu(void); /* 0 if not connected */
esp_err_t iotmer_ble_suspend(void); /* free RAM for TLS */
esp_err_t iotmer_ble_resume(void);