I have a peripheral device based on the nRF52832, using SDK 15.3.0. It uses a bunch of the standard services, including the TX Power Service, plus a custom one. When I connect and bond from my Android app, or even from nRF Connect on Android, I can't read the TX power level characteristic. The BLE stack on Android is passing status 137, which is GATT AUTH FAIL, which kind of suggests I'm not really bonded. But everything else suggests I am: on a subsequent run of my peripheral code the peer manager tells me I have a bond.
I'm using "just works" bonding and I'm adding the TX Power Level service like this:
BLE_TPS_DEF(m_tps);
ble_tps_init_t tps_init;
memset(&tps_init, 0, sizeof(tps_init));
tps_init.initial_tx_power_level = TX_POWER_LEVEL;
tps_init.tpl_rd_sec = SEC_MITM;
err_code = ble_tps_init(&m_tps, &tps_init);
APP_ERROR_CHECK(err_code);
When trying to read the TX Power Level characteristic using nRF Connect, I see this in the logs from the peripherhal:
[00:15:04.733,398] D ble_periph PM_EVT_CONN_SEC_START [00:15:04.958,984] D ble_periph PM_EVT_CONN_SEC_SUCCEEDED
Where do I start?