My nRF52 device has a connection opened in peripheral mode and in some cases I want to close the connection with reason code "power off", i.e. call sd_ble_gap_disconnect with reason code set to BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF.
When testing this with the nRF Connect mobile app (on Android), the logging shows: "Error 21 (0x15): UNKNOWN (21) "
21 is the numeric value that maps to BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF.
Is this a problem with the Android mobile app? Or Android BLE stack? Or perhaps this is not a proper way to close a connection. Any ideas?
Just before clicking POST button I double-checked the API documentation of sd_ble_gap_disconnect and there's a note regarding the reason code:
(accepted values are @ref BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION and @ref BLE_HCI_CONN_INTERVAL_UNACCEPTABLE).
Now I'm even more confused. Is there a possibility to close connection with reason code "power off"?