diff --git a/examples/src/bin/ble_advertise.rs b/examples/src/bin/ble_advertise.rs
index ef0eb2ed..0a70d992 100644
--- a/examples/src/bin/ble_advertise.rs
+++ b/examples/src/bin/ble_advertise.rs
@@ -44,6 +44,7 @@ async fn main(spawner: Spawner) {
central_role_count: 3,
central_sec_count: 0,
_bitfield_1: raw::ble_gap_cfg_role_count_t::new_bitfield_1(0),
+ _bitfield_align_1: [],
}),
gap_device_name: Some(raw::ble_gap_cfg_device_name_t {
p_value: b"HelloRust" as *const u8 as _,
@@ -51,6 +52,7 @@ async fn main(spawner: Spawner) {
max_len: 9,
write_perm: unsafe { mem::zeroed() },
_bitfield_1: raw::ble_gap_cfg_device_name_t::new_bitfield_1(raw::BLE_GATTS_VLOC_STACK as u8),
+ _bitfield_align_1: [],
}),
..Default::default()
};
diff --git a/examples/src/bin/ble_bas_central.rs b/examples/src/bin/ble_bas_central.rs
index 9e4ec389..13bd2a44 100644
--- a/examples/src/bin/ble_bas_central.rs
+++ b/examples/src/bin/ble_bas_central.rs
@@ -47,6 +47,7 @@ async fn main(spawner: Spawner) {
central_role_count: 3,
central_sec_count: 0,
_bitfield_1: raw::ble_gap_cfg_role_count_t::new_bitfield_1(0),
+ _bitfield_align_1: [],
}),
gap_device_name: Some(raw::ble_gap_cfg_device_name_t {
p_value: b"HelloRust" as *const u8 as _,
@@ -54,6 +55,7 @@ async fn main(spawner: Spawner) {
max_len: 9,
write_perm: unsafe { mem::zeroed() },
_bitfield_1: raw::ble_gap_cfg_device_name_t::new_bitfield_1(raw::BLE_GATTS_VLOC_STACK as u8),
+ _bitfield_align_1: [],
}),
..Default::default()
};
diff --git a/examples/src/bin/ble_bas_peripheral.rs b/examples/src/bin/ble_bas_peripheral.rs
index 7110dfe7..938a06e5 100644
--- a/examples/src/bin/ble_bas_peripheral.rs
+++ b/examples/src/bin/ble_bas_peripheral.rs
@@ -62,6 +62,7 @@ async fn main(spawner: Spawner) {
central_role_count: 3,
central_sec_count: 0,
_bitfield_1: raw::ble_gap_cfg_role_count_t::new_bitfield_1(0),
+ _bitfield_align_1: [],
}),
gap_device_name: Some(raw::ble_gap_cfg_device_name_t {
p_value: b"HelloRust" as *const u8 as _,
@@ -69,6 +70,7 @@ async fn main(spawner: Spawner) {
max_len: 9,
write_perm: unsafe { mem::zeroed() },
_bitfield_1: raw::ble_gap_cfg_device_name_t::new_bitfield_1(raw::BLE_GATTS_VLOC_STACK as u8),
+ _bitfield_align_1: [],
}),
..Default::default()
};
diff --git a/examples/src/bin/ble_bas_peripheral_notify.rs b/examples/src/bin/ble_bas_peripheral_notify.rs
index 8dfbbe0f..354e4c61 100644
--- a/examples/src/bin/ble_bas_peripheral_notify.rs
+++ b/examples/src/bin/ble_bas_peripheral_notify.rs
@@ -126,6 +126,7 @@ async fn main(spawner: Spawner) {
central_role_count: 0,
central_sec_count: 0,
_bitfield_1: raw::ble_gap_cfg_role_count_t::new_bitfield_1(0),
+ _bitfield_align_1: [],
}),
gap_device_name: Some(raw::ble_gap_cfg_device_name_t {
p_value: b"HelloRust" as *const u8 as _,
@@ -133,6 +134,7 @@ async fn main(spawner: Spawner) {
max_len: 9,
write_perm: unsafe { mem::zeroed() },
_bitfield_1: raw::ble_gap_cfg_device_name_t::new_bitfield_1(raw::BLE_GATTS_VLOC_STACK as u8),
+ _bitfield_align_1: [],
}),
..Default::default()
};
diff --git a/examples/src/bin/ble_bond_central.rs b/examples/src/bin/ble_bond_central.rs
index fc3e546d..ab1aa60b 100644
--- a/examples/src/bin/ble_bond_central.rs
+++ b/examples/src/bin/ble_bond_central.rs
@@ -141,6 +141,7 @@ async fn main(spawner: Spawner) {
central_role_count: 3,
central_sec_count: 1,
_bitfield_1: raw::ble_gap_cfg_role_count_t::new_bitfield_1(0),
+ _bitfield_align_1: [],
}),
gap_device_name: Some(raw::ble_gap_cfg_device_name_t {
p_value: b"HelloRust" as *const u8 as _,
@@ -148,6 +149,7 @@ async fn main(spawner: Spawner) {
max_len: 9,
write_perm: unsafe { mem::zeroed() },
_bitfield_1: raw::ble_gap_cfg_device_name_t::new_bitfield_1(raw::BLE_GATTS_VLOC_STACK as u8),
+ _bitfield_align_1: [],
}),
..Default::default()
};
diff --git a/examples/src/bin/ble_bond_peripheral.rs b/examples/src/bin/ble_bond_peripheral.rs
index 52b84e87..b122663c 100644
--- a/examples/src/bin/ble_bond_peripheral.rs
+++ b/examples/src/bin/ble_bond_peripheral.rs
@@ -212,6 +212,7 @@ async fn main(spawner: Spawner) -> ! {
central_role_count: 3,
central_sec_count: 0,
_bitfield_1: raw::ble_gap_cfg_role_count_t::new_bitfield_1(0),
+ _bitfield_align_1: [],
}),
gap_device_name: Some(raw::ble_gap_cfg_device_name_t {
p_value: b"HelloRust" as *const u8 as _,
@@ -219,6 +220,7 @@ async fn main(spawner: Spawner) -> ! {
max_len: 9,
write_perm: unsafe { mem::zeroed() },
_bitfield_1: raw::ble_gap_cfg_device_name_t::new_bitfield_1(raw::BLE_GATTS_VLOC_STACK as u8),
+ _bitfield_align_1: [],
}),
..Default::default()
};
diff --git a/examples/src/bin/ble_dis_bas_peripheral_builder.rs b/examples/src/bin/ble_dis_bas_peripheral_builder.rs
index 79a314c1..46abb494 100644
--- a/examples/src/bin/ble_dis_bas_peripheral_builder.rs
+++ b/examples/src/bin/ble_dis_bas_peripheral_builder.rs
@@ -222,6 +222,7 @@ async fn main(spawner: Spawner) {
central_role_count: 3,
central_sec_count: 0,
_bitfield_1: raw::ble_gap_cfg_role_count_t::new_bitfield_1(0),
+ _bitfield_align_1: [],
}),
gap_device_name: Some(raw::ble_gap_cfg_device_name_t {
p_value: b"HelloRust" as *const u8 as _,
@@ -229,6 +230,7 @@ async fn main(spawner: Spawner) {
max_len: 9,
write_perm: unsafe { mem::zeroed() },
_bitfield_1: raw::ble_gap_cfg_device_name_t::new_bitfield_1(raw::BLE_GATTS_VLOC_STACK as u8),
+ _bitfield_align_1: [],
}),
..Default::default()
};
diff --git a/examples/src/bin/ble_keyboard_peripheral_builder.rs b/examples/src/bin/ble_keyboard_peripheral_builder.rs
index 0d2b2ca2..398d2803 100644
--- a/examples/src/bin/ble_keyboard_peripheral_builder.rs
+++ b/examples/src/bin/ble_keyboard_peripheral_builder.rs
@@ -467,6 +467,7 @@ async fn main(spawner: Spawner) {
central_role_count: 3,
central_sec_count: 0,
_bitfield_1: raw::ble_gap_cfg_role_count_t::new_bitfield_1(0),
+ _bitfield_align_1: [],
}),
gap_device_name: Some(raw::ble_gap_cfg_device_name_t {
p_value: b"HelloRust" as *const u8 as _,
@@ -474,6 +475,7 @@ async fn main(spawner: Spawner) {
max_len: 9,
write_perm: unsafe { mem::zeroed() },
_bitfield_1: raw::ble_gap_cfg_device_name_t::new_bitfield_1(raw::BLE_GATTS_VLOC_STACK as u8),
+ _bitfield_align_1: [],
}),
..Default::default()
};
diff --git a/examples/src/bin/ble_keyboard_peripheral_builder_macro.rs b/examples/src/bin/ble_keyboard_peripheral_builder_macro.rs
index e3484461..3fd8aaff 100644
--- a/examples/src/bin/ble_keyboard_peripheral_builder_macro.rs
+++ b/examples/src/bin/ble_keyboard_peripheral_builder_macro.rs
@@ -363,6 +363,7 @@ async fn main(spawner: Spawner) {
central_role_count: 3,
central_sec_count: 0,
_bitfield_1: raw::ble_gap_cfg_role_count_t::new_bitfield_1(0),
+ _bitfield_align_1: [],
}),
gap_device_name: Some(raw::ble_gap_cfg_device_name_t {
p_value: b"HelloRust" as *const u8 as _,
@@ -370,6 +371,7 @@ async fn main(spawner: Spawner) {
max_len: 9,
write_perm: unsafe { mem::zeroed() },
_bitfield_1: raw::ble_gap_cfg_device_name_t::new_bitfield_1(raw::BLE_GATTS_VLOC_STACK as u8),
+ _bitfield_align_1: [],
}),
..Default::default()
};
diff --git a/examples/src/bin/ble_l2cap_central.rs b/examples/src/bin/ble_l2cap_central.rs
index 38f74c0c..df125816 100644
--- a/examples/src/bin/ble_l2cap_central.rs
+++ b/examples/src/bin/ble_l2cap_central.rs
@@ -100,6 +100,7 @@ async fn main(spawner: Spawner) {
central_role_count: 15,
central_sec_count: 0,
_bitfield_1: raw::ble_gap_cfg_role_count_t::new_bitfield_1(0),
+ _bitfield_align_1: [],
}),
gap_device_name: Some(raw::ble_gap_cfg_device_name_t {
p_value: b"HelloRust" as *const u8 as _,
@@ -107,6 +108,7 @@ async fn main(spawner: Spawner) {
max_len: 9,
write_perm: unsafe { mem::zeroed() },
_bitfield_1: raw::ble_gap_cfg_device_name_t::new_bitfield_1(raw::BLE_GATTS_VLOC_STACK as u8),
+ _bitfield_align_1: [],
}),
conn_l2cap: Some(raw::ble_l2cap_conn_cfg_t {
ch_count: 1,
diff --git a/examples/src/bin/ble_l2cap_peripheral.rs b/examples/src/bin/ble_l2cap_peripheral.rs
index 4a90fbd5..1c06cec9 100644
--- a/examples/src/bin/ble_l2cap_peripheral.rs
+++ b/examples/src/bin/ble_l2cap_peripheral.rs
@@ -94,6 +94,7 @@ async fn main(spawner: Spawner) {
central_role_count: 15,
central_sec_count: 0,
_bitfield_1: raw::ble_gap_cfg_role_count_t::new_bitfield_1(0),
+ _bitfield_align_1: [],
}),
gap_device_name: Some(raw::ble_gap_cfg_device_name_t {
p_value: b"HelloRust" as *const u8 as _,
@@ -101,6 +102,7 @@ async fn main(spawner: Spawner) {
max_len: 9,
write_perm: unsafe { mem::zeroed() },
_bitfield_1: raw::ble_gap_cfg_device_name_t::new_bitfield_1(raw::BLE_GATTS_VLOC_STACK as u8),
+ _bitfield_align_1: [],
}),
conn_l2cap: Some(raw::ble_l2cap_conn_cfg_t {
ch_count: 1,
diff --git a/examples/src/bin/ble_peripheral_onoff.rs b/examples/src/bin/ble_peripheral_onoff.rs
index 1bc8d483..2f19d1bd 100644
--- a/examples/src/bin/ble_peripheral_onoff.rs
+++ b/examples/src/bin/ble_peripheral_onoff.rs
@@ -105,6 +105,7 @@ async fn main(spawner: Spawner) {
central_role_count: 3,
central_sec_count: 0,
_bitfield_1: raw::ble_gap_cfg_role_count_t::new_bitfield_1(0),
+ _bitfield_align_1: [],
}),
gap_device_name: Some(raw::ble_gap_cfg_device_name_t {
p_value: b"HelloRust" as *const u8 as _,
@@ -112,6 +113,7 @@ async fn main(spawner: Spawner) {
max_len: 9,
write_perm: unsafe { mem::zeroed() },
_bitfield_1: raw::ble_gap_cfg_device_name_t::new_bitfield_1(raw::BLE_GATTS_VLOC_STACK as u8),
+ _bitfield_align_1: [],
}),
..Default::default()
};
diff --git a/examples/src/bin/ble_scan.rs b/examples/src/bin/ble_scan.rs
index 32782c61..722d0980 100644
--- a/examples/src/bin/ble_scan.rs
+++ b/examples/src/bin/ble_scan.rs
@@ -41,6 +41,7 @@ async fn main(spawner: Spawner) {
central_role_count: 3,
central_sec_count: 0,
_bitfield_1: raw::ble_gap_cfg_role_count_t::new_bitfield_1(0),
+ _bitfield_align_1: [],
}),
gap_device_name: Some(raw::ble_gap_cfg_device_name_t {
p_value: b"HelloRust" as *const u8 as _,
@@ -48,6 +49,7 @@ async fn main(spawner: Spawner) {
max_len: 9,
write_perm: unsafe { mem::zeroed() },
_bitfield_1: raw::ble_gap_cfg_device_name_t::new_bitfield_1(raw::BLE_GATTS_VLOC_STACK as u8),
+ _bitfield_align_1: [],
}),
..Default::default()
};
diff --git a/nrf-softdevice-gen/Cargo.toml b/nrf-softdevice-gen/Cargo.toml
index 28c2e9d3..f4ebeafd 100644
--- a/nrf-softdevice-gen/Cargo.toml
+++ b/nrf-softdevice-gen/Cargo.toml
@@ -6,6 +6,6 @@ edition = "2021"
license = "MIT OR Apache-2.0"
[dependencies]
-bindgen = "0.55.1"
+bindgen = "0.72.0"
walkdir = "2.3.1"
regex = "1.3.9"
\ No newline at end of file
diff --git a/nrf-softdevice-gen/src/main.rs b/nrf-softdevice-gen/src/main.rs
index 4caabb05..0c8aa43b 100644
--- a/nrf-softdevice-gen/src/main.rs
+++ b/nrf-softdevice-gen/src/main.rs
@@ -94,7 +94,7 @@ fn main() {
let data = fs::read_to_string(&tmp_bindings_path).unwrap();
let re = Regex::new(
- r#"extern "C" \{(?P(?s).*?)pub fn (?Psd_[A-Za-z0-9_]+)\((?P(?s).*?)\) -> u32;\s+\}"#,
+ r#"unsafe extern "C" \{(?P(?s).*?)pub fn (?Psd_[A-Za-z0-9_]+)\((?P(?s).*?)\) -> u32;\s+\}"#,
)
.unwrap();
let data = re.replace_all(&data, |m: &Captures| {
diff --git a/nrf-softdevice-mbr/src/bindings.rs b/nrf-softdevice-mbr/src/bindings.rs
index 3bbc7ccd..1d2be0c5 100644
--- a/nrf-softdevice-mbr/src/bindings.rs
+++ b/nrf-softdevice-mbr/src/bindings.rs
@@ -132,7 +132,7 @@ impl ToAsm for unsafe extern "C" fn(X, Y, Z) -> R {
}
}
-/* automatically generated by rust-bindgen 0.55.1 */
+/* automatically generated by rust-bindgen 0.72.0 */
pub const MBR_SVC_BASE: u32 = 24;
pub const MBR_PAGE_SIZE_IN_WORDS: u32 = 1024;
@@ -176,16 +176,7 @@ pub const NRF_MBR_COMMANDS_SD_MBR_COMMAND_RESERVED: NRF_MBR_COMMANDS = 5;
pub const NRF_MBR_COMMANDS_SD_MBR_COMMAND_IRQ_FORWARD_ADDRESS_SET: NRF_MBR_COMMANDS = 6;
#[doc = "@brief Possible values for ::sd_mbr_command_t.command"]
pub type NRF_MBR_COMMANDS = self::c_uint;
-#[doc = "@brief This command copies part of a new SoftDevice"]
-#[doc = ""]
-#[doc = " The destination area is erased before copying."]
-#[doc = " If dst is in the middle of a flash page, that whole flash page will be erased."]
-#[doc = " If (dst+len) is in the middle of a flash page, that whole flash page will be erased."]
-#[doc = ""]
-#[doc = " The user of this function is responsible for setting the BPROT registers."]
-#[doc = ""]
-#[doc = " @retval ::NRF_SUCCESS indicates that the contents of the memory blocks where copied correctly."]
-#[doc = " @retval ::NRF_ERROR_INTERNAL indicates that the contents of the memory blocks where not verified correctly after copying."]
+#[doc = "@brief This command copies part of a new SoftDevice\n\n The destination area is erased before copying.\n If dst is in the middle of a flash page, that whole flash page will be erased.\n If (dst+len) is in the middle of a flash page, that whole flash page will be erased.\n\n The user of this function is responsible for setting the BPROT registers.\n\n @retval ::NRF_SUCCESS indicates that the contents of the memory blocks where copied correctly.\n @retval ::NRF_ERROR_INTERNAL indicates that the contents of the memory blocks where not verified correctly after copying."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_mbr_command_copy_sd_t {
@@ -196,53 +187,15 @@ pub struct sd_mbr_command_copy_sd_t {
#[doc = "< Number of 32 bit words to copy. Must be a multiple of @ref MBR_PAGE_SIZE_IN_WORDS words."]
pub len: u32,
}
-#[test]
-fn bindgen_test_layout_sd_mbr_command_copy_sd_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 12usize,
- concat!("Size of: ", stringify!(sd_mbr_command_copy_sd_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 4usize,
- concat!("Alignment of ", stringify!(sd_mbr_command_copy_sd_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).src as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(sd_mbr_command_copy_sd_t),
- "::",
- stringify!(src)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).dst as *const _ as usize },
- 4usize,
- concat!(
- "Offset of field: ",
- stringify!(sd_mbr_command_copy_sd_t),
- "::",
- stringify!(dst)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).len as *const _ as usize },
- 8usize,
- concat!(
- "Offset of field: ",
- stringify!(sd_mbr_command_copy_sd_t),
- "::",
- stringify!(len)
- )
- );
-}
-#[doc = "@brief This command works like memcmp, but takes the length in words."]
-#[doc = ""]
-#[doc = " @retval ::NRF_SUCCESS indicates that the contents of both memory blocks are equal."]
-#[doc = " @retval ::NRF_ERROR_NULL indicates that the contents of the memory blocks are not equal."]
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of sd_mbr_command_copy_sd_t"][::core::mem::size_of::() - 12usize];
+ ["Alignment of sd_mbr_command_copy_sd_t"][::core::mem::align_of::() - 4usize];
+ ["Offset of field: sd_mbr_command_copy_sd_t::src"][::core::mem::offset_of!(sd_mbr_command_copy_sd_t, src) - 0usize];
+ ["Offset of field: sd_mbr_command_copy_sd_t::dst"][::core::mem::offset_of!(sd_mbr_command_copy_sd_t, dst) - 4usize];
+ ["Offset of field: sd_mbr_command_copy_sd_t::len"][::core::mem::offset_of!(sd_mbr_command_copy_sd_t, len) - 8usize];
+};
+#[doc = "@brief This command works like memcmp, but takes the length in words.\n\n @retval ::NRF_SUCCESS indicates that the contents of both memory blocks are equal.\n @retval ::NRF_ERROR_NULL indicates that the contents of the memory blocks are not equal."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_mbr_command_compare_t {
@@ -253,70 +206,17 @@ pub struct sd_mbr_command_compare_t {
#[doc = "< Number of 32 bit words to compare."]
pub len: u32,
}
-#[test]
-fn bindgen_test_layout_sd_mbr_command_compare_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 12usize,
- concat!("Size of: ", stringify!(sd_mbr_command_compare_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 4usize,
- concat!("Alignment of ", stringify!(sd_mbr_command_compare_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).ptr1 as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(sd_mbr_command_compare_t),
- "::",
- stringify!(ptr1)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).ptr2 as *const _ as usize },
- 4usize,
- concat!(
- "Offset of field: ",
- stringify!(sd_mbr_command_compare_t),
- "::",
- stringify!(ptr2)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).len as *const _ as usize },
- 8usize,
- concat!(
- "Offset of field: ",
- stringify!(sd_mbr_command_compare_t),
- "::",
- stringify!(len)
- )
- );
-}
-#[doc = "@brief This command copies a new BootLoader."]
-#[doc = ""]
-#[doc = " The MBR assumes that either @ref MBR_BOOTLOADER_ADDR or @ref MBR_UICR_BOOTLOADER_ADDR is set to"]
-#[doc = " the address where the bootloader will be copied. If both addresses are set, the MBR will prioritize"]
-#[doc = " @ref MBR_BOOTLOADER_ADDR."]
-#[doc = ""]
-#[doc = " The bootloader destination is erased by this function."]
-#[doc = " If (destination+bl_len) is in the middle of a flash page, that whole flash page will be erased."]
-#[doc = ""]
-#[doc = " This command requires that @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR is set,"]
-#[doc = " see @ref sd_mbr_command."]
-#[doc = ""]
-#[doc = " This command will use the flash protect peripheral (BPROT or ACL) to protect the flash that is"]
-#[doc = " not intended to be written."]
-#[doc = ""]
-#[doc = " On success, this function will not return. It will start the new bootloader from reset-vector as normal."]
-#[doc = ""]
-#[doc = " @retval ::NRF_ERROR_INTERNAL indicates an internal error that should not happen."]
-#[doc = " @retval ::NRF_ERROR_FORBIDDEN if the bootloader address is not set."]
-#[doc = " @retval ::NRF_ERROR_INVALID_LENGTH if parameters attempts to read or write outside flash area."]
-#[doc = " @retval ::NRF_ERROR_NO_MEM No MBR parameter page is provided. See @ref sd_mbr_command."]
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of sd_mbr_command_compare_t"][::core::mem::size_of::() - 12usize];
+ ["Alignment of sd_mbr_command_compare_t"][::core::mem::align_of::() - 4usize];
+ ["Offset of field: sd_mbr_command_compare_t::ptr1"]
+ [::core::mem::offset_of!(sd_mbr_command_compare_t, ptr1) - 0usize];
+ ["Offset of field: sd_mbr_command_compare_t::ptr2"]
+ [::core::mem::offset_of!(sd_mbr_command_compare_t, ptr2) - 4usize];
+ ["Offset of field: sd_mbr_command_compare_t::len"][::core::mem::offset_of!(sd_mbr_command_compare_t, len) - 8usize];
+};
+#[doc = "@brief This command copies a new BootLoader.\n\n The MBR assumes that either @ref MBR_BOOTLOADER_ADDR or @ref MBR_UICR_BOOTLOADER_ADDR is set to\n the address where the bootloader will be copied. If both addresses are set, the MBR will prioritize\n @ref MBR_BOOTLOADER_ADDR.\n\n The bootloader destination is erased by this function.\n If (destination+bl_len) is in the middle of a flash page, that whole flash page will be erased.\n\n This command requires that @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR is set,\n see @ref sd_mbr_command.\n\n This command will use the flash protect peripheral (BPROT or ACL) to protect the flash that is\n not intended to be written.\n\n On success, this function will not return. It will start the new bootloader from reset-vector as normal.\n\n @retval ::NRF_ERROR_INTERNAL indicates an internal error that should not happen.\n @retval ::NRF_ERROR_FORBIDDEN if the bootloader address is not set.\n @retval ::NRF_ERROR_INVALID_LENGTH if parameters attempts to read or write outside flash area.\n @retval ::NRF_ERROR_NO_MEM No MBR parameter page is provided. See @ref sd_mbr_command."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_mbr_command_copy_bl_t {
@@ -325,129 +225,48 @@ pub struct sd_mbr_command_copy_bl_t {
#[doc = "< Number of 32 bit words to copy for BootLoader."]
pub bl_len: u32,
}
-#[test]
-fn bindgen_test_layout_sd_mbr_command_copy_bl_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 8usize,
- concat!("Size of: ", stringify!(sd_mbr_command_copy_bl_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 4usize,
- concat!("Alignment of ", stringify!(sd_mbr_command_copy_bl_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).bl_src as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(sd_mbr_command_copy_bl_t),
- "::",
- stringify!(bl_src)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).bl_len as *const _ as usize },
- 4usize,
- concat!(
- "Offset of field: ",
- stringify!(sd_mbr_command_copy_bl_t),
- "::",
- stringify!(bl_len)
- )
- );
-}
-#[doc = "@brief Change the address the MBR starts after a reset"]
-#[doc = ""]
-#[doc = " Once this function has been called, this address is where the MBR will start to forward"]
-#[doc = " interrupts to after a reset."]
-#[doc = ""]
-#[doc = " To restore default forwarding, this function should be called with @ref address set to 0. If a"]
-#[doc = " bootloader is present, interrupts will be forwarded to the bootloader. If not, interrupts will"]
-#[doc = " be forwarded to the SoftDevice."]
-#[doc = ""]
-#[doc = " The location of a bootloader can be specified in @ref MBR_BOOTLOADER_ADDR or"]
-#[doc = " @ref MBR_UICR_BOOTLOADER_ADDR. If both addresses are set, the MBR will prioritize"]
-#[doc = " @ref MBR_BOOTLOADER_ADDR."]
-#[doc = ""]
-#[doc = " This command requires that @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR is set,"]
-#[doc = " see @ref sd_mbr_command."]
-#[doc = ""]
-#[doc = " On success, this function will not return. It will reset the device."]
-#[doc = ""]
-#[doc = " @retval ::NRF_ERROR_INTERNAL indicates an internal error that should not happen."]
-#[doc = " @retval ::NRF_ERROR_INVALID_ADDR if parameter address is outside of the flash size."]
-#[doc = " @retval ::NRF_ERROR_NO_MEM No MBR parameter page is provided. See @ref sd_mbr_command."]
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of sd_mbr_command_copy_bl_t"][::core::mem::size_of::() - 8usize];
+ ["Alignment of sd_mbr_command_copy_bl_t"][::core::mem::align_of::() - 4usize];
+ ["Offset of field: sd_mbr_command_copy_bl_t::bl_src"]
+ [::core::mem::offset_of!(sd_mbr_command_copy_bl_t, bl_src) - 0usize];
+ ["Offset of field: sd_mbr_command_copy_bl_t::bl_len"]
+ [::core::mem::offset_of!(sd_mbr_command_copy_bl_t, bl_len) - 4usize];
+};
+#[doc = "@brief Change the address the MBR starts after a reset\n\n Once this function has been called, this address is where the MBR will start to forward\n interrupts to after a reset.\n\n To restore default forwarding, this function should be called with @ref address set to 0. If a\n bootloader is present, interrupts will be forwarded to the bootloader. If not, interrupts will\n be forwarded to the SoftDevice.\n\n The location of a bootloader can be specified in @ref MBR_BOOTLOADER_ADDR or\n @ref MBR_UICR_BOOTLOADER_ADDR. If both addresses are set, the MBR will prioritize\n @ref MBR_BOOTLOADER_ADDR.\n\n This command requires that @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR is set,\n see @ref sd_mbr_command.\n\n On success, this function will not return. It will reset the device.\n\n @retval ::NRF_ERROR_INTERNAL indicates an internal error that should not happen.\n @retval ::NRF_ERROR_INVALID_ADDR if parameter address is outside of the flash size.\n @retval ::NRF_ERROR_NO_MEM No MBR parameter page is provided. See @ref sd_mbr_command."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_mbr_command_vector_table_base_set_t {
#[doc = "< The base address of the interrupt vector table for forwarded interrupts."]
pub address: u32,
}
-#[test]
-fn bindgen_test_layout_sd_mbr_command_vector_table_base_set_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 4usize,
- concat!("Size of: ", stringify!(sd_mbr_command_vector_table_base_set_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 4usize,
- concat!("Alignment of ", stringify!(sd_mbr_command_vector_table_base_set_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).address as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(sd_mbr_command_vector_table_base_set_t),
- "::",
- stringify!(address)
- )
- );
-}
-#[doc = "@brief Sets the base address of the interrupt vector table for interrupts forwarded from the MBR"]
-#[doc = ""]
-#[doc = " Unlike sd_mbr_command_vector_table_base_set_t, this function does not reset, and it does not"]
-#[doc = " change where the MBR starts after reset."]
-#[doc = ""]
-#[doc = " @retval ::NRF_SUCCESS"]
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of sd_mbr_command_vector_table_base_set_t"]
+ [::core::mem::size_of::() - 4usize];
+ ["Alignment of sd_mbr_command_vector_table_base_set_t"]
+ [::core::mem::align_of::() - 4usize];
+ ["Offset of field: sd_mbr_command_vector_table_base_set_t::address"]
+ [::core::mem::offset_of!(sd_mbr_command_vector_table_base_set_t, address) - 0usize];
+};
+#[doc = "@brief Sets the base address of the interrupt vector table for interrupts forwarded from the MBR\n\n Unlike sd_mbr_command_vector_table_base_set_t, this function does not reset, and it does not\n change where the MBR starts after reset.\n\n @retval ::NRF_SUCCESS"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sd_mbr_command_irq_forward_address_set_t {
#[doc = "< The base address of the interrupt vector table for forwarded interrupts."]
pub address: u32,
}
-#[test]
-fn bindgen_test_layout_sd_mbr_command_irq_forward_address_set_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 4usize,
- concat!("Size of: ", stringify!(sd_mbr_command_irq_forward_address_set_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 4usize,
- concat!("Alignment of ", stringify!(sd_mbr_command_irq_forward_address_set_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).address as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(sd_mbr_command_irq_forward_address_set_t),
- "::",
- stringify!(address)
- )
- );
-}
-#[doc = "@brief Input structure containing data used when calling ::sd_mbr_command"]
-#[doc = ""]
-#[doc = " Depending on what command value that is set, the corresponding params value type must also be"]
-#[doc = " set. See @ref NRF_MBR_COMMANDS for command types and corresponding params value type. If command"]
-#[doc = " @ref SD_MBR_COMMAND_INIT_SD is set, it is not necessary to set any values under params."]
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of sd_mbr_command_irq_forward_address_set_t"]
+ [::core::mem::size_of::() - 4usize];
+ ["Alignment of sd_mbr_command_irq_forward_address_set_t"]
+ [::core::mem::align_of::() - 4usize];
+ ["Offset of field: sd_mbr_command_irq_forward_address_set_t::address"]
+ [::core::mem::offset_of!(sd_mbr_command_irq_forward_address_set_t, address) - 0usize];
+};
+#[doc = "@brief Input structure containing data used when calling ::sd_mbr_command\n\n Depending on what command value that is set, the corresponding params value type must also be\n set. See @ref NRF_MBR_COMMANDS for command types and corresponding params value type. If command\n @ref SD_MBR_COMMAND_INIT_SD is set, it is not necessary to set any values under params."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct sd_mbr_command_t {
@@ -469,129 +288,31 @@ pub union sd_mbr_command_t__bindgen_ty_1 {
pub base_set: sd_mbr_command_vector_table_base_set_t,
#[doc = "< Parameters for irq forward address set"]
pub irq_forward_address_set: sd_mbr_command_irq_forward_address_set_t,
- _bindgen_union_align: [u32; 3usize],
-}
-#[test]
-fn bindgen_test_layout_sd_mbr_command_t__bindgen_ty_1() {
- assert_eq!(
- ::core::mem::size_of::(),
- 12usize,
- concat!("Size of: ", stringify!(sd_mbr_command_t__bindgen_ty_1))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 4usize,
- concat!("Alignment of ", stringify!(sd_mbr_command_t__bindgen_ty_1))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).copy_sd as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(sd_mbr_command_t__bindgen_ty_1),
- "::",
- stringify!(copy_sd)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).compare as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(sd_mbr_command_t__bindgen_ty_1),
- "::",
- stringify!(compare)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).copy_bl as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(sd_mbr_command_t__bindgen_ty_1),
- "::",
- stringify!(copy_bl)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).base_set as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(sd_mbr_command_t__bindgen_ty_1),
- "::",
- stringify!(base_set)
- )
- );
- assert_eq!(
- unsafe {
- &(*(::core::ptr::null::())).irq_forward_address_set as *const _ as usize
- },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(sd_mbr_command_t__bindgen_ty_1),
- "::",
- stringify!(irq_forward_address_set)
- )
- );
-}
-#[test]
-fn bindgen_test_layout_sd_mbr_command_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 16usize,
- concat!("Size of: ", stringify!(sd_mbr_command_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 4usize,
- concat!("Alignment of ", stringify!(sd_mbr_command_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).command as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(sd_mbr_command_t),
- "::",
- stringify!(command)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).params as *const _ as usize },
- 4usize,
- concat!(
- "Offset of field: ",
- stringify!(sd_mbr_command_t),
- "::",
- stringify!(params)
- )
- );
}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of sd_mbr_command_t__bindgen_ty_1"][::core::mem::size_of::() - 12usize];
+ ["Alignment of sd_mbr_command_t__bindgen_ty_1"][::core::mem::align_of::() - 4usize];
+ ["Offset of field: sd_mbr_command_t__bindgen_ty_1::copy_sd"]
+ [::core::mem::offset_of!(sd_mbr_command_t__bindgen_ty_1, copy_sd) - 0usize];
+ ["Offset of field: sd_mbr_command_t__bindgen_ty_1::compare"]
+ [::core::mem::offset_of!(sd_mbr_command_t__bindgen_ty_1, compare) - 0usize];
+ ["Offset of field: sd_mbr_command_t__bindgen_ty_1::copy_bl"]
+ [::core::mem::offset_of!(sd_mbr_command_t__bindgen_ty_1, copy_bl) - 0usize];
+ ["Offset of field: sd_mbr_command_t__bindgen_ty_1::base_set"]
+ [::core::mem::offset_of!(sd_mbr_command_t__bindgen_ty_1, base_set) - 0usize];
+ ["Offset of field: sd_mbr_command_t__bindgen_ty_1::irq_forward_address_set"]
+ [::core::mem::offset_of!(sd_mbr_command_t__bindgen_ty_1, irq_forward_address_set) - 0usize];
+};
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of sd_mbr_command_t"][::core::mem::size_of::() - 16usize];
+ ["Alignment of sd_mbr_command_t"][::core::mem::align_of::() - 4usize];
+ ["Offset of field: sd_mbr_command_t::command"][::core::mem::offset_of!(sd_mbr_command_t, command) - 0usize];
+ ["Offset of field: sd_mbr_command_t::params"][::core::mem::offset_of!(sd_mbr_command_t, params) - 4usize];
+};
-#[doc = "@brief Issue Master Boot Record commands"]
-#[doc = ""]
-#[doc = " Commands used when updating a SoftDevice and bootloader."]
-#[doc = ""]
-#[doc = " The @ref SD_MBR_COMMAND_COPY_BL and @ref SD_MBR_COMMAND_VECTOR_TABLE_BASE_SET requires"]
-#[doc = " parameters to be retained by the MBR when resetting the IC. This is done in a separate flash"]
-#[doc = " page. The location of the flash page should be provided by the application in either"]
-#[doc = " @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR. If both addresses are set, the MBR"]
-#[doc = " will prioritize @ref MBR_PARAM_PAGE_ADDR. This page will be cleared by the MBR and is used to"]
-#[doc = " store the command before reset. When an address is specified, the page it refers to must not be"]
-#[doc = " used by the application. If no address is provided by the application, i.e. both"]
-#[doc = " @ref MBR_PARAM_PAGE_ADDR and @ref MBR_UICR_PARAM_PAGE_ADDR is 0xFFFFFFFF, MBR commands which use"]
-#[doc = " flash will be unavailable and return @ref NRF_ERROR_NO_MEM."]
-#[doc = ""]
-#[doc = " @param[in] param Pointer to a struct describing the command."]
-#[doc = ""]
-#[doc = " @note For a complete set of return values, see ::sd_mbr_command_copy_sd_t,"]
-#[doc = " ::sd_mbr_command_copy_bl_t, ::sd_mbr_command_compare_t,"]
-#[doc = " ::sd_mbr_command_vector_table_base_set_t, ::sd_mbr_command_irq_forward_address_set_t"]
-#[doc = ""]
-#[doc = " @retval ::NRF_ERROR_NO_MEM No MBR parameter page provided"]
-#[doc = " @retval ::NRF_ERROR_INVALID_PARAM if an invalid command is given."]
+#[doc = "@brief Issue Master Boot Record commands\n\n Commands used when updating a SoftDevice and bootloader.\n\n The @ref SD_MBR_COMMAND_COPY_BL and @ref SD_MBR_COMMAND_VECTOR_TABLE_BASE_SET requires\n parameters to be retained by the MBR when resetting the IC. This is done in a separate flash\n page. The location of the flash page should be provided by the application in either\n @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR. If both addresses are set, the MBR\n will prioritize @ref MBR_PARAM_PAGE_ADDR. This page will be cleared by the MBR and is used to\n store the command before reset. When an address is specified, the page it refers to must not be\n used by the application. If no address is provided by the application, i.e. both\n @ref MBR_PARAM_PAGE_ADDR and @ref MBR_UICR_PARAM_PAGE_ADDR is 0xFFFFFFFF, MBR commands which use\n flash will be unavailable and return @ref NRF_ERROR_NO_MEM.\n\n @param[in] param Pointer to a struct describing the command.\n\n @note For a complete set of return values, see ::sd_mbr_command_copy_sd_t,\n ::sd_mbr_command_copy_bl_t, ::sd_mbr_command_compare_t,\n ::sd_mbr_command_vector_table_base_set_t, ::sd_mbr_command_irq_forward_address_set_t\n\n @retval ::NRF_ERROR_NO_MEM No MBR parameter page provided\n @retval ::NRF_ERROR_INVALID_PARAM if an invalid command is given."]
#[inline(always)]
pub unsafe fn sd_mbr_command(param: *mut sd_mbr_command_t) -> u32 {
let ret: u32;
diff --git a/nrf-softdevice-s112/src/bindings.rs b/nrf-softdevice-s112/src/bindings.rs
index 73de63e0..a4bcc352 100644
--- a/nrf-softdevice-s112/src/bindings.rs
+++ b/nrf-softdevice-s112/src/bindings.rs
@@ -132,29 +132,25 @@ impl ToAsm for unsafe extern "C" fn(X, Y, Z) -> R {
}
}
-/* automatically generated by rust-bindgen 0.55.1 */
+/* automatically generated by rust-bindgen 0.72.0 */
#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
-pub struct __BindgenBitfieldUnit {
+pub struct __BindgenBitfieldUnit {
storage: Storage,
- align: [Align; 0],
}
-impl __BindgenBitfieldUnit {
+impl __BindgenBitfieldUnit {
#[inline]
pub const fn new(storage: Storage) -> Self {
- Self { storage, align: [] }
+ Self { storage }
}
}
-impl __BindgenBitfieldUnit
+impl __BindgenBitfieldUnit
where
Storage: AsRef<[u8]> + AsMut<[u8]>,
{
#[inline]
- pub fn get_bit(&self, index: usize) -> bool {
- debug_assert!(index / 8 < self.storage.as_ref().len());
- let byte_index = index / 8;
- let byte = self.storage.as_ref()[byte_index];
+ fn extract_bit(byte: u8, index: usize) -> bool {
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
@@ -164,10 +160,21 @@ where
byte & mask == mask
}
#[inline]
- pub fn set_bit(&mut self, index: usize, val: bool) {
+ pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
- let byte = &mut self.storage.as_mut()[byte_index];
+ let byte = self.storage.as_ref()[byte_index];
+ Self::extract_bit(byte, index)
+ }
+ #[inline]
+ pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
+ debug_assert!(index / 8 < core::mem::size_of::());
+ let byte_index = index / 8;
+ let byte = unsafe { *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize) };
+ Self::extract_bit(byte, index)
+ }
+ #[inline]
+ fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
@@ -175,12 +182,26 @@ where
};
let mask = 1 << bit_index;
if val {
- *byte |= mask;
+ byte | mask
} else {
- *byte &= !mask;
+ byte & !mask
}
}
#[inline]
+ pub fn set_bit(&mut self, index: usize, val: bool) {
+ debug_assert!(index / 8 < self.storage.as_ref().len());
+ let byte_index = index / 8;
+ let byte = &mut self.storage.as_mut()[byte_index];
+ *byte = Self::change_bit(*byte, index, val);
+ }
+ #[inline]
+ pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
+ debug_assert!(index / 8 < core::mem::size_of::());
+ let byte_index = index / 8;
+ let byte = unsafe { (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize) };
+ unsafe { *byte = Self::change_bit(*byte, index, val) };
+ }
+ #[inline]
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@@ -199,6 +220,24 @@ where
val
}
#[inline]
+ pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
+ debug_assert!(bit_width <= 64);
+ debug_assert!(bit_offset / 8 < core::mem::size_of::());
+ debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::());
+ let mut val = 0;
+ for i in 0..(bit_width as usize) {
+ if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
+ let index = if cfg!(target_endian = "big") {
+ bit_width as usize - 1 - i
+ } else {
+ i
+ };
+ val |= 1 << index;
+ }
+ }
+ val
+ }
+ #[inline]
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@@ -214,6 +253,22 @@ where
self.set_bit(index + bit_offset, val_bit_is_set);
}
}
+ #[inline]
+ pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
+ debug_assert!(bit_width <= 64);
+ debug_assert!(bit_offset / 8 < core::mem::size_of::());
+ debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::());
+ for i in 0..(bit_width as usize) {
+ let mask = 1 << i;
+ let val_bit_is_set = val & mask == mask;
+ let index = if cfg!(target_endian = "big") {
+ bit_width as usize - 1 - i
+ } else {
+ i
+ };
+ unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
+ }
+ }
}
#[repr(C)]
#[derive(Default)]
@@ -270,7 +325,7 @@ impl ::core::default::Default for __BindgenUnionField {
impl ::core::clone::Clone for __BindgenUnionField {
#[inline]
fn clone(&self) -> Self {
- Self::new()
+ *self
}
}
impl ::core::marker::Copy for __BindgenUnionField {}
@@ -312,85 +367,6 @@ pub const NRF_ERROR_INVALID_ADDR: u32 = 16;
pub const NRF_ERROR_BUSY: u32 = 17;
pub const NRF_ERROR_CONN_COUNT: u32 = 18;
pub const NRF_ERROR_RESOURCES: u32 = 19;
-pub const BLE_ERROR_NOT_ENABLED: u32 = 12289;
-pub const BLE_ERROR_INVALID_CONN_HANDLE: u32 = 12290;
-pub const BLE_ERROR_INVALID_ATTR_HANDLE: u32 = 12291;
-pub const BLE_ERROR_INVALID_ADV_HANDLE: u32 = 12292;
-pub const BLE_ERROR_INVALID_ROLE: u32 = 12293;
-pub const BLE_ERROR_BLOCKED_BY_OTHER_LINKS: u32 = 12294;
-pub const NRF_L2CAP_ERR_BASE: u32 = 12544;
-pub const NRF_GAP_ERR_BASE: u32 = 12800;
-pub const NRF_GATTC_ERR_BASE: u32 = 13056;
-pub const NRF_GATTS_ERR_BASE: u32 = 13312;
-pub const BLE_HCI_STATUS_CODE_SUCCESS: u32 = 0;
-pub const BLE_HCI_STATUS_CODE_UNKNOWN_BTLE_COMMAND: u32 = 1;
-pub const BLE_HCI_STATUS_CODE_UNKNOWN_CONNECTION_IDENTIFIER: u32 = 2;
-pub const BLE_HCI_AUTHENTICATION_FAILURE: u32 = 5;
-pub const BLE_HCI_STATUS_CODE_PIN_OR_KEY_MISSING: u32 = 6;
-pub const BLE_HCI_MEMORY_CAPACITY_EXCEEDED: u32 = 7;
-pub const BLE_HCI_CONNECTION_TIMEOUT: u32 = 8;
-pub const BLE_HCI_STATUS_CODE_COMMAND_DISALLOWED: u32 = 12;
-pub const BLE_HCI_STATUS_CODE_INVALID_BTLE_COMMAND_PARAMETERS: u32 = 18;
-pub const BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION: u32 = 19;
-pub const BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES: u32 = 20;
-pub const BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF: u32 = 21;
-pub const BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION: u32 = 22;
-pub const BLE_HCI_UNSUPPORTED_REMOTE_FEATURE: u32 = 26;
-pub const BLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS: u32 = 30;
-pub const BLE_HCI_STATUS_CODE_UNSPECIFIED_ERROR: u32 = 31;
-pub const BLE_HCI_STATUS_CODE_LMP_RESPONSE_TIMEOUT: u32 = 34;
-pub const BLE_HCI_STATUS_CODE_LMP_ERROR_TRANSACTION_COLLISION: u32 = 35;
-pub const BLE_HCI_STATUS_CODE_LMP_PDU_NOT_ALLOWED: u32 = 36;
-pub const BLE_HCI_INSTANT_PASSED: u32 = 40;
-pub const BLE_HCI_PAIRING_WITH_UNIT_KEY_UNSUPPORTED: u32 = 41;
-pub const BLE_HCI_DIFFERENT_TRANSACTION_COLLISION: u32 = 42;
-pub const BLE_HCI_PARAMETER_OUT_OF_MANDATORY_RANGE: u32 = 48;
-pub const BLE_HCI_CONTROLLER_BUSY: u32 = 58;
-pub const BLE_HCI_CONN_INTERVAL_UNACCEPTABLE: u32 = 59;
-pub const BLE_HCI_DIRECTED_ADVERTISER_TIMEOUT: u32 = 60;
-pub const BLE_HCI_CONN_TERMINATED_DUE_TO_MIC_FAILURE: u32 = 61;
-pub const BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED: u32 = 62;
-pub const BLE_SVC_BASE: u32 = 96;
-pub const BLE_SVC_LAST: u32 = 107;
-pub const BLE_GAP_SVC_BASE: u32 = 108;
-pub const BLE_GAP_SVC_LAST: u32 = 154;
-pub const BLE_GATTC_SVC_BASE: u32 = 155;
-pub const BLE_GATTC_SVC_LAST: u32 = 167;
-pub const BLE_GATTS_SVC_BASE: u32 = 168;
-pub const BLE_GATTS_SVC_LAST: u32 = 183;
-pub const BLE_EVT_INVALID: u32 = 0;
-pub const BLE_EVT_BASE: u32 = 1;
-pub const BLE_EVT_LAST: u32 = 15;
-pub const BLE_GAP_EVT_BASE: u32 = 16;
-pub const BLE_GAP_EVT_LAST: u32 = 47;
-pub const BLE_GATTC_EVT_BASE: u32 = 48;
-pub const BLE_GATTC_EVT_LAST: u32 = 79;
-pub const BLE_GATTS_EVT_BASE: u32 = 80;
-pub const BLE_GATTS_EVT_LAST: u32 = 111;
-pub const BLE_OPT_INVALID: u32 = 0;
-pub const BLE_OPT_BASE: u32 = 1;
-pub const BLE_OPT_LAST: u32 = 31;
-pub const BLE_GAP_OPT_BASE: u32 = 32;
-pub const BLE_GAP_OPT_LAST: u32 = 63;
-pub const BLE_GATT_OPT_BASE: u32 = 64;
-pub const BLE_GATT_OPT_LAST: u32 = 95;
-pub const BLE_GATTC_OPT_BASE: u32 = 96;
-pub const BLE_GATTC_OPT_LAST: u32 = 127;
-pub const BLE_GATTS_OPT_BASE: u32 = 128;
-pub const BLE_GATTS_OPT_LAST: u32 = 159;
-pub const BLE_CFG_INVALID: u32 = 0;
-pub const BLE_CFG_BASE: u32 = 1;
-pub const BLE_CFG_LAST: u32 = 31;
-pub const BLE_CONN_CFG_BASE: u32 = 32;
-pub const BLE_CONN_CFG_LAST: u32 = 63;
-pub const BLE_GAP_CFG_BASE: u32 = 64;
-pub const BLE_GAP_CFG_LAST: u32 = 95;
-pub const BLE_GATT_CFG_BASE: u32 = 96;
-pub const BLE_GATT_CFG_LAST: u32 = 127;
-pub const BLE_GATTC_CFG_BASE: u32 = 128;
-pub const BLE_GATTC_CFG_LAST: u32 = 159;
-pub const BLE_GATTS_CFG_BASE: u32 = 160;
-pub const BLE_GATTS_CFG_LAST: u32 = 191;
pub const BLE_CONN_HANDLE_INVALID: u32 = 65535;
pub const BLE_CONN_HANDLE_ALL: u32 = 65534;
pub const BLE_UUID_UNKNOWN: u32 = 0;
@@ -465,168 +441,149 @@ pub const BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_DISP: u32 = 5185;
pub const BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_DISP: u32 = 5186;
pub const BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_POD: u32 = 5187;
pub const BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_POD: u32 = 5188;
-pub const BLE_ERROR_GAP_UUID_LIST_MISMATCH: u32 = 12800;
-pub const BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST: u32 = 12801;
-pub const BLE_ERROR_GAP_INVALID_BLE_ADDR: u32 = 12802;
-pub const BLE_ERROR_GAP_WHITELIST_IN_USE: u32 = 12803;
-pub const BLE_ERROR_GAP_DEVICE_IDENTITIES_IN_USE: u32 = 12804;
-pub const BLE_ERROR_GAP_DEVICE_IDENTITIES_DUPLICATE: u32 = 12805;
-pub const BLE_GAP_ROLE_INVALID: u32 = 0;
-pub const BLE_GAP_ROLE_PERIPH: u32 = 1;
-pub const BLE_GAP_TIMEOUT_SRC_CONN: u32 = 2;
-pub const BLE_GAP_TIMEOUT_SRC_AUTH_PAYLOAD: u32 = 3;
-pub const BLE_GAP_ADDR_TYPE_PUBLIC: u32 = 0;
-pub const BLE_GAP_ADDR_TYPE_RANDOM_STATIC: u32 = 1;
-pub const BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE: u32 = 2;
-pub const BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE: u32 = 3;
-pub const BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S: u32 = 900;
-pub const BLE_GAP_MAX_PRIVATE_ADDR_CYCLE_INTERVAL_S: u32 = 41400;
-pub const BLE_GAP_ADDR_LEN: u32 = 6;
-pub const BLE_GAP_PRIVACY_MODE_OFF: u32 = 0;
-pub const BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY: u32 = 1;
-pub const BLE_GAP_PRIVACY_MODE_NETWORK_PRIVACY: u32 = 2;
-pub const BLE_GAP_POWER_LEVEL_INVALID: u32 = 127;
-pub const BLE_GAP_ADV_SET_HANDLE_NOT_SET: u32 = 255;
-pub const BLE_GAP_ADV_SET_COUNT_DEFAULT: u32 = 1;
-pub const BLE_GAP_ADV_SET_COUNT_MAX: u32 = 1;
-pub const BLE_GAP_ADV_SET_DATA_SIZE_MAX: u32 = 31;
-pub const BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE: u32 = 255;
-pub const BLE_GAP_EVT_ADV_SET_TERMINATED_REASON_TIMEOUT: u32 = 1;
-pub const BLE_GAP_EVT_ADV_SET_TERMINATED_REASON_LIMIT_REACHED: u32 = 2;
-pub const BLE_GAP_AD_TYPE_FLAGS: u32 = 1;
-pub const BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_MORE_AVAILABLE: u32 = 2;
-pub const BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_COMPLETE: u32 = 3;
-pub const BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_MORE_AVAILABLE: u32 = 4;
-pub const BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_COMPLETE: u32 = 5;
-pub const BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE: u32 = 6;
-pub const BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE: u32 = 7;
-pub const BLE_GAP_AD_TYPE_SHORT_LOCAL_NAME: u32 = 8;
-pub const BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME: u32 = 9;
-pub const BLE_GAP_AD_TYPE_TX_POWER_LEVEL: u32 = 10;
-pub const BLE_GAP_AD_TYPE_CLASS_OF_DEVICE: u32 = 13;
-pub const BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C: u32 = 14;
-pub const BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R: u32 = 15;
-pub const BLE_GAP_AD_TYPE_SECURITY_MANAGER_TK_VALUE: u32 = 16;
-pub const BLE_GAP_AD_TYPE_SECURITY_MANAGER_OOB_FLAGS: u32 = 17;
-pub const BLE_GAP_AD_TYPE_SLAVE_CONNECTION_INTERVAL_RANGE: u32 = 18;
-pub const BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_16BIT: u32 = 20;
-pub const BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_128BIT: u32 = 21;
-pub const BLE_GAP_AD_TYPE_SERVICE_DATA: u32 = 22;
-pub const BLE_GAP_AD_TYPE_PUBLIC_TARGET_ADDRESS: u32 = 23;
-pub const BLE_GAP_AD_TYPE_RANDOM_TARGET_ADDRESS: u32 = 24;
-pub const BLE_GAP_AD_TYPE_APPEARANCE: u32 = 25;
-pub const BLE_GAP_AD_TYPE_ADVERTISING_INTERVAL: u32 = 26;
-pub const BLE_GAP_AD_TYPE_LE_BLUETOOTH_DEVICE_ADDRESS: u32 = 27;
-pub const BLE_GAP_AD_TYPE_LE_ROLE: u32 = 28;
-pub const BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C256: u32 = 29;
-pub const BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R256: u32 = 30;
-pub const BLE_GAP_AD_TYPE_SERVICE_DATA_32BIT_UUID: u32 = 32;
-pub const BLE_GAP_AD_TYPE_SERVICE_DATA_128BIT_UUID: u32 = 33;
-pub const BLE_GAP_AD_TYPE_LESC_CONFIRMATION_VALUE: u32 = 34;
-pub const BLE_GAP_AD_TYPE_LESC_RANDOM_VALUE: u32 = 35;
-pub const BLE_GAP_AD_TYPE_URI: u32 = 36;
-pub const BLE_GAP_AD_TYPE_3D_INFORMATION_DATA: u32 = 61;
-pub const BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA: u32 = 255;
-pub const BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE: u32 = 1;
-pub const BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE: u32 = 2;
-pub const BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED: u32 = 4;
-pub const BLE_GAP_ADV_FLAG_LE_BR_EDR_CONTROLLER: u32 = 8;
-pub const BLE_GAP_ADV_FLAG_LE_BR_EDR_HOST: u32 = 16;
-pub const BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE: u32 = 5;
-pub const BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE: u32 = 6;
-pub const BLE_GAP_ADV_INTERVAL_MIN: u32 = 32;
-pub const BLE_GAP_ADV_INTERVAL_MAX: u32 = 16384;
-pub const BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED: u32 = 1;
-pub const BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE: u32 = 2;
-pub const BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED: u32 = 3;
-pub const BLE_GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED: u32 = 4;
-pub const BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED: u32 = 5;
-pub const BLE_GAP_ADV_FP_ANY: u32 = 0;
-pub const BLE_GAP_ADV_FP_FILTER_SCANREQ: u32 = 1;
-pub const BLE_GAP_ADV_FP_FILTER_CONNREQ: u32 = 2;
-pub const BLE_GAP_ADV_FP_FILTER_BOTH: u32 = 3;
-pub const BLE_GAP_ADV_TIMEOUT_HIGH_DUTY_MAX: u32 = 128;
-pub const BLE_GAP_ADV_TIMEOUT_LIMITED_MAX: u32 = 18000;
-pub const BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED: u32 = 0;
-pub const BLE_GAP_DISC_MODE_NOT_DISCOVERABLE: u32 = 0;
-pub const BLE_GAP_DISC_MODE_LIMITED: u32 = 1;
-pub const BLE_GAP_DISC_MODE_GENERAL: u32 = 2;
-pub const BLE_GAP_IO_CAPS_DISPLAY_ONLY: u32 = 0;
-pub const BLE_GAP_IO_CAPS_DISPLAY_YESNO: u32 = 1;
-pub const BLE_GAP_IO_CAPS_KEYBOARD_ONLY: u32 = 2;
-pub const BLE_GAP_IO_CAPS_NONE: u32 = 3;
-pub const BLE_GAP_IO_CAPS_KEYBOARD_DISPLAY: u32 = 4;
-pub const BLE_GAP_AUTH_KEY_TYPE_NONE: u32 = 0;
-pub const BLE_GAP_AUTH_KEY_TYPE_PASSKEY: u32 = 1;
-pub const BLE_GAP_AUTH_KEY_TYPE_OOB: u32 = 2;
-pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_START: u32 = 0;
-pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_DIGIT_IN: u32 = 1;
-pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_DIGIT_OUT: u32 = 2;
-pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_CLEAR: u32 = 3;
-pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_END: u32 = 4;
-pub const BLE_GAP_SEC_STATUS_SUCCESS: u32 = 0;
-pub const BLE_GAP_SEC_STATUS_TIMEOUT: u32 = 1;
-pub const BLE_GAP_SEC_STATUS_PDU_INVALID: u32 = 2;
-pub const BLE_GAP_SEC_STATUS_RFU_RANGE1_BEGIN: u32 = 3;
-pub const BLE_GAP_SEC_STATUS_RFU_RANGE1_END: u32 = 128;
-pub const BLE_GAP_SEC_STATUS_PASSKEY_ENTRY_FAILED: u32 = 129;
-pub const BLE_GAP_SEC_STATUS_OOB_NOT_AVAILABLE: u32 = 130;
-pub const BLE_GAP_SEC_STATUS_AUTH_REQ: u32 = 131;
-pub const BLE_GAP_SEC_STATUS_CONFIRM_VALUE: u32 = 132;
-pub const BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP: u32 = 133;
-pub const BLE_GAP_SEC_STATUS_ENC_KEY_SIZE: u32 = 134;
-pub const BLE_GAP_SEC_STATUS_SMP_CMD_UNSUPPORTED: u32 = 135;
-pub const BLE_GAP_SEC_STATUS_UNSPECIFIED: u32 = 136;
-pub const BLE_GAP_SEC_STATUS_REPEATED_ATTEMPTS: u32 = 137;
-pub const BLE_GAP_SEC_STATUS_INVALID_PARAMS: u32 = 138;
-pub const BLE_GAP_SEC_STATUS_DHKEY_FAILURE: u32 = 139;
-pub const BLE_GAP_SEC_STATUS_NUM_COMP_FAILURE: u32 = 140;
-pub const BLE_GAP_SEC_STATUS_BR_EDR_IN_PROG: u32 = 141;
-pub const BLE_GAP_SEC_STATUS_X_TRANS_KEY_DISALLOWED: u32 = 142;
-pub const BLE_GAP_SEC_STATUS_RFU_RANGE2_BEGIN: u32 = 143;
-pub const BLE_GAP_SEC_STATUS_RFU_RANGE2_END: u32 = 255;
-pub const BLE_GAP_SEC_STATUS_SOURCE_LOCAL: u32 = 0;
-pub const BLE_GAP_SEC_STATUS_SOURCE_REMOTE: u32 = 1;
-pub const BLE_GAP_CP_MIN_CONN_INTVL_NONE: u32 = 65535;
-pub const BLE_GAP_CP_MIN_CONN_INTVL_MIN: u32 = 6;
-pub const BLE_GAP_CP_MIN_CONN_INTVL_MAX: u32 = 3200;
-pub const BLE_GAP_CP_MAX_CONN_INTVL_NONE: u32 = 65535;
-pub const BLE_GAP_CP_MAX_CONN_INTVL_MIN: u32 = 6;
-pub const BLE_GAP_CP_MAX_CONN_INTVL_MAX: u32 = 3200;
-pub const BLE_GAP_CP_SLAVE_LATENCY_MAX: u32 = 499;
-pub const BLE_GAP_CP_CONN_SUP_TIMEOUT_NONE: u32 = 65535;
-pub const BLE_GAP_CP_CONN_SUP_TIMEOUT_MIN: u32 = 10;
-pub const BLE_GAP_CP_CONN_SUP_TIMEOUT_MAX: u32 = 3200;
-pub const BLE_GAP_DEVNAME_DEFAULT: &'static [u8; 6usize] = b"nRF5x\0";
-pub const BLE_GAP_DEVNAME_DEFAULT_LEN: u32 = 31;
-pub const BLE_GAP_DEVNAME_MAX_LEN: u32 = 248;
-pub const BLE_GAP_RSSI_THRESHOLD_INVALID: u32 = 255;
-pub const BLE_GAP_PHY_AUTO: u32 = 0;
-pub const BLE_GAP_PHY_1MBPS: u32 = 1;
-pub const BLE_GAP_PHY_2MBPS: u32 = 2;
-pub const BLE_GAP_PHY_CODED: u32 = 4;
-pub const BLE_GAP_PHY_NOT_SET: u32 = 255;
-pub const BLE_GAP_PHYS_SUPPORTED: u32 = 3;
-pub const BLE_GAP_SEC_RAND_LEN: u32 = 8;
-pub const BLE_GAP_SEC_KEY_LEN: u32 = 16;
-pub const BLE_GAP_LESC_P256_PK_LEN: u32 = 64;
-pub const BLE_GAP_LESC_DHKEY_LEN: u32 = 32;
-pub const BLE_GAP_PASSKEY_LEN: u32 = 6;
-pub const BLE_GAP_WHITELIST_ADDR_MAX_COUNT: u32 = 8;
-pub const BLE_GAP_DEVICE_IDENTITIES_MAX_COUNT: u32 = 8;
-pub const BLE_GAP_CONN_COUNT_DEFAULT: u32 = 1;
-pub const BLE_GAP_EVENT_LENGTH_MIN: u32 = 2;
-pub const BLE_GAP_EVENT_LENGTH_DEFAULT: u32 = 3;
-pub const BLE_GAP_ROLE_COUNT_PERIPH_DEFAULT: u32 = 1;
-pub const BLE_GAP_ROLE_COUNT_COMBINED_MAX: u32 = 20;
-pub const BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MAX: u32 = 48000;
-pub const BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MIN: u32 = 1;
-pub const BLE_GAP_SEC_MODE: u32 = 0;
-pub const BLE_GAP_CHAR_INCL_CONFIG_INCLUDE: u32 = 0;
-pub const BLE_GAP_CHAR_INCL_CONFIG_EXCLUDE_WITH_SPACE: u32 = 1;
-pub const BLE_GAP_CHAR_INCL_CONFIG_EXCLUDE_WITHOUT_SPACE: u32 = 2;
-pub const BLE_GAP_PPCP_INCL_CONFIG_DEFAULT: u32 = 0;
-pub const BLE_GAP_CAR_INCL_CONFIG_DEFAULT: u32 = 0;
+pub const NRF_ERROR_SDM_LFCLK_SOURCE_UNKNOWN: u32 = 4096;
+pub const NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION: u32 = 4097;
+pub const NRF_ERROR_SDM_INCORRECT_CLENR0: u32 = 4098;
+pub const NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN: u32 = 8192;
+pub const NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE: u32 = 8193;
+pub const NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED: u32 = 8194;
+pub const NRF_ERROR_SOC_NVIC_SHOULD_NOT_RETURN: u32 = 8195;
+pub const NRF_ERROR_SOC_POWER_MODE_UNKNOWN: u32 = 8196;
+pub const NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN: u32 = 8197;
+pub const NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN: u32 = 8198;
+pub const NRF_ERROR_SOC_RAND_NOT_ENOUGH_VALUES: u32 = 8199;
+pub const NRF_ERROR_SOC_PPI_INVALID_CHANNEL: u32 = 8200;
+pub const NRF_ERROR_SOC_PPI_INVALID_GROUP: u32 = 8201;
+pub const SOC_SVC_BASE: u32 = 32;
+pub const SOC_SVC_BASE_NOT_AVAILABLE: u32 = 44;
+pub const NRF_RADIO_NOTIFICATION_INACTIVE_GUARANTEED_TIME_US: u32 = 62;
+pub const NRF_RADIO_MINIMUM_TIMESLOT_LENGTH_EXTENSION_TIME_US: u32 = 200;
+pub const NRF_RADIO_MAX_EXTENSION_PROCESSING_TIME_US: u32 = 20;
+pub const NRF_RADIO_MIN_EXTENSION_MARGIN_US: u32 = 82;
+pub const SOC_ECB_KEY_LENGTH: u32 = 16;
+pub const SOC_ECB_CLEARTEXT_LENGTH: u32 = 16;
+pub const SOC_ECB_CIPHERTEXT_LENGTH: u32 = 16;
+pub const NRF_RADIO_LENGTH_MIN_US: u32 = 100;
+pub const NRF_RADIO_LENGTH_MAX_US: u32 = 100000;
+pub const NRF_RADIO_DISTANCE_MAX_US: u32 = 127999999;
+pub const NRF_RADIO_EARLIEST_TIMEOUT_MAX_US: u32 = 127999999;
+pub const NRF_RADIO_START_JITTER_US: u32 = 2;
+pub const SD_MAJOR_VERSION: u32 = 7;
+pub const SD_MINOR_VERSION: u32 = 0;
+pub const SD_BUGFIX_VERSION: u32 = 1;
+pub const SD_VARIANT_ID: u32 = 112;
+pub const SD_VERSION: u32 = 7000001;
+pub const SDM_SVC_BASE: u32 = 16;
+pub const SD_UNIQUE_STR_SIZE: u32 = 20;
+pub const SDM_INFO_FIELD_INVALID: u32 = 0;
+pub const SOFTDEVICE_INFO_STRUCT_OFFSET: u32 = 8192;
+pub const SD_INFO_STRUCT_SIZE_OFFSET: u32 = 8192;
+pub const SD_SIZE_OFFSET: u32 = 8200;
+pub const SD_FWID_OFFSET: u32 = 8204;
+pub const SD_ID_OFFSET: u32 = 8208;
+pub const SD_VERSION_OFFSET: u32 = 8212;
+pub const SD_UNIQUE_STR_OFFSET: u32 = 8216;
+pub const SD_FLASH_SIZE: u32 = 98304;
+pub const NRF_FAULT_ID_SD_RANGE_START: u32 = 0;
+pub const NRF_FAULT_ID_APP_RANGE_START: u32 = 4096;
+pub const NRF_FAULT_ID_SD_ASSERT: u32 = 1;
+pub const NRF_FAULT_ID_APP_MEMACC: u32 = 4097;
+pub const NRF_CLOCK_LF_ACCURACY_250_PPM: u32 = 0;
+pub const NRF_CLOCK_LF_ACCURACY_500_PPM: u32 = 1;
+pub const NRF_CLOCK_LF_ACCURACY_150_PPM: u32 = 2;
+pub const NRF_CLOCK_LF_ACCURACY_100_PPM: u32 = 3;
+pub const NRF_CLOCK_LF_ACCURACY_75_PPM: u32 = 4;
+pub const NRF_CLOCK_LF_ACCURACY_50_PPM: u32 = 5;
+pub const NRF_CLOCK_LF_ACCURACY_30_PPM: u32 = 6;
+pub const NRF_CLOCK_LF_ACCURACY_20_PPM: u32 = 7;
+pub const NRF_CLOCK_LF_ACCURACY_10_PPM: u32 = 8;
+pub const NRF_CLOCK_LF_ACCURACY_5_PPM: u32 = 9;
+pub const NRF_CLOCK_LF_ACCURACY_2_PPM: u32 = 10;
+pub const NRF_CLOCK_LF_ACCURACY_1_PPM: u32 = 11;
+pub const NRF_CLOCK_LF_SRC_RC: u32 = 0;
+pub const NRF_CLOCK_LF_SRC_XTAL: u32 = 1;
+pub const NRF_CLOCK_LF_SRC_SYNTH: u32 = 2;
+pub const SD_TIMERS_USED: u32 = 1;
+pub const SD_SWI_USED: u32 = 54;
+pub const BLE_HCI_STATUS_CODE_SUCCESS: u32 = 0;
+pub const BLE_HCI_STATUS_CODE_UNKNOWN_BTLE_COMMAND: u32 = 1;
+pub const BLE_HCI_STATUS_CODE_UNKNOWN_CONNECTION_IDENTIFIER: u32 = 2;
+pub const BLE_HCI_AUTHENTICATION_FAILURE: u32 = 5;
+pub const BLE_HCI_STATUS_CODE_PIN_OR_KEY_MISSING: u32 = 6;
+pub const BLE_HCI_MEMORY_CAPACITY_EXCEEDED: u32 = 7;
+pub const BLE_HCI_CONNECTION_TIMEOUT: u32 = 8;
+pub const BLE_HCI_STATUS_CODE_COMMAND_DISALLOWED: u32 = 12;
+pub const BLE_HCI_STATUS_CODE_INVALID_BTLE_COMMAND_PARAMETERS: u32 = 18;
+pub const BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION: u32 = 19;
+pub const BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES: u32 = 20;
+pub const BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF: u32 = 21;
+pub const BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION: u32 = 22;
+pub const BLE_HCI_UNSUPPORTED_REMOTE_FEATURE: u32 = 26;
+pub const BLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS: u32 = 30;
+pub const BLE_HCI_STATUS_CODE_UNSPECIFIED_ERROR: u32 = 31;
+pub const BLE_HCI_STATUS_CODE_LMP_RESPONSE_TIMEOUT: u32 = 34;
+pub const BLE_HCI_STATUS_CODE_LMP_ERROR_TRANSACTION_COLLISION: u32 = 35;
+pub const BLE_HCI_STATUS_CODE_LMP_PDU_NOT_ALLOWED: u32 = 36;
+pub const BLE_HCI_INSTANT_PASSED: u32 = 40;
+pub const BLE_HCI_PAIRING_WITH_UNIT_KEY_UNSUPPORTED: u32 = 41;
+pub const BLE_HCI_DIFFERENT_TRANSACTION_COLLISION: u32 = 42;
+pub const BLE_HCI_PARAMETER_OUT_OF_MANDATORY_RANGE: u32 = 48;
+pub const BLE_HCI_CONTROLLER_BUSY: u32 = 58;
+pub const BLE_HCI_CONN_INTERVAL_UNACCEPTABLE: u32 = 59;
+pub const BLE_HCI_DIRECTED_ADVERTISER_TIMEOUT: u32 = 60;
+pub const BLE_HCI_CONN_TERMINATED_DUE_TO_MIC_FAILURE: u32 = 61;
+pub const BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED: u32 = 62;
+pub const BLE_SVC_BASE: u32 = 96;
+pub const BLE_SVC_LAST: u32 = 107;
+pub const BLE_GAP_SVC_BASE: u32 = 108;
+pub const BLE_GAP_SVC_LAST: u32 = 154;
+pub const BLE_GATTC_SVC_BASE: u32 = 155;
+pub const BLE_GATTC_SVC_LAST: u32 = 167;
+pub const BLE_GATTS_SVC_BASE: u32 = 168;
+pub const BLE_GATTS_SVC_LAST: u32 = 183;
+pub const BLE_EVT_INVALID: u32 = 0;
+pub const BLE_EVT_BASE: u32 = 1;
+pub const BLE_EVT_LAST: u32 = 15;
+pub const BLE_GAP_EVT_BASE: u32 = 16;
+pub const BLE_GAP_EVT_LAST: u32 = 47;
+pub const BLE_GATTC_EVT_BASE: u32 = 48;
+pub const BLE_GATTC_EVT_LAST: u32 = 79;
+pub const BLE_GATTS_EVT_BASE: u32 = 80;
+pub const BLE_GATTS_EVT_LAST: u32 = 111;
+pub const BLE_OPT_INVALID: u32 = 0;
+pub const BLE_OPT_BASE: u32 = 1;
+pub const BLE_OPT_LAST: u32 = 31;
+pub const BLE_GAP_OPT_BASE: u32 = 32;
+pub const BLE_GAP_OPT_LAST: u32 = 63;
+pub const BLE_GATT_OPT_BASE: u32 = 64;
+pub const BLE_GATT_OPT_LAST: u32 = 95;
+pub const BLE_GATTC_OPT_BASE: u32 = 96;
+pub const BLE_GATTC_OPT_LAST: u32 = 127;
+pub const BLE_GATTS_OPT_BASE: u32 = 128;
+pub const BLE_GATTS_OPT_LAST: u32 = 159;
+pub const BLE_CFG_INVALID: u32 = 0;
+pub const BLE_CFG_BASE: u32 = 1;
+pub const BLE_CFG_LAST: u32 = 31;
+pub const BLE_CONN_CFG_BASE: u32 = 32;
+pub const BLE_CONN_CFG_LAST: u32 = 63;
+pub const BLE_GAP_CFG_BASE: u32 = 64;
+pub const BLE_GAP_CFG_LAST: u32 = 95;
+pub const BLE_GATT_CFG_BASE: u32 = 96;
+pub const BLE_GATT_CFG_LAST: u32 = 127;
+pub const BLE_GATTC_CFG_BASE: u32 = 128;
+pub const BLE_GATTC_CFG_LAST: u32 = 159;
+pub const BLE_GATTS_CFG_BASE: u32 = 160;
+pub const BLE_GATTS_CFG_LAST: u32 = 191;
+pub const BLE_ERROR_NOT_ENABLED: u32 = 12289;
+pub const BLE_ERROR_INVALID_CONN_HANDLE: u32 = 12290;
+pub const BLE_ERROR_INVALID_ATTR_HANDLE: u32 = 12291;
+pub const BLE_ERROR_INVALID_ADV_HANDLE: u32 = 12292;
+pub const BLE_ERROR_INVALID_ROLE: u32 = 12293;
+pub const BLE_ERROR_BLOCKED_BY_OTHER_LINKS: u32 = 12294;
+pub const NRF_L2CAP_ERR_BASE: u32 = 12544;
+pub const NRF_GAP_ERR_BASE: u32 = 12800;
+pub const NRF_GATTC_ERR_BASE: u32 = 13056;
+pub const NRF_GATTS_ERR_BASE: u32 = 13312;
pub const BLE_GATT_ATT_MTU_DEFAULT: u32 = 23;
pub const BLE_GATT_HANDLE_INVALID: u32 = 0;
pub const BLE_GATT_HANDLE_START: u32 = 1;
@@ -709,116 +666,213 @@ pub const BLE_ERROR_GATTC_PROC_NOT_PERMITTED: u32 = 13056;
pub const BLE_GATTC_ATTR_INFO_FORMAT_16BIT: u32 = 1;
pub const BLE_GATTC_ATTR_INFO_FORMAT_128BIT: u32 = 2;
pub const BLE_GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT: u32 = 1;
-pub const BLE_ERROR_GATTS_INVALID_ATTR_TYPE: u32 = 13312;
-pub const BLE_ERROR_GATTS_SYS_ATTR_MISSING: u32 = 13313;
-pub const BLE_GATTS_FIX_ATTR_LEN_MAX: u32 = 510;
-pub const BLE_GATTS_VAR_ATTR_LEN_MAX: u32 = 512;
-pub const BLE_GATTS_SRVC_TYPE_INVALID: u32 = 0;
-pub const BLE_GATTS_SRVC_TYPE_PRIMARY: u32 = 1;
-pub const BLE_GATTS_SRVC_TYPE_SECONDARY: u32 = 2;
-pub const BLE_GATTS_ATTR_TYPE_INVALID: u32 = 0;
-pub const BLE_GATTS_ATTR_TYPE_PRIM_SRVC_DECL: u32 = 1;
-pub const BLE_GATTS_ATTR_TYPE_SEC_SRVC_DECL: u32 = 2;
-pub const BLE_GATTS_ATTR_TYPE_INC_DECL: u32 = 3;
-pub const BLE_GATTS_ATTR_TYPE_CHAR_DECL: u32 = 4;
-pub const BLE_GATTS_ATTR_TYPE_CHAR_VAL: u32 = 5;
-pub const BLE_GATTS_ATTR_TYPE_DESC: u32 = 6;
-pub const BLE_GATTS_ATTR_TYPE_OTHER: u32 = 7;
-pub const BLE_GATTS_OP_INVALID: u32 = 0;
-pub const BLE_GATTS_OP_WRITE_REQ: u32 = 1;
-pub const BLE_GATTS_OP_WRITE_CMD: u32 = 2;
-pub const BLE_GATTS_OP_SIGN_WRITE_CMD: u32 = 3;
-pub const BLE_GATTS_OP_PREP_WRITE_REQ: u32 = 4;
-pub const BLE_GATTS_OP_EXEC_WRITE_REQ_CANCEL: u32 = 5;
-pub const BLE_GATTS_OP_EXEC_WRITE_REQ_NOW: u32 = 6;
-pub const BLE_GATTS_VLOC_INVALID: u32 = 0;
-pub const BLE_GATTS_VLOC_STACK: u32 = 1;
-pub const BLE_GATTS_VLOC_USER: u32 = 2;
-pub const BLE_GATTS_AUTHORIZE_TYPE_INVALID: u32 = 0;
-pub const BLE_GATTS_AUTHORIZE_TYPE_READ: u32 = 1;
-pub const BLE_GATTS_AUTHORIZE_TYPE_WRITE: u32 = 2;
-pub const BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS: u32 = 1;
-pub const BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS: u32 = 2;
-pub const BLE_GATTS_SERVICE_CHANGED_DEFAULT: u32 = 1;
-pub const BLE_GATTS_ATTR_TAB_SIZE_MIN: u32 = 248;
-pub const BLE_GATTS_ATTR_TAB_SIZE_DEFAULT: u32 = 1408;
-pub const BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT: u32 = 1;
-pub const BLE_EVT_PTR_ALIGNMENT: u32 = 4;
-pub const BLE_USER_MEM_TYPE_INVALID: u32 = 0;
-pub const BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES: u32 = 1;
-pub const BLE_UUID_VS_COUNT_DEFAULT: u32 = 10;
-pub const BLE_UUID_VS_COUNT_MAX: u32 = 254;
-pub const BLE_CONN_CFG_TAG_DEFAULT: u32 = 0;
-pub const NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN: u32 = 8192;
-pub const NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE: u32 = 8193;
-pub const NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED: u32 = 8194;
-pub const NRF_ERROR_SOC_NVIC_SHOULD_NOT_RETURN: u32 = 8195;
-pub const NRF_ERROR_SOC_POWER_MODE_UNKNOWN: u32 = 8196;
-pub const NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN: u32 = 8197;
-pub const NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN: u32 = 8198;
-pub const NRF_ERROR_SOC_RAND_NOT_ENOUGH_VALUES: u32 = 8199;
-pub const NRF_ERROR_SOC_PPI_INVALID_CHANNEL: u32 = 8200;
-pub const NRF_ERROR_SOC_PPI_INVALID_GROUP: u32 = 8201;
-pub const SOC_SVC_BASE: u32 = 32;
-pub const SOC_SVC_BASE_NOT_AVAILABLE: u32 = 44;
-pub const NRF_RADIO_NOTIFICATION_INACTIVE_GUARANTEED_TIME_US: u32 = 62;
-pub const NRF_RADIO_MINIMUM_TIMESLOT_LENGTH_EXTENSION_TIME_US: u32 = 200;
-pub const NRF_RADIO_MAX_EXTENSION_PROCESSING_TIME_US: u32 = 20;
-pub const NRF_RADIO_MIN_EXTENSION_MARGIN_US: u32 = 82;
-pub const SOC_ECB_KEY_LENGTH: u32 = 16;
-pub const SOC_ECB_CLEARTEXT_LENGTH: u32 = 16;
-pub const SOC_ECB_CIPHERTEXT_LENGTH: u32 = 16;
-pub const NRF_RADIO_LENGTH_MIN_US: u32 = 100;
-pub const NRF_RADIO_LENGTH_MAX_US: u32 = 100000;
-pub const NRF_RADIO_DISTANCE_MAX_US: u32 = 127999999;
-pub const NRF_RADIO_EARLIEST_TIMEOUT_MAX_US: u32 = 127999999;
-pub const NRF_RADIO_START_JITTER_US: u32 = 2;
-pub const SD_TIMERS_USED: u32 = 1;
-pub const SD_SWI_USED: u32 = 54;
pub const MBR_SVC_BASE: u32 = 24;
pub const MBR_PAGE_SIZE_IN_WORDS: u32 = 1024;
pub const MBR_SIZE: u32 = 4096;
pub const MBR_BOOTLOADER_ADDR: u32 = 4088;
pub const MBR_PARAM_PAGE_ADDR: u32 = 4092;
-pub const NRF_ERROR_SDM_LFCLK_SOURCE_UNKNOWN: u32 = 4096;
-pub const NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION: u32 = 4097;
-pub const NRF_ERROR_SDM_INCORRECT_CLENR0: u32 = 4098;
-pub const SD_MAJOR_VERSION: u32 = 7;
-pub const SD_MINOR_VERSION: u32 = 0;
-pub const SD_BUGFIX_VERSION: u32 = 1;
-pub const SD_VARIANT_ID: u32 = 112;
-pub const SD_VERSION: u32 = 7000001;
-pub const SDM_SVC_BASE: u32 = 16;
-pub const SD_UNIQUE_STR_SIZE: u32 = 20;
-pub const SDM_INFO_FIELD_INVALID: u32 = 0;
-pub const SOFTDEVICE_INFO_STRUCT_OFFSET: u32 = 8192;
-pub const SOFTDEVICE_INFO_STRUCT_ADDRESS: u32 = 12288;
-pub const SD_INFO_STRUCT_SIZE_OFFSET: u32 = 8192;
-pub const SD_SIZE_OFFSET: u32 = 8200;
-pub const SD_FWID_OFFSET: u32 = 8204;
-pub const SD_ID_OFFSET: u32 = 8208;
-pub const SD_VERSION_OFFSET: u32 = 8212;
-pub const SD_UNIQUE_STR_OFFSET: u32 = 8216;
-pub const SD_FLASH_SIZE: u32 = 98304;
-pub const NRF_FAULT_ID_SD_RANGE_START: u32 = 0;
-pub const NRF_FAULT_ID_APP_RANGE_START: u32 = 4096;
-pub const NRF_FAULT_ID_SD_ASSERT: u32 = 1;
-pub const NRF_FAULT_ID_APP_MEMACC: u32 = 4097;
-pub const NRF_CLOCK_LF_ACCURACY_250_PPM: u32 = 0;
-pub const NRF_CLOCK_LF_ACCURACY_500_PPM: u32 = 1;
-pub const NRF_CLOCK_LF_ACCURACY_150_PPM: u32 = 2;
-pub const NRF_CLOCK_LF_ACCURACY_100_PPM: u32 = 3;
-pub const NRF_CLOCK_LF_ACCURACY_75_PPM: u32 = 4;
-pub const NRF_CLOCK_LF_ACCURACY_50_PPM: u32 = 5;
-pub const NRF_CLOCK_LF_ACCURACY_30_PPM: u32 = 6;
-pub const NRF_CLOCK_LF_ACCURACY_20_PPM: u32 = 7;
-pub const NRF_CLOCK_LF_ACCURACY_10_PPM: u32 = 8;
-pub const NRF_CLOCK_LF_ACCURACY_5_PPM: u32 = 9;
-pub const NRF_CLOCK_LF_ACCURACY_2_PPM: u32 = 10;
-pub const NRF_CLOCK_LF_ACCURACY_1_PPM: u32 = 11;
-pub const NRF_CLOCK_LF_SRC_RC: u32 = 0;
-pub const NRF_CLOCK_LF_SRC_XTAL: u32 = 1;
-pub const NRF_CLOCK_LF_SRC_SYNTH: u32 = 2;
+pub const BLE_ERROR_GAP_UUID_LIST_MISMATCH: u32 = 12800;
+pub const BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST: u32 = 12801;
+pub const BLE_ERROR_GAP_INVALID_BLE_ADDR: u32 = 12802;
+pub const BLE_ERROR_GAP_WHITELIST_IN_USE: u32 = 12803;
+pub const BLE_ERROR_GAP_DEVICE_IDENTITIES_IN_USE: u32 = 12804;
+pub const BLE_ERROR_GAP_DEVICE_IDENTITIES_DUPLICATE: u32 = 12805;
+pub const BLE_GAP_ROLE_INVALID: u32 = 0;
+pub const BLE_GAP_ROLE_PERIPH: u32 = 1;
+pub const BLE_GAP_TIMEOUT_SRC_CONN: u32 = 2;
+pub const BLE_GAP_TIMEOUT_SRC_AUTH_PAYLOAD: u32 = 3;
+pub const BLE_GAP_ADDR_TYPE_PUBLIC: u32 = 0;
+pub const BLE_GAP_ADDR_TYPE_RANDOM_STATIC: u32 = 1;
+pub const BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE: u32 = 2;
+pub const BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE: u32 = 3;
+pub const BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S: u32 = 900;
+pub const BLE_GAP_MAX_PRIVATE_ADDR_CYCLE_INTERVAL_S: u32 = 41400;
+pub const BLE_GAP_ADDR_LEN: u32 = 6;
+pub const BLE_GAP_PRIVACY_MODE_OFF: u32 = 0;
+pub const BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY: u32 = 1;
+pub const BLE_GAP_PRIVACY_MODE_NETWORK_PRIVACY: u32 = 2;
+pub const BLE_GAP_POWER_LEVEL_INVALID: u32 = 127;
+pub const BLE_GAP_ADV_SET_HANDLE_NOT_SET: u32 = 255;
+pub const BLE_GAP_ADV_SET_COUNT_DEFAULT: u32 = 1;
+pub const BLE_GAP_ADV_SET_COUNT_MAX: u32 = 1;
+pub const BLE_GAP_ADV_SET_DATA_SIZE_MAX: u32 = 31;
+pub const BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE: u32 = 255;
+pub const BLE_GAP_EVT_ADV_SET_TERMINATED_REASON_TIMEOUT: u32 = 1;
+pub const BLE_GAP_EVT_ADV_SET_TERMINATED_REASON_LIMIT_REACHED: u32 = 2;
+pub const BLE_GAP_AD_TYPE_FLAGS: u32 = 1;
+pub const BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_MORE_AVAILABLE: u32 = 2;
+pub const BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_COMPLETE: u32 = 3;
+pub const BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_MORE_AVAILABLE: u32 = 4;
+pub const BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_COMPLETE: u32 = 5;
+pub const BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE: u32 = 6;
+pub const BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE: u32 = 7;
+pub const BLE_GAP_AD_TYPE_SHORT_LOCAL_NAME: u32 = 8;
+pub const BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME: u32 = 9;
+pub const BLE_GAP_AD_TYPE_TX_POWER_LEVEL: u32 = 10;
+pub const BLE_GAP_AD_TYPE_CLASS_OF_DEVICE: u32 = 13;
+pub const BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C: u32 = 14;
+pub const BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R: u32 = 15;
+pub const BLE_GAP_AD_TYPE_SECURITY_MANAGER_TK_VALUE: u32 = 16;
+pub const BLE_GAP_AD_TYPE_SECURITY_MANAGER_OOB_FLAGS: u32 = 17;
+pub const BLE_GAP_AD_TYPE_SLAVE_CONNECTION_INTERVAL_RANGE: u32 = 18;
+pub const BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_16BIT: u32 = 20;
+pub const BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_128BIT: u32 = 21;
+pub const BLE_GAP_AD_TYPE_SERVICE_DATA: u32 = 22;
+pub const BLE_GAP_AD_TYPE_PUBLIC_TARGET_ADDRESS: u32 = 23;
+pub const BLE_GAP_AD_TYPE_RANDOM_TARGET_ADDRESS: u32 = 24;
+pub const BLE_GAP_AD_TYPE_APPEARANCE: u32 = 25;
+pub const BLE_GAP_AD_TYPE_ADVERTISING_INTERVAL: u32 = 26;
+pub const BLE_GAP_AD_TYPE_LE_BLUETOOTH_DEVICE_ADDRESS: u32 = 27;
+pub const BLE_GAP_AD_TYPE_LE_ROLE: u32 = 28;
+pub const BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C256: u32 = 29;
+pub const BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R256: u32 = 30;
+pub const BLE_GAP_AD_TYPE_SERVICE_DATA_32BIT_UUID: u32 = 32;
+pub const BLE_GAP_AD_TYPE_SERVICE_DATA_128BIT_UUID: u32 = 33;
+pub const BLE_GAP_AD_TYPE_LESC_CONFIRMATION_VALUE: u32 = 34;
+pub const BLE_GAP_AD_TYPE_LESC_RANDOM_VALUE: u32 = 35;
+pub const BLE_GAP_AD_TYPE_URI: u32 = 36;
+pub const BLE_GAP_AD_TYPE_3D_INFORMATION_DATA: u32 = 61;
+pub const BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA: u32 = 255;
+pub const BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE: u32 = 1;
+pub const BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE: u32 = 2;
+pub const BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED: u32 = 4;
+pub const BLE_GAP_ADV_FLAG_LE_BR_EDR_CONTROLLER: u32 = 8;
+pub const BLE_GAP_ADV_FLAG_LE_BR_EDR_HOST: u32 = 16;
+pub const BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE: u32 = 5;
+pub const BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE: u32 = 6;
+pub const BLE_GAP_ADV_INTERVAL_MIN: u32 = 32;
+pub const BLE_GAP_ADV_INTERVAL_MAX: u32 = 16384;
+pub const BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED: u32 = 1;
+pub const BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE: u32 = 2;
+pub const BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED: u32 = 3;
+pub const BLE_GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED: u32 = 4;
+pub const BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED: u32 = 5;
+pub const BLE_GAP_ADV_FP_ANY: u32 = 0;
+pub const BLE_GAP_ADV_FP_FILTER_SCANREQ: u32 = 1;
+pub const BLE_GAP_ADV_FP_FILTER_CONNREQ: u32 = 2;
+pub const BLE_GAP_ADV_FP_FILTER_BOTH: u32 = 3;
+pub const BLE_GAP_ADV_TIMEOUT_HIGH_DUTY_MAX: u32 = 128;
+pub const BLE_GAP_ADV_TIMEOUT_LIMITED_MAX: u32 = 18000;
+pub const BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED: u32 = 0;
+pub const BLE_GAP_DISC_MODE_NOT_DISCOVERABLE: u32 = 0;
+pub const BLE_GAP_DISC_MODE_LIMITED: u32 = 1;
+pub const BLE_GAP_DISC_MODE_GENERAL: u32 = 2;
+pub const BLE_GAP_IO_CAPS_DISPLAY_ONLY: u32 = 0;
+pub const BLE_GAP_IO_CAPS_DISPLAY_YESNO: u32 = 1;
+pub const BLE_GAP_IO_CAPS_KEYBOARD_ONLY: u32 = 2;
+pub const BLE_GAP_IO_CAPS_NONE: u32 = 3;
+pub const BLE_GAP_IO_CAPS_KEYBOARD_DISPLAY: u32 = 4;
+pub const BLE_GAP_AUTH_KEY_TYPE_NONE: u32 = 0;
+pub const BLE_GAP_AUTH_KEY_TYPE_PASSKEY: u32 = 1;
+pub const BLE_GAP_AUTH_KEY_TYPE_OOB: u32 = 2;
+pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_START: u32 = 0;
+pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_DIGIT_IN: u32 = 1;
+pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_DIGIT_OUT: u32 = 2;
+pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_CLEAR: u32 = 3;
+pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_END: u32 = 4;
+pub const BLE_GAP_SEC_STATUS_SUCCESS: u32 = 0;
+pub const BLE_GAP_SEC_STATUS_TIMEOUT: u32 = 1;
+pub const BLE_GAP_SEC_STATUS_PDU_INVALID: u32 = 2;
+pub const BLE_GAP_SEC_STATUS_RFU_RANGE1_BEGIN: u32 = 3;
+pub const BLE_GAP_SEC_STATUS_RFU_RANGE1_END: u32 = 128;
+pub const BLE_GAP_SEC_STATUS_PASSKEY_ENTRY_FAILED: u32 = 129;
+pub const BLE_GAP_SEC_STATUS_OOB_NOT_AVAILABLE: u32 = 130;
+pub const BLE_GAP_SEC_STATUS_AUTH_REQ: u32 = 131;
+pub const BLE_GAP_SEC_STATUS_CONFIRM_VALUE: u32 = 132;
+pub const BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP: u32 = 133;
+pub const BLE_GAP_SEC_STATUS_ENC_KEY_SIZE: u32 = 134;
+pub const BLE_GAP_SEC_STATUS_SMP_CMD_UNSUPPORTED: u32 = 135;
+pub const BLE_GAP_SEC_STATUS_UNSPECIFIED: u32 = 136;
+pub const BLE_GAP_SEC_STATUS_REPEATED_ATTEMPTS: u32 = 137;
+pub const BLE_GAP_SEC_STATUS_INVALID_PARAMS: u32 = 138;
+pub const BLE_GAP_SEC_STATUS_DHKEY_FAILURE: u32 = 139;
+pub const BLE_GAP_SEC_STATUS_NUM_COMP_FAILURE: u32 = 140;
+pub const BLE_GAP_SEC_STATUS_BR_EDR_IN_PROG: u32 = 141;
+pub const BLE_GAP_SEC_STATUS_X_TRANS_KEY_DISALLOWED: u32 = 142;
+pub const BLE_GAP_SEC_STATUS_RFU_RANGE2_BEGIN: u32 = 143;
+pub const BLE_GAP_SEC_STATUS_RFU_RANGE2_END: u32 = 255;
+pub const BLE_GAP_SEC_STATUS_SOURCE_LOCAL: u32 = 0;
+pub const BLE_GAP_SEC_STATUS_SOURCE_REMOTE: u32 = 1;
+pub const BLE_GAP_CP_MIN_CONN_INTVL_NONE: u32 = 65535;
+pub const BLE_GAP_CP_MIN_CONN_INTVL_MIN: u32 = 6;
+pub const BLE_GAP_CP_MIN_CONN_INTVL_MAX: u32 = 3200;
+pub const BLE_GAP_CP_MAX_CONN_INTVL_NONE: u32 = 65535;
+pub const BLE_GAP_CP_MAX_CONN_INTVL_MIN: u32 = 6;
+pub const BLE_GAP_CP_MAX_CONN_INTVL_MAX: u32 = 3200;
+pub const BLE_GAP_CP_SLAVE_LATENCY_MAX: u32 = 499;
+pub const BLE_GAP_CP_CONN_SUP_TIMEOUT_NONE: u32 = 65535;
+pub const BLE_GAP_CP_CONN_SUP_TIMEOUT_MIN: u32 = 10;
+pub const BLE_GAP_CP_CONN_SUP_TIMEOUT_MAX: u32 = 3200;
+pub const BLE_GAP_DEVNAME_DEFAULT: &[u8; 6] = b"nRF5x\0";
+pub const BLE_GAP_DEVNAME_DEFAULT_LEN: u32 = 31;
+pub const BLE_GAP_DEVNAME_MAX_LEN: u32 = 248;
+pub const BLE_GAP_RSSI_THRESHOLD_INVALID: u32 = 255;
+pub const BLE_GAP_PHY_AUTO: u32 = 0;
+pub const BLE_GAP_PHY_1MBPS: u32 = 1;
+pub const BLE_GAP_PHY_2MBPS: u32 = 2;
+pub const BLE_GAP_PHY_CODED: u32 = 4;
+pub const BLE_GAP_PHY_NOT_SET: u32 = 255;
+pub const BLE_GAP_PHYS_SUPPORTED: u32 = 3;
+pub const BLE_GAP_SEC_RAND_LEN: u32 = 8;
+pub const BLE_GAP_SEC_KEY_LEN: u32 = 16;
+pub const BLE_GAP_LESC_P256_PK_LEN: u32 = 64;
+pub const BLE_GAP_LESC_DHKEY_LEN: u32 = 32;
+pub const BLE_GAP_PASSKEY_LEN: u32 = 6;
+pub const BLE_GAP_WHITELIST_ADDR_MAX_COUNT: u32 = 8;
+pub const BLE_GAP_DEVICE_IDENTITIES_MAX_COUNT: u32 = 8;
+pub const BLE_GAP_CONN_COUNT_DEFAULT: u32 = 1;
+pub const BLE_GAP_EVENT_LENGTH_MIN: u32 = 2;
+pub const BLE_GAP_EVENT_LENGTH_DEFAULT: u32 = 3;
+pub const BLE_GAP_ROLE_COUNT_PERIPH_DEFAULT: u32 = 1;
+pub const BLE_GAP_ROLE_COUNT_COMBINED_MAX: u32 = 20;
+pub const BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MAX: u32 = 48000;
+pub const BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MIN: u32 = 1;
+pub const BLE_GAP_SEC_MODE: u32 = 0;
+pub const BLE_GAP_CHAR_INCL_CONFIG_INCLUDE: u32 = 0;
+pub const BLE_GAP_CHAR_INCL_CONFIG_EXCLUDE_WITH_SPACE: u32 = 1;
+pub const BLE_GAP_CHAR_INCL_CONFIG_EXCLUDE_WITHOUT_SPACE: u32 = 2;
+pub const BLE_GAP_PPCP_INCL_CONFIG_DEFAULT: u32 = 0;
+pub const BLE_GAP_CAR_INCL_CONFIG_DEFAULT: u32 = 0;
+pub const BLE_ERROR_GATTS_INVALID_ATTR_TYPE: u32 = 13312;
+pub const BLE_ERROR_GATTS_SYS_ATTR_MISSING: u32 = 13313;
+pub const BLE_GATTS_FIX_ATTR_LEN_MAX: u32 = 510;
+pub const BLE_GATTS_VAR_ATTR_LEN_MAX: u32 = 512;
+pub const BLE_GATTS_SRVC_TYPE_INVALID: u32 = 0;
+pub const BLE_GATTS_SRVC_TYPE_PRIMARY: u32 = 1;
+pub const BLE_GATTS_SRVC_TYPE_SECONDARY: u32 = 2;
+pub const BLE_GATTS_ATTR_TYPE_INVALID: u32 = 0;
+pub const BLE_GATTS_ATTR_TYPE_PRIM_SRVC_DECL: u32 = 1;
+pub const BLE_GATTS_ATTR_TYPE_SEC_SRVC_DECL: u32 = 2;
+pub const BLE_GATTS_ATTR_TYPE_INC_DECL: u32 = 3;
+pub const BLE_GATTS_ATTR_TYPE_CHAR_DECL: u32 = 4;
+pub const BLE_GATTS_ATTR_TYPE_CHAR_VAL: u32 = 5;
+pub const BLE_GATTS_ATTR_TYPE_DESC: u32 = 6;
+pub const BLE_GATTS_ATTR_TYPE_OTHER: u32 = 7;
+pub const BLE_GATTS_OP_INVALID: u32 = 0;
+pub const BLE_GATTS_OP_WRITE_REQ: u32 = 1;
+pub const BLE_GATTS_OP_WRITE_CMD: u32 = 2;
+pub const BLE_GATTS_OP_SIGN_WRITE_CMD: u32 = 3;
+pub const BLE_GATTS_OP_PREP_WRITE_REQ: u32 = 4;
+pub const BLE_GATTS_OP_EXEC_WRITE_REQ_CANCEL: u32 = 5;
+pub const BLE_GATTS_OP_EXEC_WRITE_REQ_NOW: u32 = 6;
+pub const BLE_GATTS_VLOC_INVALID: u32 = 0;
+pub const BLE_GATTS_VLOC_STACK: u32 = 1;
+pub const BLE_GATTS_VLOC_USER: u32 = 2;
+pub const BLE_GATTS_AUTHORIZE_TYPE_INVALID: u32 = 0;
+pub const BLE_GATTS_AUTHORIZE_TYPE_READ: u32 = 1;
+pub const BLE_GATTS_AUTHORIZE_TYPE_WRITE: u32 = 2;
+pub const BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS: u32 = 1;
+pub const BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS: u32 = 2;
+pub const BLE_GATTS_SERVICE_CHANGED_DEFAULT: u32 = 1;
+pub const BLE_GATTS_ATTR_TAB_SIZE_MIN: u32 = 248;
+pub const BLE_GATTS_ATTR_TAB_SIZE_DEFAULT: u32 = 1408;
+pub const BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT: u32 = 1;
+pub const BLE_EVT_PTR_ALIGNMENT: u32 = 4;
+pub const BLE_USER_MEM_TYPE_INVALID: u32 = 0;
+pub const BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES: u32 = 1;
+pub const BLE_UUID_VS_COUNT_DEFAULT: u32 = 10;
+pub const BLE_UUID_VS_COUNT_MAX: u32 = 254;
+pub const BLE_CONN_CFG_TAG_DEFAULT: u32 = 0;
pub type int_least64_t = i64;
pub type uint_least64_t = u64;
pub type int_fast64_t = i64;
@@ -844,29 +898,12 @@ pub struct ble_uuid128_t {
#[doc = "< Little-Endian UUID bytes."]
pub uuid128: [u8; 16usize],
}
-#[test]
-fn bindgen_test_layout_ble_uuid128_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 16usize,
- concat!("Size of: ", stringify!(ble_uuid128_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_uuid128_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).uuid128 as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_uuid128_t),
- "::",
- stringify!(uuid128)
- )
- );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of ble_uuid128_t"][::core::mem::size_of::() - 16usize];
+ ["Alignment of ble_uuid128_t"][::core::mem::align_of::() - 1usize];
+ ["Offset of field: ble_uuid128_t::uuid128"][::core::mem::offset_of!(ble_uuid128_t, uuid128) - 0usize];
+};
#[doc = " @brief Bluetooth Low Energy UUID type, encapsulates both 16-bit and 128-bit UUIDs."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
@@ -876,29 +913,13 @@ pub struct ble_uuid_t {
#[doc = "< UUID type, see @ref BLE_UUID_TYPES. If type is @ref BLE_UUID_TYPE_UNKNOWN, the value of uuid is undefined."]
pub type_: u8,
}
-#[test]
-fn bindgen_test_layout_ble_uuid_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 4usize,
- concat!("Size of: ", stringify!(ble_uuid_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 2usize,
- concat!("Alignment of ", stringify!(ble_uuid_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).uuid as *const _ as usize },
- 0usize,
- concat!("Offset of field: ", stringify!(ble_uuid_t), "::", stringify!(uuid))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).type_ as *const _ as usize },
- 2usize,
- concat!("Offset of field: ", stringify!(ble_uuid_t), "::", stringify!(type_))
- );
-}
+#[allow(clippy::unnecessary_operation, clippy::identity_op)]
+const _: () = {
+ ["Size of ble_uuid_t"][::core::mem::size_of::() - 4usize];
+ ["Alignment of ble_uuid_t"][::core::mem::align_of::() - 2usize];
+ ["Offset of field: ble_uuid_t::uuid"][::core::mem::offset_of!(ble_uuid_t, uuid) - 0usize];
+ ["Offset of field: ble_uuid_t::type_"][::core::mem::offset_of!(ble_uuid_t, type_) - 2usize];
+};
#[doc = "@brief Data structure."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
@@ -908,3698 +929,609 @@ pub struct ble_data_t {
#[doc = "< Length of the data buffer, in bytes."]
pub len: u16,
}
-#[test]
-fn bindgen_test_layout_ble_data_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 8usize,
- concat!("Size of: ", stringify!(ble_data_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 4usize,
- concat!("Alignment of ", stringify!(ble_data_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).p_data as *const _ as usize },
- 0usize,
- concat!("Offset of field: ", stringify!(ble_data_t), "::", stringify!(p_data))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).len as *const _ as usize },
- 4usize,
- concat!("Offset of field: ", stringify!(ble_data_t), "::", stringify!(len))
- );
-}
-#[doc = "< Set own Bluetooth Address."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_ADDR_SET: BLE_GAP_SVCS = 108;
-#[doc = "< Get own Bluetooth Address."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_ADDR_GET: BLE_GAP_SVCS = 109;
-#[doc = "< Set active whitelist."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_WHITELIST_SET: BLE_GAP_SVCS = 110;
-#[doc = "< Set device identity list."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_DEVICE_IDENTITIES_SET: BLE_GAP_SVCS = 111;
-#[doc = "< Set Privacy settings"]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_PRIVACY_SET: BLE_GAP_SVCS = 112;
-#[doc = "< Get Privacy settings"]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_PRIVACY_GET: BLE_GAP_SVCS = 113;
-#[doc = "< Configure an advertising set."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_ADV_SET_CONFIGURE: BLE_GAP_SVCS = 114;
-#[doc = "< Start Advertising."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_ADV_START: BLE_GAP_SVCS = 115;
-#[doc = "< Stop Advertising."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_ADV_STOP: BLE_GAP_SVCS = 116;
-#[doc = "< Connection Parameter Update."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_CONN_PARAM_UPDATE: BLE_GAP_SVCS = 117;
-#[doc = "< Disconnect."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_DISCONNECT: BLE_GAP_SVCS = 118;
-#[doc = "< Set TX Power."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_TX_POWER_SET: BLE_GAP_SVCS = 119;
-#[doc = "< Set Appearance."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_APPEARANCE_SET: BLE_GAP_SVCS = 120;
-#[doc = "< Get Appearance."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_APPEARANCE_GET: BLE_GAP_SVCS = 121;
-#[doc = "< Set PPCP."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_PPCP_SET: BLE_GAP_SVCS = 122;
-#[doc = "< Get PPCP."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_PPCP_GET: BLE_GAP_SVCS = 123;
-#[doc = "< Set Device Name."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_DEVICE_NAME_SET: BLE_GAP_SVCS = 124;
-#[doc = "< Get Device Name."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_DEVICE_NAME_GET: BLE_GAP_SVCS = 125;
-#[doc = "< Initiate Pairing/Bonding."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_AUTHENTICATE: BLE_GAP_SVCS = 126;
-#[doc = "< Reply with Security Parameters."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_SEC_PARAMS_REPLY: BLE_GAP_SVCS = 127;
-#[doc = "< Reply with an authentication key."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_AUTH_KEY_REPLY: BLE_GAP_SVCS = 128;
-#[doc = "< Reply with an LE Secure Connections DHKey."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_LESC_DHKEY_REPLY: BLE_GAP_SVCS = 129;
-#[doc = "< Notify of a keypress during an authentication procedure."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_KEYPRESS_NOTIFY: BLE_GAP_SVCS = 130;
-#[doc = "< Get the local LE Secure Connections OOB data."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_LESC_OOB_DATA_GET: BLE_GAP_SVCS = 131;
-#[doc = "< Set the remote LE Secure Connections OOB data."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_LESC_OOB_DATA_SET: BLE_GAP_SVCS = 132;
-#[doc = "< Reply with Security Information."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_SEC_INFO_REPLY: BLE_GAP_SVCS = 134;
-#[doc = "< Obtain connection security level."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_CONN_SEC_GET: BLE_GAP_SVCS = 135;
-#[doc = "< Start reporting of changes in RSSI."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_RSSI_START: BLE_GAP_SVCS = 136;
-#[doc = "< Stop reporting of changes in RSSI."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_RSSI_STOP: BLE_GAP_SVCS = 137;
-#[doc = "< Get the last RSSI sample."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_RSSI_GET: BLE_GAP_SVCS = 142;
-#[doc = "< Initiate or respond to a PHY Update Procedure."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_PHY_UPDATE: BLE_GAP_SVCS = 143;
-#[doc = "< Get the Address used on air while Advertising."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_ADV_ADDR_GET: BLE_GAP_SVCS = 147;
-#[doc = "< Get the next connection event counter."]
-pub const BLE_GAP_SVCS_SD_BLE_GAP_NEXT_CONN_EVT_COUNTER_GET: BLE_GAP_SVCS = 148;
-#[doc = "@brief GAP API SVC numbers."]
-pub type BLE_GAP_SVCS = self::c_uint;
-#[doc = "< Connected to peer. \\n See @ref ble_gap_evt_connected_t"]
-pub const BLE_GAP_EVTS_BLE_GAP_EVT_CONNECTED: BLE_GAP_EVTS = 16;
-#[doc = "< Disconnected from peer. \\n See @ref ble_gap_evt_disconnected_t."]
-pub const BLE_GAP_EVTS_BLE_GAP_EVT_DISCONNECTED: BLE_GAP_EVTS = 17;
-#[doc = "< Connection Parameters updated. \\n See @ref ble_gap_evt_conn_param_update_t."]
-pub const BLE_GAP_EVTS_BLE_GAP_EVT_CONN_PARAM_UPDATE: BLE_GAP_EVTS = 18;
-#[doc = "< Request to provide security parameters. \\n Reply with @ref sd_ble_gap_sec_params_reply. \\n See @ref ble_gap_evt_sec_params_request_t."]
-pub const BLE_GAP_EVTS_BLE_GAP_EVT_SEC_PARAMS_REQUEST: BLE_GAP_EVTS = 19;
-#[doc = "< Request to provide security information. \\n Reply with @ref sd_ble_gap_sec_info_reply. \\n See @ref ble_gap_evt_sec_info_request_t."]
-pub const BLE_GAP_EVTS_BLE_GAP_EVT_SEC_INFO_REQUEST: BLE_GAP_EVTS = 20;
-#[doc = "< Request to display a passkey to the user. \\n In LESC Numeric Comparison, reply with @ref sd_ble_gap_auth_key_reply. \\n See @ref ble_gap_evt_passkey_display_t."]
-pub const BLE_GAP_EVTS_BLE_GAP_EVT_PASSKEY_DISPLAY: BLE_GAP_EVTS = 21;
-#[doc = "< Notification of a keypress on the remote device.\\n See @ref ble_gap_evt_key_pressed_t"]
-pub const BLE_GAP_EVTS_BLE_GAP_EVT_KEY_PRESSED: BLE_GAP_EVTS = 22;
-#[doc = "< Request to provide an authentication key. \\n Reply with @ref sd_ble_gap_auth_key_reply. \\n See @ref ble_gap_evt_auth_key_request_t."]
-pub const BLE_GAP_EVTS_BLE_GAP_EVT_AUTH_KEY_REQUEST: BLE_GAP_EVTS = 23;
-#[doc = "< Request to calculate an LE Secure Connections DHKey. \\n Reply with @ref sd_ble_gap_lesc_dhkey_reply. \\n See @ref ble_gap_evt_lesc_dhkey_request_t"]
-pub const BLE_GAP_EVTS_BLE_GAP_EVT_LESC_DHKEY_REQUEST: BLE_GAP_EVTS = 24;
-#[doc = "< Authentication procedure completed with status. \\n See @ref ble_gap_evt_auth_status_t."]
-pub const BLE_GAP_EVTS_BLE_GAP_EVT_AUTH_STATUS: BLE_GAP_EVTS = 25;
-#[doc = "< Connection security updated. \\n See @ref ble_gap_evt_conn_sec_update_t."]
-pub const BLE_GAP_EVTS_BLE_GAP_EVT_CONN_SEC_UPDATE: BLE_GAP_EVTS = 26;
-#[doc = "< Timeout expired. \\n See @ref ble_gap_evt_timeout_t."]
-pub const BLE_GAP_EVTS_BLE_GAP_EVT_TIMEOUT: BLE_GAP_EVTS = 27;
-#[doc = "< RSSI report. \\n See @ref ble_gap_evt_rssi_changed_t."]
-pub const BLE_GAP_EVTS_BLE_GAP_EVT_RSSI_CHANGED: BLE_GAP_EVTS = 28;
-#[doc = "< Security Request. \\n See @ref ble_gap_evt_sec_request_t."]
-pub const BLE_GAP_EVTS_BLE_GAP_EVT_SEC_REQUEST: BLE_GAP_EVTS = 30;
-#[doc = "< Scan request report. \\n See @ref ble_gap_evt_scan_req_report_t."]
-pub const BLE_GAP_EVTS_BLE_GAP_EVT_SCAN_REQ_REPORT: BLE_GAP_EVTS = 32;
-#[doc = "< PHY Update Request. \\n Reply with @ref sd_ble_gap_phy_update. \\n See @ref ble_gap_evt_phy_update_request_t."]
-pub const BLE_GAP_EVTS_BLE_GAP_EVT_PHY_UPDATE_REQUEST: BLE_GAP_EVTS = 33;
-#[doc = "< PHY Update Procedure is complete. \\n See @ref ble_gap_evt_phy_update_t."]
-pub const BLE_GAP_EVTS_BLE_GAP_EVT_PHY_UPDATE: BLE_GAP_EVTS = 34;
-#[doc = "< Advertising set terminated. \\n See @ref ble_gap_evt_adv_set_terminated_t."]
-pub const BLE_GAP_EVTS_BLE_GAP_EVT_ADV_SET_TERMINATED: BLE_GAP_EVTS = 38;
-#[doc = "@brief GAP Event IDs."]
-#[doc = " IDs that uniquely identify an event coming from the stack to the application."]
-pub type BLE_GAP_EVTS = self::c_uint;
-#[doc = "< Channel Map. @ref ble_gap_opt_ch_map_t"]
-pub const BLE_GAP_OPTS_BLE_GAP_OPT_CH_MAP: BLE_GAP_OPTS = 32;
-#[doc = "< Local connection latency. @ref ble_gap_opt_local_conn_latency_t"]
-pub const BLE_GAP_OPTS_BLE_GAP_OPT_LOCAL_CONN_LATENCY: BLE_GAP_OPTS = 33;
-#[doc = "< Set passkey. @ref ble_gap_opt_passkey_t"]
-pub const BLE_GAP_OPTS_BLE_GAP_OPT_PASSKEY: BLE_GAP_OPTS = 34;
-#[doc = "< Set Authenticated payload timeout. @ref ble_gap_opt_auth_payload_timeout_t"]
-pub const BLE_GAP_OPTS_BLE_GAP_OPT_AUTH_PAYLOAD_TIMEOUT: BLE_GAP_OPTS = 36;
-#[doc = "< Disable slave latency. @ref ble_gap_opt_slave_latency_disable_t"]
-pub const BLE_GAP_OPTS_BLE_GAP_OPT_SLAVE_LATENCY_DISABLE: BLE_GAP_OPTS = 37;
-#[doc = "@brief GAP Option IDs."]
-#[doc = " IDs that uniquely identify a GAP option."]
-pub type BLE_GAP_OPTS = self::c_uint;
-#[doc = "< Role count configuration."]
-pub const BLE_GAP_CFGS_BLE_GAP_CFG_ROLE_COUNT: BLE_GAP_CFGS = 64;
-#[doc = "< Device name configuration."]
-pub const BLE_GAP_CFGS_BLE_GAP_CFG_DEVICE_NAME: BLE_GAP_CFGS = 65;
-#[doc = "< Peripheral Preferred Connection Parameters characteristic"]
-#[doc = "inclusion configuration."]
-pub const BLE_GAP_CFGS_BLE_GAP_CFG_PPCP_INCL_CONFIG: BLE_GAP_CFGS = 66;
-#[doc = "< Central Address Resolution characteristic"]
-#[doc = "inclusion configuration."]
-pub const BLE_GAP_CFGS_BLE_GAP_CFG_CAR_INCL_CONFIG: BLE_GAP_CFGS = 67;
-#[doc = "@brief GAP Configuration IDs."]
-#[doc = ""]
-#[doc = " IDs that uniquely identify a GAP configuration."]
-pub type BLE_GAP_CFGS = self::c_uint;
-#[doc = "< Advertiser role."]
-pub const BLE_GAP_TX_POWER_ROLES_BLE_GAP_TX_POWER_ROLE_ADV: BLE_GAP_TX_POWER_ROLES = 1;
-#[doc = "< Connection role."]
-pub const BLE_GAP_TX_POWER_ROLES_BLE_GAP_TX_POWER_ROLE_CONN: BLE_GAP_TX_POWER_ROLES = 3;
-#[doc = "@brief GAP TX Power roles."]
-pub type BLE_GAP_TX_POWER_ROLES = self::c_uint;
-#[doc = "@brief Advertising event properties."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_adv_properties_t {
- #[doc = "< Advertising type. See @ref BLE_GAP_ADV_TYPES."]
- pub type_: u8,
- pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_adv_properties_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 2usize,
- concat!("Size of: ", stringify!(ble_gap_adv_properties_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_adv_properties_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).type_ as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_adv_properties_t),
- "::",
- stringify!(type_)
- )
- );
-}
-impl ble_gap_adv_properties_t {
- #[inline]
- pub fn anonymous(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_anonymous(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(0usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn include_tx_power(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_include_tx_power(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(1usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn new_bitfield_1(anonymous: u8, include_tx_power: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
- let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
- __bindgen_bitfield_unit.set(0usize, 1u8, {
- let anonymous: u8 = unsafe { ::core::mem::transmute(anonymous) };
- anonymous as u64
- });
- __bindgen_bitfield_unit.set(1usize, 1u8, {
- let include_tx_power: u8 = unsafe { ::core::mem::transmute(include_tx_power) };
- include_tx_power as u64
- });
- __bindgen_bitfield_unit
- }
-}
-#[doc = "@brief Bluetooth Low Energy address."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_addr_t {
- pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
- #[doc = "< 48-bit address, LSB format."]
- pub addr: [u8; 6usize],
-}
-#[test]
-fn bindgen_test_layout_ble_gap_addr_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 7usize,
- concat!("Size of: ", stringify!(ble_gap_addr_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_addr_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).addr as *const _ as usize },
- 1usize,
- concat!("Offset of field: ", stringify!(ble_gap_addr_t), "::", stringify!(addr))
- );
-}
-impl ble_gap_addr_t {
- #[inline]
- pub fn addr_id_peer(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_addr_id_peer(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(0usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn addr_type(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) }
- }
- #[inline]
- pub fn set_addr_type(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(1usize, 7u8, val as u64)
- }
- }
- #[inline]
- pub fn new_bitfield_1(addr_id_peer: u8, addr_type: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
- let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
- __bindgen_bitfield_unit.set(0usize, 1u8, {
- let addr_id_peer: u8 = unsafe { ::core::mem::transmute(addr_id_peer) };
- addr_id_peer as u64
- });
- __bindgen_bitfield_unit.set(1usize, 7u8, {
- let addr_type: u8 = unsafe { ::core::mem::transmute(addr_type) };
- addr_type as u64
- });
- __bindgen_bitfield_unit
- }
-}
-#[doc = "@brief GAP connection parameters."]
-#[doc = ""]
-#[doc = " @note When ble_conn_params_t is received in an event, both min_conn_interval and"]
-#[doc = " max_conn_interval will be equal to the connection interval set by the central."]
-#[doc = ""]
-#[doc = " @note If both conn_sup_timeout and max_conn_interval are specified, then the following constraint applies:"]
-#[doc = " conn_sup_timeout * 4 > (1 + slave_latency) * max_conn_interval"]
-#[doc = " that corresponds to the following Bluetooth Spec requirement:"]
-#[doc = " The Supervision_Timeout in milliseconds shall be larger than"]
-#[doc = " (1 + Conn_Latency) * Conn_Interval_Max * 2, where Conn_Interval_Max is given in milliseconds."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_conn_params_t {
- #[doc = "< Minimum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS."]
- pub min_conn_interval: u16,
- #[doc = "< Maximum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS."]
- pub max_conn_interval: u16,
- #[doc = "< Slave Latency in number of connection events, see @ref BLE_GAP_CP_LIMITS."]
- pub slave_latency: u16,
- #[doc = "< Connection Supervision Timeout in 10 ms units, see @ref BLE_GAP_CP_LIMITS."]
- pub conn_sup_timeout: u16,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_conn_params_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 8usize,
- concat!("Size of: ", stringify!(ble_gap_conn_params_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 2usize,
- concat!("Alignment of ", stringify!(ble_gap_conn_params_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).min_conn_interval as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_conn_params_t),
- "::",
- stringify!(min_conn_interval)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).max_conn_interval as *const _ as usize },
- 2usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_conn_params_t),
- "::",
- stringify!(max_conn_interval)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).slave_latency as *const _ as usize },
- 4usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_conn_params_t),
- "::",
- stringify!(slave_latency)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).conn_sup_timeout as *const _ as usize },
- 6usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_conn_params_t),
- "::",
- stringify!(conn_sup_timeout)
- )
- );
-}
-#[doc = "@brief GAP connection security modes."]
-#[doc = ""]
-#[doc = " Security Mode 0 Level 0: No access permissions at all (this level is not defined by the Bluetooth Core specification).\\n"]
-#[doc = " Security Mode 1 Level 1: No security is needed (aka open link).\\n"]
-#[doc = " Security Mode 1 Level 2: Encrypted link required, MITM protection not necessary.\\n"]
-#[doc = " Security Mode 1 Level 3: MITM protected encrypted link required.\\n"]
-#[doc = " Security Mode 1 Level 4: LESC MITM protected encrypted link using a 128-bit strength encryption key required.\\n"]
-#[doc = " Security Mode 2 Level 1: Signing or encryption required, MITM protection not necessary.\\n"]
-#[doc = " Security Mode 2 Level 2: MITM protected signing required, unless link is MITM protected encrypted.\\n"]
-#[repr(C, packed)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_conn_sec_mode_t {
- pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_conn_sec_mode_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 1usize,
- concat!("Size of: ", stringify!(ble_gap_conn_sec_mode_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_conn_sec_mode_t))
- );
-}
-impl ble_gap_conn_sec_mode_t {
- #[inline]
- pub fn sm(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
- }
- #[inline]
- pub fn set_sm(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(0usize, 4u8, val as u64)
- }
- }
- #[inline]
- pub fn lv(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
- }
- #[inline]
- pub fn set_lv(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(4usize, 4u8, val as u64)
- }
- }
- #[inline]
- pub fn new_bitfield_1(sm: u8, lv: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
- let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
- __bindgen_bitfield_unit.set(0usize, 4u8, {
- let sm: u8 = unsafe { ::core::mem::transmute(sm) };
- sm as u64
- });
- __bindgen_bitfield_unit.set(4usize, 4u8, {
- let lv: u8 = unsafe { ::core::mem::transmute(lv) };
- lv as u64
- });
- __bindgen_bitfield_unit
- }
-}
-#[doc = "@brief GAP connection security status."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_conn_sec_t {
- #[doc = "< Currently active security mode for this connection."]
- pub sec_mode: ble_gap_conn_sec_mode_t,
- #[doc = "< Length of currently active encryption key, 7 to 16 octets (only applicable for bonding procedures)."]
- pub encr_key_size: u8,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_conn_sec_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 2usize,
- concat!("Size of: ", stringify!(ble_gap_conn_sec_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_conn_sec_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).sec_mode as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_conn_sec_t),
- "::",
- stringify!(sec_mode)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).encr_key_size as *const _ as usize },
- 1usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_conn_sec_t),
- "::",
- stringify!(encr_key_size)
- )
- );
-}
-#[doc = "@brief Identity Resolving Key."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_irk_t {
- #[doc = "< Array containing IRK."]
- pub irk: [u8; 16usize],
-}
-#[test]
-fn bindgen_test_layout_ble_gap_irk_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 16usize,
- concat!("Size of: ", stringify!(ble_gap_irk_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_irk_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).irk as *const _ as usize },
- 0usize,
- concat!("Offset of field: ", stringify!(ble_gap_irk_t), "::", stringify!(irk))
- );
-}
-#[doc = "@brief Channel mask (40 bits)."]
-#[doc = " Every channel is represented with a bit positioned as per channel index defined in Bluetooth Core Specification v5.0,"]
-#[doc = " Vol 6, Part B, Section 1.4.1. The LSB contained in array element 0 represents channel index 0, and bit 39 represents"]
-#[doc = " channel index 39. If a bit is set to 1, the channel is not used."]
-pub type ble_gap_ch_mask_t = [u8; 5usize];
-#[doc = "@brief GAP advertising parameters."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_adv_params_t {
- #[doc = "< The properties of the advertising events."]
- pub properties: ble_gap_adv_properties_t,
- #[doc = "< Address of a known peer."]
- #[doc = "- When privacy is enabled and the local device uses"]
- #[doc = "@ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE addresses,"]
- #[doc = "the device identity list is searched for a matching entry. If"]
- #[doc = "the local IRK for that device identity is set, the local IRK"]
- #[doc = "for that device will be used to generate the advertiser address"]
- #[doc = "field in the advertising packet."]
- #[doc = "- If @ref ble_gap_adv_properties_t::type is directed, this must be"]
- #[doc = "set to the targeted scanner or initiator. If the peer address is"]
- #[doc = "in the device identity list, the peer IRK for that device will be"]
- #[doc = "used to generate @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE"]
- #[doc = "target addresses used in the advertising event PDUs."]
- pub p_peer_addr: *const ble_gap_addr_t,
- #[doc = "< Advertising interval in 625 us units. @sa BLE_GAP_ADV_INTERVALS."]
- #[doc = "@note If @ref ble_gap_adv_properties_t::type is set to"]
- #[doc = "@ref BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE"]
- #[doc = "advertising, this parameter is ignored."]
- pub interval: u32,
- #[doc = "< Advertising duration in 10 ms units. When timeout is reached,"]
- #[doc = "an event of type @ref BLE_GAP_EVT_ADV_SET_TERMINATED is raised."]
- #[doc = "@sa BLE_GAP_ADV_TIMEOUT_VALUES."]
- #[doc = "@note The SoftDevice will always complete at least one advertising"]
- #[doc = "event even if the duration is set too low."]
- pub duration: u16,
- #[doc = "< Maximum advertising events that shall be sent prior to disabling"]
- #[doc = "advertising. Setting the value to 0 disables the limitation. When"]
- #[doc = "the count of advertising events specified by this parameter"]
- #[doc = "(if not 0) is reached, advertising will be automatically stopped"]
- #[doc = "and an event of type @ref BLE_GAP_EVT_ADV_SET_TERMINATED is raised"]
- #[doc = "@note If @ref ble_gap_adv_properties_t::type is set to"]
- #[doc = "@ref BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE,"]
- #[doc = "this parameter is ignored."]
- pub max_adv_evts: u8,
- #[doc = "< Channel mask for primary channels."]
- #[doc = "At least one of the primary channels, that is channel index 37-39, must be used."]
- pub channel_mask: ble_gap_ch_mask_t,
- #[doc = "< Filter Policy. @sa BLE_GAP_ADV_FILTER_POLICIES."]
- pub filter_policy: u8,
- #[doc = "< Indicates the PHY on which the primary advertising channel packets"]
- #[doc = "are transmitted. If set to @ref BLE_GAP_PHY_AUTO, @ref BLE_GAP_PHY_1MBPS"]
- #[doc = "will be used."]
- #[doc = "The only supported value by this SoftDevice is @ref BLE_GAP_PHY_1MBPS."]
- pub primary_phy: u8,
- #[doc = "< This field is ignored on this SoftDevice."]
- pub secondary_phy: u8,
- pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_adv_params_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 24usize,
- concat!("Size of: ", stringify!(ble_gap_adv_params_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 4usize,
- concat!("Alignment of ", stringify!(ble_gap_adv_params_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).properties as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_adv_params_t),
- "::",
- stringify!(properties)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).p_peer_addr as *const _ as usize },
- 4usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_adv_params_t),
- "::",
- stringify!(p_peer_addr)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).interval as *const _ as usize },
- 8usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_adv_params_t),
- "::",
- stringify!(interval)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).duration as *const _ as usize },
- 12usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_adv_params_t),
- "::",
- stringify!(duration)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).max_adv_evts as *const _ as usize },
- 14usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_adv_params_t),
- "::",
- stringify!(max_adv_evts)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).channel_mask as *const _ as usize },
- 15usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_adv_params_t),
- "::",
- stringify!(channel_mask)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).filter_policy as *const _ as usize },
- 20usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_adv_params_t),
- "::",
- stringify!(filter_policy)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).primary_phy as *const _ as usize },
- 21usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_adv_params_t),
- "::",
- stringify!(primary_phy)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).secondary_phy as *const _ as usize },
- 22usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_adv_params_t),
- "::",
- stringify!(secondary_phy)
- )
- );
-}
-impl ble_gap_adv_params_t {
- #[inline]
- pub fn set_id(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
- }
- #[inline]
- pub fn set_set_id(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(0usize, 4u8, val as u64)
- }
- }
- #[inline]
- pub fn scan_req_notification(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_scan_req_notification(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(4usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn new_bitfield_1(set_id: u8, scan_req_notification: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
- let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
- __bindgen_bitfield_unit.set(0usize, 4u8, {
- let set_id: u8 = unsafe { ::core::mem::transmute(set_id) };
- set_id as u64
- });
- __bindgen_bitfield_unit.set(4usize, 1u8, {
- let scan_req_notification: u8 = unsafe { ::core::mem::transmute(scan_req_notification) };
- scan_req_notification as u64
- });
- __bindgen_bitfield_unit
- }
-}
-#[doc = "@brief GAP advertising data buffers."]
-#[doc = ""]
-#[doc = " The application must provide the buffers for advertisement. The memory shall reside in application RAM, and"]
-#[doc = " shall never be modified while advertising. The data shall be kept alive until either:"]
-#[doc = " - @ref BLE_GAP_EVT_ADV_SET_TERMINATED is raised."]
-#[doc = " - @ref BLE_GAP_EVT_CONNECTED is raised with @ref ble_gap_evt_connected_t::adv_handle set to the corresponding"]
-#[doc = " advertising handle."]
-#[doc = " - Advertising is stopped."]
-#[doc = " - Advertising data is changed."]
-#[doc = " To update advertising data while advertising, provide new buffers to @ref sd_ble_gap_adv_set_configure."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_adv_data_t {
- #[doc = "< Advertising data."]
- #[doc = "@note"]
- #[doc = "Advertising data can only be specified for a @ref ble_gap_adv_properties_t::type"]
- #[doc = "that is allowed to contain advertising data."]
- pub adv_data: ble_data_t,
- #[doc = "< Scan response data."]
- #[doc = "@note"]
- #[doc = "Scan response data can only be specified for a @ref ble_gap_adv_properties_t::type"]
- #[doc = "that is scannable."]
- pub scan_rsp_data: ble_data_t,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_adv_data_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 16usize,
- concat!("Size of: ", stringify!(ble_gap_adv_data_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 4usize,
- concat!("Alignment of ", stringify!(ble_gap_adv_data_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).adv_data as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_adv_data_t),
- "::",
- stringify!(adv_data)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).scan_rsp_data as *const _ as usize },
- 8usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_adv_data_t),
- "::",
- stringify!(scan_rsp_data)
- )
- );
-}
-#[doc = "@brief Privacy."]
-#[doc = ""]
-#[doc = " The privacy feature provides a way for the device to avoid being tracked over a period of time."]
-#[doc = " The privacy feature, when enabled, hides the local device identity and replaces it with a private address"]
-#[doc = " that is automatically refreshed at a specified interval."]
-#[doc = ""]
-#[doc = " If a device still wants to be recognized by other peers, it needs to share it's Identity Resolving Key (IRK)."]
-#[doc = " With this key, a device can generate a random private address that can only be recognized by peers in possession of that key,"]
-#[doc = " and devices can establish connections without revealing their real identities."]
-#[doc = ""]
-#[doc = " Both network privacy (@ref BLE_GAP_PRIVACY_MODE_NETWORK_PRIVACY) and device privacy (@ref BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY)"]
-#[doc = " are supported."]
-#[doc = ""]
-#[doc = " @note If the device IRK is updated, the new IRK becomes the one to be distributed in all"]
-#[doc = " bonding procedures performed after @ref sd_ble_gap_privacy_set returns."]
-#[doc = " The IRK distributed during bonding procedure is the device IRK that is active when @ref sd_ble_gap_sec_params_reply is called."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_privacy_params_t {
- #[doc = "< Privacy mode, see @ref BLE_GAP_PRIVACY_MODES. Default is @ref BLE_GAP_PRIVACY_MODE_OFF."]
- pub privacy_mode: u8,
- #[doc = "< The private address type must be either @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE or @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE."]
- pub private_addr_type: u8,
- #[doc = "< Private address cycle interval in seconds. Providing an address cycle value of 0 will use the default value defined by @ref BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S."]
- pub private_addr_cycle_s: u16,
- #[doc = "< When used as input, pointer to IRK structure that will be used as the default IRK. If NULL, the device default IRK will be used."]
- #[doc = "When used as output, pointer to IRK structure where the current default IRK will be written to. If NULL, this argument is ignored."]
- #[doc = "By default, the default IRK is used to generate random private resolvable addresses for the local device unless instructed otherwise."]
- pub p_device_irk: *mut ble_gap_irk_t,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_privacy_params_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 8usize,
- concat!("Size of: ", stringify!(ble_gap_privacy_params_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 4usize,
- concat!("Alignment of ", stringify!(ble_gap_privacy_params_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).privacy_mode as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_privacy_params_t),
- "::",
- stringify!(privacy_mode)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).private_addr_type as *const _ as usize },
- 1usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_privacy_params_t),
- "::",
- stringify!(private_addr_type)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).private_addr_cycle_s as *const _ as usize },
- 2usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_privacy_params_t),
- "::",
- stringify!(private_addr_cycle_s)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).p_device_irk as *const _ as usize },
- 4usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_privacy_params_t),
- "::",
- stringify!(p_device_irk)
- )
- );
-}
-#[doc = "@brief PHY preferences for TX and RX"]
-#[doc = " @note tx_phys and rx_phys are bit fields. Multiple bits can be set in them to indicate multiple preferred PHYs for each direction."]
-#[doc = " @code"]
-#[doc = " p_gap_phys->tx_phys = BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_2MBPS;"]
-#[doc = " p_gap_phys->rx_phys = BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_2MBPS;"]
-#[doc = " @endcode"]
-#[doc = ""]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_phys_t {
- #[doc = "< Preferred transmit PHYs, see @ref BLE_GAP_PHYS."]
- pub tx_phys: u8,
- #[doc = "< Preferred receive PHYs, see @ref BLE_GAP_PHYS."]
- pub rx_phys: u8,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_phys_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 2usize,
- concat!("Size of: ", stringify!(ble_gap_phys_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_phys_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).tx_phys as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_phys_t),
- "::",
- stringify!(tx_phys)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).rx_phys as *const _ as usize },
- 1usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_phys_t),
- "::",
- stringify!(rx_phys)
- )
- );
-}
-#[doc = " @brief Keys that can be exchanged during a bonding procedure."]
-#[repr(C, packed)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_sec_kdist_t {
- pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_sec_kdist_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 1usize,
- concat!("Size of: ", stringify!(ble_gap_sec_kdist_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_sec_kdist_t))
- );
-}
-impl ble_gap_sec_kdist_t {
- #[inline]
- pub fn enc(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_enc(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(0usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn id(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_id(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(1usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn sign(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_sign(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(2usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn link(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_link(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(3usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn new_bitfield_1(enc: u8, id: u8, sign: u8, link: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
- let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
- __bindgen_bitfield_unit.set(0usize, 1u8, {
- let enc: u8 = unsafe { ::core::mem::transmute(enc) };
- enc as u64
- });
- __bindgen_bitfield_unit.set(1usize, 1u8, {
- let id: u8 = unsafe { ::core::mem::transmute(id) };
- id as u64
- });
- __bindgen_bitfield_unit.set(2usize, 1u8, {
- let sign: u8 = unsafe { ::core::mem::transmute(sign) };
- sign as u64
- });
- __bindgen_bitfield_unit.set(3usize, 1u8, {
- let link: u8 = unsafe { ::core::mem::transmute(link) };
- link as u64
- });
- __bindgen_bitfield_unit
- }
-}
-#[doc = "@brief GAP security parameters."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_sec_params_t {
- pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
- #[doc = "< Minimum encryption key size in octets between 7 and 16. If 0 then not applicable in this instance."]
- pub min_key_size: u8,
- #[doc = "< Maximum encryption key size in octets between min_key_size and 16."]
- pub max_key_size: u8,
- #[doc = "< Key distribution bitmap: keys that the local device will distribute."]
- pub kdist_own: ble_gap_sec_kdist_t,
- #[doc = "< Key distribution bitmap: keys that the remote device will distribute."]
- pub kdist_peer: ble_gap_sec_kdist_t,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_sec_params_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 5usize,
- concat!("Size of: ", stringify!(ble_gap_sec_params_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_sec_params_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).min_key_size as *const _ as usize },
- 1usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_sec_params_t),
- "::",
- stringify!(min_key_size)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).max_key_size as *const _ as usize },
- 2usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_sec_params_t),
- "::",
- stringify!(max_key_size)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).kdist_own as *const _ as usize },
- 3usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_sec_params_t),
- "::",
- stringify!(kdist_own)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).kdist_peer as *const _ as usize },
- 4usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_sec_params_t),
- "::",
- stringify!(kdist_peer)
- )
- );
-}
-impl ble_gap_sec_params_t {
- #[inline]
- pub fn bond(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_bond(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(0usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn mitm(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_mitm(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(1usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn lesc(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_lesc(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(2usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn keypress(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_keypress(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(3usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn io_caps(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 3u8) as u8) }
- }
- #[inline]
- pub fn set_io_caps(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(4usize, 3u8, val as u64)
- }
- }
- #[inline]
- pub fn oob(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_oob(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(7usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn new_bitfield_1(
- bond: u8,
- mitm: u8,
- lesc: u8,
- keypress: u8,
- io_caps: u8,
- oob: u8,
- ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
- let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
- __bindgen_bitfield_unit.set(0usize, 1u8, {
- let bond: u8 = unsafe { ::core::mem::transmute(bond) };
- bond as u64
- });
- __bindgen_bitfield_unit.set(1usize, 1u8, {
- let mitm: u8 = unsafe { ::core::mem::transmute(mitm) };
- mitm as u64
- });
- __bindgen_bitfield_unit.set(2usize, 1u8, {
- let lesc: u8 = unsafe { ::core::mem::transmute(lesc) };
- lesc as u64
- });
- __bindgen_bitfield_unit.set(3usize, 1u8, {
- let keypress: u8 = unsafe { ::core::mem::transmute(keypress) };
- keypress as u64
- });
- __bindgen_bitfield_unit.set(4usize, 3u8, {
- let io_caps: u8 = unsafe { ::core::mem::transmute(io_caps) };
- io_caps as u64
- });
- __bindgen_bitfield_unit.set(7usize, 1u8, {
- let oob: u8 = unsafe { ::core::mem::transmute(oob) };
- oob as u64
- });
- __bindgen_bitfield_unit
- }
-}
-#[doc = "@brief GAP Encryption Information."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_enc_info_t {
- #[doc = "< Long Term Key."]
- pub ltk: [u8; 16usize],
- pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_enc_info_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 17usize,
- concat!("Size of: ", stringify!(ble_gap_enc_info_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_enc_info_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).ltk as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_enc_info_t),
- "::",
- stringify!(ltk)
- )
- );
-}
-impl ble_gap_enc_info_t {
- #[inline]
- pub fn lesc(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_lesc(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(0usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn auth(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_auth(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(1usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn ltk_len(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 6u8) as u8) }
- }
- #[inline]
- pub fn set_ltk_len(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(2usize, 6u8, val as u64)
- }
- }
- #[inline]
- pub fn new_bitfield_1(lesc: u8, auth: u8, ltk_len: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
- let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
- __bindgen_bitfield_unit.set(0usize, 1u8, {
- let lesc: u8 = unsafe { ::core::mem::transmute(lesc) };
- lesc as u64
- });
- __bindgen_bitfield_unit.set(1usize, 1u8, {
- let auth: u8 = unsafe { ::core::mem::transmute(auth) };
- auth as u64
- });
- __bindgen_bitfield_unit.set(2usize, 6u8, {
- let ltk_len: u8 = unsafe { ::core::mem::transmute(ltk_len) };
- ltk_len as u64
- });
- __bindgen_bitfield_unit
- }
-}
-#[doc = "@brief GAP Master Identification."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_master_id_t {
- #[doc = "< Encrypted Diversifier."]
- pub ediv: u16,
- #[doc = "< Random Number."]
- pub rand: [u8; 8usize],
-}
-#[test]
-fn bindgen_test_layout_ble_gap_master_id_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 10usize,
- concat!("Size of: ", stringify!(ble_gap_master_id_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 2usize,
- concat!("Alignment of ", stringify!(ble_gap_master_id_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).ediv as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_master_id_t),
- "::",
- stringify!(ediv)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).rand as *const _ as usize },
- 2usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_master_id_t),
- "::",
- stringify!(rand)
- )
- );
-}
-#[doc = "@brief GAP Signing Information."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_sign_info_t {
- #[doc = "< Connection Signature Resolving Key."]
- pub csrk: [u8; 16usize],
-}
-#[test]
-fn bindgen_test_layout_ble_gap_sign_info_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 16usize,
- concat!("Size of: ", stringify!(ble_gap_sign_info_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_sign_info_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).csrk as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_sign_info_t),
- "::",
- stringify!(csrk)
- )
- );
-}
-#[doc = "@brief GAP LE Secure Connections P-256 Public Key."]
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct ble_gap_lesc_p256_pk_t {
- #[doc = "< LE Secure Connections Elliptic Curve Diffie-Hellman P-256 Public Key. Stored in the standard SMP protocol format: {X,Y} both in little-endian."]
- pub pk: [u8; 64usize],
-}
-#[test]
-fn bindgen_test_layout_ble_gap_lesc_p256_pk_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 64usize,
- concat!("Size of: ", stringify!(ble_gap_lesc_p256_pk_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_lesc_p256_pk_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).pk as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_lesc_p256_pk_t),
- "::",
- stringify!(pk)
- )
- );
-}
-#[doc = "@brief GAP LE Secure Connections DHKey."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_lesc_dhkey_t {
- #[doc = "< LE Secure Connections Elliptic Curve Diffie-Hellman Key. Stored in little-endian."]
- pub key: [u8; 32usize],
-}
-#[test]
-fn bindgen_test_layout_ble_gap_lesc_dhkey_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 32usize,
- concat!("Size of: ", stringify!(ble_gap_lesc_dhkey_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_lesc_dhkey_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).key as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_lesc_dhkey_t),
- "::",
- stringify!(key)
- )
- );
-}
-#[doc = "@brief GAP LE Secure Connections OOB data."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_lesc_oob_data_t {
- #[doc = "< Bluetooth address of the device."]
- pub addr: ble_gap_addr_t,
- #[doc = "< Random Number."]
- pub r: [u8; 16usize],
- #[doc = "< Confirm Value."]
- pub c: [u8; 16usize],
-}
-#[test]
-fn bindgen_test_layout_ble_gap_lesc_oob_data_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 39usize,
- concat!("Size of: ", stringify!(ble_gap_lesc_oob_data_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_lesc_oob_data_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).addr as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_lesc_oob_data_t),
- "::",
- stringify!(addr)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).r as *const _ as usize },
- 7usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_lesc_oob_data_t),
- "::",
- stringify!(r)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).c as *const _ as usize },
- 23usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_lesc_oob_data_t),
- "::",
- stringify!(c)
- )
- );
-}
-#[doc = "@brief Event structure for @ref BLE_GAP_EVT_CONNECTED."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_evt_connected_t {
- #[doc = "< Bluetooth address of the peer device. If the peer_addr resolved: @ref ble_gap_addr_t::addr_id_peer is set to 1"]
- #[doc = "and the address is the device's identity address."]
- pub peer_addr: ble_gap_addr_t,
- #[doc = "< BLE role for this connection, see @ref BLE_GAP_ROLES"]
- pub role: u8,
- #[doc = "< GAP Connection Parameters."]
- pub conn_params: ble_gap_conn_params_t,
- #[doc = "< Advertising handle in which advertising has ended."]
- #[doc = "This variable is only set if role is set to @ref BLE_GAP_ROLE_PERIPH."]
- pub adv_handle: u8,
- #[doc = "< Advertising buffers corresponding to the terminated"]
- #[doc = "advertising set. The advertising buffers provided in"]
- #[doc = "@ref sd_ble_gap_adv_set_configure are now released."]
- #[doc = "This variable is only set if role is set to @ref BLE_GAP_ROLE_PERIPH."]
- pub adv_data: ble_gap_adv_data_t,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_evt_connected_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 36usize,
- concat!("Size of: ", stringify!(ble_gap_evt_connected_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 4usize,
- concat!("Alignment of ", stringify!(ble_gap_evt_connected_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).peer_addr as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_connected_t),
- "::",
- stringify!(peer_addr)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).role as *const _ as usize },
- 7usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_connected_t),
- "::",
- stringify!(role)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).conn_params as *const _ as usize },
- 8usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_connected_t),
- "::",
- stringify!(conn_params)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).adv_handle as *const _ as usize },
- 16usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_connected_t),
- "::",
- stringify!(adv_handle)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).adv_data as *const _ as usize },
- 20usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_connected_t),
- "::",
- stringify!(adv_data)
- )
- );
-}
-#[doc = "@brief Event structure for @ref BLE_GAP_EVT_DISCONNECTED."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_evt_disconnected_t {
- #[doc = "< HCI error code, see @ref BLE_HCI_STATUS_CODES."]
- pub reason: u8,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_evt_disconnected_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 1usize,
- concat!("Size of: ", stringify!(ble_gap_evt_disconnected_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_evt_disconnected_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).reason as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_disconnected_t),
- "::",
- stringify!(reason)
- )
- );
-}
-#[doc = "@brief Event structure for @ref BLE_GAP_EVT_CONN_PARAM_UPDATE."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_evt_conn_param_update_t {
- #[doc = "< GAP Connection Parameters."]
- pub conn_params: ble_gap_conn_params_t,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_evt_conn_param_update_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 8usize,
- concat!("Size of: ", stringify!(ble_gap_evt_conn_param_update_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 2usize,
- concat!("Alignment of ", stringify!(ble_gap_evt_conn_param_update_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).conn_params as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_conn_param_update_t),
- "::",
- stringify!(conn_params)
- )
- );
-}
-#[doc = "@brief Event structure for @ref BLE_GAP_EVT_PHY_UPDATE_REQUEST."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_evt_phy_update_request_t {
- #[doc = "< The PHYs the peer prefers to use."]
- pub peer_preferred_phys: ble_gap_phys_t,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_evt_phy_update_request_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 2usize,
- concat!("Size of: ", stringify!(ble_gap_evt_phy_update_request_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_evt_phy_update_request_t))
- );
- assert_eq!(
- unsafe {
- &(*(::core::ptr::null::())).peer_preferred_phys as *const _ as usize
- },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_phy_update_request_t),
- "::",
- stringify!(peer_preferred_phys)
- )
- );
-}
-#[doc = "@brief Event Structure for @ref BLE_GAP_EVT_PHY_UPDATE."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_evt_phy_update_t {
- #[doc = "< Status of the procedure, see @ref BLE_HCI_STATUS_CODES."]
- pub status: u8,
- #[doc = "< TX PHY for this connection, see @ref BLE_GAP_PHYS."]
- pub tx_phy: u8,
- #[doc = "< RX PHY for this connection, see @ref BLE_GAP_PHYS."]
- pub rx_phy: u8,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_evt_phy_update_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 3usize,
- concat!("Size of: ", stringify!(ble_gap_evt_phy_update_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_evt_phy_update_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).status as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_phy_update_t),
- "::",
- stringify!(status)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).tx_phy as *const _ as usize },
- 1usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_phy_update_t),
- "::",
- stringify!(tx_phy)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).rx_phy as *const _ as usize },
- 2usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_phy_update_t),
- "::",
- stringify!(rx_phy)
- )
- );
-}
-#[doc = "@brief Event structure for @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_evt_sec_params_request_t {
- #[doc = "< Initiator Security Parameters."]
- pub peer_params: ble_gap_sec_params_t,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_evt_sec_params_request_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 5usize,
- concat!("Size of: ", stringify!(ble_gap_evt_sec_params_request_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_evt_sec_params_request_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).peer_params as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_sec_params_request_t),
- "::",
- stringify!(peer_params)
- )
- );
-}
-#[doc = "@brief Event structure for @ref BLE_GAP_EVT_SEC_INFO_REQUEST."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_evt_sec_info_request_t {
- #[doc = "< Bluetooth address of the peer device."]
- pub peer_addr: ble_gap_addr_t,
- #[doc = "< Master Identification for LTK lookup."]
- pub master_id: ble_gap_master_id_t,
- pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
- pub __bindgen_padding_0: u8,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_evt_sec_info_request_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 20usize,
- concat!("Size of: ", stringify!(ble_gap_evt_sec_info_request_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 2usize,
- concat!("Alignment of ", stringify!(ble_gap_evt_sec_info_request_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).peer_addr as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_sec_info_request_t),
- "::",
- stringify!(peer_addr)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).master_id as *const _ as usize },
- 8usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_sec_info_request_t),
- "::",
- stringify!(master_id)
- )
- );
-}
-impl ble_gap_evt_sec_info_request_t {
- #[inline]
- pub fn enc_info(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_enc_info(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(0usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn id_info(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_id_info(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(1usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn sign_info(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_sign_info(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(2usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn new_bitfield_1(enc_info: u8, id_info: u8, sign_info: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
- let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
- __bindgen_bitfield_unit.set(0usize, 1u8, {
- let enc_info: u8 = unsafe { ::core::mem::transmute(enc_info) };
- enc_info as u64
- });
- __bindgen_bitfield_unit.set(1usize, 1u8, {
- let id_info: u8 = unsafe { ::core::mem::transmute(id_info) };
- id_info as u64
- });
- __bindgen_bitfield_unit.set(2usize, 1u8, {
- let sign_info: u8 = unsafe { ::core::mem::transmute(sign_info) };
- sign_info as u64
- });
- __bindgen_bitfield_unit
- }
-}
-#[doc = "@brief Event structure for @ref BLE_GAP_EVT_PASSKEY_DISPLAY."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_evt_passkey_display_t {
- #[doc = "< 6-digit passkey in ASCII ('0'-'9' digits only)."]
- pub passkey: [u8; 6usize],
- pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_evt_passkey_display_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 7usize,
- concat!("Size of: ", stringify!(ble_gap_evt_passkey_display_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_evt_passkey_display_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).passkey as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_passkey_display_t),
- "::",
- stringify!(passkey)
- )
- );
-}
-impl ble_gap_evt_passkey_display_t {
- #[inline]
- pub fn match_request(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_match_request(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(0usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn new_bitfield_1(match_request: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
- let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
- __bindgen_bitfield_unit.set(0usize, 1u8, {
- let match_request: u8 = unsafe { ::core::mem::transmute(match_request) };
- match_request as u64
- });
- __bindgen_bitfield_unit
- }
-}
-#[doc = "@brief Event structure for @ref BLE_GAP_EVT_KEY_PRESSED."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_evt_key_pressed_t {
- #[doc = "< Keypress notification type, see @ref BLE_GAP_KP_NOT_TYPES."]
- pub kp_not: u8,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_evt_key_pressed_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 1usize,
- concat!("Size of: ", stringify!(ble_gap_evt_key_pressed_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_evt_key_pressed_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).kp_not as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_key_pressed_t),
- "::",
- stringify!(kp_not)
- )
- );
-}
-#[doc = "@brief Event structure for @ref BLE_GAP_EVT_AUTH_KEY_REQUEST."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_evt_auth_key_request_t {
- #[doc = "< See @ref BLE_GAP_AUTH_KEY_TYPES."]
- pub key_type: u8,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_evt_auth_key_request_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 1usize,
- concat!("Size of: ", stringify!(ble_gap_evt_auth_key_request_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_evt_auth_key_request_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).key_type as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_auth_key_request_t),
- "::",
- stringify!(key_type)
- )
- );
-}
-#[doc = "@brief Event structure for @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_evt_lesc_dhkey_request_t {
- #[doc = "< LE Secure Connections remote P-256 Public Key. This will point to the application-supplied memory"]
- #[doc = "inside the keyset during the call to @ref sd_ble_gap_sec_params_reply."]
- pub p_pk_peer: *mut ble_gap_lesc_p256_pk_t,
- pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
- pub __bindgen_padding_0: [u8; 3usize],
-}
-#[test]
-fn bindgen_test_layout_ble_gap_evt_lesc_dhkey_request_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 8usize,
- concat!("Size of: ", stringify!(ble_gap_evt_lesc_dhkey_request_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 4usize,
- concat!("Alignment of ", stringify!(ble_gap_evt_lesc_dhkey_request_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).p_pk_peer as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_lesc_dhkey_request_t),
- "::",
- stringify!(p_pk_peer)
- )
- );
-}
-impl ble_gap_evt_lesc_dhkey_request_t {
- #[inline]
- pub fn oobd_req(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_oobd_req(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(0usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn new_bitfield_1(oobd_req: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
- let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
- __bindgen_bitfield_unit.set(0usize, 1u8, {
- let oobd_req: u8 = unsafe { ::core::mem::transmute(oobd_req) };
- oobd_req as u64
- });
- __bindgen_bitfield_unit
- }
-}
-#[doc = "@brief Security levels supported."]
-#[doc = " @note See Bluetooth Specification Version 4.2 Volume 3, Part C, Chapter 10, Section 10.2.1."]
-#[repr(C, packed)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_sec_levels_t {
- pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_sec_levels_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 1usize,
- concat!("Size of: ", stringify!(ble_gap_sec_levels_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_sec_levels_t))
- );
-}
-impl ble_gap_sec_levels_t {
- #[inline]
- pub fn lv1(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_lv1(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(0usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn lv2(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_lv2(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(1usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn lv3(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_lv3(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(2usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn lv4(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_lv4(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(3usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn new_bitfield_1(lv1: u8, lv2: u8, lv3: u8, lv4: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
- let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
- __bindgen_bitfield_unit.set(0usize, 1u8, {
- let lv1: u8 = unsafe { ::core::mem::transmute(lv1) };
- lv1 as u64
- });
- __bindgen_bitfield_unit.set(1usize, 1u8, {
- let lv2: u8 = unsafe { ::core::mem::transmute(lv2) };
- lv2 as u64
- });
- __bindgen_bitfield_unit.set(2usize, 1u8, {
- let lv3: u8 = unsafe { ::core::mem::transmute(lv3) };
- lv3 as u64
- });
- __bindgen_bitfield_unit.set(3usize, 1u8, {
- let lv4: u8 = unsafe { ::core::mem::transmute(lv4) };
- lv4 as u64
- });
- __bindgen_bitfield_unit
- }
-}
-#[doc = "@brief Encryption Key."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_enc_key_t {
- #[doc = "< Encryption Information."]
- pub enc_info: ble_gap_enc_info_t,
- #[doc = "< Master Identification."]
- pub master_id: ble_gap_master_id_t,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_enc_key_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 28usize,
- concat!("Size of: ", stringify!(ble_gap_enc_key_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 2usize,
- concat!("Alignment of ", stringify!(ble_gap_enc_key_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).enc_info as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_enc_key_t),
- "::",
- stringify!(enc_info)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).master_id as *const _ as usize },
- 18usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_enc_key_t),
- "::",
- stringify!(master_id)
- )
- );
-}
-#[doc = "@brief Identity Key."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_id_key_t {
- #[doc = "< Identity Resolving Key."]
- pub id_info: ble_gap_irk_t,
- #[doc = "< Identity Address."]
- pub id_addr_info: ble_gap_addr_t,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_id_key_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 23usize,
- concat!("Size of: ", stringify!(ble_gap_id_key_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_id_key_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).id_info as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_id_key_t),
- "::",
- stringify!(id_info)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).id_addr_info as *const _ as usize },
- 16usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_id_key_t),
- "::",
- stringify!(id_addr_info)
- )
- );
-}
-#[doc = "@brief Security Keys."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_sec_keys_t {
- #[doc = "< Encryption Key, or NULL."]
- pub p_enc_key: *mut ble_gap_enc_key_t,
- #[doc = "< Identity Key, or NULL."]
- pub p_id_key: *mut ble_gap_id_key_t,
- #[doc = "< Signing Key, or NULL."]
- pub p_sign_key: *mut ble_gap_sign_info_t,
- #[doc = "< LE Secure Connections P-256 Public Key. When in debug mode the application must use the value defined"]
- #[doc = "in the Core Bluetooth Specification v4.2 Vol.3, Part H, Section 2.3.5.6.1"]
- pub p_pk: *mut ble_gap_lesc_p256_pk_t,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_sec_keys_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 16usize,
- concat!("Size of: ", stringify!(ble_gap_sec_keys_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 4usize,
- concat!("Alignment of ", stringify!(ble_gap_sec_keys_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).p_enc_key as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_sec_keys_t),
- "::",
- stringify!(p_enc_key)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).p_id_key as *const _ as usize },
- 4usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_sec_keys_t),
- "::",
- stringify!(p_id_key)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).p_sign_key as *const _ as usize },
- 8usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_sec_keys_t),
- "::",
- stringify!(p_sign_key)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).p_pk as *const _ as usize },
- 12usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_sec_keys_t),
- "::",
- stringify!(p_pk)
- )
- );
-}
-#[doc = "@brief Security key set for both local and peer keys."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_sec_keyset_t {
- #[doc = "< Keys distributed by the local device. For LE Secure Connections the encryption key will be generated locally and will always be stored if bonding."]
- pub keys_own: ble_gap_sec_keys_t,
- #[doc = "< Keys distributed by the remote device. For LE Secure Connections, p_enc_key must always be NULL."]
- pub keys_peer: ble_gap_sec_keys_t,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_sec_keyset_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 32usize,
- concat!("Size of: ", stringify!(ble_gap_sec_keyset_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 4usize,
- concat!("Alignment of ", stringify!(ble_gap_sec_keyset_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).keys_own as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_sec_keyset_t),
- "::",
- stringify!(keys_own)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).keys_peer as *const _ as usize },
- 16usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_sec_keyset_t),
- "::",
- stringify!(keys_peer)
- )
- );
-}
-#[doc = "@brief Event structure for @ref BLE_GAP_EVT_AUTH_STATUS."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_evt_auth_status_t {
- #[doc = "< Authentication status, see @ref BLE_GAP_SEC_STATUS."]
- pub auth_status: u8,
- pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
- #[doc = "< Levels supported in Security Mode 1."]
- pub sm1_levels: ble_gap_sec_levels_t,
- #[doc = "< Levels supported in Security Mode 2."]
- pub sm2_levels: ble_gap_sec_levels_t,
- #[doc = "< Bitmap stating which keys were exchanged (distributed) by the local device. If bonding with LE Secure Connections, the enc bit will be always set."]
- pub kdist_own: ble_gap_sec_kdist_t,
- #[doc = "< Bitmap stating which keys were exchanged (distributed) by the remote device. If bonding with LE Secure Connections, the enc bit will never be set."]
- pub kdist_peer: ble_gap_sec_kdist_t,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_evt_auth_status_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 6usize,
- concat!("Size of: ", stringify!(ble_gap_evt_auth_status_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_evt_auth_status_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).auth_status as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_auth_status_t),
- "::",
- stringify!(auth_status)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).sm1_levels as *const _ as usize },
- 2usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_auth_status_t),
- "::",
- stringify!(sm1_levels)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).sm2_levels as *const _ as usize },
- 3usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_auth_status_t),
- "::",
- stringify!(sm2_levels)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).kdist_own as *const _ as usize },
- 4usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_auth_status_t),
- "::",
- stringify!(kdist_own)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).kdist_peer as *const _ as usize },
- 5usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_auth_status_t),
- "::",
- stringify!(kdist_peer)
- )
- );
-}
-impl ble_gap_evt_auth_status_t {
- #[inline]
- pub fn error_src(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u8) }
- }
- #[inline]
- pub fn set_error_src(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(0usize, 2u8, val as u64)
- }
- }
- #[inline]
- pub fn bonded(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_bonded(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(2usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn lesc(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_lesc(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(3usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn new_bitfield_1(error_src: u8, bonded: u8, lesc: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
- let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
- __bindgen_bitfield_unit.set(0usize, 2u8, {
- let error_src: u8 = unsafe { ::core::mem::transmute(error_src) };
- error_src as u64
- });
- __bindgen_bitfield_unit.set(2usize, 1u8, {
- let bonded: u8 = unsafe { ::core::mem::transmute(bonded) };
- bonded as u64
- });
- __bindgen_bitfield_unit.set(3usize, 1u8, {
- let lesc: u8 = unsafe { ::core::mem::transmute(lesc) };
- lesc as u64
- });
- __bindgen_bitfield_unit
- }
-}
-#[doc = "@brief Event structure for @ref BLE_GAP_EVT_CONN_SEC_UPDATE."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_evt_conn_sec_update_t {
- #[doc = "< Connection security level."]
- pub conn_sec: ble_gap_conn_sec_t,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_evt_conn_sec_update_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 2usize,
- concat!("Size of: ", stringify!(ble_gap_evt_conn_sec_update_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_evt_conn_sec_update_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).conn_sec as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_conn_sec_update_t),
- "::",
- stringify!(conn_sec)
- )
- );
-}
-#[doc = "@brief Event structure for @ref BLE_GAP_EVT_TIMEOUT."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_evt_timeout_t {
- #[doc = "< Source of timeout event, see @ref BLE_GAP_TIMEOUT_SOURCES."]
- pub src: u8,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_evt_timeout_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 1usize,
- concat!("Size of: ", stringify!(ble_gap_evt_timeout_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_evt_timeout_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).src as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_timeout_t),
- "::",
- stringify!(src)
- )
- );
-}
-#[doc = "@brief Event structure for @ref BLE_GAP_EVT_RSSI_CHANGED."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_evt_rssi_changed_t {
- #[doc = "< Received Signal Strength Indication in dBm."]
- pub rssi: i8,
- #[doc = "< Data Channel Index on which the Signal Strength is measured (0-36)."]
- pub ch_index: u8,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_evt_rssi_changed_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 2usize,
- concat!("Size of: ", stringify!(ble_gap_evt_rssi_changed_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_evt_rssi_changed_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).rssi as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_rssi_changed_t),
- "::",
- stringify!(rssi)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).ch_index as *const _ as usize },
- 1usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_rssi_changed_t),
- "::",
- stringify!(ch_index)
- )
- );
-}
-#[doc = "@brief Event structure for @ref BLE_GAP_EVT_ADV_SET_TERMINATED"]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_evt_adv_set_terminated_t {
- #[doc = "< Reason for why the advertising set terminated. See"]
- #[doc = "@ref BLE_GAP_EVT_ADV_SET_TERMINATED_REASON."]
- pub reason: u8,
- #[doc = "< Advertising handle in which advertising has ended."]
- pub adv_handle: u8,
- #[doc = "< If @ref ble_gap_adv_params_t::max_adv_evts was not set to 0,"]
- #[doc = "this field indicates the number of completed advertising events."]
- pub num_completed_adv_events: u8,
- #[doc = "< Advertising buffers corresponding to the terminated"]
- #[doc = "advertising set. The advertising buffers provided in"]
- #[doc = "@ref sd_ble_gap_adv_set_configure are now released."]
- pub adv_data: ble_gap_adv_data_t,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_evt_adv_set_terminated_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 20usize,
- concat!("Size of: ", stringify!(ble_gap_evt_adv_set_terminated_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 4usize,
- concat!("Alignment of ", stringify!(ble_gap_evt_adv_set_terminated_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).reason as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_adv_set_terminated_t),
- "::",
- stringify!(reason)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).adv_handle as *const _ as usize },
- 1usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_adv_set_terminated_t),
- "::",
- stringify!(adv_handle)
- )
- );
- assert_eq!(
- unsafe {
- &(*(::core::ptr::null::())).num_completed_adv_events as *const _ as usize
- },
- 2usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_adv_set_terminated_t),
- "::",
- stringify!(num_completed_adv_events)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).adv_data as *const _ as usize },
- 4usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_adv_set_terminated_t),
- "::",
- stringify!(adv_data)
- )
- );
-}
-#[doc = "@brief Event structure for @ref BLE_GAP_EVT_SEC_REQUEST."]
-#[repr(C, packed)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_evt_sec_request_t {
- pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_evt_sec_request_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 1usize,
- concat!("Size of: ", stringify!(ble_gap_evt_sec_request_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_evt_sec_request_t))
- );
-}
-impl ble_gap_evt_sec_request_t {
- #[inline]
- pub fn bond(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_bond(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(0usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn mitm(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_mitm(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(1usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn lesc(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_lesc(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(2usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn keypress(&self) -> u8 {
- unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
- }
- #[inline]
- pub fn set_keypress(&mut self, val: u8) {
- unsafe {
- let val: u8 = ::core::mem::transmute(val);
- self._bitfield_1.set(3usize, 1u8, val as u64)
- }
- }
- #[inline]
- pub fn new_bitfield_1(bond: u8, mitm: u8, lesc: u8, keypress: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
- let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
- __bindgen_bitfield_unit.set(0usize, 1u8, {
- let bond: u8 = unsafe { ::core::mem::transmute(bond) };
- bond as u64
- });
- __bindgen_bitfield_unit.set(1usize, 1u8, {
- let mitm: u8 = unsafe { ::core::mem::transmute(mitm) };
- mitm as u64
- });
- __bindgen_bitfield_unit.set(2usize, 1u8, {
- let lesc: u8 = unsafe { ::core::mem::transmute(lesc) };
- lesc as u64
- });
- __bindgen_bitfield_unit.set(3usize, 1u8, {
- let keypress: u8 = unsafe { ::core::mem::transmute(keypress) };
- keypress as u64
- });
- __bindgen_bitfield_unit
- }
-}
-#[doc = "@brief Event structure for @ref BLE_GAP_EVT_SCAN_REQ_REPORT."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct ble_gap_evt_scan_req_report_t {
- #[doc = "< Advertising handle for the advertising set which received the Scan Request"]
- pub adv_handle: u8,
- #[doc = "< Received Signal Strength Indication in dBm."]
- pub rssi: i8,
- #[doc = "< Bluetooth address of the peer device. If the peer_addr resolved: @ref ble_gap_addr_t::addr_id_peer is set to 1"]
- #[doc = "and the address is the device's identity address."]
- pub peer_addr: ble_gap_addr_t,
-}
-#[test]
-fn bindgen_test_layout_ble_gap_evt_scan_req_report_t() {
- assert_eq!(
- ::core::mem::size_of::(),
- 9usize,
- concat!("Size of: ", stringify!(ble_gap_evt_scan_req_report_t))
- );
- assert_eq!(
- ::core::mem::align_of::(),
- 1usize,
- concat!("Alignment of ", stringify!(ble_gap_evt_scan_req_report_t))
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).adv_handle as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_scan_req_report_t),
- "::",
- stringify!(adv_handle)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).rssi as *const _ as usize },
- 1usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_scan_req_report_t),
- "::",
- stringify!(rssi)
- )
- );
- assert_eq!(
- unsafe { &(*(::core::ptr::null::())).peer_addr as *const _ as usize },
- 2usize,
- concat!(
- "Offset of field: ",
- stringify!(ble_gap_evt_scan_req_report_t),
- "::",
- stringify!(peer_addr)
- )
- );
-}
-#[doc = "@brief GAP event structure."]
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct ble_gap_evt_t {
- #[doc = "< Connection Handle on which event occurred."]
- pub conn_handle: u16,
- #[doc = "< Event Parameters."]
- pub params: ble_gap_evt_t__bindgen_ty_1,
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub union ble_gap_evt_t__bindgen_ty_1 {
- #[doc = "< Connected Event Parameters."]
- pub connected: ble_gap_evt_connected_t,
- #[doc = "< Disconnected Event Parameters."]
- pub disconnected: ble_gap_evt_disconnected_t,
- #[doc = "< Connection Parameter Update Parameters."]
- pub conn_param_update: ble_gap_evt_conn_param_update_t,
- #[doc = "< Security Parameters Request Event Parameters."]
- pub sec_params_request: ble_gap_evt_sec_params_request_t,
- #[doc = "< Security Information Request Event Parameters."]
- pub sec_info_request: ble_gap_evt_sec_info_request_t,
- #[doc = "< Passkey Display Event Parameters."]
- pub passkey_display: ble_gap_evt_passkey_display_t,
- #[doc = "< Key Pressed Event Parameters."]
- pub key_pressed: ble_gap_evt_key_pressed_t,
- #[doc = "< Authentication Key Request Event Parameters."]
- pub auth_key_request: ble_gap_evt_auth_key_request_t,
- #[doc = "< LE Secure Connections DHKey calculation request."]
- pub lesc_dhkey_request: ble_gap_evt_lesc_dhkey_request_t,
- #[doc = "< Authentication Status Event Parameters."]
- pub auth_status: ble_gap_evt_auth_status_t,
- #[doc = "< Connection Security Update Event Parameters."]
- pub conn_sec_update: ble_gap_evt_conn_sec_update_t,
- #[doc = "< Timeout Event Parameters."]
- pub timeout: ble_gap_evt_timeout_t,
- #[doc = "< RSSI Event Parameters."]
- pub rssi_changed: ble_gap_evt_rssi_changed_t,
- #[doc = "< Advertising Set Terminated Event Parameters."]
- pub adv_set_terminated: ble_gap_evt_adv_set_terminated_t,
- #[doc = "< Security Request Event Parameters."]
- pub sec_request: ble_gap_evt_sec_request_t,
- #[doc = "< Scan Request Report Parameters."]
- pub scan_req_report: ble_gap_evt_scan_req_report_t,
- #[doc = "< PHY Update Request Event Parameters."]
- pub phy_update_request: ble_gap_evt_phy_update_request_t,
- #[doc = "< PHY Update Parameters."]
- pub phy_update: ble_gap_evt_phy_update_t,
- _bindgen_union_align: [u32; 9usize],
-}
-#[test]
-fn bindgen_test_layout_ble_gap_evt_t__bindgen_ty_1() {
- assert_eq!(
- ::core::mem::size_of::