diff options
author | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2022-05-11 23:13:39 +0200 |
---|---|---|
committer | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2022-05-11 23:13:39 +0200 |
commit | 17fc923d7b749d1817ab26e52ab6eecfb6999eac (patch) | |
tree | 9611a99604cdd2b3c256dc61b3a7b873ac3738f5 | |
parent | c8b2ff9644356debe6fddc135f260884e8caf16e (diff) | |
download | nrf-softdevice-17fc923d7b749d1817ab26e52ab6eecfb6999eac.zip |
Print which unexpected event it is.
-rw-r--r-- | nrf-softdevice/src/ble/central.rs | 2 | ||||
-rw-r--r-- | nrf-softdevice/src/ble/gatt_client.rs | 8 | ||||
-rw-r--r-- | nrf-softdevice/src/ble/l2cap.rs | 4 | ||||
-rw-r--r-- | nrf-softdevice/src/ble/peripheral.rs | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/nrf-softdevice/src/ble/central.rs b/nrf-softdevice/src/ble/central.rs index c30da39..86a97a4 100644 --- a/nrf-softdevice/src/ble/central.rs +++ b/nrf-softdevice/src/ble/central.rs @@ -88,7 +88,7 @@ pub async fn connect( } } raw::BLE_GAP_EVTS_BLE_GAP_EVT_TIMEOUT => Err(ConnectError::Timeout), - _ => unreachable!(), + e => panic!("unexpected event {}", e), } }) .await?; diff --git a/nrf-softdevice/src/ble/gatt_client.rs b/nrf-softdevice/src/ble/gatt_client.rs index 5affd5f..fca71fb 100644 --- a/nrf-softdevice/src/ble/gatt_client.rs +++ b/nrf-softdevice/src/ble/gatt_client.rs @@ -157,7 +157,7 @@ pub(crate) async fn discover_service( } } } - _ => unreachable!(), + e => panic!("unexpected event {}", e), } }) .await @@ -201,7 +201,7 @@ async fn discover_characteristics( }); Ok(v) } - _ => unreachable!(), + e => panic!("unexpected event {}", e), } }) .await @@ -245,7 +245,7 @@ async fn discover_descriptors( }); Ok(v) } - _ => unreachable!(), + e => panic!("unexpected event {}", e), } }) .await @@ -648,7 +648,7 @@ pub(crate) async fn att_mtu_exchange(conn: &Connection, mtu: u16) -> Result<(), Ok(()) } - _ => unreachable!(), + e => panic!("unexpected event {}", e), } }) .await diff --git a/nrf-softdevice/src/ble/l2cap.rs b/nrf-softdevice/src/ble/l2cap.rs index 95c0ddd..33a2baa 100644 --- a/nrf-softdevice/src/ble/l2cap.rs +++ b/nrf-softdevice/src/ble/l2cap.rs @@ -196,7 +196,7 @@ impl<P: Packet> L2cap<P> { let _evt = &l2cap_evt.params.ch_setup_refused; Err(SetupError::Refused) } - _ => unreachable!(), + e => panic!("unexpected event {}", e), } }) .await @@ -290,7 +290,7 @@ impl<P: Packet> L2cap<P> { None } } - _ => unreachable!(), + e => panic!("unexpected event {}", e), } }) .await diff --git a/nrf-softdevice/src/ble/peripheral.rs b/nrf-softdevice/src/ble/peripheral.rs index 185ab86..5c8ee41 100644 --- a/nrf-softdevice/src/ble/peripheral.rs +++ b/nrf-softdevice/src/ble/peripheral.rs @@ -263,7 +263,7 @@ pub async fn advertise( match (*ble_evt).header.evt_id as u32 { raw::BLE_GAP_EVTS_BLE_GAP_EVT_TIMEOUT => Err(AdvertiseError::Timeout), raw::BLE_GAP_EVTS_BLE_GAP_EVT_ADV_SET_TERMINATED => Err(AdvertiseError::Timeout), - _ => unreachable!(), + e => panic!("unexpected event {}", e), } }) .await; @@ -318,7 +318,7 @@ pub async fn advertise_connectable( } raw::BLE_GAP_EVTS_BLE_GAP_EVT_TIMEOUT => Err(AdvertiseError::Timeout), raw::BLE_GAP_EVTS_BLE_GAP_EVT_ADV_SET_TERMINATED => Err(AdvertiseError::Timeout), - _ => unreachable!(), + e => panic!("unexpected event {}", e), } }) .await; |