Skip to content

Commit e63796c

Browse files
committed
Special exception message for when pairing prompt is ignored.
1 parent 39f4046 commit e63796c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ports/nrf/common-hal/_bleio/__init__.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,14 @@ void check_sec_status(uint8_t sec_status) {
7474
if (sec_status == BLE_GAP_SEC_STATUS_SUCCESS) {
7575
return;
7676
}
77-
mp_raise_bleio_SecurityError(translate("Unknown security error: 0x%04x"), sec_status);
77+
78+
switch (sec_status) {
79+
case BLE_GAP_SEC_STATUS_UNSPECIFIED:
80+
mp_raise_bleio_SecurityError(translate("Unspecified issue. Can be that the pairing prompt on the other device was declined or ignored."));
81+
return;
82+
default:
83+
mp_raise_bleio_SecurityError(translate("Unknown security error: 0x%04x"), sec_status);
84+
}
7885
}
7986

8087
// Turn off BLE on a reset or reload.

0 commit comments

Comments
 (0)