diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2019-11-21 16:32:28 -0800 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2019-11-21 16:32:42 -0800 |
| commit | e63796c7bc28d8add63441f54ef4060a4ec11006 (patch) | |
| tree | 718eda3f6c37cc2a3ab372dd9c16339b31aa446b | |
| parent | 39f4046f701388d20ddad1429616dfb729063c1e (diff) | |
Special exception message for when pairing prompt is ignored.
| -rw-r--r-- | ports/nrf/common-hal/_bleio/__init__.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ports/nrf/common-hal/_bleio/__init__.c b/ports/nrf/common-hal/_bleio/__init__.c index bc2500f68..7ba3dc8c1 100644 --- a/ports/nrf/common-hal/_bleio/__init__.c +++ b/ports/nrf/common-hal/_bleio/__init__.c @@ -74,7 +74,14 @@ void check_sec_status(uint8_t sec_status) { if (sec_status == BLE_GAP_SEC_STATUS_SUCCESS) { return; } - mp_raise_bleio_SecurityError(translate("Unknown security error: 0x%04x"), sec_status); + + switch (sec_status) { + case BLE_GAP_SEC_STATUS_UNSPECIFIED: + mp_raise_bleio_SecurityError(translate("Unspecified issue. Can be that the pairing prompt on the other device was declined or ignored.")); + return; + default: + mp_raise_bleio_SecurityError(translate("Unknown security error: 0x%04x"), sec_status); + } } // Turn off BLE on a reset or reload. |
