diff --git a/nrf-softdevice/src/ble/gatt_traits.rs b/nrf-softdevice/src/ble/gatt_traits.rs index a72a4d3..1b9ce86 100644 --- a/nrf-softdevice/src/ble/gatt_traits.rs +++ b/nrf-softdevice/src/ble/gatt_traits.rs @@ -66,7 +66,7 @@ impl FixedGattValue for T { if data.len() != Self::SIZE { panic!("Bad len") } - unsafe { *(data.as_ptr() as *const Self) } + unsafe { (data.as_ptr() as *const Self).read_unaligned() } } fn to_gatt(&self) -> &[u8] {