1#![allow(
40 clippy::fn_to_numeric_cast,
41 clippy::missing_safety_doc,
42 clippy::redundant_static_lifetimes,
43 clippy::useless_transmute
44)]
45
46pub type c_schar = i8;
47pub type c_uchar = u8;
48pub type c_char = u8;
49
50pub type c_short = i16;
51pub type c_ushort = u16;
52
53pub type c_int = i32;
54pub type c_uint = u32;
55
56pub type c_long = i32;
57pub type c_ulong = u32;
58
59pub type c_longlong = i64;
60pub type c_ulonglong = u64;
61
62pub type c_void = core::ffi::c_void;
63
64trait ToAsm {
65 fn to_asm(self) -> u32;
66}
67
68fn to_asm<T: ToAsm>(t: T) -> u32 {
69 t.to_asm()
70}
71
72impl ToAsm for u32 {
73 fn to_asm(self) -> u32 {
74 self
75 }
76}
77
78impl ToAsm for u16 {
79 fn to_asm(self) -> u32 {
80 self as u32
81 }
82}
83
84impl ToAsm for u8 {
85 fn to_asm(self) -> u32 {
86 self as u32
87 }
88}
89
90impl ToAsm for i8 {
91 fn to_asm(self) -> u32 {
92 self as u32
93 }
94}
95
96impl<T> ToAsm for *const T {
97 fn to_asm(self) -> u32 {
98 self as u32
99 }
100}
101
102impl<T> ToAsm for *mut T {
103 fn to_asm(self) -> u32 {
104 self as u32
105 }
106}
107
108impl<T: ToAsm> ToAsm for Option<T> {
109 fn to_asm(self) -> u32 {
110 match self {
111 Some(x) => x.to_asm(),
112 None => 0,
113 }
114 }
115}
116
117impl<X, R> ToAsm for unsafe extern "C" fn(X) -> R {
118 fn to_asm(self) -> u32 {
119 self as u32
120 }
121}
122
123impl<X, Y, R> ToAsm for unsafe extern "C" fn(X, Y) -> R {
124 fn to_asm(self) -> u32 {
125 self as u32
126 }
127}
128
129impl<X, Y, Z, R> ToAsm for unsafe extern "C" fn(X, Y, Z) -> R {
130 fn to_asm(self) -> u32 {
131 self as u32
132 }
133}
134
135#[repr(C)]
138#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
139pub struct __BindgenBitfieldUnit<Storage, Align> {
140 storage: Storage,
141 align: [Align; 0],
142}
143impl<Storage, Align> __BindgenBitfieldUnit<Storage, Align> {
144 #[inline]
145 pub const fn new(storage: Storage) -> Self {
146 Self { storage, align: [] }
147 }
148}
149impl<Storage, Align> __BindgenBitfieldUnit<Storage, Align>
150where
151 Storage: AsRef<[u8]> + AsMut<[u8]>,
152{
153 #[inline]
154 pub fn get_bit(&self, index: usize) -> bool {
155 debug_assert!(index / 8 < self.storage.as_ref().len());
156 let byte_index = index / 8;
157 let byte = self.storage.as_ref()[byte_index];
158 let bit_index = if cfg!(target_endian = "big") {
159 7 - (index % 8)
160 } else {
161 index % 8
162 };
163 let mask = 1 << bit_index;
164 byte & mask == mask
165 }
166 #[inline]
167 pub fn set_bit(&mut self, index: usize, val: bool) {
168 debug_assert!(index / 8 < self.storage.as_ref().len());
169 let byte_index = index / 8;
170 let byte = &mut self.storage.as_mut()[byte_index];
171 let bit_index = if cfg!(target_endian = "big") {
172 7 - (index % 8)
173 } else {
174 index % 8
175 };
176 let mask = 1 << bit_index;
177 if val {
178 *byte |= mask;
179 } else {
180 *byte &= !mask;
181 }
182 }
183 #[inline]
184 pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
185 debug_assert!(bit_width <= 64);
186 debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
187 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
188 let mut val = 0;
189 for i in 0..(bit_width as usize) {
190 if self.get_bit(i + bit_offset) {
191 let index = if cfg!(target_endian = "big") {
192 bit_width as usize - 1 - i
193 } else {
194 i
195 };
196 val |= 1 << index;
197 }
198 }
199 val
200 }
201 #[inline]
202 pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
203 debug_assert!(bit_width <= 64);
204 debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
205 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
206 for i in 0..(bit_width as usize) {
207 let mask = 1 << i;
208 let val_bit_is_set = val & mask == mask;
209 let index = if cfg!(target_endian = "big") {
210 bit_width as usize - 1 - i
211 } else {
212 i
213 };
214 self.set_bit(index + bit_offset, val_bit_is_set);
215 }
216 }
217}
218#[repr(C)]
219#[derive(Default)]
220pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
221impl<T> __IncompleteArrayField<T> {
222 #[inline]
223 pub const fn new() -> Self {
224 __IncompleteArrayField(::core::marker::PhantomData, [])
225 }
226 #[inline]
227 pub fn as_ptr(&self) -> *const T {
228 self as *const _ as *const T
229 }
230 #[inline]
231 pub fn as_mut_ptr(&mut self) -> *mut T {
232 self as *mut _ as *mut T
233 }
234 #[inline]
235 pub unsafe fn as_slice(&self, len: usize) -> &[T] {
236 ::core::slice::from_raw_parts(self.as_ptr(), len)
237 }
238 #[inline]
239 pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
240 ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
241 }
242}
243impl<T> ::core::fmt::Debug for __IncompleteArrayField<T> {
244 fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
245 fmt.write_str("__IncompleteArrayField")
246 }
247}
248#[repr(C)]
249pub struct __BindgenUnionField<T>(::core::marker::PhantomData<T>);
250impl<T> __BindgenUnionField<T> {
251 #[inline]
252 pub const fn new() -> Self {
253 __BindgenUnionField(::core::marker::PhantomData)
254 }
255 #[inline]
256 pub unsafe fn as_ref(&self) -> &T {
257 ::core::mem::transmute(self)
258 }
259 #[inline]
260 pub unsafe fn as_mut(&mut self) -> &mut T {
261 ::core::mem::transmute(self)
262 }
263}
264impl<T> ::core::default::Default for __BindgenUnionField<T> {
265 #[inline]
266 fn default() -> Self {
267 Self::new()
268 }
269}
270impl<T> ::core::clone::Clone for __BindgenUnionField<T> {
271 #[inline]
272 fn clone(&self) -> Self {
273 Self::new()
274 }
275}
276impl<T> ::core::marker::Copy for __BindgenUnionField<T> {}
277impl<T> ::core::fmt::Debug for __BindgenUnionField<T> {
278 fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
279 fmt.write_str("__BindgenUnionField")
280 }
281}
282impl<T> ::core::hash::Hash for __BindgenUnionField<T> {
283 fn hash<H: ::core::hash::Hasher>(&self, _state: &mut H) {}
284}
285impl<T> ::core::cmp::PartialEq for __BindgenUnionField<T> {
286 fn eq(&self, _other: &__BindgenUnionField<T>) -> bool {
287 true
288 }
289}
290impl<T> ::core::cmp::Eq for __BindgenUnionField<T> {}
291pub const NRF_ERROR_BASE_NUM: u32 = 0;
292pub const NRF_ERROR_SDM_BASE_NUM: u32 = 4096;
293pub const NRF_ERROR_SOC_BASE_NUM: u32 = 8192;
294pub const NRF_ERROR_STK_BASE_NUM: u32 = 12288;
295pub const NRF_SUCCESS: u32 = 0;
296pub const NRF_ERROR_SVC_HANDLER_MISSING: u32 = 1;
297pub const NRF_ERROR_SOFTDEVICE_NOT_ENABLED: u32 = 2;
298pub const NRF_ERROR_INTERNAL: u32 = 3;
299pub const NRF_ERROR_NO_MEM: u32 = 4;
300pub const NRF_ERROR_NOT_FOUND: u32 = 5;
301pub const NRF_ERROR_NOT_SUPPORTED: u32 = 6;
302pub const NRF_ERROR_INVALID_PARAM: u32 = 7;
303pub const NRF_ERROR_INVALID_STATE: u32 = 8;
304pub const NRF_ERROR_INVALID_LENGTH: u32 = 9;
305pub const NRF_ERROR_INVALID_FLAGS: u32 = 10;
306pub const NRF_ERROR_INVALID_DATA: u32 = 11;
307pub const NRF_ERROR_DATA_SIZE: u32 = 12;
308pub const NRF_ERROR_TIMEOUT: u32 = 13;
309pub const NRF_ERROR_NULL: u32 = 14;
310pub const NRF_ERROR_FORBIDDEN: u32 = 15;
311pub const NRF_ERROR_INVALID_ADDR: u32 = 16;
312pub const NRF_ERROR_BUSY: u32 = 17;
313pub const NRF_ERROR_CONN_COUNT: u32 = 18;
314pub const NRF_ERROR_RESOURCES: u32 = 19;
315pub const BLE_ERROR_NOT_ENABLED: u32 = 12289;
316pub const BLE_ERROR_INVALID_CONN_HANDLE: u32 = 12290;
317pub const BLE_ERROR_INVALID_ATTR_HANDLE: u32 = 12291;
318pub const BLE_ERROR_INVALID_ADV_HANDLE: u32 = 12292;
319pub const BLE_ERROR_INVALID_ROLE: u32 = 12293;
320pub const BLE_ERROR_BLOCKED_BY_OTHER_LINKS: u32 = 12294;
321pub const NRF_L2CAP_ERR_BASE: u32 = 12544;
322pub const NRF_GAP_ERR_BASE: u32 = 12800;
323pub const NRF_GATTC_ERR_BASE: u32 = 13056;
324pub const NRF_GATTS_ERR_BASE: u32 = 13312;
325pub const BLE_HCI_STATUS_CODE_SUCCESS: u32 = 0;
326pub const BLE_HCI_STATUS_CODE_UNKNOWN_BTLE_COMMAND: u32 = 1;
327pub const BLE_HCI_STATUS_CODE_UNKNOWN_CONNECTION_IDENTIFIER: u32 = 2;
328pub const BLE_HCI_AUTHENTICATION_FAILURE: u32 = 5;
329pub const BLE_HCI_STATUS_CODE_PIN_OR_KEY_MISSING: u32 = 6;
330pub const BLE_HCI_MEMORY_CAPACITY_EXCEEDED: u32 = 7;
331pub const BLE_HCI_CONNECTION_TIMEOUT: u32 = 8;
332pub const BLE_HCI_STATUS_CODE_COMMAND_DISALLOWED: u32 = 12;
333pub const BLE_HCI_STATUS_CODE_INVALID_BTLE_COMMAND_PARAMETERS: u32 = 18;
334pub const BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION: u32 = 19;
335pub const BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES: u32 = 20;
336pub const BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF: u32 = 21;
337pub const BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION: u32 = 22;
338pub const BLE_HCI_UNSUPPORTED_REMOTE_FEATURE: u32 = 26;
339pub const BLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS: u32 = 30;
340pub const BLE_HCI_STATUS_CODE_UNSPECIFIED_ERROR: u32 = 31;
341pub const BLE_HCI_STATUS_CODE_LMP_RESPONSE_TIMEOUT: u32 = 34;
342pub const BLE_HCI_STATUS_CODE_LMP_ERROR_TRANSACTION_COLLISION: u32 = 35;
343pub const BLE_HCI_STATUS_CODE_LMP_PDU_NOT_ALLOWED: u32 = 36;
344pub const BLE_HCI_INSTANT_PASSED: u32 = 40;
345pub const BLE_HCI_PAIRING_WITH_UNIT_KEY_UNSUPPORTED: u32 = 41;
346pub const BLE_HCI_DIFFERENT_TRANSACTION_COLLISION: u32 = 42;
347pub const BLE_HCI_PARAMETER_OUT_OF_MANDATORY_RANGE: u32 = 48;
348pub const BLE_HCI_CONTROLLER_BUSY: u32 = 58;
349pub const BLE_HCI_CONN_INTERVAL_UNACCEPTABLE: u32 = 59;
350pub const BLE_HCI_DIRECTED_ADVERTISER_TIMEOUT: u32 = 60;
351pub const BLE_HCI_CONN_TERMINATED_DUE_TO_MIC_FAILURE: u32 = 61;
352pub const BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED: u32 = 62;
353pub const BLE_SVC_BASE: u32 = 96;
354pub const BLE_SVC_LAST: u32 = 107;
355pub const BLE_GAP_SVC_BASE: u32 = 108;
356pub const BLE_GAP_SVC_LAST: u32 = 154;
357pub const BLE_GATTC_SVC_BASE: u32 = 155;
358pub const BLE_GATTC_SVC_LAST: u32 = 167;
359pub const BLE_GATTS_SVC_BASE: u32 = 168;
360pub const BLE_GATTS_SVC_LAST: u32 = 183;
361pub const BLE_L2CAP_SVC_BASE: u32 = 184;
362pub const BLE_L2CAP_SVC_LAST: u32 = 191;
363pub const BLE_EVT_INVALID: u32 = 0;
364pub const BLE_EVT_BASE: u32 = 1;
365pub const BLE_EVT_LAST: u32 = 15;
366pub const BLE_GAP_EVT_BASE: u32 = 16;
367pub const BLE_GAP_EVT_LAST: u32 = 47;
368pub const BLE_GATTC_EVT_BASE: u32 = 48;
369pub const BLE_GATTC_EVT_LAST: u32 = 79;
370pub const BLE_GATTS_EVT_BASE: u32 = 80;
371pub const BLE_GATTS_EVT_LAST: u32 = 111;
372pub const BLE_L2CAP_EVT_BASE: u32 = 112;
373pub const BLE_L2CAP_EVT_LAST: u32 = 143;
374pub const BLE_OPT_INVALID: u32 = 0;
375pub const BLE_OPT_BASE: u32 = 1;
376pub const BLE_OPT_LAST: u32 = 31;
377pub const BLE_GAP_OPT_BASE: u32 = 32;
378pub const BLE_GAP_OPT_LAST: u32 = 63;
379pub const BLE_GATT_OPT_BASE: u32 = 64;
380pub const BLE_GATT_OPT_LAST: u32 = 95;
381pub const BLE_GATTC_OPT_BASE: u32 = 96;
382pub const BLE_GATTC_OPT_LAST: u32 = 127;
383pub const BLE_GATTS_OPT_BASE: u32 = 128;
384pub const BLE_GATTS_OPT_LAST: u32 = 159;
385pub const BLE_L2CAP_OPT_BASE: u32 = 160;
386pub const BLE_L2CAP_OPT_LAST: u32 = 191;
387pub const BLE_CFG_INVALID: u32 = 0;
388pub const BLE_CFG_BASE: u32 = 1;
389pub const BLE_CFG_LAST: u32 = 31;
390pub const BLE_CONN_CFG_BASE: u32 = 32;
391pub const BLE_CONN_CFG_LAST: u32 = 63;
392pub const BLE_GAP_CFG_BASE: u32 = 64;
393pub const BLE_GAP_CFG_LAST: u32 = 95;
394pub const BLE_GATT_CFG_BASE: u32 = 96;
395pub const BLE_GATT_CFG_LAST: u32 = 127;
396pub const BLE_GATTC_CFG_BASE: u32 = 128;
397pub const BLE_GATTC_CFG_LAST: u32 = 159;
398pub const BLE_GATTS_CFG_BASE: u32 = 160;
399pub const BLE_GATTS_CFG_LAST: u32 = 191;
400pub const BLE_L2CAP_CFG_BASE: u32 = 192;
401pub const BLE_L2CAP_CFG_LAST: u32 = 223;
402pub const BLE_CONN_HANDLE_INVALID: u32 = 65535;
403pub const BLE_CONN_HANDLE_ALL: u32 = 65534;
404pub const BLE_UUID_UNKNOWN: u32 = 0;
405pub const BLE_UUID_SERVICE_PRIMARY: u32 = 10240;
406pub const BLE_UUID_SERVICE_SECONDARY: u32 = 10241;
407pub const BLE_UUID_SERVICE_INCLUDE: u32 = 10242;
408pub const BLE_UUID_CHARACTERISTIC: u32 = 10243;
409pub const BLE_UUID_DESCRIPTOR_CHAR_EXT_PROP: u32 = 10496;
410pub const BLE_UUID_DESCRIPTOR_CHAR_USER_DESC: u32 = 10497;
411pub const BLE_UUID_DESCRIPTOR_CLIENT_CHAR_CONFIG: u32 = 10498;
412pub const BLE_UUID_DESCRIPTOR_SERVER_CHAR_CONFIG: u32 = 10499;
413pub const BLE_UUID_DESCRIPTOR_CHAR_PRESENTATION_FORMAT: u32 = 10500;
414pub const BLE_UUID_DESCRIPTOR_CHAR_AGGREGATE_FORMAT: u32 = 10501;
415pub const BLE_UUID_GATT: u32 = 6145;
416pub const BLE_UUID_GATT_CHARACTERISTIC_SERVICE_CHANGED: u32 = 10757;
417pub const BLE_UUID_GAP: u32 = 6144;
418pub const BLE_UUID_GAP_CHARACTERISTIC_DEVICE_NAME: u32 = 10752;
419pub const BLE_UUID_GAP_CHARACTERISTIC_APPEARANCE: u32 = 10753;
420pub const BLE_UUID_GAP_CHARACTERISTIC_RECONN_ADDR: u32 = 10755;
421pub const BLE_UUID_GAP_CHARACTERISTIC_PPCP: u32 = 10756;
422pub const BLE_UUID_GAP_CHARACTERISTIC_CAR: u32 = 10918;
423pub const BLE_UUID_GAP_CHARACTERISTIC_RPA_ONLY: u32 = 10953;
424pub const BLE_UUID_TYPE_UNKNOWN: u32 = 0;
425pub const BLE_UUID_TYPE_BLE: u32 = 1;
426pub const BLE_UUID_TYPE_VENDOR_BEGIN: u32 = 2;
427pub const BLE_APPEARANCE_UNKNOWN: u32 = 0;
428pub const BLE_APPEARANCE_GENERIC_PHONE: u32 = 64;
429pub const BLE_APPEARANCE_GENERIC_COMPUTER: u32 = 128;
430pub const BLE_APPEARANCE_GENERIC_WATCH: u32 = 192;
431pub const BLE_APPEARANCE_WATCH_SPORTS_WATCH: u32 = 193;
432pub const BLE_APPEARANCE_GENERIC_CLOCK: u32 = 256;
433pub const BLE_APPEARANCE_GENERIC_DISPLAY: u32 = 320;
434pub const BLE_APPEARANCE_GENERIC_REMOTE_CONTROL: u32 = 384;
435pub const BLE_APPEARANCE_GENERIC_EYE_GLASSES: u32 = 448;
436pub const BLE_APPEARANCE_GENERIC_TAG: u32 = 512;
437pub const BLE_APPEARANCE_GENERIC_KEYRING: u32 = 576;
438pub const BLE_APPEARANCE_GENERIC_MEDIA_PLAYER: u32 = 640;
439pub const BLE_APPEARANCE_GENERIC_BARCODE_SCANNER: u32 = 704;
440pub const BLE_APPEARANCE_GENERIC_THERMOMETER: u32 = 768;
441pub const BLE_APPEARANCE_THERMOMETER_EAR: u32 = 769;
442pub const BLE_APPEARANCE_GENERIC_HEART_RATE_SENSOR: u32 = 832;
443pub const BLE_APPEARANCE_HEART_RATE_SENSOR_HEART_RATE_BELT: u32 = 833;
444pub const BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE: u32 = 896;
445pub const BLE_APPEARANCE_BLOOD_PRESSURE_ARM: u32 = 897;
446pub const BLE_APPEARANCE_BLOOD_PRESSURE_WRIST: u32 = 898;
447pub const BLE_APPEARANCE_GENERIC_HID: u32 = 960;
448pub const BLE_APPEARANCE_HID_KEYBOARD: u32 = 961;
449pub const BLE_APPEARANCE_HID_MOUSE: u32 = 962;
450pub const BLE_APPEARANCE_HID_JOYSTICK: u32 = 963;
451pub const BLE_APPEARANCE_HID_GAMEPAD: u32 = 964;
452pub const BLE_APPEARANCE_HID_DIGITIZERSUBTYPE: u32 = 965;
453pub const BLE_APPEARANCE_HID_CARD_READER: u32 = 966;
454pub const BLE_APPEARANCE_HID_DIGITAL_PEN: u32 = 967;
455pub const BLE_APPEARANCE_HID_BARCODE: u32 = 968;
456pub const BLE_APPEARANCE_GENERIC_GLUCOSE_METER: u32 = 1024;
457pub const BLE_APPEARANCE_GENERIC_RUNNING_WALKING_SENSOR: u32 = 1088;
458pub const BLE_APPEARANCE_RUNNING_WALKING_SENSOR_IN_SHOE: u32 = 1089;
459pub const BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_SHOE: u32 = 1090;
460pub const BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_HIP: u32 = 1091;
461pub const BLE_APPEARANCE_GENERIC_CYCLING: u32 = 1152;
462pub const BLE_APPEARANCE_CYCLING_CYCLING_COMPUTER: u32 = 1153;
463pub const BLE_APPEARANCE_CYCLING_SPEED_SENSOR: u32 = 1154;
464pub const BLE_APPEARANCE_CYCLING_CADENCE_SENSOR: u32 = 1155;
465pub const BLE_APPEARANCE_CYCLING_POWER_SENSOR: u32 = 1156;
466pub const BLE_APPEARANCE_CYCLING_SPEED_CADENCE_SENSOR: u32 = 1157;
467pub const BLE_APPEARANCE_GENERIC_PULSE_OXIMETER: u32 = 3136;
468pub const BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP: u32 = 3137;
469pub const BLE_APPEARANCE_PULSE_OXIMETER_WRIST_WORN: u32 = 3138;
470pub const BLE_APPEARANCE_GENERIC_WEIGHT_SCALE: u32 = 3200;
471pub const BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS_ACT: u32 = 5184;
472pub const BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_DISP: u32 = 5185;
473pub const BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_DISP: u32 = 5186;
474pub const BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_POD: u32 = 5187;
475pub const BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_POD: u32 = 5188;
476pub const BLE_ERROR_GAP_UUID_LIST_MISMATCH: u32 = 12800;
477pub const BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST: u32 = 12801;
478pub const BLE_ERROR_GAP_INVALID_BLE_ADDR: u32 = 12802;
479pub const BLE_ERROR_GAP_WHITELIST_IN_USE: u32 = 12803;
480pub const BLE_ERROR_GAP_DEVICE_IDENTITIES_IN_USE: u32 = 12804;
481pub const BLE_ERROR_GAP_DEVICE_IDENTITIES_DUPLICATE: u32 = 12805;
482pub const BLE_GAP_ROLE_INVALID: u32 = 0;
483pub const BLE_GAP_ROLE_PERIPH: u32 = 1;
484pub const BLE_GAP_ROLE_CENTRAL: u32 = 2;
485pub const BLE_GAP_TIMEOUT_SRC_SCAN: u32 = 1;
486pub const BLE_GAP_TIMEOUT_SRC_CONN: u32 = 2;
487pub const BLE_GAP_TIMEOUT_SRC_AUTH_PAYLOAD: u32 = 3;
488pub const BLE_GAP_ADDR_TYPE_PUBLIC: u32 = 0;
489pub const BLE_GAP_ADDR_TYPE_RANDOM_STATIC: u32 = 1;
490pub const BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE: u32 = 2;
491pub const BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE: u32 = 3;
492pub const BLE_GAP_ADDR_TYPE_ANONYMOUS: u32 = 127;
493pub const BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S: u32 = 900;
494pub const BLE_GAP_MAX_PRIVATE_ADDR_CYCLE_INTERVAL_S: u32 = 41400;
495pub const BLE_GAP_ADDR_LEN: u32 = 6;
496pub const BLE_GAP_PRIVACY_MODE_OFF: u32 = 0;
497pub const BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY: u32 = 1;
498pub const BLE_GAP_PRIVACY_MODE_NETWORK_PRIVACY: u32 = 2;
499pub const BLE_GAP_POWER_LEVEL_INVALID: u32 = 127;
500pub const BLE_GAP_ADV_SET_HANDLE_NOT_SET: u32 = 255;
501pub const BLE_GAP_ADV_SET_COUNT_DEFAULT: u32 = 1;
502pub const BLE_GAP_ADV_SET_COUNT_MAX: u32 = 1;
503pub const BLE_GAP_ADV_SET_DATA_SIZE_MAX: u32 = 31;
504pub const BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED: u32 = 255;
505pub const BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_CONNECTABLE_MAX_SUPPORTED: u32 = 238;
506pub const BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE: u32 = 255;
507pub const BLE_GAP_EVT_ADV_SET_TERMINATED_REASON_TIMEOUT: u32 = 1;
508pub const BLE_GAP_EVT_ADV_SET_TERMINATED_REASON_LIMIT_REACHED: u32 = 2;
509pub const BLE_GAP_AD_TYPE_FLAGS: u32 = 1;
510pub const BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_MORE_AVAILABLE: u32 = 2;
511pub const BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_COMPLETE: u32 = 3;
512pub const BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_MORE_AVAILABLE: u32 = 4;
513pub const BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_COMPLETE: u32 = 5;
514pub const BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE: u32 = 6;
515pub const BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE: u32 = 7;
516pub const BLE_GAP_AD_TYPE_SHORT_LOCAL_NAME: u32 = 8;
517pub const BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME: u32 = 9;
518pub const BLE_GAP_AD_TYPE_TX_POWER_LEVEL: u32 = 10;
519pub const BLE_GAP_AD_TYPE_CLASS_OF_DEVICE: u32 = 13;
520pub const BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C: u32 = 14;
521pub const BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R: u32 = 15;
522pub const BLE_GAP_AD_TYPE_SECURITY_MANAGER_TK_VALUE: u32 = 16;
523pub const BLE_GAP_AD_TYPE_SECURITY_MANAGER_OOB_FLAGS: u32 = 17;
524pub const BLE_GAP_AD_TYPE_SLAVE_CONNECTION_INTERVAL_RANGE: u32 = 18;
525pub const BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_16BIT: u32 = 20;
526pub const BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_128BIT: u32 = 21;
527pub const BLE_GAP_AD_TYPE_SERVICE_DATA: u32 = 22;
528pub const BLE_GAP_AD_TYPE_PUBLIC_TARGET_ADDRESS: u32 = 23;
529pub const BLE_GAP_AD_TYPE_RANDOM_TARGET_ADDRESS: u32 = 24;
530pub const BLE_GAP_AD_TYPE_APPEARANCE: u32 = 25;
531pub const BLE_GAP_AD_TYPE_ADVERTISING_INTERVAL: u32 = 26;
532pub const BLE_GAP_AD_TYPE_LE_BLUETOOTH_DEVICE_ADDRESS: u32 = 27;
533pub const BLE_GAP_AD_TYPE_LE_ROLE: u32 = 28;
534pub const BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C256: u32 = 29;
535pub const BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R256: u32 = 30;
536pub const BLE_GAP_AD_TYPE_SERVICE_DATA_32BIT_UUID: u32 = 32;
537pub const BLE_GAP_AD_TYPE_SERVICE_DATA_128BIT_UUID: u32 = 33;
538pub const BLE_GAP_AD_TYPE_LESC_CONFIRMATION_VALUE: u32 = 34;
539pub const BLE_GAP_AD_TYPE_LESC_RANDOM_VALUE: u32 = 35;
540pub const BLE_GAP_AD_TYPE_URI: u32 = 36;
541pub const BLE_GAP_AD_TYPE_3D_INFORMATION_DATA: u32 = 61;
542pub const BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA: u32 = 255;
543pub const BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE: u32 = 1;
544pub const BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE: u32 = 2;
545pub const BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED: u32 = 4;
546pub const BLE_GAP_ADV_FLAG_LE_BR_EDR_CONTROLLER: u32 = 8;
547pub const BLE_GAP_ADV_FLAG_LE_BR_EDR_HOST: u32 = 16;
548pub const BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE: u32 = 5;
549pub const BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE: u32 = 6;
550pub const BLE_GAP_ADV_INTERVAL_MIN: u32 = 32;
551pub const BLE_GAP_ADV_INTERVAL_MAX: u32 = 16384;
552pub const BLE_GAP_SCAN_INTERVAL_MIN: u32 = 4;
553pub const BLE_GAP_SCAN_INTERVAL_MAX: u32 = 65535;
554pub const BLE_GAP_SCAN_WINDOW_MIN: u32 = 4;
555pub const BLE_GAP_SCAN_WINDOW_MAX: u32 = 65535;
556pub const BLE_GAP_SCAN_TIMEOUT_MIN: u32 = 1;
557pub const BLE_GAP_SCAN_TIMEOUT_UNLIMITED: u32 = 0;
558pub const BLE_GAP_SCAN_BUFFER_MIN: u32 = 31;
559pub const BLE_GAP_SCAN_BUFFER_MAX: u32 = 31;
560pub const BLE_GAP_SCAN_BUFFER_EXTENDED_MIN: u32 = 255;
561pub const BLE_GAP_SCAN_BUFFER_EXTENDED_MAX: u32 = 1650;
562pub const BLE_GAP_SCAN_BUFFER_EXTENDED_MAX_SUPPORTED: u32 = 255;
563pub const BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED: u32 = 1;
564pub const BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE: u32 = 2;
565pub const BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED: u32 = 3;
566pub const BLE_GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED: u32 = 4;
567pub const BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED: u32 = 5;
568pub const BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED: u32 = 6;
569pub const BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_DIRECTED: u32 = 7;
570pub const BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_UNDIRECTED: u32 = 8;
571pub const BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_DIRECTED: u32 = 9;
572pub const BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED: u32 = 10;
573pub const BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_DIRECTED: u32 = 11;
574pub const BLE_GAP_ADV_FP_ANY: u32 = 0;
575pub const BLE_GAP_ADV_FP_FILTER_SCANREQ: u32 = 1;
576pub const BLE_GAP_ADV_FP_FILTER_CONNREQ: u32 = 2;
577pub const BLE_GAP_ADV_FP_FILTER_BOTH: u32 = 3;
578pub const BLE_GAP_ADV_DATA_STATUS_COMPLETE: u32 = 0;
579pub const BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA: u32 = 1;
580pub const BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_TRUNCATED: u32 = 2;
581pub const BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MISSED: u32 = 3;
582pub const BLE_GAP_SCAN_FP_ACCEPT_ALL: u32 = 0;
583pub const BLE_GAP_SCAN_FP_WHITELIST: u32 = 1;
584pub const BLE_GAP_SCAN_FP_ALL_NOT_RESOLVED_DIRECTED: u32 = 2;
585pub const BLE_GAP_SCAN_FP_WHITELIST_NOT_RESOLVED_DIRECTED: u32 = 3;
586pub const BLE_GAP_ADV_TIMEOUT_HIGH_DUTY_MAX: u32 = 128;
587pub const BLE_GAP_ADV_TIMEOUT_LIMITED_MAX: u32 = 18000;
588pub const BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED: u32 = 0;
589pub const BLE_GAP_DISC_MODE_NOT_DISCOVERABLE: u32 = 0;
590pub const BLE_GAP_DISC_MODE_LIMITED: u32 = 1;
591pub const BLE_GAP_DISC_MODE_GENERAL: u32 = 2;
592pub const BLE_GAP_IO_CAPS_DISPLAY_ONLY: u32 = 0;
593pub const BLE_GAP_IO_CAPS_DISPLAY_YESNO: u32 = 1;
594pub const BLE_GAP_IO_CAPS_KEYBOARD_ONLY: u32 = 2;
595pub const BLE_GAP_IO_CAPS_NONE: u32 = 3;
596pub const BLE_GAP_IO_CAPS_KEYBOARD_DISPLAY: u32 = 4;
597pub const BLE_GAP_AUTH_KEY_TYPE_NONE: u32 = 0;
598pub const BLE_GAP_AUTH_KEY_TYPE_PASSKEY: u32 = 1;
599pub const BLE_GAP_AUTH_KEY_TYPE_OOB: u32 = 2;
600pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_START: u32 = 0;
601pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_DIGIT_IN: u32 = 1;
602pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_DIGIT_OUT: u32 = 2;
603pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_CLEAR: u32 = 3;
604pub const BLE_GAP_KP_NOT_TYPE_PASSKEY_END: u32 = 4;
605pub const BLE_GAP_SEC_STATUS_SUCCESS: u32 = 0;
606pub const BLE_GAP_SEC_STATUS_TIMEOUT: u32 = 1;
607pub const BLE_GAP_SEC_STATUS_PDU_INVALID: u32 = 2;
608pub const BLE_GAP_SEC_STATUS_RFU_RANGE1_BEGIN: u32 = 3;
609pub const BLE_GAP_SEC_STATUS_RFU_RANGE1_END: u32 = 128;
610pub const BLE_GAP_SEC_STATUS_PASSKEY_ENTRY_FAILED: u32 = 129;
611pub const BLE_GAP_SEC_STATUS_OOB_NOT_AVAILABLE: u32 = 130;
612pub const BLE_GAP_SEC_STATUS_AUTH_REQ: u32 = 131;
613pub const BLE_GAP_SEC_STATUS_CONFIRM_VALUE: u32 = 132;
614pub const BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP: u32 = 133;
615pub const BLE_GAP_SEC_STATUS_ENC_KEY_SIZE: u32 = 134;
616pub const BLE_GAP_SEC_STATUS_SMP_CMD_UNSUPPORTED: u32 = 135;
617pub const BLE_GAP_SEC_STATUS_UNSPECIFIED: u32 = 136;
618pub const BLE_GAP_SEC_STATUS_REPEATED_ATTEMPTS: u32 = 137;
619pub const BLE_GAP_SEC_STATUS_INVALID_PARAMS: u32 = 138;
620pub const BLE_GAP_SEC_STATUS_DHKEY_FAILURE: u32 = 139;
621pub const BLE_GAP_SEC_STATUS_NUM_COMP_FAILURE: u32 = 140;
622pub const BLE_GAP_SEC_STATUS_BR_EDR_IN_PROG: u32 = 141;
623pub const BLE_GAP_SEC_STATUS_X_TRANS_KEY_DISALLOWED: u32 = 142;
624pub const BLE_GAP_SEC_STATUS_RFU_RANGE2_BEGIN: u32 = 143;
625pub const BLE_GAP_SEC_STATUS_RFU_RANGE2_END: u32 = 255;
626pub const BLE_GAP_SEC_STATUS_SOURCE_LOCAL: u32 = 0;
627pub const BLE_GAP_SEC_STATUS_SOURCE_REMOTE: u32 = 1;
628pub const BLE_GAP_CP_MIN_CONN_INTVL_NONE: u32 = 65535;
629pub const BLE_GAP_CP_MIN_CONN_INTVL_MIN: u32 = 6;
630pub const BLE_GAP_CP_MIN_CONN_INTVL_MAX: u32 = 3200;
631pub const BLE_GAP_CP_MAX_CONN_INTVL_NONE: u32 = 65535;
632pub const BLE_GAP_CP_MAX_CONN_INTVL_MIN: u32 = 6;
633pub const BLE_GAP_CP_MAX_CONN_INTVL_MAX: u32 = 3200;
634pub const BLE_GAP_CP_SLAVE_LATENCY_MAX: u32 = 499;
635pub const BLE_GAP_CP_CONN_SUP_TIMEOUT_NONE: u32 = 65535;
636pub const BLE_GAP_CP_CONN_SUP_TIMEOUT_MIN: u32 = 10;
637pub const BLE_GAP_CP_CONN_SUP_TIMEOUT_MAX: u32 = 3200;
638pub const BLE_GAP_DEVNAME_DEFAULT: &'static [u8; 6usize] = b"nRF5x\0";
639pub const BLE_GAP_DEVNAME_DEFAULT_LEN: u32 = 31;
640pub const BLE_GAP_DEVNAME_MAX_LEN: u32 = 248;
641pub const BLE_GAP_RSSI_THRESHOLD_INVALID: u32 = 255;
642pub const BLE_GAP_PHY_AUTO: u32 = 0;
643pub const BLE_GAP_PHY_1MBPS: u32 = 1;
644pub const BLE_GAP_PHY_2MBPS: u32 = 2;
645pub const BLE_GAP_PHY_CODED: u32 = 4;
646pub const BLE_GAP_PHY_NOT_SET: u32 = 255;
647pub const BLE_GAP_PHYS_SUPPORTED: u32 = 7;
648pub const BLE_GAP_SEC_RAND_LEN: u32 = 8;
649pub const BLE_GAP_SEC_KEY_LEN: u32 = 16;
650pub const BLE_GAP_LESC_P256_PK_LEN: u32 = 64;
651pub const BLE_GAP_LESC_DHKEY_LEN: u32 = 32;
652pub const BLE_GAP_PASSKEY_LEN: u32 = 6;
653pub const BLE_GAP_WHITELIST_ADDR_MAX_COUNT: u32 = 8;
654pub const BLE_GAP_DEVICE_IDENTITIES_MAX_COUNT: u32 = 8;
655pub const BLE_GAP_CONN_COUNT_DEFAULT: u32 = 1;
656pub const BLE_GAP_EVENT_LENGTH_MIN: u32 = 2;
657pub const BLE_GAP_EVENT_LENGTH_CODED_PHY_MIN: u32 = 6;
658pub const BLE_GAP_EVENT_LENGTH_DEFAULT: u32 = 3;
659pub const BLE_GAP_ROLE_COUNT_PERIPH_DEFAULT: u32 = 1;
660pub const BLE_GAP_ROLE_COUNT_CENTRAL_DEFAULT: u32 = 3;
661pub const BLE_GAP_ROLE_COUNT_CENTRAL_SEC_DEFAULT: u32 = 1;
662pub const BLE_GAP_ROLE_COUNT_COMBINED_MAX: u32 = 20;
663pub const BLE_GAP_DATA_LENGTH_AUTO: u32 = 0;
664pub const BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MAX: u32 = 48000;
665pub const BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MIN: u32 = 1;
666pub const BLE_GAP_SEC_MODE: u32 = 0;
667pub const BLE_GAP_CHANNEL_COUNT: u32 = 40;
668pub const BLE_GAP_QOS_CHANNEL_SURVEY_INTERVAL_CONTINUOUS: u32 = 0;
669pub const BLE_GAP_QOS_CHANNEL_SURVEY_INTERVAL_MIN_US: u32 = 7500;
670pub const BLE_GAP_QOS_CHANNEL_SURVEY_INTERVAL_MAX_US: u32 = 4000000;
671pub const BLE_GAP_CHAR_INCL_CONFIG_INCLUDE: u32 = 0;
672pub const BLE_GAP_CHAR_INCL_CONFIG_EXCLUDE_WITH_SPACE: u32 = 1;
673pub const BLE_GAP_CHAR_INCL_CONFIG_EXCLUDE_WITHOUT_SPACE: u32 = 2;
674pub const BLE_GAP_PPCP_INCL_CONFIG_DEFAULT: u32 = 0;
675pub const BLE_GAP_CAR_INCL_CONFIG_DEFAULT: u32 = 0;
676pub const BLE_L2CAP_CH_COUNT_MAX: u32 = 64;
677pub const BLE_L2CAP_MTU_MIN: u32 = 23;
678pub const BLE_L2CAP_MPS_MIN: u32 = 23;
679pub const BLE_L2CAP_CID_INVALID: u32 = 0;
680pub const BLE_L2CAP_CREDITS_DEFAULT: u32 = 1;
681pub const BLE_L2CAP_CH_SETUP_REFUSED_SRC_LOCAL: u32 = 1;
682pub const BLE_L2CAP_CH_SETUP_REFUSED_SRC_REMOTE: u32 = 2;
683pub const BLE_L2CAP_CH_STATUS_CODE_SUCCESS: u32 = 0;
684pub const BLE_L2CAP_CH_STATUS_CODE_LE_PSM_NOT_SUPPORTED: u32 = 2;
685pub const BLE_L2CAP_CH_STATUS_CODE_NO_RESOURCES: u32 = 4;
686pub const BLE_L2CAP_CH_STATUS_CODE_INSUFF_AUTHENTICATION: u32 = 5;
687pub const BLE_L2CAP_CH_STATUS_CODE_INSUFF_AUTHORIZATION: u32 = 6;
688pub const BLE_L2CAP_CH_STATUS_CODE_INSUFF_ENC_KEY_SIZE: u32 = 7;
689pub const BLE_L2CAP_CH_STATUS_CODE_INSUFF_ENC: u32 = 8;
690pub const BLE_L2CAP_CH_STATUS_CODE_INVALID_SCID: u32 = 9;
691pub const BLE_L2CAP_CH_STATUS_CODE_SCID_ALLOCATED: u32 = 10;
692pub const BLE_L2CAP_CH_STATUS_CODE_UNACCEPTABLE_PARAMS: u32 = 11;
693pub const BLE_L2CAP_CH_STATUS_CODE_NOT_UNDERSTOOD: u32 = 32768;
694pub const BLE_L2CAP_CH_STATUS_CODE_TIMEOUT: u32 = 49152;
695pub const BLE_GATT_ATT_MTU_DEFAULT: u32 = 23;
696pub const BLE_GATT_HANDLE_INVALID: u32 = 0;
697pub const BLE_GATT_HANDLE_START: u32 = 1;
698pub const BLE_GATT_HANDLE_END: u32 = 65535;
699pub const BLE_GATT_TIMEOUT_SRC_PROTOCOL: u32 = 0;
700pub const BLE_GATT_OP_INVALID: u32 = 0;
701pub const BLE_GATT_OP_WRITE_REQ: u32 = 1;
702pub const BLE_GATT_OP_WRITE_CMD: u32 = 2;
703pub const BLE_GATT_OP_SIGN_WRITE_CMD: u32 = 3;
704pub const BLE_GATT_OP_PREP_WRITE_REQ: u32 = 4;
705pub const BLE_GATT_OP_EXEC_WRITE_REQ: u32 = 5;
706pub const BLE_GATT_EXEC_WRITE_FLAG_PREPARED_CANCEL: u32 = 0;
707pub const BLE_GATT_EXEC_WRITE_FLAG_PREPARED_WRITE: u32 = 1;
708pub const BLE_GATT_HVX_INVALID: u32 = 0;
709pub const BLE_GATT_HVX_NOTIFICATION: u32 = 1;
710pub const BLE_GATT_HVX_INDICATION: u32 = 2;
711pub const BLE_GATT_STATUS_SUCCESS: u32 = 0;
712pub const BLE_GATT_STATUS_UNKNOWN: u32 = 1;
713pub const BLE_GATT_STATUS_ATTERR_INVALID: u32 = 256;
714pub const BLE_GATT_STATUS_ATTERR_INVALID_HANDLE: u32 = 257;
715pub const BLE_GATT_STATUS_ATTERR_READ_NOT_PERMITTED: u32 = 258;
716pub const BLE_GATT_STATUS_ATTERR_WRITE_NOT_PERMITTED: u32 = 259;
717pub const BLE_GATT_STATUS_ATTERR_INVALID_PDU: u32 = 260;
718pub const BLE_GATT_STATUS_ATTERR_INSUF_AUTHENTICATION: u32 = 261;
719pub const BLE_GATT_STATUS_ATTERR_REQUEST_NOT_SUPPORTED: u32 = 262;
720pub const BLE_GATT_STATUS_ATTERR_INVALID_OFFSET: u32 = 263;
721pub const BLE_GATT_STATUS_ATTERR_INSUF_AUTHORIZATION: u32 = 264;
722pub const BLE_GATT_STATUS_ATTERR_PREPARE_QUEUE_FULL: u32 = 265;
723pub const BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_FOUND: u32 = 266;
724pub const BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_LONG: u32 = 267;
725pub const BLE_GATT_STATUS_ATTERR_INSUF_ENC_KEY_SIZE: u32 = 268;
726pub const BLE_GATT_STATUS_ATTERR_INVALID_ATT_VAL_LENGTH: u32 = 269;
727pub const BLE_GATT_STATUS_ATTERR_UNLIKELY_ERROR: u32 = 270;
728pub const BLE_GATT_STATUS_ATTERR_INSUF_ENCRYPTION: u32 = 271;
729pub const BLE_GATT_STATUS_ATTERR_UNSUPPORTED_GROUP_TYPE: u32 = 272;
730pub const BLE_GATT_STATUS_ATTERR_INSUF_RESOURCES: u32 = 273;
731pub const BLE_GATT_STATUS_ATTERR_RFU_RANGE1_BEGIN: u32 = 274;
732pub const BLE_GATT_STATUS_ATTERR_RFU_RANGE1_END: u32 = 383;
733pub const BLE_GATT_STATUS_ATTERR_APP_BEGIN: u32 = 384;
734pub const BLE_GATT_STATUS_ATTERR_APP_END: u32 = 415;
735pub const BLE_GATT_STATUS_ATTERR_RFU_RANGE2_BEGIN: u32 = 416;
736pub const BLE_GATT_STATUS_ATTERR_RFU_RANGE2_END: u32 = 479;
737pub const BLE_GATT_STATUS_ATTERR_RFU_RANGE3_BEGIN: u32 = 480;
738pub const BLE_GATT_STATUS_ATTERR_RFU_RANGE3_END: u32 = 508;
739pub const BLE_GATT_STATUS_ATTERR_CPS_WRITE_REQ_REJECTED: u32 = 508;
740pub const BLE_GATT_STATUS_ATTERR_CPS_CCCD_CONFIG_ERROR: u32 = 509;
741pub const BLE_GATT_STATUS_ATTERR_CPS_PROC_ALR_IN_PROG: u32 = 510;
742pub const BLE_GATT_STATUS_ATTERR_CPS_OUT_OF_RANGE: u32 = 511;
743pub const BLE_GATT_CPF_FORMAT_RFU: u32 = 0;
744pub const BLE_GATT_CPF_FORMAT_BOOLEAN: u32 = 1;
745pub const BLE_GATT_CPF_FORMAT_2BIT: u32 = 2;
746pub const BLE_GATT_CPF_FORMAT_NIBBLE: u32 = 3;
747pub const BLE_GATT_CPF_FORMAT_UINT8: u32 = 4;
748pub const BLE_GATT_CPF_FORMAT_UINT12: u32 = 5;
749pub const BLE_GATT_CPF_FORMAT_UINT16: u32 = 6;
750pub const BLE_GATT_CPF_FORMAT_UINT24: u32 = 7;
751pub const BLE_GATT_CPF_FORMAT_UINT32: u32 = 8;
752pub const BLE_GATT_CPF_FORMAT_UINT48: u32 = 9;
753pub const BLE_GATT_CPF_FORMAT_UINT64: u32 = 10;
754pub const BLE_GATT_CPF_FORMAT_UINT128: u32 = 11;
755pub const BLE_GATT_CPF_FORMAT_SINT8: u32 = 12;
756pub const BLE_GATT_CPF_FORMAT_SINT12: u32 = 13;
757pub const BLE_GATT_CPF_FORMAT_SINT16: u32 = 14;
758pub const BLE_GATT_CPF_FORMAT_SINT24: u32 = 15;
759pub const BLE_GATT_CPF_FORMAT_SINT32: u32 = 16;
760pub const BLE_GATT_CPF_FORMAT_SINT48: u32 = 17;
761pub const BLE_GATT_CPF_FORMAT_SINT64: u32 = 18;
762pub const BLE_GATT_CPF_FORMAT_SINT128: u32 = 19;
763pub const BLE_GATT_CPF_FORMAT_FLOAT32: u32 = 20;
764pub const BLE_GATT_CPF_FORMAT_FLOAT64: u32 = 21;
765pub const BLE_GATT_CPF_FORMAT_SFLOAT: u32 = 22;
766pub const BLE_GATT_CPF_FORMAT_FLOAT: u32 = 23;
767pub const BLE_GATT_CPF_FORMAT_DUINT16: u32 = 24;
768pub const BLE_GATT_CPF_FORMAT_UTF8S: u32 = 25;
769pub const BLE_GATT_CPF_FORMAT_UTF16S: u32 = 26;
770pub const BLE_GATT_CPF_FORMAT_STRUCT: u32 = 27;
771pub const BLE_GATT_CPF_NAMESPACE_BTSIG: u32 = 1;
772pub const BLE_GATT_CPF_NAMESPACE_DESCRIPTION_UNKNOWN: u32 = 0;
773pub const BLE_ERROR_GATTC_PROC_NOT_PERMITTED: u32 = 13056;
774pub const BLE_GATTC_ATTR_INFO_FORMAT_16BIT: u32 = 1;
775pub const BLE_GATTC_ATTR_INFO_FORMAT_128BIT: u32 = 2;
776pub const BLE_GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT: u32 = 1;
777pub const BLE_ERROR_GATTS_INVALID_ATTR_TYPE: u32 = 13312;
778pub const BLE_ERROR_GATTS_SYS_ATTR_MISSING: u32 = 13313;
779pub const BLE_GATTS_FIX_ATTR_LEN_MAX: u32 = 510;
780pub const BLE_GATTS_VAR_ATTR_LEN_MAX: u32 = 512;
781pub const BLE_GATTS_SRVC_TYPE_INVALID: u32 = 0;
782pub const BLE_GATTS_SRVC_TYPE_PRIMARY: u32 = 1;
783pub const BLE_GATTS_SRVC_TYPE_SECONDARY: u32 = 2;
784pub const BLE_GATTS_ATTR_TYPE_INVALID: u32 = 0;
785pub const BLE_GATTS_ATTR_TYPE_PRIM_SRVC_DECL: u32 = 1;
786pub const BLE_GATTS_ATTR_TYPE_SEC_SRVC_DECL: u32 = 2;
787pub const BLE_GATTS_ATTR_TYPE_INC_DECL: u32 = 3;
788pub const BLE_GATTS_ATTR_TYPE_CHAR_DECL: u32 = 4;
789pub const BLE_GATTS_ATTR_TYPE_CHAR_VAL: u32 = 5;
790pub const BLE_GATTS_ATTR_TYPE_DESC: u32 = 6;
791pub const BLE_GATTS_ATTR_TYPE_OTHER: u32 = 7;
792pub const BLE_GATTS_OP_INVALID: u32 = 0;
793pub const BLE_GATTS_OP_WRITE_REQ: u32 = 1;
794pub const BLE_GATTS_OP_WRITE_CMD: u32 = 2;
795pub const BLE_GATTS_OP_SIGN_WRITE_CMD: u32 = 3;
796pub const BLE_GATTS_OP_PREP_WRITE_REQ: u32 = 4;
797pub const BLE_GATTS_OP_EXEC_WRITE_REQ_CANCEL: u32 = 5;
798pub const BLE_GATTS_OP_EXEC_WRITE_REQ_NOW: u32 = 6;
799pub const BLE_GATTS_VLOC_INVALID: u32 = 0;
800pub const BLE_GATTS_VLOC_STACK: u32 = 1;
801pub const BLE_GATTS_VLOC_USER: u32 = 2;
802pub const BLE_GATTS_AUTHORIZE_TYPE_INVALID: u32 = 0;
803pub const BLE_GATTS_AUTHORIZE_TYPE_READ: u32 = 1;
804pub const BLE_GATTS_AUTHORIZE_TYPE_WRITE: u32 = 2;
805pub const BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS: u32 = 1;
806pub const BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS: u32 = 2;
807pub const BLE_GATTS_SERVICE_CHANGED_DEFAULT: u32 = 1;
808pub const BLE_GATTS_ATTR_TAB_SIZE_MIN: u32 = 248;
809pub const BLE_GATTS_ATTR_TAB_SIZE_DEFAULT: u32 = 1408;
810pub const BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT: u32 = 1;
811pub const BLE_EVT_PTR_ALIGNMENT: u32 = 4;
812pub const BLE_USER_MEM_TYPE_INVALID: u32 = 0;
813pub const BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES: u32 = 1;
814pub const BLE_UUID_VS_COUNT_DEFAULT: u32 = 10;
815pub const BLE_UUID_VS_COUNT_MAX: u32 = 254;
816pub const BLE_CONN_CFG_TAG_DEFAULT: u32 = 0;
817pub const NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN: u32 = 8192;
818pub const NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE: u32 = 8193;
819pub const NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED: u32 = 8194;
820pub const NRF_ERROR_SOC_NVIC_SHOULD_NOT_RETURN: u32 = 8195;
821pub const NRF_ERROR_SOC_POWER_MODE_UNKNOWN: u32 = 8196;
822pub const NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN: u32 = 8197;
823pub const NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN: u32 = 8198;
824pub const NRF_ERROR_SOC_RAND_NOT_ENOUGH_VALUES: u32 = 8199;
825pub const NRF_ERROR_SOC_PPI_INVALID_CHANNEL: u32 = 8200;
826pub const NRF_ERROR_SOC_PPI_INVALID_GROUP: u32 = 8201;
827pub const SOC_SVC_BASE: u32 = 32;
828pub const SOC_SVC_BASE_NOT_AVAILABLE: u32 = 44;
829pub const NRF_RADIO_NOTIFICATION_INACTIVE_GUARANTEED_TIME_US: u32 = 62;
830pub const NRF_RADIO_MINIMUM_TIMESLOT_LENGTH_EXTENSION_TIME_US: u32 = 200;
831pub const NRF_RADIO_MAX_EXTENSION_PROCESSING_TIME_US: u32 = 20;
832pub const NRF_RADIO_MIN_EXTENSION_MARGIN_US: u32 = 82;
833pub const SOC_ECB_KEY_LENGTH: u32 = 16;
834pub const SOC_ECB_CLEARTEXT_LENGTH: u32 = 16;
835pub const SOC_ECB_CIPHERTEXT_LENGTH: u32 = 16;
836pub const NRF_RADIO_LENGTH_MIN_US: u32 = 100;
837pub const NRF_RADIO_LENGTH_MAX_US: u32 = 100000;
838pub const NRF_RADIO_DISTANCE_MAX_US: u32 = 127999999;
839pub const NRF_RADIO_EARLIEST_TIMEOUT_MAX_US: u32 = 127999999;
840pub const NRF_RADIO_START_JITTER_US: u32 = 2;
841pub const SD_TIMERS_USED: u32 = 1;
842pub const SD_SWI_USED: u32 = 54;
843pub const MBR_SVC_BASE: u32 = 24;
844pub const MBR_PAGE_SIZE_IN_WORDS: u32 = 1024;
845pub const MBR_SIZE: u32 = 4096;
846pub const MBR_BOOTLOADER_ADDR: u32 = 4088;
847pub const MBR_PARAM_PAGE_ADDR: u32 = 4092;
848pub const NRF_ERROR_SDM_LFCLK_SOURCE_UNKNOWN: u32 = 4096;
849pub const NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION: u32 = 4097;
850pub const NRF_ERROR_SDM_INCORRECT_CLENR0: u32 = 4098;
851pub const SD_MAJOR_VERSION: u32 = 7;
852pub const SD_MINOR_VERSION: u32 = 0;
853pub const SD_BUGFIX_VERSION: u32 = 1;
854pub const SD_VARIANT_ID: u32 = 140;
855pub const SD_VERSION: u32 = 7000001;
856pub const SDM_SVC_BASE: u32 = 16;
857pub const SD_UNIQUE_STR_SIZE: u32 = 20;
858pub const SDM_INFO_FIELD_INVALID: u32 = 0;
859pub const SOFTDEVICE_INFO_STRUCT_OFFSET: u32 = 8192;
860pub const SOFTDEVICE_INFO_STRUCT_ADDRESS: u32 = 12288;
861pub const SD_INFO_STRUCT_SIZE_OFFSET: u32 = 8192;
862pub const SD_SIZE_OFFSET: u32 = 8200;
863pub const SD_FWID_OFFSET: u32 = 8204;
864pub const SD_ID_OFFSET: u32 = 8208;
865pub const SD_VERSION_OFFSET: u32 = 8212;
866pub const SD_UNIQUE_STR_OFFSET: u32 = 8216;
867pub const SD_FLASH_SIZE: u32 = 155648;
868pub const NRF_FAULT_ID_SD_RANGE_START: u32 = 0;
869pub const NRF_FAULT_ID_APP_RANGE_START: u32 = 4096;
870pub const NRF_FAULT_ID_SD_ASSERT: u32 = 1;
871pub const NRF_FAULT_ID_APP_MEMACC: u32 = 4097;
872pub const NRF_CLOCK_LF_ACCURACY_250_PPM: u32 = 0;
873pub const NRF_CLOCK_LF_ACCURACY_500_PPM: u32 = 1;
874pub const NRF_CLOCK_LF_ACCURACY_150_PPM: u32 = 2;
875pub const NRF_CLOCK_LF_ACCURACY_100_PPM: u32 = 3;
876pub const NRF_CLOCK_LF_ACCURACY_75_PPM: u32 = 4;
877pub const NRF_CLOCK_LF_ACCURACY_50_PPM: u32 = 5;
878pub const NRF_CLOCK_LF_ACCURACY_30_PPM: u32 = 6;
879pub const NRF_CLOCK_LF_ACCURACY_20_PPM: u32 = 7;
880pub const NRF_CLOCK_LF_ACCURACY_10_PPM: u32 = 8;
881pub const NRF_CLOCK_LF_ACCURACY_5_PPM: u32 = 9;
882pub const NRF_CLOCK_LF_ACCURACY_2_PPM: u32 = 10;
883pub const NRF_CLOCK_LF_ACCURACY_1_PPM: u32 = 11;
884pub const NRF_CLOCK_LF_SRC_RC: u32 = 0;
885pub const NRF_CLOCK_LF_SRC_XTAL: u32 = 1;
886pub const NRF_CLOCK_LF_SRC_SYNTH: u32 = 2;
887pub type int_least64_t = i64;
888pub type uint_least64_t = u64;
889pub type int_fast64_t = i64;
890pub type uint_fast64_t = u64;
891pub type int_least32_t = i32;
892pub type uint_least32_t = u32;
893pub type int_fast32_t = i32;
894pub type uint_fast32_t = u32;
895pub type int_least16_t = i16;
896pub type uint_least16_t = u16;
897pub type int_fast16_t = i16;
898pub type uint_fast16_t = u16;
899pub type int_least8_t = i8;
900pub type uint_least8_t = u8;
901pub type int_fast8_t = i8;
902pub type uint_fast8_t = u8;
903pub type intmax_t = self::c_longlong;
904pub type uintmax_t = self::c_ulonglong;
905#[doc = " @brief 128 bit UUID values."]
906#[repr(C)]
907#[derive(Debug, Copy, Clone)]
908pub struct ble_uuid128_t {
909 #[doc = "< Little-Endian UUID bytes."]
910 pub uuid128: [u8; 16usize],
911}
912#[test]
913fn bindgen_test_layout_ble_uuid128_t() {
914 assert_eq!(
915 ::core::mem::size_of::<ble_uuid128_t>(),
916 16usize,
917 concat!("Size of: ", stringify!(ble_uuid128_t))
918 );
919 assert_eq!(
920 ::core::mem::align_of::<ble_uuid128_t>(),
921 1usize,
922 concat!("Alignment of ", stringify!(ble_uuid128_t))
923 );
924 assert_eq!(
925 unsafe { &(*(::core::ptr::null::<ble_uuid128_t>())).uuid128 as *const _ as usize },
926 0usize,
927 concat!(
928 "Offset of field: ",
929 stringify!(ble_uuid128_t),
930 "::",
931 stringify!(uuid128)
932 )
933 );
934}
935#[doc = " @brief Bluetooth Low Energy UUID type, encapsulates both 16-bit and 128-bit UUIDs."]
936#[repr(C)]
937#[derive(Debug, Copy, Clone)]
938pub struct ble_uuid_t {
939 #[doc = "< 16-bit UUID value or octets 12-13 of 128-bit UUID."]
940 pub uuid: u16,
941 #[doc = "< UUID type, see @ref BLE_UUID_TYPES. If type is @ref BLE_UUID_TYPE_UNKNOWN, the value of uuid is undefined."]
942 pub type_: u8,
943}
944#[test]
945fn bindgen_test_layout_ble_uuid_t() {
946 assert_eq!(
947 ::core::mem::size_of::<ble_uuid_t>(),
948 4usize,
949 concat!("Size of: ", stringify!(ble_uuid_t))
950 );
951 assert_eq!(
952 ::core::mem::align_of::<ble_uuid_t>(),
953 2usize,
954 concat!("Alignment of ", stringify!(ble_uuid_t))
955 );
956 assert_eq!(
957 unsafe { &(*(::core::ptr::null::<ble_uuid_t>())).uuid as *const _ as usize },
958 0usize,
959 concat!("Offset of field: ", stringify!(ble_uuid_t), "::", stringify!(uuid))
960 );
961 assert_eq!(
962 unsafe { &(*(::core::ptr::null::<ble_uuid_t>())).type_ as *const _ as usize },
963 2usize,
964 concat!("Offset of field: ", stringify!(ble_uuid_t), "::", stringify!(type_))
965 );
966}
967#[doc = "@brief Data structure."]
968#[repr(C)]
969#[derive(Debug, Copy, Clone)]
970pub struct ble_data_t {
971 #[doc = "< Pointer to the data buffer provided to/from the application."]
972 pub p_data: *mut u8,
973 #[doc = "< Length of the data buffer, in bytes."]
974 pub len: u16,
975}
976#[test]
977fn bindgen_test_layout_ble_data_t() {
978 assert_eq!(
979 ::core::mem::size_of::<ble_data_t>(),
980 8usize,
981 concat!("Size of: ", stringify!(ble_data_t))
982 );
983 assert_eq!(
984 ::core::mem::align_of::<ble_data_t>(),
985 4usize,
986 concat!("Alignment of ", stringify!(ble_data_t))
987 );
988 assert_eq!(
989 unsafe { &(*(::core::ptr::null::<ble_data_t>())).p_data as *const _ as usize },
990 0usize,
991 concat!("Offset of field: ", stringify!(ble_data_t), "::", stringify!(p_data))
992 );
993 assert_eq!(
994 unsafe { &(*(::core::ptr::null::<ble_data_t>())).len as *const _ as usize },
995 4usize,
996 concat!("Offset of field: ", stringify!(ble_data_t), "::", stringify!(len))
997 );
998}
999#[doc = "< Set own Bluetooth Address."]
1000pub const BLE_GAP_SVCS_SD_BLE_GAP_ADDR_SET: BLE_GAP_SVCS = 108;
1001#[doc = "< Get own Bluetooth Address."]
1002pub const BLE_GAP_SVCS_SD_BLE_GAP_ADDR_GET: BLE_GAP_SVCS = 109;
1003#[doc = "< Set active whitelist."]
1004pub const BLE_GAP_SVCS_SD_BLE_GAP_WHITELIST_SET: BLE_GAP_SVCS = 110;
1005#[doc = "< Set device identity list."]
1006pub const BLE_GAP_SVCS_SD_BLE_GAP_DEVICE_IDENTITIES_SET: BLE_GAP_SVCS = 111;
1007#[doc = "< Set Privacy settings"]
1008pub const BLE_GAP_SVCS_SD_BLE_GAP_PRIVACY_SET: BLE_GAP_SVCS = 112;
1009#[doc = "< Get Privacy settings"]
1010pub const BLE_GAP_SVCS_SD_BLE_GAP_PRIVACY_GET: BLE_GAP_SVCS = 113;
1011#[doc = "< Configure an advertising set."]
1012pub const BLE_GAP_SVCS_SD_BLE_GAP_ADV_SET_CONFIGURE: BLE_GAP_SVCS = 114;
1013#[doc = "< Start Advertising."]
1014pub const BLE_GAP_SVCS_SD_BLE_GAP_ADV_START: BLE_GAP_SVCS = 115;
1015#[doc = "< Stop Advertising."]
1016pub const BLE_GAP_SVCS_SD_BLE_GAP_ADV_STOP: BLE_GAP_SVCS = 116;
1017#[doc = "< Connection Parameter Update."]
1018pub const BLE_GAP_SVCS_SD_BLE_GAP_CONN_PARAM_UPDATE: BLE_GAP_SVCS = 117;
1019#[doc = "< Disconnect."]
1020pub const BLE_GAP_SVCS_SD_BLE_GAP_DISCONNECT: BLE_GAP_SVCS = 118;
1021#[doc = "< Set TX Power."]
1022pub const BLE_GAP_SVCS_SD_BLE_GAP_TX_POWER_SET: BLE_GAP_SVCS = 119;
1023#[doc = "< Set Appearance."]
1024pub const BLE_GAP_SVCS_SD_BLE_GAP_APPEARANCE_SET: BLE_GAP_SVCS = 120;
1025#[doc = "< Get Appearance."]
1026pub const BLE_GAP_SVCS_SD_BLE_GAP_APPEARANCE_GET: BLE_GAP_SVCS = 121;
1027#[doc = "< Set PPCP."]
1028pub const BLE_GAP_SVCS_SD_BLE_GAP_PPCP_SET: BLE_GAP_SVCS = 122;
1029#[doc = "< Get PPCP."]
1030pub const BLE_GAP_SVCS_SD_BLE_GAP_PPCP_GET: BLE_GAP_SVCS = 123;
1031#[doc = "< Set Device Name."]
1032pub const BLE_GAP_SVCS_SD_BLE_GAP_DEVICE_NAME_SET: BLE_GAP_SVCS = 124;
1033#[doc = "< Get Device Name."]
1034pub const BLE_GAP_SVCS_SD_BLE_GAP_DEVICE_NAME_GET: BLE_GAP_SVCS = 125;
1035#[doc = "< Initiate Pairing/Bonding."]
1036pub const BLE_GAP_SVCS_SD_BLE_GAP_AUTHENTICATE: BLE_GAP_SVCS = 126;
1037#[doc = "< Reply with Security Parameters."]
1038pub const BLE_GAP_SVCS_SD_BLE_GAP_SEC_PARAMS_REPLY: BLE_GAP_SVCS = 127;
1039#[doc = "< Reply with an authentication key."]
1040pub const BLE_GAP_SVCS_SD_BLE_GAP_AUTH_KEY_REPLY: BLE_GAP_SVCS = 128;
1041#[doc = "< Reply with an LE Secure Connections DHKey."]
1042pub const BLE_GAP_SVCS_SD_BLE_GAP_LESC_DHKEY_REPLY: BLE_GAP_SVCS = 129;
1043#[doc = "< Notify of a keypress during an authentication procedure."]
1044pub const BLE_GAP_SVCS_SD_BLE_GAP_KEYPRESS_NOTIFY: BLE_GAP_SVCS = 130;
1045#[doc = "< Get the local LE Secure Connections OOB data."]
1046pub const BLE_GAP_SVCS_SD_BLE_GAP_LESC_OOB_DATA_GET: BLE_GAP_SVCS = 131;
1047#[doc = "< Set the remote LE Secure Connections OOB data."]
1048pub const BLE_GAP_SVCS_SD_BLE_GAP_LESC_OOB_DATA_SET: BLE_GAP_SVCS = 132;
1049#[doc = "< Initiate encryption procedure."]
1050pub const BLE_GAP_SVCS_SD_BLE_GAP_ENCRYPT: BLE_GAP_SVCS = 133;
1051#[doc = "< Reply with Security Information."]
1052pub const BLE_GAP_SVCS_SD_BLE_GAP_SEC_INFO_REPLY: BLE_GAP_SVCS = 134;
1053#[doc = "< Obtain connection security level."]
1054pub const BLE_GAP_SVCS_SD_BLE_GAP_CONN_SEC_GET: BLE_GAP_SVCS = 135;
1055#[doc = "< Start reporting of changes in RSSI."]
1056pub const BLE_GAP_SVCS_SD_BLE_GAP_RSSI_START: BLE_GAP_SVCS = 136;
1057#[doc = "< Stop reporting of changes in RSSI."]
1058pub const BLE_GAP_SVCS_SD_BLE_GAP_RSSI_STOP: BLE_GAP_SVCS = 137;
1059#[doc = "< Start Scanning."]
1060pub const BLE_GAP_SVCS_SD_BLE_GAP_SCAN_START: BLE_GAP_SVCS = 138;
1061#[doc = "< Stop Scanning."]
1062pub const BLE_GAP_SVCS_SD_BLE_GAP_SCAN_STOP: BLE_GAP_SVCS = 139;
1063#[doc = "< Connect."]
1064pub const BLE_GAP_SVCS_SD_BLE_GAP_CONNECT: BLE_GAP_SVCS = 140;
1065#[doc = "< Cancel ongoing connection procedure."]
1066pub const BLE_GAP_SVCS_SD_BLE_GAP_CONNECT_CANCEL: BLE_GAP_SVCS = 141;
1067#[doc = "< Get the last RSSI sample."]
1068pub const BLE_GAP_SVCS_SD_BLE_GAP_RSSI_GET: BLE_GAP_SVCS = 142;
1069#[doc = "< Initiate or respond to a PHY Update Procedure."]
1070pub const BLE_GAP_SVCS_SD_BLE_GAP_PHY_UPDATE: BLE_GAP_SVCS = 143;
1071#[doc = "< Initiate or respond to a Data Length Update Procedure."]
1072pub const BLE_GAP_SVCS_SD_BLE_GAP_DATA_LENGTH_UPDATE: BLE_GAP_SVCS = 144;
1073#[doc = "< Start Quality of Service (QoS) channel survey module."]
1074pub const BLE_GAP_SVCS_SD_BLE_GAP_QOS_CHANNEL_SURVEY_START: BLE_GAP_SVCS = 145;
1075#[doc = "< Stop Quality of Service (QoS) channel survey module."]
1076pub const BLE_GAP_SVCS_SD_BLE_GAP_QOS_CHANNEL_SURVEY_STOP: BLE_GAP_SVCS = 146;
1077#[doc = "< Get the Address used on air while Advertising."]
1078pub const BLE_GAP_SVCS_SD_BLE_GAP_ADV_ADDR_GET: BLE_GAP_SVCS = 147;
1079#[doc = "< Get the next connection event counter."]
1080pub const BLE_GAP_SVCS_SD_BLE_GAP_NEXT_CONN_EVT_COUNTER_GET: BLE_GAP_SVCS = 148;
1081pub const BLE_GAP_SVCS_SD_BLE_GAP_CONN_EVT_TRIGGER_START: BLE_GAP_SVCS = 149;
1082#[doc = " Start triggering a given task on connection event start."]
1083pub const BLE_GAP_SVCS_SD_BLE_GAP_CONN_EVT_TRIGGER_STOP: BLE_GAP_SVCS = 150;
1084#[doc = "@brief GAP API SVC numbers."]
1085pub type BLE_GAP_SVCS = self::c_uint;
1086#[doc = "< Connected to peer. \\n See @ref ble_gap_evt_connected_t"]
1087pub const BLE_GAP_EVTS_BLE_GAP_EVT_CONNECTED: BLE_GAP_EVTS = 16;
1088#[doc = "< Disconnected from peer. \\n See @ref ble_gap_evt_disconnected_t."]
1089pub const BLE_GAP_EVTS_BLE_GAP_EVT_DISCONNECTED: BLE_GAP_EVTS = 17;
1090#[doc = "< Connection Parameters updated. \\n See @ref ble_gap_evt_conn_param_update_t."]
1091pub const BLE_GAP_EVTS_BLE_GAP_EVT_CONN_PARAM_UPDATE: BLE_GAP_EVTS = 18;
1092#[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."]
1093pub const BLE_GAP_EVTS_BLE_GAP_EVT_SEC_PARAMS_REQUEST: BLE_GAP_EVTS = 19;
1094#[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."]
1095pub const BLE_GAP_EVTS_BLE_GAP_EVT_SEC_INFO_REQUEST: BLE_GAP_EVTS = 20;
1096#[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."]
1097pub const BLE_GAP_EVTS_BLE_GAP_EVT_PASSKEY_DISPLAY: BLE_GAP_EVTS = 21;
1098#[doc = "< Notification of a keypress on the remote device.\\n See @ref ble_gap_evt_key_pressed_t"]
1099pub const BLE_GAP_EVTS_BLE_GAP_EVT_KEY_PRESSED: BLE_GAP_EVTS = 22;
1100#[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."]
1101pub const BLE_GAP_EVTS_BLE_GAP_EVT_AUTH_KEY_REQUEST: BLE_GAP_EVTS = 23;
1102#[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"]
1103pub const BLE_GAP_EVTS_BLE_GAP_EVT_LESC_DHKEY_REQUEST: BLE_GAP_EVTS = 24;
1104#[doc = "< Authentication procedure completed with status. \\n See @ref ble_gap_evt_auth_status_t."]
1105pub const BLE_GAP_EVTS_BLE_GAP_EVT_AUTH_STATUS: BLE_GAP_EVTS = 25;
1106#[doc = "< Connection security updated. \\n See @ref ble_gap_evt_conn_sec_update_t."]
1107pub const BLE_GAP_EVTS_BLE_GAP_EVT_CONN_SEC_UPDATE: BLE_GAP_EVTS = 26;
1108#[doc = "< Timeout expired. \\n See @ref ble_gap_evt_timeout_t."]
1109pub const BLE_GAP_EVTS_BLE_GAP_EVT_TIMEOUT: BLE_GAP_EVTS = 27;
1110#[doc = "< RSSI report. \\n See @ref ble_gap_evt_rssi_changed_t."]
1111pub const BLE_GAP_EVTS_BLE_GAP_EVT_RSSI_CHANGED: BLE_GAP_EVTS = 28;
1112#[doc = "< Advertising report. \\n See @ref ble_gap_evt_adv_report_t."]
1113pub const BLE_GAP_EVTS_BLE_GAP_EVT_ADV_REPORT: BLE_GAP_EVTS = 29;
1114#[doc = "< Security Request. \\n See @ref ble_gap_evt_sec_request_t."]
1115pub const BLE_GAP_EVTS_BLE_GAP_EVT_SEC_REQUEST: BLE_GAP_EVTS = 30;
1116#[doc = "< Connection Parameter Update Request. \\n Reply with @ref sd_ble_gap_conn_param_update. \\n See @ref ble_gap_evt_conn_param_update_request_t."]
1117pub const BLE_GAP_EVTS_BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST: BLE_GAP_EVTS = 31;
1118#[doc = "< Scan request report. \\n See @ref ble_gap_evt_scan_req_report_t."]
1119pub const BLE_GAP_EVTS_BLE_GAP_EVT_SCAN_REQ_REPORT: BLE_GAP_EVTS = 32;
1120#[doc = "< PHY Update Request. \\n Reply with @ref sd_ble_gap_phy_update. \\n See @ref ble_gap_evt_phy_update_request_t."]
1121pub const BLE_GAP_EVTS_BLE_GAP_EVT_PHY_UPDATE_REQUEST: BLE_GAP_EVTS = 33;
1122#[doc = "< PHY Update Procedure is complete. \\n See @ref ble_gap_evt_phy_update_t."]
1123pub const BLE_GAP_EVTS_BLE_GAP_EVT_PHY_UPDATE: BLE_GAP_EVTS = 34;
1124#[doc = "< Data Length Update Request. \\n Reply with @ref sd_ble_gap_data_length_update. \\n See @ref ble_gap_evt_data_length_update_request_t."]
1125pub const BLE_GAP_EVTS_BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST: BLE_GAP_EVTS = 35;
1126#[doc = "< LL Data Channel PDU payload length updated. \\n See @ref ble_gap_evt_data_length_update_t."]
1127pub const BLE_GAP_EVTS_BLE_GAP_EVT_DATA_LENGTH_UPDATE: BLE_GAP_EVTS = 36;
1128#[doc = "< Channel survey report. \\n See @ref ble_gap_evt_qos_channel_survey_report_t."]
1129pub const BLE_GAP_EVTS_BLE_GAP_EVT_QOS_CHANNEL_SURVEY_REPORT: BLE_GAP_EVTS = 37;
1130#[doc = "< Advertising set terminated. \\n See @ref ble_gap_evt_adv_set_terminated_t."]
1131pub const BLE_GAP_EVTS_BLE_GAP_EVT_ADV_SET_TERMINATED: BLE_GAP_EVTS = 38;
1132#[doc = "@brief GAP Event IDs."]
1133#[doc = " IDs that uniquely identify an event coming from the stack to the application."]
1134pub type BLE_GAP_EVTS = self::c_uint;
1135#[doc = "< Channel Map. @ref ble_gap_opt_ch_map_t"]
1136pub const BLE_GAP_OPTS_BLE_GAP_OPT_CH_MAP: BLE_GAP_OPTS = 32;
1137#[doc = "< Local connection latency. @ref ble_gap_opt_local_conn_latency_t"]
1138pub const BLE_GAP_OPTS_BLE_GAP_OPT_LOCAL_CONN_LATENCY: BLE_GAP_OPTS = 33;
1139#[doc = "< Set passkey. @ref ble_gap_opt_passkey_t"]
1140pub const BLE_GAP_OPTS_BLE_GAP_OPT_PASSKEY: BLE_GAP_OPTS = 34;
1141#[doc = "< Compatibility mode. @ref ble_gap_opt_compat_mode_1_t"]
1142pub const BLE_GAP_OPTS_BLE_GAP_OPT_COMPAT_MODE_1: BLE_GAP_OPTS = 35;
1143#[doc = "< Set Authenticated payload timeout. @ref ble_gap_opt_auth_payload_timeout_t"]
1144pub const BLE_GAP_OPTS_BLE_GAP_OPT_AUTH_PAYLOAD_TIMEOUT: BLE_GAP_OPTS = 36;
1145#[doc = "< Disable slave latency. @ref ble_gap_opt_slave_latency_disable_t"]
1146pub const BLE_GAP_OPTS_BLE_GAP_OPT_SLAVE_LATENCY_DISABLE: BLE_GAP_OPTS = 37;
1147#[doc = "@brief GAP Option IDs."]
1148#[doc = " IDs that uniquely identify a GAP option."]
1149pub type BLE_GAP_OPTS = self::c_uint;
1150#[doc = "< Role count configuration."]
1151pub const BLE_GAP_CFGS_BLE_GAP_CFG_ROLE_COUNT: BLE_GAP_CFGS = 64;
1152#[doc = "< Device name configuration."]
1153pub const BLE_GAP_CFGS_BLE_GAP_CFG_DEVICE_NAME: BLE_GAP_CFGS = 65;
1154#[doc = "< Peripheral Preferred Connection Parameters characteristic"]
1155#[doc = "inclusion configuration."]
1156pub const BLE_GAP_CFGS_BLE_GAP_CFG_PPCP_INCL_CONFIG: BLE_GAP_CFGS = 66;
1157#[doc = "< Central Address Resolution characteristic"]
1158#[doc = "inclusion configuration."]
1159pub const BLE_GAP_CFGS_BLE_GAP_CFG_CAR_INCL_CONFIG: BLE_GAP_CFGS = 67;
1160#[doc = "@brief GAP Configuration IDs."]
1161#[doc = ""]
1162#[doc = " IDs that uniquely identify a GAP configuration."]
1163pub type BLE_GAP_CFGS = self::c_uint;
1164#[doc = "< Advertiser role."]
1165pub const BLE_GAP_TX_POWER_ROLES_BLE_GAP_TX_POWER_ROLE_ADV: BLE_GAP_TX_POWER_ROLES = 1;
1166#[doc = "< Scanner and initiator role."]
1167pub const BLE_GAP_TX_POWER_ROLES_BLE_GAP_TX_POWER_ROLE_SCAN_INIT: BLE_GAP_TX_POWER_ROLES = 2;
1168#[doc = "< Connection role."]
1169pub const BLE_GAP_TX_POWER_ROLES_BLE_GAP_TX_POWER_ROLE_CONN: BLE_GAP_TX_POWER_ROLES = 3;
1170#[doc = "@brief GAP TX Power roles."]
1171pub type BLE_GAP_TX_POWER_ROLES = self::c_uint;
1172#[doc = "@brief Advertising event properties."]
1173#[repr(C)]
1174#[derive(Debug, Copy, Clone)]
1175pub struct ble_gap_adv_properties_t {
1176 #[doc = "< Advertising type. See @ref BLE_GAP_ADV_TYPES."]
1177 pub type_: u8,
1178 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
1179}
1180#[test]
1181fn bindgen_test_layout_ble_gap_adv_properties_t() {
1182 assert_eq!(
1183 ::core::mem::size_of::<ble_gap_adv_properties_t>(),
1184 2usize,
1185 concat!("Size of: ", stringify!(ble_gap_adv_properties_t))
1186 );
1187 assert_eq!(
1188 ::core::mem::align_of::<ble_gap_adv_properties_t>(),
1189 1usize,
1190 concat!("Alignment of ", stringify!(ble_gap_adv_properties_t))
1191 );
1192 assert_eq!(
1193 unsafe { &(*(::core::ptr::null::<ble_gap_adv_properties_t>())).type_ as *const _ as usize },
1194 0usize,
1195 concat!(
1196 "Offset of field: ",
1197 stringify!(ble_gap_adv_properties_t),
1198 "::",
1199 stringify!(type_)
1200 )
1201 );
1202}
1203impl ble_gap_adv_properties_t {
1204 #[inline]
1205 pub fn anonymous(&self) -> u8 {
1206 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
1207 }
1208 #[inline]
1209 pub fn set_anonymous(&mut self, val: u8) {
1210 unsafe {
1211 let val: u8 = ::core::mem::transmute(val);
1212 self._bitfield_1.set(0usize, 1u8, val as u64)
1213 }
1214 }
1215 #[inline]
1216 pub fn include_tx_power(&self) -> u8 {
1217 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
1218 }
1219 #[inline]
1220 pub fn set_include_tx_power(&mut self, val: u8) {
1221 unsafe {
1222 let val: u8 = ::core::mem::transmute(val);
1223 self._bitfield_1.set(1usize, 1u8, val as u64)
1224 }
1225 }
1226 #[inline]
1227 pub fn new_bitfield_1(anonymous: u8, include_tx_power: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
1228 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
1229 __bindgen_bitfield_unit.set(0usize, 1u8, {
1230 let anonymous: u8 = unsafe { ::core::mem::transmute(anonymous) };
1231 anonymous as u64
1232 });
1233 __bindgen_bitfield_unit.set(1usize, 1u8, {
1234 let include_tx_power: u8 = unsafe { ::core::mem::transmute(include_tx_power) };
1235 include_tx_power as u64
1236 });
1237 __bindgen_bitfield_unit
1238 }
1239}
1240#[doc = "@brief Advertising report type."]
1241#[repr(C)]
1242#[repr(align(2))]
1243#[derive(Debug, Copy, Clone)]
1244pub struct ble_gap_adv_report_type_t {
1245 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize], u16>,
1246}
1247#[test]
1248fn bindgen_test_layout_ble_gap_adv_report_type_t() {
1249 assert_eq!(
1250 ::core::mem::size_of::<ble_gap_adv_report_type_t>(),
1251 2usize,
1252 concat!("Size of: ", stringify!(ble_gap_adv_report_type_t))
1253 );
1254 assert_eq!(
1255 ::core::mem::align_of::<ble_gap_adv_report_type_t>(),
1256 2usize,
1257 concat!("Alignment of ", stringify!(ble_gap_adv_report_type_t))
1258 );
1259}
1260impl ble_gap_adv_report_type_t {
1261 #[inline]
1262 pub fn connectable(&self) -> u16 {
1263 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) }
1264 }
1265 #[inline]
1266 pub fn set_connectable(&mut self, val: u16) {
1267 unsafe {
1268 let val: u16 = ::core::mem::transmute(val);
1269 self._bitfield_1.set(0usize, 1u8, val as u64)
1270 }
1271 }
1272 #[inline]
1273 pub fn scannable(&self) -> u16 {
1274 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u16) }
1275 }
1276 #[inline]
1277 pub fn set_scannable(&mut self, val: u16) {
1278 unsafe {
1279 let val: u16 = ::core::mem::transmute(val);
1280 self._bitfield_1.set(1usize, 1u8, val as u64)
1281 }
1282 }
1283 #[inline]
1284 pub fn directed(&self) -> u16 {
1285 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u16) }
1286 }
1287 #[inline]
1288 pub fn set_directed(&mut self, val: u16) {
1289 unsafe {
1290 let val: u16 = ::core::mem::transmute(val);
1291 self._bitfield_1.set(2usize, 1u8, val as u64)
1292 }
1293 }
1294 #[inline]
1295 pub fn scan_response(&self) -> u16 {
1296 unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u16) }
1297 }
1298 #[inline]
1299 pub fn set_scan_response(&mut self, val: u16) {
1300 unsafe {
1301 let val: u16 = ::core::mem::transmute(val);
1302 self._bitfield_1.set(3usize, 1u8, val as u64)
1303 }
1304 }
1305 #[inline]
1306 pub fn extended_pdu(&self) -> u16 {
1307 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) }
1308 }
1309 #[inline]
1310 pub fn set_extended_pdu(&mut self, val: u16) {
1311 unsafe {
1312 let val: u16 = ::core::mem::transmute(val);
1313 self._bitfield_1.set(4usize, 1u8, val as u64)
1314 }
1315 }
1316 #[inline]
1317 pub fn status(&self) -> u16 {
1318 unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 2u8) as u16) }
1319 }
1320 #[inline]
1321 pub fn set_status(&mut self, val: u16) {
1322 unsafe {
1323 let val: u16 = ::core::mem::transmute(val);
1324 self._bitfield_1.set(5usize, 2u8, val as u64)
1325 }
1326 }
1327 #[inline]
1328 pub fn reserved(&self) -> u16 {
1329 unsafe { ::core::mem::transmute(self._bitfield_1.get(7usize, 9u8) as u16) }
1330 }
1331 #[inline]
1332 pub fn set_reserved(&mut self, val: u16) {
1333 unsafe {
1334 let val: u16 = ::core::mem::transmute(val);
1335 self._bitfield_1.set(7usize, 9u8, val as u64)
1336 }
1337 }
1338 #[inline]
1339 pub fn new_bitfield_1(
1340 connectable: u16,
1341 scannable: u16,
1342 directed: u16,
1343 scan_response: u16,
1344 extended_pdu: u16,
1345 status: u16,
1346 reserved: u16,
1347 ) -> __BindgenBitfieldUnit<[u8; 2usize], u16> {
1348 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u16> = Default::default();
1349 __bindgen_bitfield_unit.set(0usize, 1u8, {
1350 let connectable: u16 = unsafe { ::core::mem::transmute(connectable) };
1351 connectable as u64
1352 });
1353 __bindgen_bitfield_unit.set(1usize, 1u8, {
1354 let scannable: u16 = unsafe { ::core::mem::transmute(scannable) };
1355 scannable as u64
1356 });
1357 __bindgen_bitfield_unit.set(2usize, 1u8, {
1358 let directed: u16 = unsafe { ::core::mem::transmute(directed) };
1359 directed as u64
1360 });
1361 __bindgen_bitfield_unit.set(3usize, 1u8, {
1362 let scan_response: u16 = unsafe { ::core::mem::transmute(scan_response) };
1363 scan_response as u64
1364 });
1365 __bindgen_bitfield_unit.set(4usize, 1u8, {
1366 let extended_pdu: u16 = unsafe { ::core::mem::transmute(extended_pdu) };
1367 extended_pdu as u64
1368 });
1369 __bindgen_bitfield_unit.set(5usize, 2u8, {
1370 let status: u16 = unsafe { ::core::mem::transmute(status) };
1371 status as u64
1372 });
1373 __bindgen_bitfield_unit.set(7usize, 9u8, {
1374 let reserved: u16 = unsafe { ::core::mem::transmute(reserved) };
1375 reserved as u64
1376 });
1377 __bindgen_bitfield_unit
1378 }
1379}
1380#[doc = "@brief Advertising Auxiliary Pointer."]
1381#[repr(C)]
1382#[derive(Debug, Copy, Clone)]
1383pub struct ble_gap_aux_pointer_t {
1384 #[doc = "< Time offset from the beginning of advertising packet to the auxiliary packet in 100 us units."]
1385 pub aux_offset: u16,
1386 #[doc = "< Indicates the PHY on which the auxiliary advertising packet is sent. See @ref BLE_GAP_PHYS."]
1387 pub aux_phy: u8,
1388}
1389#[test]
1390fn bindgen_test_layout_ble_gap_aux_pointer_t() {
1391 assert_eq!(
1392 ::core::mem::size_of::<ble_gap_aux_pointer_t>(),
1393 4usize,
1394 concat!("Size of: ", stringify!(ble_gap_aux_pointer_t))
1395 );
1396 assert_eq!(
1397 ::core::mem::align_of::<ble_gap_aux_pointer_t>(),
1398 2usize,
1399 concat!("Alignment of ", stringify!(ble_gap_aux_pointer_t))
1400 );
1401 assert_eq!(
1402 unsafe { &(*(::core::ptr::null::<ble_gap_aux_pointer_t>())).aux_offset as *const _ as usize },
1403 0usize,
1404 concat!(
1405 "Offset of field: ",
1406 stringify!(ble_gap_aux_pointer_t),
1407 "::",
1408 stringify!(aux_offset)
1409 )
1410 );
1411 assert_eq!(
1412 unsafe { &(*(::core::ptr::null::<ble_gap_aux_pointer_t>())).aux_phy as *const _ as usize },
1413 2usize,
1414 concat!(
1415 "Offset of field: ",
1416 stringify!(ble_gap_aux_pointer_t),
1417 "::",
1418 stringify!(aux_phy)
1419 )
1420 );
1421}
1422#[doc = "@brief Bluetooth Low Energy address."]
1423#[repr(C)]
1424#[derive(Debug, Copy, Clone)]
1425pub struct ble_gap_addr_t {
1426 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
1427 #[doc = "< 48-bit address, LSB format."]
1428 #[doc = "@ref addr is not used if @ref addr_type is @ref BLE_GAP_ADDR_TYPE_ANONYMOUS."]
1429 pub addr: [u8; 6usize],
1430}
1431#[test]
1432fn bindgen_test_layout_ble_gap_addr_t() {
1433 assert_eq!(
1434 ::core::mem::size_of::<ble_gap_addr_t>(),
1435 7usize,
1436 concat!("Size of: ", stringify!(ble_gap_addr_t))
1437 );
1438 assert_eq!(
1439 ::core::mem::align_of::<ble_gap_addr_t>(),
1440 1usize,
1441 concat!("Alignment of ", stringify!(ble_gap_addr_t))
1442 );
1443 assert_eq!(
1444 unsafe { &(*(::core::ptr::null::<ble_gap_addr_t>())).addr as *const _ as usize },
1445 1usize,
1446 concat!("Offset of field: ", stringify!(ble_gap_addr_t), "::", stringify!(addr))
1447 );
1448}
1449impl ble_gap_addr_t {
1450 #[inline]
1451 pub fn addr_id_peer(&self) -> u8 {
1452 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
1453 }
1454 #[inline]
1455 pub fn set_addr_id_peer(&mut self, val: u8) {
1456 unsafe {
1457 let val: u8 = ::core::mem::transmute(val);
1458 self._bitfield_1.set(0usize, 1u8, val as u64)
1459 }
1460 }
1461 #[inline]
1462 pub fn addr_type(&self) -> u8 {
1463 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) }
1464 }
1465 #[inline]
1466 pub fn set_addr_type(&mut self, val: u8) {
1467 unsafe {
1468 let val: u8 = ::core::mem::transmute(val);
1469 self._bitfield_1.set(1usize, 7u8, val as u64)
1470 }
1471 }
1472 #[inline]
1473 pub fn new_bitfield_1(addr_id_peer: u8, addr_type: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
1474 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
1475 __bindgen_bitfield_unit.set(0usize, 1u8, {
1476 let addr_id_peer: u8 = unsafe { ::core::mem::transmute(addr_id_peer) };
1477 addr_id_peer as u64
1478 });
1479 __bindgen_bitfield_unit.set(1usize, 7u8, {
1480 let addr_type: u8 = unsafe { ::core::mem::transmute(addr_type) };
1481 addr_type as u64
1482 });
1483 __bindgen_bitfield_unit
1484 }
1485}
1486#[doc = "@brief GAP connection parameters."]
1487#[doc = ""]
1488#[doc = " @note When ble_conn_params_t is received in an event, both min_conn_interval and"]
1489#[doc = " max_conn_interval will be equal to the connection interval set by the central."]
1490#[doc = ""]
1491#[doc = " @note If both conn_sup_timeout and max_conn_interval are specified, then the following constraint applies:"]
1492#[doc = " conn_sup_timeout * 4 > (1 + slave_latency) * max_conn_interval"]
1493#[doc = " that corresponds to the following Bluetooth Spec requirement:"]
1494#[doc = " The Supervision_Timeout in milliseconds shall be larger than"]
1495#[doc = " (1 + Conn_Latency) * Conn_Interval_Max * 2, where Conn_Interval_Max is given in milliseconds."]
1496#[repr(C)]
1497#[derive(Debug, Copy, Clone)]
1498pub struct ble_gap_conn_params_t {
1499 #[doc = "< Minimum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS."]
1500 pub min_conn_interval: u16,
1501 #[doc = "< Maximum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS."]
1502 pub max_conn_interval: u16,
1503 #[doc = "< Slave Latency in number of connection events, see @ref BLE_GAP_CP_LIMITS."]
1504 pub slave_latency: u16,
1505 #[doc = "< Connection Supervision Timeout in 10 ms units, see @ref BLE_GAP_CP_LIMITS."]
1506 pub conn_sup_timeout: u16,
1507}
1508#[test]
1509fn bindgen_test_layout_ble_gap_conn_params_t() {
1510 assert_eq!(
1511 ::core::mem::size_of::<ble_gap_conn_params_t>(),
1512 8usize,
1513 concat!("Size of: ", stringify!(ble_gap_conn_params_t))
1514 );
1515 assert_eq!(
1516 ::core::mem::align_of::<ble_gap_conn_params_t>(),
1517 2usize,
1518 concat!("Alignment of ", stringify!(ble_gap_conn_params_t))
1519 );
1520 assert_eq!(
1521 unsafe { &(*(::core::ptr::null::<ble_gap_conn_params_t>())).min_conn_interval as *const _ as usize },
1522 0usize,
1523 concat!(
1524 "Offset of field: ",
1525 stringify!(ble_gap_conn_params_t),
1526 "::",
1527 stringify!(min_conn_interval)
1528 )
1529 );
1530 assert_eq!(
1531 unsafe { &(*(::core::ptr::null::<ble_gap_conn_params_t>())).max_conn_interval as *const _ as usize },
1532 2usize,
1533 concat!(
1534 "Offset of field: ",
1535 stringify!(ble_gap_conn_params_t),
1536 "::",
1537 stringify!(max_conn_interval)
1538 )
1539 );
1540 assert_eq!(
1541 unsafe { &(*(::core::ptr::null::<ble_gap_conn_params_t>())).slave_latency as *const _ as usize },
1542 4usize,
1543 concat!(
1544 "Offset of field: ",
1545 stringify!(ble_gap_conn_params_t),
1546 "::",
1547 stringify!(slave_latency)
1548 )
1549 );
1550 assert_eq!(
1551 unsafe { &(*(::core::ptr::null::<ble_gap_conn_params_t>())).conn_sup_timeout as *const _ as usize },
1552 6usize,
1553 concat!(
1554 "Offset of field: ",
1555 stringify!(ble_gap_conn_params_t),
1556 "::",
1557 stringify!(conn_sup_timeout)
1558 )
1559 );
1560}
1561#[doc = "@brief GAP connection security modes."]
1562#[doc = ""]
1563#[doc = " Security Mode 0 Level 0: No access permissions at all (this level is not defined by the Bluetooth Core specification).\\n"]
1564#[doc = " Security Mode 1 Level 1: No security is needed (aka open link).\\n"]
1565#[doc = " Security Mode 1 Level 2: Encrypted link required, MITM protection not necessary.\\n"]
1566#[doc = " Security Mode 1 Level 3: MITM protected encrypted link required.\\n"]
1567#[doc = " Security Mode 1 Level 4: LESC MITM protected encrypted link using a 128-bit strength encryption key required.\\n"]
1568#[doc = " Security Mode 2 Level 1: Signing or encryption required, MITM protection not necessary.\\n"]
1569#[doc = " Security Mode 2 Level 2: MITM protected signing required, unless link is MITM protected encrypted.\\n"]
1570#[repr(C, packed)]
1571#[derive(Debug, Copy, Clone)]
1572pub struct ble_gap_conn_sec_mode_t {
1573 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
1574}
1575#[test]
1576fn bindgen_test_layout_ble_gap_conn_sec_mode_t() {
1577 assert_eq!(
1578 ::core::mem::size_of::<ble_gap_conn_sec_mode_t>(),
1579 1usize,
1580 concat!("Size of: ", stringify!(ble_gap_conn_sec_mode_t))
1581 );
1582 assert_eq!(
1583 ::core::mem::align_of::<ble_gap_conn_sec_mode_t>(),
1584 1usize,
1585 concat!("Alignment of ", stringify!(ble_gap_conn_sec_mode_t))
1586 );
1587}
1588impl ble_gap_conn_sec_mode_t {
1589 #[inline]
1590 pub fn sm(&self) -> u8 {
1591 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
1592 }
1593 #[inline]
1594 pub fn set_sm(&mut self, val: u8) {
1595 unsafe {
1596 let val: u8 = ::core::mem::transmute(val);
1597 self._bitfield_1.set(0usize, 4u8, val as u64)
1598 }
1599 }
1600 #[inline]
1601 pub fn lv(&self) -> u8 {
1602 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
1603 }
1604 #[inline]
1605 pub fn set_lv(&mut self, val: u8) {
1606 unsafe {
1607 let val: u8 = ::core::mem::transmute(val);
1608 self._bitfield_1.set(4usize, 4u8, val as u64)
1609 }
1610 }
1611 #[inline]
1612 pub fn new_bitfield_1(sm: u8, lv: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
1613 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
1614 __bindgen_bitfield_unit.set(0usize, 4u8, {
1615 let sm: u8 = unsafe { ::core::mem::transmute(sm) };
1616 sm as u64
1617 });
1618 __bindgen_bitfield_unit.set(4usize, 4u8, {
1619 let lv: u8 = unsafe { ::core::mem::transmute(lv) };
1620 lv as u64
1621 });
1622 __bindgen_bitfield_unit
1623 }
1624}
1625#[doc = "@brief GAP connection security status."]
1626#[repr(C)]
1627#[derive(Debug, Copy, Clone)]
1628pub struct ble_gap_conn_sec_t {
1629 #[doc = "< Currently active security mode for this connection."]
1630 pub sec_mode: ble_gap_conn_sec_mode_t,
1631 #[doc = "< Length of currently active encryption key, 7 to 16 octets (only applicable for bonding procedures)."]
1632 pub encr_key_size: u8,
1633}
1634#[test]
1635fn bindgen_test_layout_ble_gap_conn_sec_t() {
1636 assert_eq!(
1637 ::core::mem::size_of::<ble_gap_conn_sec_t>(),
1638 2usize,
1639 concat!("Size of: ", stringify!(ble_gap_conn_sec_t))
1640 );
1641 assert_eq!(
1642 ::core::mem::align_of::<ble_gap_conn_sec_t>(),
1643 1usize,
1644 concat!("Alignment of ", stringify!(ble_gap_conn_sec_t))
1645 );
1646 assert_eq!(
1647 unsafe { &(*(::core::ptr::null::<ble_gap_conn_sec_t>())).sec_mode as *const _ as usize },
1648 0usize,
1649 concat!(
1650 "Offset of field: ",
1651 stringify!(ble_gap_conn_sec_t),
1652 "::",
1653 stringify!(sec_mode)
1654 )
1655 );
1656 assert_eq!(
1657 unsafe { &(*(::core::ptr::null::<ble_gap_conn_sec_t>())).encr_key_size as *const _ as usize },
1658 1usize,
1659 concat!(
1660 "Offset of field: ",
1661 stringify!(ble_gap_conn_sec_t),
1662 "::",
1663 stringify!(encr_key_size)
1664 )
1665 );
1666}
1667#[doc = "@brief Identity Resolving Key."]
1668#[repr(C)]
1669#[derive(Debug, Copy, Clone)]
1670pub struct ble_gap_irk_t {
1671 #[doc = "< Array containing IRK."]
1672 pub irk: [u8; 16usize],
1673}
1674#[test]
1675fn bindgen_test_layout_ble_gap_irk_t() {
1676 assert_eq!(
1677 ::core::mem::size_of::<ble_gap_irk_t>(),
1678 16usize,
1679 concat!("Size of: ", stringify!(ble_gap_irk_t))
1680 );
1681 assert_eq!(
1682 ::core::mem::align_of::<ble_gap_irk_t>(),
1683 1usize,
1684 concat!("Alignment of ", stringify!(ble_gap_irk_t))
1685 );
1686 assert_eq!(
1687 unsafe { &(*(::core::ptr::null::<ble_gap_irk_t>())).irk as *const _ as usize },
1688 0usize,
1689 concat!("Offset of field: ", stringify!(ble_gap_irk_t), "::", stringify!(irk))
1690 );
1691}
1692#[doc = "@brief Channel mask (40 bits)."]
1693#[doc = " Every channel is represented with a bit positioned as per channel index defined in Bluetooth Core Specification v5.0,"]
1694#[doc = " Vol 6, Part B, Section 1.4.1. The LSB contained in array element 0 represents channel index 0, and bit 39 represents"]
1695#[doc = " channel index 39. If a bit is set to 1, the channel is not used."]
1696pub type ble_gap_ch_mask_t = [u8; 5usize];
1697#[doc = "@brief GAP advertising parameters."]
1698#[repr(C)]
1699#[derive(Debug, Copy, Clone)]
1700pub struct ble_gap_adv_params_t {
1701 #[doc = "< The properties of the advertising events."]
1702 pub properties: ble_gap_adv_properties_t,
1703 #[doc = "< Address of a known peer."]
1704 #[doc = "@note ble_gap_addr_t::addr_type cannot be"]
1705 #[doc = "@ref BLE_GAP_ADDR_TYPE_ANONYMOUS."]
1706 #[doc = "- When privacy is enabled and the local device uses"]
1707 #[doc = "@ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE addresses,"]
1708 #[doc = "the device identity list is searched for a matching entry. If"]
1709 #[doc = "the local IRK for that device identity is set, the local IRK"]
1710 #[doc = "for that device will be used to generate the advertiser address"]
1711 #[doc = "field in the advertising packet."]
1712 #[doc = "- If @ref ble_gap_adv_properties_t::type is directed, this must be"]
1713 #[doc = "set to the targeted scanner or initiator. If the peer address is"]
1714 #[doc = "in the device identity list, the peer IRK for that device will be"]
1715 #[doc = "used to generate @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE"]
1716 #[doc = "target addresses used in the advertising event PDUs."]
1717 pub p_peer_addr: *const ble_gap_addr_t,
1718 #[doc = "< Advertising interval in 625 us units. @sa BLE_GAP_ADV_INTERVALS."]
1719 #[doc = "@note If @ref ble_gap_adv_properties_t::type is set to"]
1720 #[doc = "@ref BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE"]
1721 #[doc = "advertising, this parameter is ignored."]
1722 pub interval: u32,
1723 #[doc = "< Advertising duration in 10 ms units. When timeout is reached,"]
1724 #[doc = "an event of type @ref BLE_GAP_EVT_ADV_SET_TERMINATED is raised."]
1725 #[doc = "@sa BLE_GAP_ADV_TIMEOUT_VALUES."]
1726 #[doc = "@note The SoftDevice will always complete at least one advertising"]
1727 #[doc = "event even if the duration is set too low."]
1728 pub duration: u16,
1729 #[doc = "< Maximum advertising events that shall be sent prior to disabling"]
1730 #[doc = "advertising. Setting the value to 0 disables the limitation. When"]
1731 #[doc = "the count of advertising events specified by this parameter"]
1732 #[doc = "(if not 0) is reached, advertising will be automatically stopped"]
1733 #[doc = "and an event of type @ref BLE_GAP_EVT_ADV_SET_TERMINATED is raised"]
1734 #[doc = "@note If @ref ble_gap_adv_properties_t::type is set to"]
1735 #[doc = "@ref BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE,"]
1736 #[doc = "this parameter is ignored."]
1737 pub max_adv_evts: u8,
1738 #[doc = "< Channel mask for primary and secondary advertising channels."]
1739 #[doc = "At least one of the primary channels, that is channel index 37-39, must be used."]
1740 #[doc = "Masking away secondary advertising channels is not supported."]
1741 pub channel_mask: ble_gap_ch_mask_t,
1742 #[doc = "< Filter Policy. @sa BLE_GAP_ADV_FILTER_POLICIES."]
1743 pub filter_policy: u8,
1744 #[doc = "< Indicates the PHY on which the primary advertising channel packets"]
1745 #[doc = "are transmitted. If set to @ref BLE_GAP_PHY_AUTO, @ref BLE_GAP_PHY_1MBPS"]
1746 #[doc = "will be used."]
1747 #[doc = "Valid values are @ref BLE_GAP_PHY_1MBPS and @ref BLE_GAP_PHY_CODED."]
1748 #[doc = "@note The primary_phy shall indicate @ref BLE_GAP_PHY_1MBPS if"]
1749 #[doc = "@ref ble_gap_adv_properties_t::type is not an extended advertising type."]
1750 pub primary_phy: u8,
1751 #[doc = "< Indicates the PHY on which the secondary advertising channel packets"]
1752 #[doc = "are transmitted."]
1753 #[doc = "If set to @ref BLE_GAP_PHY_AUTO, @ref BLE_GAP_PHY_1MBPS will be used."]
1754 #[doc = "Valid values are"]
1755 #[doc = "@ref BLE_GAP_PHY_1MBPS, @ref BLE_GAP_PHY_2MBPS, and @ref BLE_GAP_PHY_CODED."]
1756 #[doc = "If @ref ble_gap_adv_properties_t::type is an extended advertising type"]
1757 #[doc = "and connectable, this is the PHY that will be used to establish a"]
1758 #[doc = "connection and send AUX_ADV_IND packets on."]
1759 #[doc = "@note This parameter will be ignored when"]
1760 #[doc = "@ref ble_gap_adv_properties_t::type is not an extended advertising type."]
1761 pub secondary_phy: u8,
1762 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
1763}
1764#[test]
1765fn bindgen_test_layout_ble_gap_adv_params_t() {
1766 assert_eq!(
1767 ::core::mem::size_of::<ble_gap_adv_params_t>(),
1768 24usize,
1769 concat!("Size of: ", stringify!(ble_gap_adv_params_t))
1770 );
1771 assert_eq!(
1772 ::core::mem::align_of::<ble_gap_adv_params_t>(),
1773 4usize,
1774 concat!("Alignment of ", stringify!(ble_gap_adv_params_t))
1775 );
1776 assert_eq!(
1777 unsafe { &(*(::core::ptr::null::<ble_gap_adv_params_t>())).properties as *const _ as usize },
1778 0usize,
1779 concat!(
1780 "Offset of field: ",
1781 stringify!(ble_gap_adv_params_t),
1782 "::",
1783 stringify!(properties)
1784 )
1785 );
1786 assert_eq!(
1787 unsafe { &(*(::core::ptr::null::<ble_gap_adv_params_t>())).p_peer_addr as *const _ as usize },
1788 4usize,
1789 concat!(
1790 "Offset of field: ",
1791 stringify!(ble_gap_adv_params_t),
1792 "::",
1793 stringify!(p_peer_addr)
1794 )
1795 );
1796 assert_eq!(
1797 unsafe { &(*(::core::ptr::null::<ble_gap_adv_params_t>())).interval as *const _ as usize },
1798 8usize,
1799 concat!(
1800 "Offset of field: ",
1801 stringify!(ble_gap_adv_params_t),
1802 "::",
1803 stringify!(interval)
1804 )
1805 );
1806 assert_eq!(
1807 unsafe { &(*(::core::ptr::null::<ble_gap_adv_params_t>())).duration as *const _ as usize },
1808 12usize,
1809 concat!(
1810 "Offset of field: ",
1811 stringify!(ble_gap_adv_params_t),
1812 "::",
1813 stringify!(duration)
1814 )
1815 );
1816 assert_eq!(
1817 unsafe { &(*(::core::ptr::null::<ble_gap_adv_params_t>())).max_adv_evts as *const _ as usize },
1818 14usize,
1819 concat!(
1820 "Offset of field: ",
1821 stringify!(ble_gap_adv_params_t),
1822 "::",
1823 stringify!(max_adv_evts)
1824 )
1825 );
1826 assert_eq!(
1827 unsafe { &(*(::core::ptr::null::<ble_gap_adv_params_t>())).channel_mask as *const _ as usize },
1828 15usize,
1829 concat!(
1830 "Offset of field: ",
1831 stringify!(ble_gap_adv_params_t),
1832 "::",
1833 stringify!(channel_mask)
1834 )
1835 );
1836 assert_eq!(
1837 unsafe { &(*(::core::ptr::null::<ble_gap_adv_params_t>())).filter_policy as *const _ as usize },
1838 20usize,
1839 concat!(
1840 "Offset of field: ",
1841 stringify!(ble_gap_adv_params_t),
1842 "::",
1843 stringify!(filter_policy)
1844 )
1845 );
1846 assert_eq!(
1847 unsafe { &(*(::core::ptr::null::<ble_gap_adv_params_t>())).primary_phy as *const _ as usize },
1848 21usize,
1849 concat!(
1850 "Offset of field: ",
1851 stringify!(ble_gap_adv_params_t),
1852 "::",
1853 stringify!(primary_phy)
1854 )
1855 );
1856 assert_eq!(
1857 unsafe { &(*(::core::ptr::null::<ble_gap_adv_params_t>())).secondary_phy as *const _ as usize },
1858 22usize,
1859 concat!(
1860 "Offset of field: ",
1861 stringify!(ble_gap_adv_params_t),
1862 "::",
1863 stringify!(secondary_phy)
1864 )
1865 );
1866}
1867impl ble_gap_adv_params_t {
1868 #[inline]
1869 pub fn set_id(&self) -> u8 {
1870 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
1871 }
1872 #[inline]
1873 pub fn set_set_id(&mut self, val: u8) {
1874 unsafe {
1875 let val: u8 = ::core::mem::transmute(val);
1876 self._bitfield_1.set(0usize, 4u8, val as u64)
1877 }
1878 }
1879 #[inline]
1880 pub fn scan_req_notification(&self) -> u8 {
1881 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u8) }
1882 }
1883 #[inline]
1884 pub fn set_scan_req_notification(&mut self, val: u8) {
1885 unsafe {
1886 let val: u8 = ::core::mem::transmute(val);
1887 self._bitfield_1.set(4usize, 1u8, val as u64)
1888 }
1889 }
1890 #[inline]
1891 pub fn new_bitfield_1(set_id: u8, scan_req_notification: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
1892 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
1893 __bindgen_bitfield_unit.set(0usize, 4u8, {
1894 let set_id: u8 = unsafe { ::core::mem::transmute(set_id) };
1895 set_id as u64
1896 });
1897 __bindgen_bitfield_unit.set(4usize, 1u8, {
1898 let scan_req_notification: u8 = unsafe { ::core::mem::transmute(scan_req_notification) };
1899 scan_req_notification as u64
1900 });
1901 __bindgen_bitfield_unit
1902 }
1903}
1904#[doc = "@brief GAP advertising data buffers."]
1905#[doc = ""]
1906#[doc = " The application must provide the buffers for advertisement. The memory shall reside in application RAM, and"]
1907#[doc = " shall never be modified while advertising. The data shall be kept alive until either:"]
1908#[doc = " - @ref BLE_GAP_EVT_ADV_SET_TERMINATED is raised."]
1909#[doc = " - @ref BLE_GAP_EVT_CONNECTED is raised with @ref ble_gap_evt_connected_t::adv_handle set to the corresponding"]
1910#[doc = " advertising handle."]
1911#[doc = " - Advertising is stopped."]
1912#[doc = " - Advertising data is changed."]
1913#[doc = " To update advertising data while advertising, provide new buffers to @ref sd_ble_gap_adv_set_configure."]
1914#[repr(C)]
1915#[derive(Debug, Copy, Clone)]
1916pub struct ble_gap_adv_data_t {
1917 #[doc = "< Advertising data."]
1918 #[doc = "@note"]
1919 #[doc = "Advertising data can only be specified for a @ref ble_gap_adv_properties_t::type"]
1920 #[doc = "that is allowed to contain advertising data."]
1921 pub adv_data: ble_data_t,
1922 #[doc = "< Scan response data."]
1923 #[doc = "@note"]
1924 #[doc = "Scan response data can only be specified for a @ref ble_gap_adv_properties_t::type"]
1925 #[doc = "that is scannable."]
1926 pub scan_rsp_data: ble_data_t,
1927}
1928#[test]
1929fn bindgen_test_layout_ble_gap_adv_data_t() {
1930 assert_eq!(
1931 ::core::mem::size_of::<ble_gap_adv_data_t>(),
1932 16usize,
1933 concat!("Size of: ", stringify!(ble_gap_adv_data_t))
1934 );
1935 assert_eq!(
1936 ::core::mem::align_of::<ble_gap_adv_data_t>(),
1937 4usize,
1938 concat!("Alignment of ", stringify!(ble_gap_adv_data_t))
1939 );
1940 assert_eq!(
1941 unsafe { &(*(::core::ptr::null::<ble_gap_adv_data_t>())).adv_data as *const _ as usize },
1942 0usize,
1943 concat!(
1944 "Offset of field: ",
1945 stringify!(ble_gap_adv_data_t),
1946 "::",
1947 stringify!(adv_data)
1948 )
1949 );
1950 assert_eq!(
1951 unsafe { &(*(::core::ptr::null::<ble_gap_adv_data_t>())).scan_rsp_data as *const _ as usize },
1952 8usize,
1953 concat!(
1954 "Offset of field: ",
1955 stringify!(ble_gap_adv_data_t),
1956 "::",
1957 stringify!(scan_rsp_data)
1958 )
1959 );
1960}
1961#[doc = "@brief GAP scanning parameters."]
1962#[repr(C)]
1963#[derive(Debug, Copy, Clone)]
1964pub struct ble_gap_scan_params_t {
1965 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
1966 #[doc = "< Bitfield of PHYs to scan on. If set to @ref BLE_GAP_PHY_AUTO,"]
1967 #[doc = "scan_phys will default to @ref BLE_GAP_PHY_1MBPS."]
1968 #[doc = "- If @ref ble_gap_scan_params_t::extended is set to 0, the only"]
1969 #[doc = "supported PHY is @ref BLE_GAP_PHY_1MBPS."]
1970 #[doc = "- When used with @ref sd_ble_gap_scan_start,"]
1971 #[doc = "the bitfield indicates the PHYs the scanner will use for scanning"]
1972 #[doc = "on primary advertising channels. The scanner will accept"]
1973 #[doc = "@ref BLE_GAP_PHYS_SUPPORTED as secondary advertising channel PHYs."]
1974 #[doc = "- When used with @ref sd_ble_gap_connect, the bitfield indicates"]
1975 #[doc = "the PHYs the initiator will use for scanning on primary advertising"]
1976 #[doc = "channels. The initiator will accept connections initiated on either"]
1977 #[doc = "of the @ref BLE_GAP_PHYS_SUPPORTED PHYs."]
1978 #[doc = "If scan_phys contains @ref BLE_GAP_PHY_1MBPS and/or @ref BLE_GAP_PHY_2MBPS,"]
1979 #[doc = "the primary scan PHY is @ref BLE_GAP_PHY_1MBPS."]
1980 #[doc = "If scan_phys also contains @ref BLE_GAP_PHY_CODED, the primary scan"]
1981 #[doc = "PHY will also contain @ref BLE_GAP_PHY_CODED. If the only scan PHY is"]
1982 #[doc = "@ref BLE_GAP_PHY_CODED, the primary scan PHY is"]
1983 #[doc = "@ref BLE_GAP_PHY_CODED only."]
1984 pub scan_phys: u8,
1985 #[doc = "< Scan interval in 625 us units. @sa BLE_GAP_SCAN_INTERVALS."]
1986 pub interval: u16,
1987 #[doc = "< Scan window in 625 us units. @sa BLE_GAP_SCAN_WINDOW."]
1988 #[doc = "If scan_phys contains both @ref BLE_GAP_PHY_1MBPS and"]
1989 #[doc = "@ref BLE_GAP_PHY_CODED interval shall be larger than or"]
1990 #[doc = "equal to twice the scan window."]
1991 pub window: u16,
1992 #[doc = "< Scan timeout in 10 ms units. @sa BLE_GAP_SCAN_TIMEOUT."]
1993 pub timeout: u16,
1994 #[doc = "< Channel mask for primary and secondary advertising channels."]
1995 #[doc = "At least one of the primary channels, that is channel index 37-39, must be"]
1996 #[doc = "set to 0."]
1997 #[doc = "Masking away secondary channels is not supported."]
1998 pub channel_mask: ble_gap_ch_mask_t,
1999}
2000#[test]
2001fn bindgen_test_layout_ble_gap_scan_params_t() {
2002 assert_eq!(
2003 ::core::mem::size_of::<ble_gap_scan_params_t>(),
2004 14usize,
2005 concat!("Size of: ", stringify!(ble_gap_scan_params_t))
2006 );
2007 assert_eq!(
2008 ::core::mem::align_of::<ble_gap_scan_params_t>(),
2009 2usize,
2010 concat!("Alignment of ", stringify!(ble_gap_scan_params_t))
2011 );
2012 assert_eq!(
2013 unsafe { &(*(::core::ptr::null::<ble_gap_scan_params_t>())).scan_phys as *const _ as usize },
2014 1usize,
2015 concat!(
2016 "Offset of field: ",
2017 stringify!(ble_gap_scan_params_t),
2018 "::",
2019 stringify!(scan_phys)
2020 )
2021 );
2022 assert_eq!(
2023 unsafe { &(*(::core::ptr::null::<ble_gap_scan_params_t>())).interval as *const _ as usize },
2024 2usize,
2025 concat!(
2026 "Offset of field: ",
2027 stringify!(ble_gap_scan_params_t),
2028 "::",
2029 stringify!(interval)
2030 )
2031 );
2032 assert_eq!(
2033 unsafe { &(*(::core::ptr::null::<ble_gap_scan_params_t>())).window as *const _ as usize },
2034 4usize,
2035 concat!(
2036 "Offset of field: ",
2037 stringify!(ble_gap_scan_params_t),
2038 "::",
2039 stringify!(window)
2040 )
2041 );
2042 assert_eq!(
2043 unsafe { &(*(::core::ptr::null::<ble_gap_scan_params_t>())).timeout as *const _ as usize },
2044 6usize,
2045 concat!(
2046 "Offset of field: ",
2047 stringify!(ble_gap_scan_params_t),
2048 "::",
2049 stringify!(timeout)
2050 )
2051 );
2052 assert_eq!(
2053 unsafe { &(*(::core::ptr::null::<ble_gap_scan_params_t>())).channel_mask as *const _ as usize },
2054 8usize,
2055 concat!(
2056 "Offset of field: ",
2057 stringify!(ble_gap_scan_params_t),
2058 "::",
2059 stringify!(channel_mask)
2060 )
2061 );
2062}
2063impl ble_gap_scan_params_t {
2064 #[inline]
2065 pub fn extended(&self) -> u8 {
2066 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
2067 }
2068 #[inline]
2069 pub fn set_extended(&mut self, val: u8) {
2070 unsafe {
2071 let val: u8 = ::core::mem::transmute(val);
2072 self._bitfield_1.set(0usize, 1u8, val as u64)
2073 }
2074 }
2075 #[inline]
2076 pub fn report_incomplete_evts(&self) -> u8 {
2077 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
2078 }
2079 #[inline]
2080 pub fn set_report_incomplete_evts(&mut self, val: u8) {
2081 unsafe {
2082 let val: u8 = ::core::mem::transmute(val);
2083 self._bitfield_1.set(1usize, 1u8, val as u64)
2084 }
2085 }
2086 #[inline]
2087 pub fn active(&self) -> u8 {
2088 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
2089 }
2090 #[inline]
2091 pub fn set_active(&mut self, val: u8) {
2092 unsafe {
2093 let val: u8 = ::core::mem::transmute(val);
2094 self._bitfield_1.set(2usize, 1u8, val as u64)
2095 }
2096 }
2097 #[inline]
2098 pub fn filter_policy(&self) -> u8 {
2099 unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 2u8) as u8) }
2100 }
2101 #[inline]
2102 pub fn set_filter_policy(&mut self, val: u8) {
2103 unsafe {
2104 let val: u8 = ::core::mem::transmute(val);
2105 self._bitfield_1.set(3usize, 2u8, val as u64)
2106 }
2107 }
2108 #[inline]
2109 pub fn new_bitfield_1(
2110 extended: u8,
2111 report_incomplete_evts: u8,
2112 active: u8,
2113 filter_policy: u8,
2114 ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
2115 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
2116 __bindgen_bitfield_unit.set(0usize, 1u8, {
2117 let extended: u8 = unsafe { ::core::mem::transmute(extended) };
2118 extended as u64
2119 });
2120 __bindgen_bitfield_unit.set(1usize, 1u8, {
2121 let report_incomplete_evts: u8 = unsafe { ::core::mem::transmute(report_incomplete_evts) };
2122 report_incomplete_evts as u64
2123 });
2124 __bindgen_bitfield_unit.set(2usize, 1u8, {
2125 let active: u8 = unsafe { ::core::mem::transmute(active) };
2126 active as u64
2127 });
2128 __bindgen_bitfield_unit.set(3usize, 2u8, {
2129 let filter_policy: u8 = unsafe { ::core::mem::transmute(filter_policy) };
2130 filter_policy as u64
2131 });
2132 __bindgen_bitfield_unit
2133 }
2134}
2135#[doc = "@brief Privacy."]
2136#[doc = ""]
2137#[doc = " The privacy feature provides a way for the device to avoid being tracked over a period of time."]
2138#[doc = " The privacy feature, when enabled, hides the local device identity and replaces it with a private address"]
2139#[doc = " that is automatically refreshed at a specified interval."]
2140#[doc = ""]
2141#[doc = " If a device still wants to be recognized by other peers, it needs to share it's Identity Resolving Key (IRK)."]
2142#[doc = " With this key, a device can generate a random private address that can only be recognized by peers in possession of that key,"]
2143#[doc = " and devices can establish connections without revealing their real identities."]
2144#[doc = ""]
2145#[doc = " Both network privacy (@ref BLE_GAP_PRIVACY_MODE_NETWORK_PRIVACY) and device privacy (@ref BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY)"]
2146#[doc = " are supported."]
2147#[doc = ""]
2148#[doc = " @note If the device IRK is updated, the new IRK becomes the one to be distributed in all"]
2149#[doc = " bonding procedures performed after @ref sd_ble_gap_privacy_set returns."]
2150#[doc = " The IRK distributed during bonding procedure is the device IRK that is active when @ref sd_ble_gap_sec_params_reply is called."]
2151#[repr(C)]
2152#[derive(Debug, Copy, Clone)]
2153pub struct ble_gap_privacy_params_t {
2154 #[doc = "< Privacy mode, see @ref BLE_GAP_PRIVACY_MODES. Default is @ref BLE_GAP_PRIVACY_MODE_OFF."]
2155 pub privacy_mode: u8,
2156 #[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."]
2157 pub private_addr_type: u8,
2158 #[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."]
2159 pub private_addr_cycle_s: u16,
2160 #[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."]
2161 #[doc = "When used as output, pointer to IRK structure where the current default IRK will be written to. If NULL, this argument is ignored."]
2162 #[doc = "By default, the default IRK is used to generate random private resolvable addresses for the local device unless instructed otherwise."]
2163 pub p_device_irk: *mut ble_gap_irk_t,
2164}
2165#[test]
2166fn bindgen_test_layout_ble_gap_privacy_params_t() {
2167 assert_eq!(
2168 ::core::mem::size_of::<ble_gap_privacy_params_t>(),
2169 8usize,
2170 concat!("Size of: ", stringify!(ble_gap_privacy_params_t))
2171 );
2172 assert_eq!(
2173 ::core::mem::align_of::<ble_gap_privacy_params_t>(),
2174 4usize,
2175 concat!("Alignment of ", stringify!(ble_gap_privacy_params_t))
2176 );
2177 assert_eq!(
2178 unsafe { &(*(::core::ptr::null::<ble_gap_privacy_params_t>())).privacy_mode as *const _ as usize },
2179 0usize,
2180 concat!(
2181 "Offset of field: ",
2182 stringify!(ble_gap_privacy_params_t),
2183 "::",
2184 stringify!(privacy_mode)
2185 )
2186 );
2187 assert_eq!(
2188 unsafe { &(*(::core::ptr::null::<ble_gap_privacy_params_t>())).private_addr_type as *const _ as usize },
2189 1usize,
2190 concat!(
2191 "Offset of field: ",
2192 stringify!(ble_gap_privacy_params_t),
2193 "::",
2194 stringify!(private_addr_type)
2195 )
2196 );
2197 assert_eq!(
2198 unsafe { &(*(::core::ptr::null::<ble_gap_privacy_params_t>())).private_addr_cycle_s as *const _ as usize },
2199 2usize,
2200 concat!(
2201 "Offset of field: ",
2202 stringify!(ble_gap_privacy_params_t),
2203 "::",
2204 stringify!(private_addr_cycle_s)
2205 )
2206 );
2207 assert_eq!(
2208 unsafe { &(*(::core::ptr::null::<ble_gap_privacy_params_t>())).p_device_irk as *const _ as usize },
2209 4usize,
2210 concat!(
2211 "Offset of field: ",
2212 stringify!(ble_gap_privacy_params_t),
2213 "::",
2214 stringify!(p_device_irk)
2215 )
2216 );
2217}
2218#[doc = "@brief PHY preferences for TX and RX"]
2219#[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."]
2220#[doc = " @code"]
2221#[doc = " p_gap_phys->tx_phys = BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_2MBPS;"]
2222#[doc = " p_gap_phys->rx_phys = BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_2MBPS;"]
2223#[doc = " @endcode"]
2224#[doc = ""]
2225#[repr(C)]
2226#[derive(Debug, Copy, Clone)]
2227pub struct ble_gap_phys_t {
2228 #[doc = "< Preferred transmit PHYs, see @ref BLE_GAP_PHYS."]
2229 pub tx_phys: u8,
2230 #[doc = "< Preferred receive PHYs, see @ref BLE_GAP_PHYS."]
2231 pub rx_phys: u8,
2232}
2233#[test]
2234fn bindgen_test_layout_ble_gap_phys_t() {
2235 assert_eq!(
2236 ::core::mem::size_of::<ble_gap_phys_t>(),
2237 2usize,
2238 concat!("Size of: ", stringify!(ble_gap_phys_t))
2239 );
2240 assert_eq!(
2241 ::core::mem::align_of::<ble_gap_phys_t>(),
2242 1usize,
2243 concat!("Alignment of ", stringify!(ble_gap_phys_t))
2244 );
2245 assert_eq!(
2246 unsafe { &(*(::core::ptr::null::<ble_gap_phys_t>())).tx_phys as *const _ as usize },
2247 0usize,
2248 concat!(
2249 "Offset of field: ",
2250 stringify!(ble_gap_phys_t),
2251 "::",
2252 stringify!(tx_phys)
2253 )
2254 );
2255 assert_eq!(
2256 unsafe { &(*(::core::ptr::null::<ble_gap_phys_t>())).rx_phys as *const _ as usize },
2257 1usize,
2258 concat!(
2259 "Offset of field: ",
2260 stringify!(ble_gap_phys_t),
2261 "::",
2262 stringify!(rx_phys)
2263 )
2264 );
2265}
2266#[doc = " @brief Keys that can be exchanged during a bonding procedure."]
2267#[repr(C, packed)]
2268#[derive(Debug, Copy, Clone)]
2269pub struct ble_gap_sec_kdist_t {
2270 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
2271}
2272#[test]
2273fn bindgen_test_layout_ble_gap_sec_kdist_t() {
2274 assert_eq!(
2275 ::core::mem::size_of::<ble_gap_sec_kdist_t>(),
2276 1usize,
2277 concat!("Size of: ", stringify!(ble_gap_sec_kdist_t))
2278 );
2279 assert_eq!(
2280 ::core::mem::align_of::<ble_gap_sec_kdist_t>(),
2281 1usize,
2282 concat!("Alignment of ", stringify!(ble_gap_sec_kdist_t))
2283 );
2284}
2285impl ble_gap_sec_kdist_t {
2286 #[inline]
2287 pub fn enc(&self) -> u8 {
2288 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
2289 }
2290 #[inline]
2291 pub fn set_enc(&mut self, val: u8) {
2292 unsafe {
2293 let val: u8 = ::core::mem::transmute(val);
2294 self._bitfield_1.set(0usize, 1u8, val as u64)
2295 }
2296 }
2297 #[inline]
2298 pub fn id(&self) -> u8 {
2299 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
2300 }
2301 #[inline]
2302 pub fn set_id(&mut self, val: u8) {
2303 unsafe {
2304 let val: u8 = ::core::mem::transmute(val);
2305 self._bitfield_1.set(1usize, 1u8, val as u64)
2306 }
2307 }
2308 #[inline]
2309 pub fn sign(&self) -> u8 {
2310 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
2311 }
2312 #[inline]
2313 pub fn set_sign(&mut self, val: u8) {
2314 unsafe {
2315 let val: u8 = ::core::mem::transmute(val);
2316 self._bitfield_1.set(2usize, 1u8, val as u64)
2317 }
2318 }
2319 #[inline]
2320 pub fn link(&self) -> u8 {
2321 unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
2322 }
2323 #[inline]
2324 pub fn set_link(&mut self, val: u8) {
2325 unsafe {
2326 let val: u8 = ::core::mem::transmute(val);
2327 self._bitfield_1.set(3usize, 1u8, val as u64)
2328 }
2329 }
2330 #[inline]
2331 pub fn new_bitfield_1(enc: u8, id: u8, sign: u8, link: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
2332 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
2333 __bindgen_bitfield_unit.set(0usize, 1u8, {
2334 let enc: u8 = unsafe { ::core::mem::transmute(enc) };
2335 enc as u64
2336 });
2337 __bindgen_bitfield_unit.set(1usize, 1u8, {
2338 let id: u8 = unsafe { ::core::mem::transmute(id) };
2339 id as u64
2340 });
2341 __bindgen_bitfield_unit.set(2usize, 1u8, {
2342 let sign: u8 = unsafe { ::core::mem::transmute(sign) };
2343 sign as u64
2344 });
2345 __bindgen_bitfield_unit.set(3usize, 1u8, {
2346 let link: u8 = unsafe { ::core::mem::transmute(link) };
2347 link as u64
2348 });
2349 __bindgen_bitfield_unit
2350 }
2351}
2352#[doc = "@brief GAP security parameters."]
2353#[repr(C)]
2354#[derive(Debug, Copy, Clone)]
2355pub struct ble_gap_sec_params_t {
2356 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
2357 #[doc = "< Minimum encryption key size in octets between 7 and 16. If 0 then not applicable in this instance."]
2358 pub min_key_size: u8,
2359 #[doc = "< Maximum encryption key size in octets between min_key_size and 16."]
2360 pub max_key_size: u8,
2361 #[doc = "< Key distribution bitmap: keys that the local device will distribute."]
2362 pub kdist_own: ble_gap_sec_kdist_t,
2363 #[doc = "< Key distribution bitmap: keys that the remote device will distribute."]
2364 pub kdist_peer: ble_gap_sec_kdist_t,
2365}
2366#[test]
2367fn bindgen_test_layout_ble_gap_sec_params_t() {
2368 assert_eq!(
2369 ::core::mem::size_of::<ble_gap_sec_params_t>(),
2370 5usize,
2371 concat!("Size of: ", stringify!(ble_gap_sec_params_t))
2372 );
2373 assert_eq!(
2374 ::core::mem::align_of::<ble_gap_sec_params_t>(),
2375 1usize,
2376 concat!("Alignment of ", stringify!(ble_gap_sec_params_t))
2377 );
2378 assert_eq!(
2379 unsafe { &(*(::core::ptr::null::<ble_gap_sec_params_t>())).min_key_size as *const _ as usize },
2380 1usize,
2381 concat!(
2382 "Offset of field: ",
2383 stringify!(ble_gap_sec_params_t),
2384 "::",
2385 stringify!(min_key_size)
2386 )
2387 );
2388 assert_eq!(
2389 unsafe { &(*(::core::ptr::null::<ble_gap_sec_params_t>())).max_key_size as *const _ as usize },
2390 2usize,
2391 concat!(
2392 "Offset of field: ",
2393 stringify!(ble_gap_sec_params_t),
2394 "::",
2395 stringify!(max_key_size)
2396 )
2397 );
2398 assert_eq!(
2399 unsafe { &(*(::core::ptr::null::<ble_gap_sec_params_t>())).kdist_own as *const _ as usize },
2400 3usize,
2401 concat!(
2402 "Offset of field: ",
2403 stringify!(ble_gap_sec_params_t),
2404 "::",
2405 stringify!(kdist_own)
2406 )
2407 );
2408 assert_eq!(
2409 unsafe { &(*(::core::ptr::null::<ble_gap_sec_params_t>())).kdist_peer as *const _ as usize },
2410 4usize,
2411 concat!(
2412 "Offset of field: ",
2413 stringify!(ble_gap_sec_params_t),
2414 "::",
2415 stringify!(kdist_peer)
2416 )
2417 );
2418}
2419impl ble_gap_sec_params_t {
2420 #[inline]
2421 pub fn bond(&self) -> u8 {
2422 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
2423 }
2424 #[inline]
2425 pub fn set_bond(&mut self, val: u8) {
2426 unsafe {
2427 let val: u8 = ::core::mem::transmute(val);
2428 self._bitfield_1.set(0usize, 1u8, val as u64)
2429 }
2430 }
2431 #[inline]
2432 pub fn mitm(&self) -> u8 {
2433 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
2434 }
2435 #[inline]
2436 pub fn set_mitm(&mut self, val: u8) {
2437 unsafe {
2438 let val: u8 = ::core::mem::transmute(val);
2439 self._bitfield_1.set(1usize, 1u8, val as u64)
2440 }
2441 }
2442 #[inline]
2443 pub fn lesc(&self) -> u8 {
2444 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
2445 }
2446 #[inline]
2447 pub fn set_lesc(&mut self, val: u8) {
2448 unsafe {
2449 let val: u8 = ::core::mem::transmute(val);
2450 self._bitfield_1.set(2usize, 1u8, val as u64)
2451 }
2452 }
2453 #[inline]
2454 pub fn keypress(&self) -> u8 {
2455 unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
2456 }
2457 #[inline]
2458 pub fn set_keypress(&mut self, val: u8) {
2459 unsafe {
2460 let val: u8 = ::core::mem::transmute(val);
2461 self._bitfield_1.set(3usize, 1u8, val as u64)
2462 }
2463 }
2464 #[inline]
2465 pub fn io_caps(&self) -> u8 {
2466 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 3u8) as u8) }
2467 }
2468 #[inline]
2469 pub fn set_io_caps(&mut self, val: u8) {
2470 unsafe {
2471 let val: u8 = ::core::mem::transmute(val);
2472 self._bitfield_1.set(4usize, 3u8, val as u64)
2473 }
2474 }
2475 #[inline]
2476 pub fn oob(&self) -> u8 {
2477 unsafe { ::core::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u8) }
2478 }
2479 #[inline]
2480 pub fn set_oob(&mut self, val: u8) {
2481 unsafe {
2482 let val: u8 = ::core::mem::transmute(val);
2483 self._bitfield_1.set(7usize, 1u8, val as u64)
2484 }
2485 }
2486 #[inline]
2487 pub fn new_bitfield_1(
2488 bond: u8,
2489 mitm: u8,
2490 lesc: u8,
2491 keypress: u8,
2492 io_caps: u8,
2493 oob: u8,
2494 ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
2495 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
2496 __bindgen_bitfield_unit.set(0usize, 1u8, {
2497 let bond: u8 = unsafe { ::core::mem::transmute(bond) };
2498 bond as u64
2499 });
2500 __bindgen_bitfield_unit.set(1usize, 1u8, {
2501 let mitm: u8 = unsafe { ::core::mem::transmute(mitm) };
2502 mitm as u64
2503 });
2504 __bindgen_bitfield_unit.set(2usize, 1u8, {
2505 let lesc: u8 = unsafe { ::core::mem::transmute(lesc) };
2506 lesc as u64
2507 });
2508 __bindgen_bitfield_unit.set(3usize, 1u8, {
2509 let keypress: u8 = unsafe { ::core::mem::transmute(keypress) };
2510 keypress as u64
2511 });
2512 __bindgen_bitfield_unit.set(4usize, 3u8, {
2513 let io_caps: u8 = unsafe { ::core::mem::transmute(io_caps) };
2514 io_caps as u64
2515 });
2516 __bindgen_bitfield_unit.set(7usize, 1u8, {
2517 let oob: u8 = unsafe { ::core::mem::transmute(oob) };
2518 oob as u64
2519 });
2520 __bindgen_bitfield_unit
2521 }
2522}
2523#[doc = "@brief GAP Encryption Information."]
2524#[repr(C)]
2525#[derive(Debug, Copy, Clone)]
2526pub struct ble_gap_enc_info_t {
2527 #[doc = "< Long Term Key."]
2528 pub ltk: [u8; 16usize],
2529 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
2530}
2531#[test]
2532fn bindgen_test_layout_ble_gap_enc_info_t() {
2533 assert_eq!(
2534 ::core::mem::size_of::<ble_gap_enc_info_t>(),
2535 17usize,
2536 concat!("Size of: ", stringify!(ble_gap_enc_info_t))
2537 );
2538 assert_eq!(
2539 ::core::mem::align_of::<ble_gap_enc_info_t>(),
2540 1usize,
2541 concat!("Alignment of ", stringify!(ble_gap_enc_info_t))
2542 );
2543 assert_eq!(
2544 unsafe { &(*(::core::ptr::null::<ble_gap_enc_info_t>())).ltk as *const _ as usize },
2545 0usize,
2546 concat!(
2547 "Offset of field: ",
2548 stringify!(ble_gap_enc_info_t),
2549 "::",
2550 stringify!(ltk)
2551 )
2552 );
2553}
2554impl ble_gap_enc_info_t {
2555 #[inline]
2556 pub fn lesc(&self) -> u8 {
2557 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
2558 }
2559 #[inline]
2560 pub fn set_lesc(&mut self, val: u8) {
2561 unsafe {
2562 let val: u8 = ::core::mem::transmute(val);
2563 self._bitfield_1.set(0usize, 1u8, val as u64)
2564 }
2565 }
2566 #[inline]
2567 pub fn auth(&self) -> u8 {
2568 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
2569 }
2570 #[inline]
2571 pub fn set_auth(&mut self, val: u8) {
2572 unsafe {
2573 let val: u8 = ::core::mem::transmute(val);
2574 self._bitfield_1.set(1usize, 1u8, val as u64)
2575 }
2576 }
2577 #[inline]
2578 pub fn ltk_len(&self) -> u8 {
2579 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 6u8) as u8) }
2580 }
2581 #[inline]
2582 pub fn set_ltk_len(&mut self, val: u8) {
2583 unsafe {
2584 let val: u8 = ::core::mem::transmute(val);
2585 self._bitfield_1.set(2usize, 6u8, val as u64)
2586 }
2587 }
2588 #[inline]
2589 pub fn new_bitfield_1(lesc: u8, auth: u8, ltk_len: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
2590 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
2591 __bindgen_bitfield_unit.set(0usize, 1u8, {
2592 let lesc: u8 = unsafe { ::core::mem::transmute(lesc) };
2593 lesc as u64
2594 });
2595 __bindgen_bitfield_unit.set(1usize, 1u8, {
2596 let auth: u8 = unsafe { ::core::mem::transmute(auth) };
2597 auth as u64
2598 });
2599 __bindgen_bitfield_unit.set(2usize, 6u8, {
2600 let ltk_len: u8 = unsafe { ::core::mem::transmute(ltk_len) };
2601 ltk_len as u64
2602 });
2603 __bindgen_bitfield_unit
2604 }
2605}
2606#[doc = "@brief GAP Master Identification."]
2607#[repr(C)]
2608#[derive(Debug, Copy, Clone)]
2609pub struct ble_gap_master_id_t {
2610 #[doc = "< Encrypted Diversifier."]
2611 pub ediv: u16,
2612 #[doc = "< Random Number."]
2613 pub rand: [u8; 8usize],
2614}
2615#[test]
2616fn bindgen_test_layout_ble_gap_master_id_t() {
2617 assert_eq!(
2618 ::core::mem::size_of::<ble_gap_master_id_t>(),
2619 10usize,
2620 concat!("Size of: ", stringify!(ble_gap_master_id_t))
2621 );
2622 assert_eq!(
2623 ::core::mem::align_of::<ble_gap_master_id_t>(),
2624 2usize,
2625 concat!("Alignment of ", stringify!(ble_gap_master_id_t))
2626 );
2627 assert_eq!(
2628 unsafe { &(*(::core::ptr::null::<ble_gap_master_id_t>())).ediv as *const _ as usize },
2629 0usize,
2630 concat!(
2631 "Offset of field: ",
2632 stringify!(ble_gap_master_id_t),
2633 "::",
2634 stringify!(ediv)
2635 )
2636 );
2637 assert_eq!(
2638 unsafe { &(*(::core::ptr::null::<ble_gap_master_id_t>())).rand as *const _ as usize },
2639 2usize,
2640 concat!(
2641 "Offset of field: ",
2642 stringify!(ble_gap_master_id_t),
2643 "::",
2644 stringify!(rand)
2645 )
2646 );
2647}
2648#[doc = "@brief GAP Signing Information."]
2649#[repr(C)]
2650#[derive(Debug, Copy, Clone)]
2651pub struct ble_gap_sign_info_t {
2652 #[doc = "< Connection Signature Resolving Key."]
2653 pub csrk: [u8; 16usize],
2654}
2655#[test]
2656fn bindgen_test_layout_ble_gap_sign_info_t() {
2657 assert_eq!(
2658 ::core::mem::size_of::<ble_gap_sign_info_t>(),
2659 16usize,
2660 concat!("Size of: ", stringify!(ble_gap_sign_info_t))
2661 );
2662 assert_eq!(
2663 ::core::mem::align_of::<ble_gap_sign_info_t>(),
2664 1usize,
2665 concat!("Alignment of ", stringify!(ble_gap_sign_info_t))
2666 );
2667 assert_eq!(
2668 unsafe { &(*(::core::ptr::null::<ble_gap_sign_info_t>())).csrk as *const _ as usize },
2669 0usize,
2670 concat!(
2671 "Offset of field: ",
2672 stringify!(ble_gap_sign_info_t),
2673 "::",
2674 stringify!(csrk)
2675 )
2676 );
2677}
2678#[doc = "@brief GAP LE Secure Connections P-256 Public Key."]
2679#[repr(C)]
2680#[derive(Copy, Clone)]
2681pub struct ble_gap_lesc_p256_pk_t {
2682 #[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."]
2683 pub pk: [u8; 64usize],
2684}
2685#[test]
2686fn bindgen_test_layout_ble_gap_lesc_p256_pk_t() {
2687 assert_eq!(
2688 ::core::mem::size_of::<ble_gap_lesc_p256_pk_t>(),
2689 64usize,
2690 concat!("Size of: ", stringify!(ble_gap_lesc_p256_pk_t))
2691 );
2692 assert_eq!(
2693 ::core::mem::align_of::<ble_gap_lesc_p256_pk_t>(),
2694 1usize,
2695 concat!("Alignment of ", stringify!(ble_gap_lesc_p256_pk_t))
2696 );
2697 assert_eq!(
2698 unsafe { &(*(::core::ptr::null::<ble_gap_lesc_p256_pk_t>())).pk as *const _ as usize },
2699 0usize,
2700 concat!(
2701 "Offset of field: ",
2702 stringify!(ble_gap_lesc_p256_pk_t),
2703 "::",
2704 stringify!(pk)
2705 )
2706 );
2707}
2708#[doc = "@brief GAP LE Secure Connections DHKey."]
2709#[repr(C)]
2710#[derive(Debug, Copy, Clone)]
2711pub struct ble_gap_lesc_dhkey_t {
2712 #[doc = "< LE Secure Connections Elliptic Curve Diffie-Hellman Key. Stored in little-endian."]
2713 pub key: [u8; 32usize],
2714}
2715#[test]
2716fn bindgen_test_layout_ble_gap_lesc_dhkey_t() {
2717 assert_eq!(
2718 ::core::mem::size_of::<ble_gap_lesc_dhkey_t>(),
2719 32usize,
2720 concat!("Size of: ", stringify!(ble_gap_lesc_dhkey_t))
2721 );
2722 assert_eq!(
2723 ::core::mem::align_of::<ble_gap_lesc_dhkey_t>(),
2724 1usize,
2725 concat!("Alignment of ", stringify!(ble_gap_lesc_dhkey_t))
2726 );
2727 assert_eq!(
2728 unsafe { &(*(::core::ptr::null::<ble_gap_lesc_dhkey_t>())).key as *const _ as usize },
2729 0usize,
2730 concat!(
2731 "Offset of field: ",
2732 stringify!(ble_gap_lesc_dhkey_t),
2733 "::",
2734 stringify!(key)
2735 )
2736 );
2737}
2738#[doc = "@brief GAP LE Secure Connections OOB data."]
2739#[repr(C)]
2740#[derive(Debug, Copy, Clone)]
2741pub struct ble_gap_lesc_oob_data_t {
2742 #[doc = "< Bluetooth address of the device."]
2743 pub addr: ble_gap_addr_t,
2744 #[doc = "< Random Number."]
2745 pub r: [u8; 16usize],
2746 #[doc = "< Confirm Value."]
2747 pub c: [u8; 16usize],
2748}
2749#[test]
2750fn bindgen_test_layout_ble_gap_lesc_oob_data_t() {
2751 assert_eq!(
2752 ::core::mem::size_of::<ble_gap_lesc_oob_data_t>(),
2753 39usize,
2754 concat!("Size of: ", stringify!(ble_gap_lesc_oob_data_t))
2755 );
2756 assert_eq!(
2757 ::core::mem::align_of::<ble_gap_lesc_oob_data_t>(),
2758 1usize,
2759 concat!("Alignment of ", stringify!(ble_gap_lesc_oob_data_t))
2760 );
2761 assert_eq!(
2762 unsafe { &(*(::core::ptr::null::<ble_gap_lesc_oob_data_t>())).addr as *const _ as usize },
2763 0usize,
2764 concat!(
2765 "Offset of field: ",
2766 stringify!(ble_gap_lesc_oob_data_t),
2767 "::",
2768 stringify!(addr)
2769 )
2770 );
2771 assert_eq!(
2772 unsafe { &(*(::core::ptr::null::<ble_gap_lesc_oob_data_t>())).r as *const _ as usize },
2773 7usize,
2774 concat!(
2775 "Offset of field: ",
2776 stringify!(ble_gap_lesc_oob_data_t),
2777 "::",
2778 stringify!(r)
2779 )
2780 );
2781 assert_eq!(
2782 unsafe { &(*(::core::ptr::null::<ble_gap_lesc_oob_data_t>())).c as *const _ as usize },
2783 23usize,
2784 concat!(
2785 "Offset of field: ",
2786 stringify!(ble_gap_lesc_oob_data_t),
2787 "::",
2788 stringify!(c)
2789 )
2790 );
2791}
2792#[doc = "@brief Event structure for @ref BLE_GAP_EVT_CONNECTED."]
2793#[repr(C)]
2794#[derive(Debug, Copy, Clone)]
2795pub struct ble_gap_evt_connected_t {
2796 #[doc = "< Bluetooth address of the peer device. If the peer_addr resolved: @ref ble_gap_addr_t::addr_id_peer is set to 1"]
2797 #[doc = "and the address is the device's identity address."]
2798 pub peer_addr: ble_gap_addr_t,
2799 #[doc = "< BLE role for this connection, see @ref BLE_GAP_ROLES"]
2800 pub role: u8,
2801 #[doc = "< GAP Connection Parameters."]
2802 pub conn_params: ble_gap_conn_params_t,
2803 #[doc = "< Advertising handle in which advertising has ended."]
2804 #[doc = "This variable is only set if role is set to @ref BLE_GAP_ROLE_PERIPH."]
2805 pub adv_handle: u8,
2806 #[doc = "< Advertising buffers corresponding to the terminated"]
2807 #[doc = "advertising set. The advertising buffers provided in"]
2808 #[doc = "@ref sd_ble_gap_adv_set_configure are now released."]
2809 #[doc = "This variable is only set if role is set to @ref BLE_GAP_ROLE_PERIPH."]
2810 pub adv_data: ble_gap_adv_data_t,
2811}
2812#[test]
2813fn bindgen_test_layout_ble_gap_evt_connected_t() {
2814 assert_eq!(
2815 ::core::mem::size_of::<ble_gap_evt_connected_t>(),
2816 36usize,
2817 concat!("Size of: ", stringify!(ble_gap_evt_connected_t))
2818 );
2819 assert_eq!(
2820 ::core::mem::align_of::<ble_gap_evt_connected_t>(),
2821 4usize,
2822 concat!("Alignment of ", stringify!(ble_gap_evt_connected_t))
2823 );
2824 assert_eq!(
2825 unsafe { &(*(::core::ptr::null::<ble_gap_evt_connected_t>())).peer_addr as *const _ as usize },
2826 0usize,
2827 concat!(
2828 "Offset of field: ",
2829 stringify!(ble_gap_evt_connected_t),
2830 "::",
2831 stringify!(peer_addr)
2832 )
2833 );
2834 assert_eq!(
2835 unsafe { &(*(::core::ptr::null::<ble_gap_evt_connected_t>())).role as *const _ as usize },
2836 7usize,
2837 concat!(
2838 "Offset of field: ",
2839 stringify!(ble_gap_evt_connected_t),
2840 "::",
2841 stringify!(role)
2842 )
2843 );
2844 assert_eq!(
2845 unsafe { &(*(::core::ptr::null::<ble_gap_evt_connected_t>())).conn_params as *const _ as usize },
2846 8usize,
2847 concat!(
2848 "Offset of field: ",
2849 stringify!(ble_gap_evt_connected_t),
2850 "::",
2851 stringify!(conn_params)
2852 )
2853 );
2854 assert_eq!(
2855 unsafe { &(*(::core::ptr::null::<ble_gap_evt_connected_t>())).adv_handle as *const _ as usize },
2856 16usize,
2857 concat!(
2858 "Offset of field: ",
2859 stringify!(ble_gap_evt_connected_t),
2860 "::",
2861 stringify!(adv_handle)
2862 )
2863 );
2864 assert_eq!(
2865 unsafe { &(*(::core::ptr::null::<ble_gap_evt_connected_t>())).adv_data as *const _ as usize },
2866 20usize,
2867 concat!(
2868 "Offset of field: ",
2869 stringify!(ble_gap_evt_connected_t),
2870 "::",
2871 stringify!(adv_data)
2872 )
2873 );
2874}
2875#[doc = "@brief Event structure for @ref BLE_GAP_EVT_DISCONNECTED."]
2876#[repr(C)]
2877#[derive(Debug, Copy, Clone)]
2878pub struct ble_gap_evt_disconnected_t {
2879 #[doc = "< HCI error code, see @ref BLE_HCI_STATUS_CODES."]
2880 pub reason: u8,
2881}
2882#[test]
2883fn bindgen_test_layout_ble_gap_evt_disconnected_t() {
2884 assert_eq!(
2885 ::core::mem::size_of::<ble_gap_evt_disconnected_t>(),
2886 1usize,
2887 concat!("Size of: ", stringify!(ble_gap_evt_disconnected_t))
2888 );
2889 assert_eq!(
2890 ::core::mem::align_of::<ble_gap_evt_disconnected_t>(),
2891 1usize,
2892 concat!("Alignment of ", stringify!(ble_gap_evt_disconnected_t))
2893 );
2894 assert_eq!(
2895 unsafe { &(*(::core::ptr::null::<ble_gap_evt_disconnected_t>())).reason as *const _ as usize },
2896 0usize,
2897 concat!(
2898 "Offset of field: ",
2899 stringify!(ble_gap_evt_disconnected_t),
2900 "::",
2901 stringify!(reason)
2902 )
2903 );
2904}
2905#[doc = "@brief Event structure for @ref BLE_GAP_EVT_CONN_PARAM_UPDATE."]
2906#[repr(C)]
2907#[derive(Debug, Copy, Clone)]
2908pub struct ble_gap_evt_conn_param_update_t {
2909 #[doc = "< GAP Connection Parameters."]
2910 pub conn_params: ble_gap_conn_params_t,
2911}
2912#[test]
2913fn bindgen_test_layout_ble_gap_evt_conn_param_update_t() {
2914 assert_eq!(
2915 ::core::mem::size_of::<ble_gap_evt_conn_param_update_t>(),
2916 8usize,
2917 concat!("Size of: ", stringify!(ble_gap_evt_conn_param_update_t))
2918 );
2919 assert_eq!(
2920 ::core::mem::align_of::<ble_gap_evt_conn_param_update_t>(),
2921 2usize,
2922 concat!("Alignment of ", stringify!(ble_gap_evt_conn_param_update_t))
2923 );
2924 assert_eq!(
2925 unsafe { &(*(::core::ptr::null::<ble_gap_evt_conn_param_update_t>())).conn_params as *const _ as usize },
2926 0usize,
2927 concat!(
2928 "Offset of field: ",
2929 stringify!(ble_gap_evt_conn_param_update_t),
2930 "::",
2931 stringify!(conn_params)
2932 )
2933 );
2934}
2935#[doc = "@brief Event structure for @ref BLE_GAP_EVT_PHY_UPDATE_REQUEST."]
2936#[repr(C)]
2937#[derive(Debug, Copy, Clone)]
2938pub struct ble_gap_evt_phy_update_request_t {
2939 #[doc = "< The PHYs the peer prefers to use."]
2940 pub peer_preferred_phys: ble_gap_phys_t,
2941}
2942#[test]
2943fn bindgen_test_layout_ble_gap_evt_phy_update_request_t() {
2944 assert_eq!(
2945 ::core::mem::size_of::<ble_gap_evt_phy_update_request_t>(),
2946 2usize,
2947 concat!("Size of: ", stringify!(ble_gap_evt_phy_update_request_t))
2948 );
2949 assert_eq!(
2950 ::core::mem::align_of::<ble_gap_evt_phy_update_request_t>(),
2951 1usize,
2952 concat!("Alignment of ", stringify!(ble_gap_evt_phy_update_request_t))
2953 );
2954 assert_eq!(
2955 unsafe {
2956 &(*(::core::ptr::null::<ble_gap_evt_phy_update_request_t>())).peer_preferred_phys as *const _ as usize
2957 },
2958 0usize,
2959 concat!(
2960 "Offset of field: ",
2961 stringify!(ble_gap_evt_phy_update_request_t),
2962 "::",
2963 stringify!(peer_preferred_phys)
2964 )
2965 );
2966}
2967#[doc = "@brief Event Structure for @ref BLE_GAP_EVT_PHY_UPDATE."]
2968#[repr(C)]
2969#[derive(Debug, Copy, Clone)]
2970pub struct ble_gap_evt_phy_update_t {
2971 #[doc = "< Status of the procedure, see @ref BLE_HCI_STATUS_CODES."]
2972 pub status: u8,
2973 #[doc = "< TX PHY for this connection, see @ref BLE_GAP_PHYS."]
2974 pub tx_phy: u8,
2975 #[doc = "< RX PHY for this connection, see @ref BLE_GAP_PHYS."]
2976 pub rx_phy: u8,
2977}
2978#[test]
2979fn bindgen_test_layout_ble_gap_evt_phy_update_t() {
2980 assert_eq!(
2981 ::core::mem::size_of::<ble_gap_evt_phy_update_t>(),
2982 3usize,
2983 concat!("Size of: ", stringify!(ble_gap_evt_phy_update_t))
2984 );
2985 assert_eq!(
2986 ::core::mem::align_of::<ble_gap_evt_phy_update_t>(),
2987 1usize,
2988 concat!("Alignment of ", stringify!(ble_gap_evt_phy_update_t))
2989 );
2990 assert_eq!(
2991 unsafe { &(*(::core::ptr::null::<ble_gap_evt_phy_update_t>())).status as *const _ as usize },
2992 0usize,
2993 concat!(
2994 "Offset of field: ",
2995 stringify!(ble_gap_evt_phy_update_t),
2996 "::",
2997 stringify!(status)
2998 )
2999 );
3000 assert_eq!(
3001 unsafe { &(*(::core::ptr::null::<ble_gap_evt_phy_update_t>())).tx_phy as *const _ as usize },
3002 1usize,
3003 concat!(
3004 "Offset of field: ",
3005 stringify!(ble_gap_evt_phy_update_t),
3006 "::",
3007 stringify!(tx_phy)
3008 )
3009 );
3010 assert_eq!(
3011 unsafe { &(*(::core::ptr::null::<ble_gap_evt_phy_update_t>())).rx_phy as *const _ as usize },
3012 2usize,
3013 concat!(
3014 "Offset of field: ",
3015 stringify!(ble_gap_evt_phy_update_t),
3016 "::",
3017 stringify!(rx_phy)
3018 )
3019 );
3020}
3021#[doc = "@brief Event structure for @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST."]
3022#[repr(C)]
3023#[derive(Debug, Copy, Clone)]
3024pub struct ble_gap_evt_sec_params_request_t {
3025 #[doc = "< Initiator Security Parameters."]
3026 pub peer_params: ble_gap_sec_params_t,
3027}
3028#[test]
3029fn bindgen_test_layout_ble_gap_evt_sec_params_request_t() {
3030 assert_eq!(
3031 ::core::mem::size_of::<ble_gap_evt_sec_params_request_t>(),
3032 5usize,
3033 concat!("Size of: ", stringify!(ble_gap_evt_sec_params_request_t))
3034 );
3035 assert_eq!(
3036 ::core::mem::align_of::<ble_gap_evt_sec_params_request_t>(),
3037 1usize,
3038 concat!("Alignment of ", stringify!(ble_gap_evt_sec_params_request_t))
3039 );
3040 assert_eq!(
3041 unsafe { &(*(::core::ptr::null::<ble_gap_evt_sec_params_request_t>())).peer_params as *const _ as usize },
3042 0usize,
3043 concat!(
3044 "Offset of field: ",
3045 stringify!(ble_gap_evt_sec_params_request_t),
3046 "::",
3047 stringify!(peer_params)
3048 )
3049 );
3050}
3051#[doc = "@brief Event structure for @ref BLE_GAP_EVT_SEC_INFO_REQUEST."]
3052#[repr(C)]
3053#[derive(Debug, Copy, Clone)]
3054pub struct ble_gap_evt_sec_info_request_t {
3055 #[doc = "< Bluetooth address of the peer device."]
3056 pub peer_addr: ble_gap_addr_t,
3057 #[doc = "< Master Identification for LTK lookup."]
3058 pub master_id: ble_gap_master_id_t,
3059 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
3060 pub __bindgen_padding_0: u8,
3061}
3062#[test]
3063fn bindgen_test_layout_ble_gap_evt_sec_info_request_t() {
3064 assert_eq!(
3065 ::core::mem::size_of::<ble_gap_evt_sec_info_request_t>(),
3066 20usize,
3067 concat!("Size of: ", stringify!(ble_gap_evt_sec_info_request_t))
3068 );
3069 assert_eq!(
3070 ::core::mem::align_of::<ble_gap_evt_sec_info_request_t>(),
3071 2usize,
3072 concat!("Alignment of ", stringify!(ble_gap_evt_sec_info_request_t))
3073 );
3074 assert_eq!(
3075 unsafe { &(*(::core::ptr::null::<ble_gap_evt_sec_info_request_t>())).peer_addr as *const _ as usize },
3076 0usize,
3077 concat!(
3078 "Offset of field: ",
3079 stringify!(ble_gap_evt_sec_info_request_t),
3080 "::",
3081 stringify!(peer_addr)
3082 )
3083 );
3084 assert_eq!(
3085 unsafe { &(*(::core::ptr::null::<ble_gap_evt_sec_info_request_t>())).master_id as *const _ as usize },
3086 8usize,
3087 concat!(
3088 "Offset of field: ",
3089 stringify!(ble_gap_evt_sec_info_request_t),
3090 "::",
3091 stringify!(master_id)
3092 )
3093 );
3094}
3095impl ble_gap_evt_sec_info_request_t {
3096 #[inline]
3097 pub fn enc_info(&self) -> u8 {
3098 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
3099 }
3100 #[inline]
3101 pub fn set_enc_info(&mut self, val: u8) {
3102 unsafe {
3103 let val: u8 = ::core::mem::transmute(val);
3104 self._bitfield_1.set(0usize, 1u8, val as u64)
3105 }
3106 }
3107 #[inline]
3108 pub fn id_info(&self) -> u8 {
3109 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
3110 }
3111 #[inline]
3112 pub fn set_id_info(&mut self, val: u8) {
3113 unsafe {
3114 let val: u8 = ::core::mem::transmute(val);
3115 self._bitfield_1.set(1usize, 1u8, val as u64)
3116 }
3117 }
3118 #[inline]
3119 pub fn sign_info(&self) -> u8 {
3120 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
3121 }
3122 #[inline]
3123 pub fn set_sign_info(&mut self, val: u8) {
3124 unsafe {
3125 let val: u8 = ::core::mem::transmute(val);
3126 self._bitfield_1.set(2usize, 1u8, val as u64)
3127 }
3128 }
3129 #[inline]
3130 pub fn new_bitfield_1(enc_info: u8, id_info: u8, sign_info: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
3131 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
3132 __bindgen_bitfield_unit.set(0usize, 1u8, {
3133 let enc_info: u8 = unsafe { ::core::mem::transmute(enc_info) };
3134 enc_info as u64
3135 });
3136 __bindgen_bitfield_unit.set(1usize, 1u8, {
3137 let id_info: u8 = unsafe { ::core::mem::transmute(id_info) };
3138 id_info as u64
3139 });
3140 __bindgen_bitfield_unit.set(2usize, 1u8, {
3141 let sign_info: u8 = unsafe { ::core::mem::transmute(sign_info) };
3142 sign_info as u64
3143 });
3144 __bindgen_bitfield_unit
3145 }
3146}
3147#[doc = "@brief Event structure for @ref BLE_GAP_EVT_PASSKEY_DISPLAY."]
3148#[repr(C)]
3149#[derive(Debug, Copy, Clone)]
3150pub struct ble_gap_evt_passkey_display_t {
3151 #[doc = "< 6-digit passkey in ASCII ('0'-'9' digits only)."]
3152 pub passkey: [u8; 6usize],
3153 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
3154}
3155#[test]
3156fn bindgen_test_layout_ble_gap_evt_passkey_display_t() {
3157 assert_eq!(
3158 ::core::mem::size_of::<ble_gap_evt_passkey_display_t>(),
3159 7usize,
3160 concat!("Size of: ", stringify!(ble_gap_evt_passkey_display_t))
3161 );
3162 assert_eq!(
3163 ::core::mem::align_of::<ble_gap_evt_passkey_display_t>(),
3164 1usize,
3165 concat!("Alignment of ", stringify!(ble_gap_evt_passkey_display_t))
3166 );
3167 assert_eq!(
3168 unsafe { &(*(::core::ptr::null::<ble_gap_evt_passkey_display_t>())).passkey as *const _ as usize },
3169 0usize,
3170 concat!(
3171 "Offset of field: ",
3172 stringify!(ble_gap_evt_passkey_display_t),
3173 "::",
3174 stringify!(passkey)
3175 )
3176 );
3177}
3178impl ble_gap_evt_passkey_display_t {
3179 #[inline]
3180 pub fn match_request(&self) -> u8 {
3181 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
3182 }
3183 #[inline]
3184 pub fn set_match_request(&mut self, val: u8) {
3185 unsafe {
3186 let val: u8 = ::core::mem::transmute(val);
3187 self._bitfield_1.set(0usize, 1u8, val as u64)
3188 }
3189 }
3190 #[inline]
3191 pub fn new_bitfield_1(match_request: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
3192 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
3193 __bindgen_bitfield_unit.set(0usize, 1u8, {
3194 let match_request: u8 = unsafe { ::core::mem::transmute(match_request) };
3195 match_request as u64
3196 });
3197 __bindgen_bitfield_unit
3198 }
3199}
3200#[doc = "@brief Event structure for @ref BLE_GAP_EVT_KEY_PRESSED."]
3201#[repr(C)]
3202#[derive(Debug, Copy, Clone)]
3203pub struct ble_gap_evt_key_pressed_t {
3204 #[doc = "< Keypress notification type, see @ref BLE_GAP_KP_NOT_TYPES."]
3205 pub kp_not: u8,
3206}
3207#[test]
3208fn bindgen_test_layout_ble_gap_evt_key_pressed_t() {
3209 assert_eq!(
3210 ::core::mem::size_of::<ble_gap_evt_key_pressed_t>(),
3211 1usize,
3212 concat!("Size of: ", stringify!(ble_gap_evt_key_pressed_t))
3213 );
3214 assert_eq!(
3215 ::core::mem::align_of::<ble_gap_evt_key_pressed_t>(),
3216 1usize,
3217 concat!("Alignment of ", stringify!(ble_gap_evt_key_pressed_t))
3218 );
3219 assert_eq!(
3220 unsafe { &(*(::core::ptr::null::<ble_gap_evt_key_pressed_t>())).kp_not as *const _ as usize },
3221 0usize,
3222 concat!(
3223 "Offset of field: ",
3224 stringify!(ble_gap_evt_key_pressed_t),
3225 "::",
3226 stringify!(kp_not)
3227 )
3228 );
3229}
3230#[doc = "@brief Event structure for @ref BLE_GAP_EVT_AUTH_KEY_REQUEST."]
3231#[repr(C)]
3232#[derive(Debug, Copy, Clone)]
3233pub struct ble_gap_evt_auth_key_request_t {
3234 #[doc = "< See @ref BLE_GAP_AUTH_KEY_TYPES."]
3235 pub key_type: u8,
3236}
3237#[test]
3238fn bindgen_test_layout_ble_gap_evt_auth_key_request_t() {
3239 assert_eq!(
3240 ::core::mem::size_of::<ble_gap_evt_auth_key_request_t>(),
3241 1usize,
3242 concat!("Size of: ", stringify!(ble_gap_evt_auth_key_request_t))
3243 );
3244 assert_eq!(
3245 ::core::mem::align_of::<ble_gap_evt_auth_key_request_t>(),
3246 1usize,
3247 concat!("Alignment of ", stringify!(ble_gap_evt_auth_key_request_t))
3248 );
3249 assert_eq!(
3250 unsafe { &(*(::core::ptr::null::<ble_gap_evt_auth_key_request_t>())).key_type as *const _ as usize },
3251 0usize,
3252 concat!(
3253 "Offset of field: ",
3254 stringify!(ble_gap_evt_auth_key_request_t),
3255 "::",
3256 stringify!(key_type)
3257 )
3258 );
3259}
3260#[doc = "@brief Event structure for @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST."]
3261#[repr(C)]
3262#[derive(Debug, Copy, Clone)]
3263pub struct ble_gap_evt_lesc_dhkey_request_t {
3264 #[doc = "< LE Secure Connections remote P-256 Public Key. This will point to the application-supplied memory"]
3265 #[doc = "inside the keyset during the call to @ref sd_ble_gap_sec_params_reply."]
3266 pub p_pk_peer: *mut ble_gap_lesc_p256_pk_t,
3267 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
3268 pub __bindgen_padding_0: [u8; 3usize],
3269}
3270#[test]
3271fn bindgen_test_layout_ble_gap_evt_lesc_dhkey_request_t() {
3272 assert_eq!(
3273 ::core::mem::size_of::<ble_gap_evt_lesc_dhkey_request_t>(),
3274 8usize,
3275 concat!("Size of: ", stringify!(ble_gap_evt_lesc_dhkey_request_t))
3276 );
3277 assert_eq!(
3278 ::core::mem::align_of::<ble_gap_evt_lesc_dhkey_request_t>(),
3279 4usize,
3280 concat!("Alignment of ", stringify!(ble_gap_evt_lesc_dhkey_request_t))
3281 );
3282 assert_eq!(
3283 unsafe { &(*(::core::ptr::null::<ble_gap_evt_lesc_dhkey_request_t>())).p_pk_peer as *const _ as usize },
3284 0usize,
3285 concat!(
3286 "Offset of field: ",
3287 stringify!(ble_gap_evt_lesc_dhkey_request_t),
3288 "::",
3289 stringify!(p_pk_peer)
3290 )
3291 );
3292}
3293impl ble_gap_evt_lesc_dhkey_request_t {
3294 #[inline]
3295 pub fn oobd_req(&self) -> u8 {
3296 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
3297 }
3298 #[inline]
3299 pub fn set_oobd_req(&mut self, val: u8) {
3300 unsafe {
3301 let val: u8 = ::core::mem::transmute(val);
3302 self._bitfield_1.set(0usize, 1u8, val as u64)
3303 }
3304 }
3305 #[inline]
3306 pub fn new_bitfield_1(oobd_req: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
3307 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
3308 __bindgen_bitfield_unit.set(0usize, 1u8, {
3309 let oobd_req: u8 = unsafe { ::core::mem::transmute(oobd_req) };
3310 oobd_req as u64
3311 });
3312 __bindgen_bitfield_unit
3313 }
3314}
3315#[doc = "@brief Security levels supported."]
3316#[doc = " @note See Bluetooth Specification Version 4.2 Volume 3, Part C, Chapter 10, Section 10.2.1."]
3317#[repr(C, packed)]
3318#[derive(Debug, Copy, Clone)]
3319pub struct ble_gap_sec_levels_t {
3320 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
3321}
3322#[test]
3323fn bindgen_test_layout_ble_gap_sec_levels_t() {
3324 assert_eq!(
3325 ::core::mem::size_of::<ble_gap_sec_levels_t>(),
3326 1usize,
3327 concat!("Size of: ", stringify!(ble_gap_sec_levels_t))
3328 );
3329 assert_eq!(
3330 ::core::mem::align_of::<ble_gap_sec_levels_t>(),
3331 1usize,
3332 concat!("Alignment of ", stringify!(ble_gap_sec_levels_t))
3333 );
3334}
3335impl ble_gap_sec_levels_t {
3336 #[inline]
3337 pub fn lv1(&self) -> u8 {
3338 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
3339 }
3340 #[inline]
3341 pub fn set_lv1(&mut self, val: u8) {
3342 unsafe {
3343 let val: u8 = ::core::mem::transmute(val);
3344 self._bitfield_1.set(0usize, 1u8, val as u64)
3345 }
3346 }
3347 #[inline]
3348 pub fn lv2(&self) -> u8 {
3349 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
3350 }
3351 #[inline]
3352 pub fn set_lv2(&mut self, val: u8) {
3353 unsafe {
3354 let val: u8 = ::core::mem::transmute(val);
3355 self._bitfield_1.set(1usize, 1u8, val as u64)
3356 }
3357 }
3358 #[inline]
3359 pub fn lv3(&self) -> u8 {
3360 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
3361 }
3362 #[inline]
3363 pub fn set_lv3(&mut self, val: u8) {
3364 unsafe {
3365 let val: u8 = ::core::mem::transmute(val);
3366 self._bitfield_1.set(2usize, 1u8, val as u64)
3367 }
3368 }
3369 #[inline]
3370 pub fn lv4(&self) -> u8 {
3371 unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
3372 }
3373 #[inline]
3374 pub fn set_lv4(&mut self, val: u8) {
3375 unsafe {
3376 let val: u8 = ::core::mem::transmute(val);
3377 self._bitfield_1.set(3usize, 1u8, val as u64)
3378 }
3379 }
3380 #[inline]
3381 pub fn new_bitfield_1(lv1: u8, lv2: u8, lv3: u8, lv4: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
3382 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
3383 __bindgen_bitfield_unit.set(0usize, 1u8, {
3384 let lv1: u8 = unsafe { ::core::mem::transmute(lv1) };
3385 lv1 as u64
3386 });
3387 __bindgen_bitfield_unit.set(1usize, 1u8, {
3388 let lv2: u8 = unsafe { ::core::mem::transmute(lv2) };
3389 lv2 as u64
3390 });
3391 __bindgen_bitfield_unit.set(2usize, 1u8, {
3392 let lv3: u8 = unsafe { ::core::mem::transmute(lv3) };
3393 lv3 as u64
3394 });
3395 __bindgen_bitfield_unit.set(3usize, 1u8, {
3396 let lv4: u8 = unsafe { ::core::mem::transmute(lv4) };
3397 lv4 as u64
3398 });
3399 __bindgen_bitfield_unit
3400 }
3401}
3402#[doc = "@brief Encryption Key."]
3403#[repr(C)]
3404#[derive(Debug, Copy, Clone)]
3405pub struct ble_gap_enc_key_t {
3406 #[doc = "< Encryption Information."]
3407 pub enc_info: ble_gap_enc_info_t,
3408 #[doc = "< Master Identification."]
3409 pub master_id: ble_gap_master_id_t,
3410}
3411#[test]
3412fn bindgen_test_layout_ble_gap_enc_key_t() {
3413 assert_eq!(
3414 ::core::mem::size_of::<ble_gap_enc_key_t>(),
3415 28usize,
3416 concat!("Size of: ", stringify!(ble_gap_enc_key_t))
3417 );
3418 assert_eq!(
3419 ::core::mem::align_of::<ble_gap_enc_key_t>(),
3420 2usize,
3421 concat!("Alignment of ", stringify!(ble_gap_enc_key_t))
3422 );
3423 assert_eq!(
3424 unsafe { &(*(::core::ptr::null::<ble_gap_enc_key_t>())).enc_info as *const _ as usize },
3425 0usize,
3426 concat!(
3427 "Offset of field: ",
3428 stringify!(ble_gap_enc_key_t),
3429 "::",
3430 stringify!(enc_info)
3431 )
3432 );
3433 assert_eq!(
3434 unsafe { &(*(::core::ptr::null::<ble_gap_enc_key_t>())).master_id as *const _ as usize },
3435 18usize,
3436 concat!(
3437 "Offset of field: ",
3438 stringify!(ble_gap_enc_key_t),
3439 "::",
3440 stringify!(master_id)
3441 )
3442 );
3443}
3444#[doc = "@brief Identity Key."]
3445#[repr(C)]
3446#[derive(Debug, Copy, Clone)]
3447pub struct ble_gap_id_key_t {
3448 #[doc = "< Identity Resolving Key."]
3449 pub id_info: ble_gap_irk_t,
3450 #[doc = "< Identity Address."]
3451 pub id_addr_info: ble_gap_addr_t,
3452}
3453#[test]
3454fn bindgen_test_layout_ble_gap_id_key_t() {
3455 assert_eq!(
3456 ::core::mem::size_of::<ble_gap_id_key_t>(),
3457 23usize,
3458 concat!("Size of: ", stringify!(ble_gap_id_key_t))
3459 );
3460 assert_eq!(
3461 ::core::mem::align_of::<ble_gap_id_key_t>(),
3462 1usize,
3463 concat!("Alignment of ", stringify!(ble_gap_id_key_t))
3464 );
3465 assert_eq!(
3466 unsafe { &(*(::core::ptr::null::<ble_gap_id_key_t>())).id_info as *const _ as usize },
3467 0usize,
3468 concat!(
3469 "Offset of field: ",
3470 stringify!(ble_gap_id_key_t),
3471 "::",
3472 stringify!(id_info)
3473 )
3474 );
3475 assert_eq!(
3476 unsafe { &(*(::core::ptr::null::<ble_gap_id_key_t>())).id_addr_info as *const _ as usize },
3477 16usize,
3478 concat!(
3479 "Offset of field: ",
3480 stringify!(ble_gap_id_key_t),
3481 "::",
3482 stringify!(id_addr_info)
3483 )
3484 );
3485}
3486#[doc = "@brief Security Keys."]
3487#[repr(C)]
3488#[derive(Debug, Copy, Clone)]
3489pub struct ble_gap_sec_keys_t {
3490 #[doc = "< Encryption Key, or NULL."]
3491 pub p_enc_key: *mut ble_gap_enc_key_t,
3492 #[doc = "< Identity Key, or NULL."]
3493 pub p_id_key: *mut ble_gap_id_key_t,
3494 #[doc = "< Signing Key, or NULL."]
3495 pub p_sign_key: *mut ble_gap_sign_info_t,
3496 #[doc = "< LE Secure Connections P-256 Public Key. When in debug mode the application must use the value defined"]
3497 #[doc = "in the Core Bluetooth Specification v4.2 Vol.3, Part H, Section 2.3.5.6.1"]
3498 pub p_pk: *mut ble_gap_lesc_p256_pk_t,
3499}
3500#[test]
3501fn bindgen_test_layout_ble_gap_sec_keys_t() {
3502 assert_eq!(
3503 ::core::mem::size_of::<ble_gap_sec_keys_t>(),
3504 16usize,
3505 concat!("Size of: ", stringify!(ble_gap_sec_keys_t))
3506 );
3507 assert_eq!(
3508 ::core::mem::align_of::<ble_gap_sec_keys_t>(),
3509 4usize,
3510 concat!("Alignment of ", stringify!(ble_gap_sec_keys_t))
3511 );
3512 assert_eq!(
3513 unsafe { &(*(::core::ptr::null::<ble_gap_sec_keys_t>())).p_enc_key as *const _ as usize },
3514 0usize,
3515 concat!(
3516 "Offset of field: ",
3517 stringify!(ble_gap_sec_keys_t),
3518 "::",
3519 stringify!(p_enc_key)
3520 )
3521 );
3522 assert_eq!(
3523 unsafe { &(*(::core::ptr::null::<ble_gap_sec_keys_t>())).p_id_key as *const _ as usize },
3524 4usize,
3525 concat!(
3526 "Offset of field: ",
3527 stringify!(ble_gap_sec_keys_t),
3528 "::",
3529 stringify!(p_id_key)
3530 )
3531 );
3532 assert_eq!(
3533 unsafe { &(*(::core::ptr::null::<ble_gap_sec_keys_t>())).p_sign_key as *const _ as usize },
3534 8usize,
3535 concat!(
3536 "Offset of field: ",
3537 stringify!(ble_gap_sec_keys_t),
3538 "::",
3539 stringify!(p_sign_key)
3540 )
3541 );
3542 assert_eq!(
3543 unsafe { &(*(::core::ptr::null::<ble_gap_sec_keys_t>())).p_pk as *const _ as usize },
3544 12usize,
3545 concat!(
3546 "Offset of field: ",
3547 stringify!(ble_gap_sec_keys_t),
3548 "::",
3549 stringify!(p_pk)
3550 )
3551 );
3552}
3553#[doc = "@brief Security key set for both local and peer keys."]
3554#[repr(C)]
3555#[derive(Debug, Copy, Clone)]
3556pub struct ble_gap_sec_keyset_t {
3557 #[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."]
3558 pub keys_own: ble_gap_sec_keys_t,
3559 #[doc = "< Keys distributed by the remote device. For LE Secure Connections, p_enc_key must always be NULL."]
3560 pub keys_peer: ble_gap_sec_keys_t,
3561}
3562#[test]
3563fn bindgen_test_layout_ble_gap_sec_keyset_t() {
3564 assert_eq!(
3565 ::core::mem::size_of::<ble_gap_sec_keyset_t>(),
3566 32usize,
3567 concat!("Size of: ", stringify!(ble_gap_sec_keyset_t))
3568 );
3569 assert_eq!(
3570 ::core::mem::align_of::<ble_gap_sec_keyset_t>(),
3571 4usize,
3572 concat!("Alignment of ", stringify!(ble_gap_sec_keyset_t))
3573 );
3574 assert_eq!(
3575 unsafe { &(*(::core::ptr::null::<ble_gap_sec_keyset_t>())).keys_own as *const _ as usize },
3576 0usize,
3577 concat!(
3578 "Offset of field: ",
3579 stringify!(ble_gap_sec_keyset_t),
3580 "::",
3581 stringify!(keys_own)
3582 )
3583 );
3584 assert_eq!(
3585 unsafe { &(*(::core::ptr::null::<ble_gap_sec_keyset_t>())).keys_peer as *const _ as usize },
3586 16usize,
3587 concat!(
3588 "Offset of field: ",
3589 stringify!(ble_gap_sec_keyset_t),
3590 "::",
3591 stringify!(keys_peer)
3592 )
3593 );
3594}
3595#[doc = "@brief Data Length Update Procedure parameters."]
3596#[repr(C)]
3597#[derive(Debug, Copy, Clone)]
3598pub struct ble_gap_data_length_params_t {
3599 #[doc = "< Maximum number of payload octets that a Controller supports for transmission of a single Link Layer Data Channel PDU."]
3600 pub max_tx_octets: u16,
3601 #[doc = "< Maximum number of payload octets that a Controller supports for reception of a single Link Layer Data Channel PDU."]
3602 pub max_rx_octets: u16,
3603 #[doc = "< Maximum time, in microseconds, that a Controller supports for transmission of a single Link Layer Data Channel PDU."]
3604 pub max_tx_time_us: u16,
3605 #[doc = "< Maximum time, in microseconds, that a Controller supports for reception of a single Link Layer Data Channel PDU."]
3606 pub max_rx_time_us: u16,
3607}
3608#[test]
3609fn bindgen_test_layout_ble_gap_data_length_params_t() {
3610 assert_eq!(
3611 ::core::mem::size_of::<ble_gap_data_length_params_t>(),
3612 8usize,
3613 concat!("Size of: ", stringify!(ble_gap_data_length_params_t))
3614 );
3615 assert_eq!(
3616 ::core::mem::align_of::<ble_gap_data_length_params_t>(),
3617 2usize,
3618 concat!("Alignment of ", stringify!(ble_gap_data_length_params_t))
3619 );
3620 assert_eq!(
3621 unsafe { &(*(::core::ptr::null::<ble_gap_data_length_params_t>())).max_tx_octets as *const _ as usize },
3622 0usize,
3623 concat!(
3624 "Offset of field: ",
3625 stringify!(ble_gap_data_length_params_t),
3626 "::",
3627 stringify!(max_tx_octets)
3628 )
3629 );
3630 assert_eq!(
3631 unsafe { &(*(::core::ptr::null::<ble_gap_data_length_params_t>())).max_rx_octets as *const _ as usize },
3632 2usize,
3633 concat!(
3634 "Offset of field: ",
3635 stringify!(ble_gap_data_length_params_t),
3636 "::",
3637 stringify!(max_rx_octets)
3638 )
3639 );
3640 assert_eq!(
3641 unsafe { &(*(::core::ptr::null::<ble_gap_data_length_params_t>())).max_tx_time_us as *const _ as usize },
3642 4usize,
3643 concat!(
3644 "Offset of field: ",
3645 stringify!(ble_gap_data_length_params_t),
3646 "::",
3647 stringify!(max_tx_time_us)
3648 )
3649 );
3650 assert_eq!(
3651 unsafe { &(*(::core::ptr::null::<ble_gap_data_length_params_t>())).max_rx_time_us as *const _ as usize },
3652 6usize,
3653 concat!(
3654 "Offset of field: ",
3655 stringify!(ble_gap_data_length_params_t),
3656 "::",
3657 stringify!(max_rx_time_us)
3658 )
3659 );
3660}
3661#[doc = "@brief Data Length Update Procedure local limitation."]
3662#[repr(C)]
3663#[derive(Debug, Copy, Clone)]
3664pub struct ble_gap_data_length_limitation_t {
3665 #[doc = "< If > 0, the requested TX packet length is too long by this many octets."]
3666 pub tx_payload_limited_octets: u16,
3667 #[doc = "< If > 0, the requested RX packet length is too long by this many octets."]
3668 pub rx_payload_limited_octets: u16,
3669 #[doc = "< If > 0, the requested combination of TX and RX packet lengths is too long by this many microseconds."]
3670 pub tx_rx_time_limited_us: u16,
3671}
3672#[test]
3673fn bindgen_test_layout_ble_gap_data_length_limitation_t() {
3674 assert_eq!(
3675 ::core::mem::size_of::<ble_gap_data_length_limitation_t>(),
3676 6usize,
3677 concat!("Size of: ", stringify!(ble_gap_data_length_limitation_t))
3678 );
3679 assert_eq!(
3680 ::core::mem::align_of::<ble_gap_data_length_limitation_t>(),
3681 2usize,
3682 concat!("Alignment of ", stringify!(ble_gap_data_length_limitation_t))
3683 );
3684 assert_eq!(
3685 unsafe {
3686 &(*(::core::ptr::null::<ble_gap_data_length_limitation_t>())).tx_payload_limited_octets as *const _ as usize
3687 },
3688 0usize,
3689 concat!(
3690 "Offset of field: ",
3691 stringify!(ble_gap_data_length_limitation_t),
3692 "::",
3693 stringify!(tx_payload_limited_octets)
3694 )
3695 );
3696 assert_eq!(
3697 unsafe {
3698 &(*(::core::ptr::null::<ble_gap_data_length_limitation_t>())).rx_payload_limited_octets as *const _ as usize
3699 },
3700 2usize,
3701 concat!(
3702 "Offset of field: ",
3703 stringify!(ble_gap_data_length_limitation_t),
3704 "::",
3705 stringify!(rx_payload_limited_octets)
3706 )
3707 );
3708 assert_eq!(
3709 unsafe {
3710 &(*(::core::ptr::null::<ble_gap_data_length_limitation_t>())).tx_rx_time_limited_us as *const _ as usize
3711 },
3712 4usize,
3713 concat!(
3714 "Offset of field: ",
3715 stringify!(ble_gap_data_length_limitation_t),
3716 "::",
3717 stringify!(tx_rx_time_limited_us)
3718 )
3719 );
3720}
3721#[doc = "@brief Event structure for @ref BLE_GAP_EVT_AUTH_STATUS."]
3722#[repr(C)]
3723#[derive(Debug, Copy, Clone)]
3724pub struct ble_gap_evt_auth_status_t {
3725 #[doc = "< Authentication status, see @ref BLE_GAP_SEC_STATUS."]
3726 pub auth_status: u8,
3727 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
3728 #[doc = "< Levels supported in Security Mode 1."]
3729 pub sm1_levels: ble_gap_sec_levels_t,
3730 #[doc = "< Levels supported in Security Mode 2."]
3731 pub sm2_levels: ble_gap_sec_levels_t,
3732 #[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."]
3733 pub kdist_own: ble_gap_sec_kdist_t,
3734 #[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."]
3735 pub kdist_peer: ble_gap_sec_kdist_t,
3736}
3737#[test]
3738fn bindgen_test_layout_ble_gap_evt_auth_status_t() {
3739 assert_eq!(
3740 ::core::mem::size_of::<ble_gap_evt_auth_status_t>(),
3741 6usize,
3742 concat!("Size of: ", stringify!(ble_gap_evt_auth_status_t))
3743 );
3744 assert_eq!(
3745 ::core::mem::align_of::<ble_gap_evt_auth_status_t>(),
3746 1usize,
3747 concat!("Alignment of ", stringify!(ble_gap_evt_auth_status_t))
3748 );
3749 assert_eq!(
3750 unsafe { &(*(::core::ptr::null::<ble_gap_evt_auth_status_t>())).auth_status as *const _ as usize },
3751 0usize,
3752 concat!(
3753 "Offset of field: ",
3754 stringify!(ble_gap_evt_auth_status_t),
3755 "::",
3756 stringify!(auth_status)
3757 )
3758 );
3759 assert_eq!(
3760 unsafe { &(*(::core::ptr::null::<ble_gap_evt_auth_status_t>())).sm1_levels as *const _ as usize },
3761 2usize,
3762 concat!(
3763 "Offset of field: ",
3764 stringify!(ble_gap_evt_auth_status_t),
3765 "::",
3766 stringify!(sm1_levels)
3767 )
3768 );
3769 assert_eq!(
3770 unsafe { &(*(::core::ptr::null::<ble_gap_evt_auth_status_t>())).sm2_levels as *const _ as usize },
3771 3usize,
3772 concat!(
3773 "Offset of field: ",
3774 stringify!(ble_gap_evt_auth_status_t),
3775 "::",
3776 stringify!(sm2_levels)
3777 )
3778 );
3779 assert_eq!(
3780 unsafe { &(*(::core::ptr::null::<ble_gap_evt_auth_status_t>())).kdist_own as *const _ as usize },
3781 4usize,
3782 concat!(
3783 "Offset of field: ",
3784 stringify!(ble_gap_evt_auth_status_t),
3785 "::",
3786 stringify!(kdist_own)
3787 )
3788 );
3789 assert_eq!(
3790 unsafe { &(*(::core::ptr::null::<ble_gap_evt_auth_status_t>())).kdist_peer as *const _ as usize },
3791 5usize,
3792 concat!(
3793 "Offset of field: ",
3794 stringify!(ble_gap_evt_auth_status_t),
3795 "::",
3796 stringify!(kdist_peer)
3797 )
3798 );
3799}
3800impl ble_gap_evt_auth_status_t {
3801 #[inline]
3802 pub fn error_src(&self) -> u8 {
3803 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u8) }
3804 }
3805 #[inline]
3806 pub fn set_error_src(&mut self, val: u8) {
3807 unsafe {
3808 let val: u8 = ::core::mem::transmute(val);
3809 self._bitfield_1.set(0usize, 2u8, val as u64)
3810 }
3811 }
3812 #[inline]
3813 pub fn bonded(&self) -> u8 {
3814 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
3815 }
3816 #[inline]
3817 pub fn set_bonded(&mut self, val: u8) {
3818 unsafe {
3819 let val: u8 = ::core::mem::transmute(val);
3820 self._bitfield_1.set(2usize, 1u8, val as u64)
3821 }
3822 }
3823 #[inline]
3824 pub fn lesc(&self) -> u8 {
3825 unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
3826 }
3827 #[inline]
3828 pub fn set_lesc(&mut self, val: u8) {
3829 unsafe {
3830 let val: u8 = ::core::mem::transmute(val);
3831 self._bitfield_1.set(3usize, 1u8, val as u64)
3832 }
3833 }
3834 #[inline]
3835 pub fn new_bitfield_1(error_src: u8, bonded: u8, lesc: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
3836 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
3837 __bindgen_bitfield_unit.set(0usize, 2u8, {
3838 let error_src: u8 = unsafe { ::core::mem::transmute(error_src) };
3839 error_src as u64
3840 });
3841 __bindgen_bitfield_unit.set(2usize, 1u8, {
3842 let bonded: u8 = unsafe { ::core::mem::transmute(bonded) };
3843 bonded as u64
3844 });
3845 __bindgen_bitfield_unit.set(3usize, 1u8, {
3846 let lesc: u8 = unsafe { ::core::mem::transmute(lesc) };
3847 lesc as u64
3848 });
3849 __bindgen_bitfield_unit
3850 }
3851}
3852#[doc = "@brief Event structure for @ref BLE_GAP_EVT_CONN_SEC_UPDATE."]
3853#[repr(C)]
3854#[derive(Debug, Copy, Clone)]
3855pub struct ble_gap_evt_conn_sec_update_t {
3856 #[doc = "< Connection security level."]
3857 pub conn_sec: ble_gap_conn_sec_t,
3858}
3859#[test]
3860fn bindgen_test_layout_ble_gap_evt_conn_sec_update_t() {
3861 assert_eq!(
3862 ::core::mem::size_of::<ble_gap_evt_conn_sec_update_t>(),
3863 2usize,
3864 concat!("Size of: ", stringify!(ble_gap_evt_conn_sec_update_t))
3865 );
3866 assert_eq!(
3867 ::core::mem::align_of::<ble_gap_evt_conn_sec_update_t>(),
3868 1usize,
3869 concat!("Alignment of ", stringify!(ble_gap_evt_conn_sec_update_t))
3870 );
3871 assert_eq!(
3872 unsafe { &(*(::core::ptr::null::<ble_gap_evt_conn_sec_update_t>())).conn_sec as *const _ as usize },
3873 0usize,
3874 concat!(
3875 "Offset of field: ",
3876 stringify!(ble_gap_evt_conn_sec_update_t),
3877 "::",
3878 stringify!(conn_sec)
3879 )
3880 );
3881}
3882#[doc = "@brief Event structure for @ref BLE_GAP_EVT_TIMEOUT."]
3883#[repr(C)]
3884#[derive(Copy, Clone)]
3885pub struct ble_gap_evt_timeout_t {
3886 #[doc = "< Source of timeout event, see @ref BLE_GAP_TIMEOUT_SOURCES."]
3887 pub src: u8,
3888 #[doc = "< Event Parameters."]
3889 pub params: ble_gap_evt_timeout_t__bindgen_ty_1,
3890}
3891#[repr(C)]
3892#[derive(Copy, Clone)]
3893pub union ble_gap_evt_timeout_t__bindgen_ty_1 {
3894 #[doc = "< If source is set to @ref BLE_GAP_TIMEOUT_SRC_SCAN, the released"]
3895 #[doc = "scan buffer is contained in this field."]
3896 pub adv_report_buffer: ble_data_t,
3897 _bindgen_union_align: [u32; 2usize],
3898}
3899#[test]
3900fn bindgen_test_layout_ble_gap_evt_timeout_t__bindgen_ty_1() {
3901 assert_eq!(
3902 ::core::mem::size_of::<ble_gap_evt_timeout_t__bindgen_ty_1>(),
3903 8usize,
3904 concat!("Size of: ", stringify!(ble_gap_evt_timeout_t__bindgen_ty_1))
3905 );
3906 assert_eq!(
3907 ::core::mem::align_of::<ble_gap_evt_timeout_t__bindgen_ty_1>(),
3908 4usize,
3909 concat!("Alignment of ", stringify!(ble_gap_evt_timeout_t__bindgen_ty_1))
3910 );
3911 assert_eq!(
3912 unsafe {
3913 &(*(::core::ptr::null::<ble_gap_evt_timeout_t__bindgen_ty_1>())).adv_report_buffer as *const _ as usize
3914 },
3915 0usize,
3916 concat!(
3917 "Offset of field: ",
3918 stringify!(ble_gap_evt_timeout_t__bindgen_ty_1),
3919 "::",
3920 stringify!(adv_report_buffer)
3921 )
3922 );
3923}
3924#[test]
3925fn bindgen_test_layout_ble_gap_evt_timeout_t() {
3926 assert_eq!(
3927 ::core::mem::size_of::<ble_gap_evt_timeout_t>(),
3928 12usize,
3929 concat!("Size of: ", stringify!(ble_gap_evt_timeout_t))
3930 );
3931 assert_eq!(
3932 ::core::mem::align_of::<ble_gap_evt_timeout_t>(),
3933 4usize,
3934 concat!("Alignment of ", stringify!(ble_gap_evt_timeout_t))
3935 );
3936 assert_eq!(
3937 unsafe { &(*(::core::ptr::null::<ble_gap_evt_timeout_t>())).src as *const _ as usize },
3938 0usize,
3939 concat!(
3940 "Offset of field: ",
3941 stringify!(ble_gap_evt_timeout_t),
3942 "::",
3943 stringify!(src)
3944 )
3945 );
3946 assert_eq!(
3947 unsafe { &(*(::core::ptr::null::<ble_gap_evt_timeout_t>())).params as *const _ as usize },
3948 4usize,
3949 concat!(
3950 "Offset of field: ",
3951 stringify!(ble_gap_evt_timeout_t),
3952 "::",
3953 stringify!(params)
3954 )
3955 );
3956}
3957#[doc = "@brief Event structure for @ref BLE_GAP_EVT_RSSI_CHANGED."]
3958#[repr(C)]
3959#[derive(Debug, Copy, Clone)]
3960pub struct ble_gap_evt_rssi_changed_t {
3961 #[doc = "< Received Signal Strength Indication in dBm."]
3962 #[doc = "@note ERRATA-153 requires the rssi sample to be compensated based on a temperature measurement."]
3963 pub rssi: i8,
3964 #[doc = "< Data Channel Index on which the Signal Strength is measured (0-36)."]
3965 pub ch_index: u8,
3966}
3967#[test]
3968fn bindgen_test_layout_ble_gap_evt_rssi_changed_t() {
3969 assert_eq!(
3970 ::core::mem::size_of::<ble_gap_evt_rssi_changed_t>(),
3971 2usize,
3972 concat!("Size of: ", stringify!(ble_gap_evt_rssi_changed_t))
3973 );
3974 assert_eq!(
3975 ::core::mem::align_of::<ble_gap_evt_rssi_changed_t>(),
3976 1usize,
3977 concat!("Alignment of ", stringify!(ble_gap_evt_rssi_changed_t))
3978 );
3979 assert_eq!(
3980 unsafe { &(*(::core::ptr::null::<ble_gap_evt_rssi_changed_t>())).rssi as *const _ as usize },
3981 0usize,
3982 concat!(
3983 "Offset of field: ",
3984 stringify!(ble_gap_evt_rssi_changed_t),
3985 "::",
3986 stringify!(rssi)
3987 )
3988 );
3989 assert_eq!(
3990 unsafe { &(*(::core::ptr::null::<ble_gap_evt_rssi_changed_t>())).ch_index as *const _ as usize },
3991 1usize,
3992 concat!(
3993 "Offset of field: ",
3994 stringify!(ble_gap_evt_rssi_changed_t),
3995 "::",
3996 stringify!(ch_index)
3997 )
3998 );
3999}
4000#[doc = "@brief Event structure for @ref BLE_GAP_EVT_ADV_SET_TERMINATED"]
4001#[repr(C)]
4002#[derive(Debug, Copy, Clone)]
4003pub struct ble_gap_evt_adv_set_terminated_t {
4004 #[doc = "< Reason for why the advertising set terminated. See"]
4005 #[doc = "@ref BLE_GAP_EVT_ADV_SET_TERMINATED_REASON."]
4006 pub reason: u8,
4007 #[doc = "< Advertising handle in which advertising has ended."]
4008 pub adv_handle: u8,
4009 #[doc = "< If @ref ble_gap_adv_params_t::max_adv_evts was not set to 0,"]
4010 #[doc = "this field indicates the number of completed advertising events."]
4011 pub num_completed_adv_events: u8,
4012 #[doc = "< Advertising buffers corresponding to the terminated"]
4013 #[doc = "advertising set. The advertising buffers provided in"]
4014 #[doc = "@ref sd_ble_gap_adv_set_configure are now released."]
4015 pub adv_data: ble_gap_adv_data_t,
4016}
4017#[test]
4018fn bindgen_test_layout_ble_gap_evt_adv_set_terminated_t() {
4019 assert_eq!(
4020 ::core::mem::size_of::<ble_gap_evt_adv_set_terminated_t>(),
4021 20usize,
4022 concat!("Size of: ", stringify!(ble_gap_evt_adv_set_terminated_t))
4023 );
4024 assert_eq!(
4025 ::core::mem::align_of::<ble_gap_evt_adv_set_terminated_t>(),
4026 4usize,
4027 concat!("Alignment of ", stringify!(ble_gap_evt_adv_set_terminated_t))
4028 );
4029 assert_eq!(
4030 unsafe { &(*(::core::ptr::null::<ble_gap_evt_adv_set_terminated_t>())).reason as *const _ as usize },
4031 0usize,
4032 concat!(
4033 "Offset of field: ",
4034 stringify!(ble_gap_evt_adv_set_terminated_t),
4035 "::",
4036 stringify!(reason)
4037 )
4038 );
4039 assert_eq!(
4040 unsafe { &(*(::core::ptr::null::<ble_gap_evt_adv_set_terminated_t>())).adv_handle as *const _ as usize },
4041 1usize,
4042 concat!(
4043 "Offset of field: ",
4044 stringify!(ble_gap_evt_adv_set_terminated_t),
4045 "::",
4046 stringify!(adv_handle)
4047 )
4048 );
4049 assert_eq!(
4050 unsafe {
4051 &(*(::core::ptr::null::<ble_gap_evt_adv_set_terminated_t>())).num_completed_adv_events as *const _ as usize
4052 },
4053 2usize,
4054 concat!(
4055 "Offset of field: ",
4056 stringify!(ble_gap_evt_adv_set_terminated_t),
4057 "::",
4058 stringify!(num_completed_adv_events)
4059 )
4060 );
4061 assert_eq!(
4062 unsafe { &(*(::core::ptr::null::<ble_gap_evt_adv_set_terminated_t>())).adv_data as *const _ as usize },
4063 4usize,
4064 concat!(
4065 "Offset of field: ",
4066 stringify!(ble_gap_evt_adv_set_terminated_t),
4067 "::",
4068 stringify!(adv_data)
4069 )
4070 );
4071}
4072#[doc = "@brief Event structure for @ref BLE_GAP_EVT_ADV_REPORT."]
4073#[doc = ""]
4074#[doc = " @note If @ref ble_gap_adv_report_type_t::status is set to @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA,"]
4075#[doc = " not all fields in the advertising report may be available."]
4076#[doc = ""]
4077#[doc = " @note When ble_gap_adv_report_type_t::status is not set to @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA,"]
4078#[doc = " scanning will be paused. To continue scanning, call @ref sd_ble_gap_scan_start."]
4079#[repr(C)]
4080#[derive(Debug, Copy, Clone)]
4081pub struct ble_gap_evt_adv_report_t {
4082 #[doc = "< Advertising report type. See @ref ble_gap_adv_report_type_t."]
4083 pub type_: ble_gap_adv_report_type_t,
4084 #[doc = "< Bluetooth address of the peer device. If the peer_addr is resolved:"]
4085 #[doc = "@ref ble_gap_addr_t::addr_id_peer is set to 1 and the address is the"]
4086 #[doc = "peer's identity address."]
4087 pub peer_addr: ble_gap_addr_t,
4088 #[doc = "< Contains the target address of the advertising event if"]
4089 #[doc = "@ref ble_gap_adv_report_type_t::directed is set to 1. If the"]
4090 #[doc = "SoftDevice was able to resolve the address,"]
4091 #[doc = "@ref ble_gap_addr_t::addr_id_peer is set to 1 and the direct_addr"]
4092 #[doc = "contains the local identity address. If the target address of the"]
4093 #[doc = "advertising event is @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE,"]
4094 #[doc = "and the SoftDevice was unable to resolve it, the application may try"]
4095 #[doc = "to resolve this address to find out if the advertising event was"]
4096 #[doc = "directed to us."]
4097 pub direct_addr: ble_gap_addr_t,
4098 #[doc = "< Indicates the PHY on which the primary advertising packet was received."]
4099 #[doc = "See @ref BLE_GAP_PHYS."]
4100 pub primary_phy: u8,
4101 #[doc = "< Indicates the PHY on which the secondary advertising packet was received."]
4102 #[doc = "See @ref BLE_GAP_PHYS. This field is set to @ref BLE_GAP_PHY_NOT_SET if no packets"]
4103 #[doc = "were received on a secondary advertising channel."]
4104 pub secondary_phy: u8,
4105 #[doc = "< TX Power reported by the advertiser in the last packet header received."]
4106 #[doc = "This field is set to @ref BLE_GAP_POWER_LEVEL_INVALID if the"]
4107 #[doc = "last received packet did not contain the Tx Power field."]
4108 #[doc = "@note TX Power is only included in extended advertising packets."]
4109 pub tx_power: i8,
4110 #[doc = "< Received Signal Strength Indication in dBm of the last packet received."]
4111 #[doc = "@note ERRATA-153 requires the rssi sample to be compensated based on a temperature measurement."]
4112 pub rssi: i8,
4113 #[doc = "< Channel Index on which the last advertising packet is received (0-39)."]
4114 pub ch_index: u8,
4115 #[doc = "< Set ID of the received advertising data. Set ID is not present"]
4116 #[doc = "if set to @ref BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE."]
4117 pub set_id: u8,
4118 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize], u16>,
4119 #[doc = "< Received advertising or scan response data. If"]
4120 #[doc = "@ref ble_gap_adv_report_type_t::status is not set to"]
4121 #[doc = "@ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA, the data buffer provided"]
4122 #[doc = "in @ref sd_ble_gap_scan_start is now released."]
4123 pub data: ble_data_t,
4124 #[doc = "< The offset and PHY of the next advertising packet in this extended advertising"]
4125 #[doc = "event. @note This field is only set if @ref ble_gap_adv_report_type_t::status"]
4126 #[doc = "is set to @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA."]
4127 pub aux_pointer: ble_gap_aux_pointer_t,
4128}
4129#[test]
4130fn bindgen_test_layout_ble_gap_evt_adv_report_t() {
4131 assert_eq!(
4132 ::core::mem::size_of::<ble_gap_evt_adv_report_t>(),
4133 36usize,
4134 concat!("Size of: ", stringify!(ble_gap_evt_adv_report_t))
4135 );
4136 assert_eq!(
4137 ::core::mem::align_of::<ble_gap_evt_adv_report_t>(),
4138 4usize,
4139 concat!("Alignment of ", stringify!(ble_gap_evt_adv_report_t))
4140 );
4141 assert_eq!(
4142 unsafe { &(*(::core::ptr::null::<ble_gap_evt_adv_report_t>())).type_ as *const _ as usize },
4143 0usize,
4144 concat!(
4145 "Offset of field: ",
4146 stringify!(ble_gap_evt_adv_report_t),
4147 "::",
4148 stringify!(type_)
4149 )
4150 );
4151 assert_eq!(
4152 unsafe { &(*(::core::ptr::null::<ble_gap_evt_adv_report_t>())).peer_addr as *const _ as usize },
4153 2usize,
4154 concat!(
4155 "Offset of field: ",
4156 stringify!(ble_gap_evt_adv_report_t),
4157 "::",
4158 stringify!(peer_addr)
4159 )
4160 );
4161 assert_eq!(
4162 unsafe { &(*(::core::ptr::null::<ble_gap_evt_adv_report_t>())).direct_addr as *const _ as usize },
4163 9usize,
4164 concat!(
4165 "Offset of field: ",
4166 stringify!(ble_gap_evt_adv_report_t),
4167 "::",
4168 stringify!(direct_addr)
4169 )
4170 );
4171 assert_eq!(
4172 unsafe { &(*(::core::ptr::null::<ble_gap_evt_adv_report_t>())).primary_phy as *const _ as usize },
4173 16usize,
4174 concat!(
4175 "Offset of field: ",
4176 stringify!(ble_gap_evt_adv_report_t),
4177 "::",
4178 stringify!(primary_phy)
4179 )
4180 );
4181 assert_eq!(
4182 unsafe { &(*(::core::ptr::null::<ble_gap_evt_adv_report_t>())).secondary_phy as *const _ as usize },
4183 17usize,
4184 concat!(
4185 "Offset of field: ",
4186 stringify!(ble_gap_evt_adv_report_t),
4187 "::",
4188 stringify!(secondary_phy)
4189 )
4190 );
4191 assert_eq!(
4192 unsafe { &(*(::core::ptr::null::<ble_gap_evt_adv_report_t>())).tx_power as *const _ as usize },
4193 18usize,
4194 concat!(
4195 "Offset of field: ",
4196 stringify!(ble_gap_evt_adv_report_t),
4197 "::",
4198 stringify!(tx_power)
4199 )
4200 );
4201 assert_eq!(
4202 unsafe { &(*(::core::ptr::null::<ble_gap_evt_adv_report_t>())).rssi as *const _ as usize },
4203 19usize,
4204 concat!(
4205 "Offset of field: ",
4206 stringify!(ble_gap_evt_adv_report_t),
4207 "::",
4208 stringify!(rssi)
4209 )
4210 );
4211 assert_eq!(
4212 unsafe { &(*(::core::ptr::null::<ble_gap_evt_adv_report_t>())).ch_index as *const _ as usize },
4213 20usize,
4214 concat!(
4215 "Offset of field: ",
4216 stringify!(ble_gap_evt_adv_report_t),
4217 "::",
4218 stringify!(ch_index)
4219 )
4220 );
4221 assert_eq!(
4222 unsafe { &(*(::core::ptr::null::<ble_gap_evt_adv_report_t>())).set_id as *const _ as usize },
4223 21usize,
4224 concat!(
4225 "Offset of field: ",
4226 stringify!(ble_gap_evt_adv_report_t),
4227 "::",
4228 stringify!(set_id)
4229 )
4230 );
4231 assert_eq!(
4232 unsafe { &(*(::core::ptr::null::<ble_gap_evt_adv_report_t>())).data as *const _ as usize },
4233 24usize,
4234 concat!(
4235 "Offset of field: ",
4236 stringify!(ble_gap_evt_adv_report_t),
4237 "::",
4238 stringify!(data)
4239 )
4240 );
4241 assert_eq!(
4242 unsafe { &(*(::core::ptr::null::<ble_gap_evt_adv_report_t>())).aux_pointer as *const _ as usize },
4243 32usize,
4244 concat!(
4245 "Offset of field: ",
4246 stringify!(ble_gap_evt_adv_report_t),
4247 "::",
4248 stringify!(aux_pointer)
4249 )
4250 );
4251}
4252impl ble_gap_evt_adv_report_t {
4253 #[inline]
4254 pub fn data_id(&self) -> u16 {
4255 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 12u8) as u16) }
4256 }
4257 #[inline]
4258 pub fn set_data_id(&mut self, val: u16) {
4259 unsafe {
4260 let val: u16 = ::core::mem::transmute(val);
4261 self._bitfield_1.set(0usize, 12u8, val as u64)
4262 }
4263 }
4264 #[inline]
4265 pub fn new_bitfield_1(data_id: u16) -> __BindgenBitfieldUnit<[u8; 2usize], u16> {
4266 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u16> = Default::default();
4267 __bindgen_bitfield_unit.set(0usize, 12u8, {
4268 let data_id: u16 = unsafe { ::core::mem::transmute(data_id) };
4269 data_id as u64
4270 });
4271 __bindgen_bitfield_unit
4272 }
4273}
4274#[doc = "@brief Event structure for @ref BLE_GAP_EVT_SEC_REQUEST."]
4275#[repr(C, packed)]
4276#[derive(Debug, Copy, Clone)]
4277pub struct ble_gap_evt_sec_request_t {
4278 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
4279}
4280#[test]
4281fn bindgen_test_layout_ble_gap_evt_sec_request_t() {
4282 assert_eq!(
4283 ::core::mem::size_of::<ble_gap_evt_sec_request_t>(),
4284 1usize,
4285 concat!("Size of: ", stringify!(ble_gap_evt_sec_request_t))
4286 );
4287 assert_eq!(
4288 ::core::mem::align_of::<ble_gap_evt_sec_request_t>(),
4289 1usize,
4290 concat!("Alignment of ", stringify!(ble_gap_evt_sec_request_t))
4291 );
4292}
4293impl ble_gap_evt_sec_request_t {
4294 #[inline]
4295 pub fn bond(&self) -> u8 {
4296 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
4297 }
4298 #[inline]
4299 pub fn set_bond(&mut self, val: u8) {
4300 unsafe {
4301 let val: u8 = ::core::mem::transmute(val);
4302 self._bitfield_1.set(0usize, 1u8, val as u64)
4303 }
4304 }
4305 #[inline]
4306 pub fn mitm(&self) -> u8 {
4307 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
4308 }
4309 #[inline]
4310 pub fn set_mitm(&mut self, val: u8) {
4311 unsafe {
4312 let val: u8 = ::core::mem::transmute(val);
4313 self._bitfield_1.set(1usize, 1u8, val as u64)
4314 }
4315 }
4316 #[inline]
4317 pub fn lesc(&self) -> u8 {
4318 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
4319 }
4320 #[inline]
4321 pub fn set_lesc(&mut self, val: u8) {
4322 unsafe {
4323 let val: u8 = ::core::mem::transmute(val);
4324 self._bitfield_1.set(2usize, 1u8, val as u64)
4325 }
4326 }
4327 #[inline]
4328 pub fn keypress(&self) -> u8 {
4329 unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
4330 }
4331 #[inline]
4332 pub fn set_keypress(&mut self, val: u8) {
4333 unsafe {
4334 let val: u8 = ::core::mem::transmute(val);
4335 self._bitfield_1.set(3usize, 1u8, val as u64)
4336 }
4337 }
4338 #[inline]
4339 pub fn new_bitfield_1(bond: u8, mitm: u8, lesc: u8, keypress: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
4340 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
4341 __bindgen_bitfield_unit.set(0usize, 1u8, {
4342 let bond: u8 = unsafe { ::core::mem::transmute(bond) };
4343 bond as u64
4344 });
4345 __bindgen_bitfield_unit.set(1usize, 1u8, {
4346 let mitm: u8 = unsafe { ::core::mem::transmute(mitm) };
4347 mitm as u64
4348 });
4349 __bindgen_bitfield_unit.set(2usize, 1u8, {
4350 let lesc: u8 = unsafe { ::core::mem::transmute(lesc) };
4351 lesc as u64
4352 });
4353 __bindgen_bitfield_unit.set(3usize, 1u8, {
4354 let keypress: u8 = unsafe { ::core::mem::transmute(keypress) };
4355 keypress as u64
4356 });
4357 __bindgen_bitfield_unit
4358 }
4359}
4360#[doc = "@brief Event structure for @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST."]
4361#[repr(C)]
4362#[derive(Debug, Copy, Clone)]
4363pub struct ble_gap_evt_conn_param_update_request_t {
4364 #[doc = "< GAP Connection Parameters."]
4365 pub conn_params: ble_gap_conn_params_t,
4366}
4367#[test]
4368fn bindgen_test_layout_ble_gap_evt_conn_param_update_request_t() {
4369 assert_eq!(
4370 ::core::mem::size_of::<ble_gap_evt_conn_param_update_request_t>(),
4371 8usize,
4372 concat!("Size of: ", stringify!(ble_gap_evt_conn_param_update_request_t))
4373 );
4374 assert_eq!(
4375 ::core::mem::align_of::<ble_gap_evt_conn_param_update_request_t>(),
4376 2usize,
4377 concat!("Alignment of ", stringify!(ble_gap_evt_conn_param_update_request_t))
4378 );
4379 assert_eq!(
4380 unsafe {
4381 &(*(::core::ptr::null::<ble_gap_evt_conn_param_update_request_t>())).conn_params as *const _ as usize
4382 },
4383 0usize,
4384 concat!(
4385 "Offset of field: ",
4386 stringify!(ble_gap_evt_conn_param_update_request_t),
4387 "::",
4388 stringify!(conn_params)
4389 )
4390 );
4391}
4392#[doc = "@brief Event structure for @ref BLE_GAP_EVT_SCAN_REQ_REPORT."]
4393#[repr(C)]
4394#[derive(Debug, Copy, Clone)]
4395pub struct ble_gap_evt_scan_req_report_t {
4396 #[doc = "< Advertising handle for the advertising set which received the Scan Request"]
4397 pub adv_handle: u8,
4398 #[doc = "< Received Signal Strength Indication in dBm."]
4399 #[doc = "@note ERRATA-153 requires the rssi sample to be compensated based on a temperature measurement."]
4400 pub rssi: i8,
4401 #[doc = "< Bluetooth address of the peer device. If the peer_addr resolved: @ref ble_gap_addr_t::addr_id_peer is set to 1"]
4402 #[doc = "and the address is the device's identity address."]
4403 pub peer_addr: ble_gap_addr_t,
4404}
4405#[test]
4406fn bindgen_test_layout_ble_gap_evt_scan_req_report_t() {
4407 assert_eq!(
4408 ::core::mem::size_of::<ble_gap_evt_scan_req_report_t>(),
4409 9usize,
4410 concat!("Size of: ", stringify!(ble_gap_evt_scan_req_report_t))
4411 );
4412 assert_eq!(
4413 ::core::mem::align_of::<ble_gap_evt_scan_req_report_t>(),
4414 1usize,
4415 concat!("Alignment of ", stringify!(ble_gap_evt_scan_req_report_t))
4416 );
4417 assert_eq!(
4418 unsafe { &(*(::core::ptr::null::<ble_gap_evt_scan_req_report_t>())).adv_handle as *const _ as usize },
4419 0usize,
4420 concat!(
4421 "Offset of field: ",
4422 stringify!(ble_gap_evt_scan_req_report_t),
4423 "::",
4424 stringify!(adv_handle)
4425 )
4426 );
4427 assert_eq!(
4428 unsafe { &(*(::core::ptr::null::<ble_gap_evt_scan_req_report_t>())).rssi as *const _ as usize },
4429 1usize,
4430 concat!(
4431 "Offset of field: ",
4432 stringify!(ble_gap_evt_scan_req_report_t),
4433 "::",
4434 stringify!(rssi)
4435 )
4436 );
4437 assert_eq!(
4438 unsafe { &(*(::core::ptr::null::<ble_gap_evt_scan_req_report_t>())).peer_addr as *const _ as usize },
4439 2usize,
4440 concat!(
4441 "Offset of field: ",
4442 stringify!(ble_gap_evt_scan_req_report_t),
4443 "::",
4444 stringify!(peer_addr)
4445 )
4446 );
4447}
4448#[doc = "@brief Event structure for @ref BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST."]
4449#[repr(C)]
4450#[derive(Debug, Copy, Clone)]
4451pub struct ble_gap_evt_data_length_update_request_t {
4452 #[doc = "< Peer data length parameters."]
4453 pub peer_params: ble_gap_data_length_params_t,
4454}
4455#[test]
4456fn bindgen_test_layout_ble_gap_evt_data_length_update_request_t() {
4457 assert_eq!(
4458 ::core::mem::size_of::<ble_gap_evt_data_length_update_request_t>(),
4459 8usize,
4460 concat!("Size of: ", stringify!(ble_gap_evt_data_length_update_request_t))
4461 );
4462 assert_eq!(
4463 ::core::mem::align_of::<ble_gap_evt_data_length_update_request_t>(),
4464 2usize,
4465 concat!("Alignment of ", stringify!(ble_gap_evt_data_length_update_request_t))
4466 );
4467 assert_eq!(
4468 unsafe {
4469 &(*(::core::ptr::null::<ble_gap_evt_data_length_update_request_t>())).peer_params as *const _ as usize
4470 },
4471 0usize,
4472 concat!(
4473 "Offset of field: ",
4474 stringify!(ble_gap_evt_data_length_update_request_t),
4475 "::",
4476 stringify!(peer_params)
4477 )
4478 );
4479}
4480#[doc = "@brief Event structure for @ref BLE_GAP_EVT_DATA_LENGTH_UPDATE."]
4481#[doc = ""]
4482#[doc = " @note This event may also be raised after a PHY Update procedure."]
4483#[repr(C)]
4484#[derive(Debug, Copy, Clone)]
4485pub struct ble_gap_evt_data_length_update_t {
4486 #[doc = "< The effective data length parameters."]
4487 pub effective_params: ble_gap_data_length_params_t,
4488}
4489#[test]
4490fn bindgen_test_layout_ble_gap_evt_data_length_update_t() {
4491 assert_eq!(
4492 ::core::mem::size_of::<ble_gap_evt_data_length_update_t>(),
4493 8usize,
4494 concat!("Size of: ", stringify!(ble_gap_evt_data_length_update_t))
4495 );
4496 assert_eq!(
4497 ::core::mem::align_of::<ble_gap_evt_data_length_update_t>(),
4498 2usize,
4499 concat!("Alignment of ", stringify!(ble_gap_evt_data_length_update_t))
4500 );
4501 assert_eq!(
4502 unsafe { &(*(::core::ptr::null::<ble_gap_evt_data_length_update_t>())).effective_params as *const _ as usize },
4503 0usize,
4504 concat!(
4505 "Offset of field: ",
4506 stringify!(ble_gap_evt_data_length_update_t),
4507 "::",
4508 stringify!(effective_params)
4509 )
4510 );
4511}
4512#[doc = "@brief Event structure for @ref BLE_GAP_EVT_QOS_CHANNEL_SURVEY_REPORT."]
4513#[repr(C)]
4514#[derive(Copy, Clone)]
4515pub struct ble_gap_evt_qos_channel_survey_report_t {
4516 #[doc = "< The measured energy on the Bluetooth Low Energy"]
4517 #[doc = "channels, in dBm, indexed by Channel Index."]
4518 #[doc = "If no measurement is available for the given channel, channel_energy is set to"]
4519 #[doc = "@ref BLE_GAP_POWER_LEVEL_INVALID."]
4520 pub channel_energy: [i8; 40usize],
4521}
4522#[test]
4523fn bindgen_test_layout_ble_gap_evt_qos_channel_survey_report_t() {
4524 assert_eq!(
4525 ::core::mem::size_of::<ble_gap_evt_qos_channel_survey_report_t>(),
4526 40usize,
4527 concat!("Size of: ", stringify!(ble_gap_evt_qos_channel_survey_report_t))
4528 );
4529 assert_eq!(
4530 ::core::mem::align_of::<ble_gap_evt_qos_channel_survey_report_t>(),
4531 1usize,
4532 concat!("Alignment of ", stringify!(ble_gap_evt_qos_channel_survey_report_t))
4533 );
4534 assert_eq!(
4535 unsafe {
4536 &(*(::core::ptr::null::<ble_gap_evt_qos_channel_survey_report_t>())).channel_energy as *const _ as usize
4537 },
4538 0usize,
4539 concat!(
4540 "Offset of field: ",
4541 stringify!(ble_gap_evt_qos_channel_survey_report_t),
4542 "::",
4543 stringify!(channel_energy)
4544 )
4545 );
4546}
4547#[doc = "@brief GAP event structure."]
4548#[repr(C)]
4549#[derive(Copy, Clone)]
4550pub struct ble_gap_evt_t {
4551 #[doc = "< Connection Handle on which event occurred."]
4552 pub conn_handle: u16,
4553 #[doc = "< Event Parameters."]
4554 pub params: ble_gap_evt_t__bindgen_ty_1,
4555}
4556#[repr(C)]
4557#[derive(Copy, Clone)]
4558pub union ble_gap_evt_t__bindgen_ty_1 {
4559 #[doc = "< Connected Event Parameters."]
4560 pub connected: ble_gap_evt_connected_t,
4561 #[doc = "< Disconnected Event Parameters."]
4562 pub disconnected: ble_gap_evt_disconnected_t,
4563 #[doc = "< Connection Parameter Update Parameters."]
4564 pub conn_param_update: ble_gap_evt_conn_param_update_t,
4565 #[doc = "< Security Parameters Request Event Parameters."]
4566 pub sec_params_request: ble_gap_evt_sec_params_request_t,
4567 #[doc = "< Security Information Request Event Parameters."]
4568 pub sec_info_request: ble_gap_evt_sec_info_request_t,
4569 #[doc = "< Passkey Display Event Parameters."]
4570 pub passkey_display: ble_gap_evt_passkey_display_t,
4571 #[doc = "< Key Pressed Event Parameters."]
4572 pub key_pressed: ble_gap_evt_key_pressed_t,
4573 #[doc = "< Authentication Key Request Event Parameters."]
4574 pub auth_key_request: ble_gap_evt_auth_key_request_t,
4575 #[doc = "< LE Secure Connections DHKey calculation request."]
4576 pub lesc_dhkey_request: ble_gap_evt_lesc_dhkey_request_t,
4577 #[doc = "< Authentication Status Event Parameters."]
4578 pub auth_status: ble_gap_evt_auth_status_t,
4579 #[doc = "< Connection Security Update Event Parameters."]
4580 pub conn_sec_update: ble_gap_evt_conn_sec_update_t,
4581 #[doc = "< Timeout Event Parameters."]
4582 pub timeout: ble_gap_evt_timeout_t,
4583 #[doc = "< RSSI Event Parameters."]
4584 pub rssi_changed: ble_gap_evt_rssi_changed_t,
4585 #[doc = "< Advertising Report Event Parameters."]
4586 pub adv_report: ble_gap_evt_adv_report_t,
4587 #[doc = "< Advertising Set Terminated Event Parameters."]
4588 pub adv_set_terminated: ble_gap_evt_adv_set_terminated_t,
4589 #[doc = "< Security Request Event Parameters."]
4590 pub sec_request: ble_gap_evt_sec_request_t,
4591 #[doc = "< Connection Parameter Update Parameters."]
4592 pub conn_param_update_request: ble_gap_evt_conn_param_update_request_t,
4593 #[doc = "< Scan Request Report Parameters."]
4594 pub scan_req_report: ble_gap_evt_scan_req_report_t,
4595 #[doc = "< PHY Update Request Event Parameters."]
4596 pub phy_update_request: ble_gap_evt_phy_update_request_t,
4597 #[doc = "< PHY Update Parameters."]
4598 pub phy_update: ble_gap_evt_phy_update_t,
4599 #[doc = "< Data Length Update Request Event Parameters."]
4600 pub data_length_update_request: ble_gap_evt_data_length_update_request_t,
4601 #[doc = "< Data Length Update Event Parameters."]
4602 pub data_length_update: ble_gap_evt_data_length_update_t,
4603 #[doc = "< Quality of Service (QoS) Channel Survey Report Parameters."]
4604 pub qos_channel_survey_report: ble_gap_evt_qos_channel_survey_report_t,
4605 _bindgen_union_align: [u32; 10usize],
4606}
4607#[test]
4608fn bindgen_test_layout_ble_gap_evt_t__bindgen_ty_1() {
4609 assert_eq!(
4610 ::core::mem::size_of::<ble_gap_evt_t__bindgen_ty_1>(),
4611 40usize,
4612 concat!("Size of: ", stringify!(ble_gap_evt_t__bindgen_ty_1))
4613 );
4614 assert_eq!(
4615 ::core::mem::align_of::<ble_gap_evt_t__bindgen_ty_1>(),
4616 4usize,
4617 concat!("Alignment of ", stringify!(ble_gap_evt_t__bindgen_ty_1))
4618 );
4619 assert_eq!(
4620 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).connected as *const _ as usize },
4621 0usize,
4622 concat!(
4623 "Offset of field: ",
4624 stringify!(ble_gap_evt_t__bindgen_ty_1),
4625 "::",
4626 stringify!(connected)
4627 )
4628 );
4629 assert_eq!(
4630 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).disconnected as *const _ as usize },
4631 0usize,
4632 concat!(
4633 "Offset of field: ",
4634 stringify!(ble_gap_evt_t__bindgen_ty_1),
4635 "::",
4636 stringify!(disconnected)
4637 )
4638 );
4639 assert_eq!(
4640 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).conn_param_update as *const _ as usize },
4641 0usize,
4642 concat!(
4643 "Offset of field: ",
4644 stringify!(ble_gap_evt_t__bindgen_ty_1),
4645 "::",
4646 stringify!(conn_param_update)
4647 )
4648 );
4649 assert_eq!(
4650 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).sec_params_request as *const _ as usize },
4651 0usize,
4652 concat!(
4653 "Offset of field: ",
4654 stringify!(ble_gap_evt_t__bindgen_ty_1),
4655 "::",
4656 stringify!(sec_params_request)
4657 )
4658 );
4659 assert_eq!(
4660 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).sec_info_request as *const _ as usize },
4661 0usize,
4662 concat!(
4663 "Offset of field: ",
4664 stringify!(ble_gap_evt_t__bindgen_ty_1),
4665 "::",
4666 stringify!(sec_info_request)
4667 )
4668 );
4669 assert_eq!(
4670 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).passkey_display as *const _ as usize },
4671 0usize,
4672 concat!(
4673 "Offset of field: ",
4674 stringify!(ble_gap_evt_t__bindgen_ty_1),
4675 "::",
4676 stringify!(passkey_display)
4677 )
4678 );
4679 assert_eq!(
4680 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).key_pressed as *const _ as usize },
4681 0usize,
4682 concat!(
4683 "Offset of field: ",
4684 stringify!(ble_gap_evt_t__bindgen_ty_1),
4685 "::",
4686 stringify!(key_pressed)
4687 )
4688 );
4689 assert_eq!(
4690 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).auth_key_request as *const _ as usize },
4691 0usize,
4692 concat!(
4693 "Offset of field: ",
4694 stringify!(ble_gap_evt_t__bindgen_ty_1),
4695 "::",
4696 stringify!(auth_key_request)
4697 )
4698 );
4699 assert_eq!(
4700 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).lesc_dhkey_request as *const _ as usize },
4701 0usize,
4702 concat!(
4703 "Offset of field: ",
4704 stringify!(ble_gap_evt_t__bindgen_ty_1),
4705 "::",
4706 stringify!(lesc_dhkey_request)
4707 )
4708 );
4709 assert_eq!(
4710 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).auth_status as *const _ as usize },
4711 0usize,
4712 concat!(
4713 "Offset of field: ",
4714 stringify!(ble_gap_evt_t__bindgen_ty_1),
4715 "::",
4716 stringify!(auth_status)
4717 )
4718 );
4719 assert_eq!(
4720 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).conn_sec_update as *const _ as usize },
4721 0usize,
4722 concat!(
4723 "Offset of field: ",
4724 stringify!(ble_gap_evt_t__bindgen_ty_1),
4725 "::",
4726 stringify!(conn_sec_update)
4727 )
4728 );
4729 assert_eq!(
4730 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).timeout as *const _ as usize },
4731 0usize,
4732 concat!(
4733 "Offset of field: ",
4734 stringify!(ble_gap_evt_t__bindgen_ty_1),
4735 "::",
4736 stringify!(timeout)
4737 )
4738 );
4739 assert_eq!(
4740 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).rssi_changed as *const _ as usize },
4741 0usize,
4742 concat!(
4743 "Offset of field: ",
4744 stringify!(ble_gap_evt_t__bindgen_ty_1),
4745 "::",
4746 stringify!(rssi_changed)
4747 )
4748 );
4749 assert_eq!(
4750 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).adv_report as *const _ as usize },
4751 0usize,
4752 concat!(
4753 "Offset of field: ",
4754 stringify!(ble_gap_evt_t__bindgen_ty_1),
4755 "::",
4756 stringify!(adv_report)
4757 )
4758 );
4759 assert_eq!(
4760 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).adv_set_terminated as *const _ as usize },
4761 0usize,
4762 concat!(
4763 "Offset of field: ",
4764 stringify!(ble_gap_evt_t__bindgen_ty_1),
4765 "::",
4766 stringify!(adv_set_terminated)
4767 )
4768 );
4769 assert_eq!(
4770 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).sec_request as *const _ as usize },
4771 0usize,
4772 concat!(
4773 "Offset of field: ",
4774 stringify!(ble_gap_evt_t__bindgen_ty_1),
4775 "::",
4776 stringify!(sec_request)
4777 )
4778 );
4779 assert_eq!(
4780 unsafe {
4781 &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).conn_param_update_request as *const _ as usize
4782 },
4783 0usize,
4784 concat!(
4785 "Offset of field: ",
4786 stringify!(ble_gap_evt_t__bindgen_ty_1),
4787 "::",
4788 stringify!(conn_param_update_request)
4789 )
4790 );
4791 assert_eq!(
4792 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).scan_req_report as *const _ as usize },
4793 0usize,
4794 concat!(
4795 "Offset of field: ",
4796 stringify!(ble_gap_evt_t__bindgen_ty_1),
4797 "::",
4798 stringify!(scan_req_report)
4799 )
4800 );
4801 assert_eq!(
4802 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).phy_update_request as *const _ as usize },
4803 0usize,
4804 concat!(
4805 "Offset of field: ",
4806 stringify!(ble_gap_evt_t__bindgen_ty_1),
4807 "::",
4808 stringify!(phy_update_request)
4809 )
4810 );
4811 assert_eq!(
4812 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).phy_update as *const _ as usize },
4813 0usize,
4814 concat!(
4815 "Offset of field: ",
4816 stringify!(ble_gap_evt_t__bindgen_ty_1),
4817 "::",
4818 stringify!(phy_update)
4819 )
4820 );
4821 assert_eq!(
4822 unsafe {
4823 &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).data_length_update_request as *const _ as usize
4824 },
4825 0usize,
4826 concat!(
4827 "Offset of field: ",
4828 stringify!(ble_gap_evt_t__bindgen_ty_1),
4829 "::",
4830 stringify!(data_length_update_request)
4831 )
4832 );
4833 assert_eq!(
4834 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).data_length_update as *const _ as usize },
4835 0usize,
4836 concat!(
4837 "Offset of field: ",
4838 stringify!(ble_gap_evt_t__bindgen_ty_1),
4839 "::",
4840 stringify!(data_length_update)
4841 )
4842 );
4843 assert_eq!(
4844 unsafe {
4845 &(*(::core::ptr::null::<ble_gap_evt_t__bindgen_ty_1>())).qos_channel_survey_report as *const _ as usize
4846 },
4847 0usize,
4848 concat!(
4849 "Offset of field: ",
4850 stringify!(ble_gap_evt_t__bindgen_ty_1),
4851 "::",
4852 stringify!(qos_channel_survey_report)
4853 )
4854 );
4855}
4856#[test]
4857fn bindgen_test_layout_ble_gap_evt_t() {
4858 assert_eq!(
4859 ::core::mem::size_of::<ble_gap_evt_t>(),
4860 44usize,
4861 concat!("Size of: ", stringify!(ble_gap_evt_t))
4862 );
4863 assert_eq!(
4864 ::core::mem::align_of::<ble_gap_evt_t>(),
4865 4usize,
4866 concat!("Alignment of ", stringify!(ble_gap_evt_t))
4867 );
4868 assert_eq!(
4869 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t>())).conn_handle as *const _ as usize },
4870 0usize,
4871 concat!(
4872 "Offset of field: ",
4873 stringify!(ble_gap_evt_t),
4874 "::",
4875 stringify!(conn_handle)
4876 )
4877 );
4878 assert_eq!(
4879 unsafe { &(*(::core::ptr::null::<ble_gap_evt_t>())).params as *const _ as usize },
4880 4usize,
4881 concat!("Offset of field: ", stringify!(ble_gap_evt_t), "::", stringify!(params))
4882 );
4883}
4884#[doc = " @brief BLE GAP connection configuration parameters, set with @ref sd_ble_cfg_set."]
4885#[doc = ""]
4886#[doc = " @retval ::NRF_ERROR_CONN_COUNT The connection count for the connection configurations is zero."]
4887#[doc = " @retval ::NRF_ERROR_INVALID_PARAM One or more of the following is true:"]
4888#[doc = " - The sum of conn_count for all connection configurations combined exceeds UINT8_MAX."]
4889#[doc = " - The event length is smaller than @ref BLE_GAP_EVENT_LENGTH_MIN."]
4890#[repr(C)]
4891#[derive(Debug, Copy, Clone)]
4892pub struct ble_gap_conn_cfg_t {
4893 #[doc = "< The number of concurrent connections the application can create with this configuration."]
4894 #[doc = "The default and minimum value is @ref BLE_GAP_CONN_COUNT_DEFAULT."]
4895 pub conn_count: u8,
4896 #[doc = "< The time set aside for this connection on every connection interval in 1.25 ms units."]
4897 #[doc = "The default value is @ref BLE_GAP_EVENT_LENGTH_DEFAULT, the minimum value is @ref BLE_GAP_EVENT_LENGTH_MIN."]
4898 #[doc = "The event length and the connection interval are the primary parameters"]
4899 #[doc = "for setting the throughput of a connection."]
4900 #[doc = "See the SoftDevice Specification for details on throughput."]
4901 pub event_length: u16,
4902}
4903#[test]
4904fn bindgen_test_layout_ble_gap_conn_cfg_t() {
4905 assert_eq!(
4906 ::core::mem::size_of::<ble_gap_conn_cfg_t>(),
4907 4usize,
4908 concat!("Size of: ", stringify!(ble_gap_conn_cfg_t))
4909 );
4910 assert_eq!(
4911 ::core::mem::align_of::<ble_gap_conn_cfg_t>(),
4912 2usize,
4913 concat!("Alignment of ", stringify!(ble_gap_conn_cfg_t))
4914 );
4915 assert_eq!(
4916 unsafe { &(*(::core::ptr::null::<ble_gap_conn_cfg_t>())).conn_count as *const _ as usize },
4917 0usize,
4918 concat!(
4919 "Offset of field: ",
4920 stringify!(ble_gap_conn_cfg_t),
4921 "::",
4922 stringify!(conn_count)
4923 )
4924 );
4925 assert_eq!(
4926 unsafe { &(*(::core::ptr::null::<ble_gap_conn_cfg_t>())).event_length as *const _ as usize },
4927 2usize,
4928 concat!(
4929 "Offset of field: ",
4930 stringify!(ble_gap_conn_cfg_t),
4931 "::",
4932 stringify!(event_length)
4933 )
4934 );
4935}
4936#[doc = " @brief Configuration of maximum concurrent connections in the different connected roles, set with"]
4937#[doc = " @ref sd_ble_cfg_set."]
4938#[doc = ""]
4939#[doc = " @retval ::NRF_ERROR_CONN_COUNT The sum of periph_role_count and central_role_count is too"]
4940#[doc = " large. The maximum supported sum of concurrent connections is"]
4941#[doc = " @ref BLE_GAP_ROLE_COUNT_COMBINED_MAX."]
4942#[doc = " @retval ::NRF_ERROR_INVALID_PARAM central_sec_count is larger than central_role_count."]
4943#[doc = " @retval ::NRF_ERROR_RESOURCES The adv_set_count is too large. The maximum"]
4944#[doc = " supported advertising handles is"]
4945#[doc = " @ref BLE_GAP_ADV_SET_COUNT_MAX."]
4946#[repr(C)]
4947#[derive(Debug, Copy, Clone)]
4948pub struct ble_gap_cfg_role_count_t {
4949 #[doc = "< Maximum number of advertising sets. Default value is @ref BLE_GAP_ADV_SET_COUNT_DEFAULT."]
4950 pub adv_set_count: u8,
4951 #[doc = "< Maximum number of connections concurrently acting as a peripheral. Default value is @ref BLE_GAP_ROLE_COUNT_PERIPH_DEFAULT."]
4952 pub periph_role_count: u8,
4953 #[doc = "< Maximum number of connections concurrently acting as a central. Default value is @ref BLE_GAP_ROLE_COUNT_CENTRAL_DEFAULT."]
4954 pub central_role_count: u8,
4955 #[doc = "< Number of SMP instances shared between all connections acting as a central. Default value is @ref BLE_GAP_ROLE_COUNT_CENTRAL_SEC_DEFAULT."]
4956 pub central_sec_count: u8,
4957 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
4958}
4959#[test]
4960fn bindgen_test_layout_ble_gap_cfg_role_count_t() {
4961 assert_eq!(
4962 ::core::mem::size_of::<ble_gap_cfg_role_count_t>(),
4963 5usize,
4964 concat!("Size of: ", stringify!(ble_gap_cfg_role_count_t))
4965 );
4966 assert_eq!(
4967 ::core::mem::align_of::<ble_gap_cfg_role_count_t>(),
4968 1usize,
4969 concat!("Alignment of ", stringify!(ble_gap_cfg_role_count_t))
4970 );
4971 assert_eq!(
4972 unsafe { &(*(::core::ptr::null::<ble_gap_cfg_role_count_t>())).adv_set_count as *const _ as usize },
4973 0usize,
4974 concat!(
4975 "Offset of field: ",
4976 stringify!(ble_gap_cfg_role_count_t),
4977 "::",
4978 stringify!(adv_set_count)
4979 )
4980 );
4981 assert_eq!(
4982 unsafe { &(*(::core::ptr::null::<ble_gap_cfg_role_count_t>())).periph_role_count as *const _ as usize },
4983 1usize,
4984 concat!(
4985 "Offset of field: ",
4986 stringify!(ble_gap_cfg_role_count_t),
4987 "::",
4988 stringify!(periph_role_count)
4989 )
4990 );
4991 assert_eq!(
4992 unsafe { &(*(::core::ptr::null::<ble_gap_cfg_role_count_t>())).central_role_count as *const _ as usize },
4993 2usize,
4994 concat!(
4995 "Offset of field: ",
4996 stringify!(ble_gap_cfg_role_count_t),
4997 "::",
4998 stringify!(central_role_count)
4999 )
5000 );
5001 assert_eq!(
5002 unsafe { &(*(::core::ptr::null::<ble_gap_cfg_role_count_t>())).central_sec_count as *const _ as usize },
5003 3usize,
5004 concat!(
5005 "Offset of field: ",
5006 stringify!(ble_gap_cfg_role_count_t),
5007 "::",
5008 stringify!(central_sec_count)
5009 )
5010 );
5011}
5012impl ble_gap_cfg_role_count_t {
5013 #[inline]
5014 pub fn qos_channel_survey_role_available(&self) -> u8 {
5015 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
5016 }
5017 #[inline]
5018 pub fn set_qos_channel_survey_role_available(&mut self, val: u8) {
5019 unsafe {
5020 let val: u8 = ::core::mem::transmute(val);
5021 self._bitfield_1.set(0usize, 1u8, val as u64)
5022 }
5023 }
5024 #[inline]
5025 pub fn new_bitfield_1(qos_channel_survey_role_available: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
5026 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
5027 __bindgen_bitfield_unit.set(0usize, 1u8, {
5028 let qos_channel_survey_role_available: u8 =
5029 unsafe { ::core::mem::transmute(qos_channel_survey_role_available) };
5030 qos_channel_survey_role_available as u64
5031 });
5032 __bindgen_bitfield_unit
5033 }
5034}
5035#[doc = " @brief Device name and its properties, set with @ref sd_ble_cfg_set."]
5036#[doc = ""]
5037#[doc = " @note If the device name is not configured, the default device name will be"]
5038#[doc = " @ref BLE_GAP_DEVNAME_DEFAULT, the maximum device name length will be"]
5039#[doc = " @ref BLE_GAP_DEVNAME_DEFAULT_LEN, vloc will be set to @ref BLE_GATTS_VLOC_STACK and the device name"]
5040#[doc = " will have no write access."]
5041#[doc = ""]
5042#[doc = " @note If @ref max_len is more than @ref BLE_GAP_DEVNAME_DEFAULT_LEN and vloc is set to @ref BLE_GATTS_VLOC_STACK,"]
5043#[doc = " the attribute table size must be increased to have room for the longer device name (see"]
5044#[doc = " @ref sd_ble_cfg_set and @ref ble_gatts_cfg_attr_tab_size_t)."]
5045#[doc = ""]
5046#[doc = " @note If vloc is @ref BLE_GATTS_VLOC_STACK :"]
5047#[doc = " - p_value must point to non-volatile memory (flash) or be NULL."]
5048#[doc = " - If p_value is NULL, the device name will initially be empty."]
5049#[doc = ""]
5050#[doc = " @note If vloc is @ref BLE_GATTS_VLOC_USER :"]
5051#[doc = " - p_value cannot be NULL."]
5052#[doc = " - If the device name is writable, p_value must point to volatile memory (RAM)."]
5053#[doc = ""]
5054#[doc = " @retval ::NRF_ERROR_INVALID_PARAM One or more of the following is true:"]
5055#[doc = " - Invalid device name location (vloc)."]
5056#[doc = " - Invalid device name security mode."]
5057#[doc = " @retval ::NRF_ERROR_INVALID_LENGTH One or more of the following is true:"]
5058#[doc = " - The device name length is invalid (must be between 0 and @ref BLE_GAP_DEVNAME_MAX_LEN)."]
5059#[doc = " - The device name length is too long for the given Attribute Table."]
5060#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED Device name security mode is not supported."]
5061#[repr(C)]
5062#[derive(Debug, Copy, Clone)]
5063pub struct ble_gap_cfg_device_name_t {
5064 #[doc = "< Write permissions."]
5065 pub write_perm: ble_gap_conn_sec_mode_t,
5066 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
5067 #[doc = "< Pointer to where the value (device name) is stored or will be stored."]
5068 pub p_value: *mut u8,
5069 #[doc = "< Current length in bytes of the memory pointed to by p_value."]
5070 pub current_len: u16,
5071 #[doc = "< Maximum length in bytes of the memory pointed to by p_value."]
5072 pub max_len: u16,
5073}
5074#[test]
5075fn bindgen_test_layout_ble_gap_cfg_device_name_t() {
5076 assert_eq!(
5077 ::core::mem::size_of::<ble_gap_cfg_device_name_t>(),
5078 12usize,
5079 concat!("Size of: ", stringify!(ble_gap_cfg_device_name_t))
5080 );
5081 assert_eq!(
5082 ::core::mem::align_of::<ble_gap_cfg_device_name_t>(),
5083 4usize,
5084 concat!("Alignment of ", stringify!(ble_gap_cfg_device_name_t))
5085 );
5086 assert_eq!(
5087 unsafe { &(*(::core::ptr::null::<ble_gap_cfg_device_name_t>())).write_perm as *const _ as usize },
5088 0usize,
5089 concat!(
5090 "Offset of field: ",
5091 stringify!(ble_gap_cfg_device_name_t),
5092 "::",
5093 stringify!(write_perm)
5094 )
5095 );
5096 assert_eq!(
5097 unsafe { &(*(::core::ptr::null::<ble_gap_cfg_device_name_t>())).p_value as *const _ as usize },
5098 4usize,
5099 concat!(
5100 "Offset of field: ",
5101 stringify!(ble_gap_cfg_device_name_t),
5102 "::",
5103 stringify!(p_value)
5104 )
5105 );
5106 assert_eq!(
5107 unsafe { &(*(::core::ptr::null::<ble_gap_cfg_device_name_t>())).current_len as *const _ as usize },
5108 8usize,
5109 concat!(
5110 "Offset of field: ",
5111 stringify!(ble_gap_cfg_device_name_t),
5112 "::",
5113 stringify!(current_len)
5114 )
5115 );
5116 assert_eq!(
5117 unsafe { &(*(::core::ptr::null::<ble_gap_cfg_device_name_t>())).max_len as *const _ as usize },
5118 10usize,
5119 concat!(
5120 "Offset of field: ",
5121 stringify!(ble_gap_cfg_device_name_t),
5122 "::",
5123 stringify!(max_len)
5124 )
5125 );
5126}
5127impl ble_gap_cfg_device_name_t {
5128 #[inline]
5129 pub fn vloc(&self) -> u8 {
5130 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u8) }
5131 }
5132 #[inline]
5133 pub fn set_vloc(&mut self, val: u8) {
5134 unsafe {
5135 let val: u8 = ::core::mem::transmute(val);
5136 self._bitfield_1.set(0usize, 2u8, val as u64)
5137 }
5138 }
5139 #[inline]
5140 pub fn new_bitfield_1(vloc: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
5141 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
5142 __bindgen_bitfield_unit.set(0usize, 2u8, {
5143 let vloc: u8 = unsafe { ::core::mem::transmute(vloc) };
5144 vloc as u64
5145 });
5146 __bindgen_bitfield_unit
5147 }
5148}
5149#[doc = "@brief Peripheral Preferred Connection Parameters include configuration parameters, set with @ref sd_ble_cfg_set."]
5150#[repr(C)]
5151#[derive(Debug, Copy, Clone)]
5152pub struct ble_gap_cfg_ppcp_incl_cfg_t {
5153 #[doc = "< Inclusion configuration of the Peripheral Preferred Connection Parameters characteristic."]
5154 #[doc = "See @ref BLE_GAP_CHAR_INCL_CONFIG. Default is @ref BLE_GAP_PPCP_INCL_CONFIG_DEFAULT."]
5155 pub include_cfg: u8,
5156}
5157#[test]
5158fn bindgen_test_layout_ble_gap_cfg_ppcp_incl_cfg_t() {
5159 assert_eq!(
5160 ::core::mem::size_of::<ble_gap_cfg_ppcp_incl_cfg_t>(),
5161 1usize,
5162 concat!("Size of: ", stringify!(ble_gap_cfg_ppcp_incl_cfg_t))
5163 );
5164 assert_eq!(
5165 ::core::mem::align_of::<ble_gap_cfg_ppcp_incl_cfg_t>(),
5166 1usize,
5167 concat!("Alignment of ", stringify!(ble_gap_cfg_ppcp_incl_cfg_t))
5168 );
5169 assert_eq!(
5170 unsafe { &(*(::core::ptr::null::<ble_gap_cfg_ppcp_incl_cfg_t>())).include_cfg as *const _ as usize },
5171 0usize,
5172 concat!(
5173 "Offset of field: ",
5174 stringify!(ble_gap_cfg_ppcp_incl_cfg_t),
5175 "::",
5176 stringify!(include_cfg)
5177 )
5178 );
5179}
5180#[doc = "@brief Central Address Resolution include configuration parameters, set with @ref sd_ble_cfg_set."]
5181#[repr(C)]
5182#[derive(Debug, Copy, Clone)]
5183pub struct ble_gap_cfg_car_incl_cfg_t {
5184 #[doc = "< Inclusion configuration of the Central Address Resolution characteristic."]
5185 #[doc = "See @ref BLE_GAP_CHAR_INCL_CONFIG. Default is @ref BLE_GAP_CAR_INCL_CONFIG_DEFAULT."]
5186 pub include_cfg: u8,
5187}
5188#[test]
5189fn bindgen_test_layout_ble_gap_cfg_car_incl_cfg_t() {
5190 assert_eq!(
5191 ::core::mem::size_of::<ble_gap_cfg_car_incl_cfg_t>(),
5192 1usize,
5193 concat!("Size of: ", stringify!(ble_gap_cfg_car_incl_cfg_t))
5194 );
5195 assert_eq!(
5196 ::core::mem::align_of::<ble_gap_cfg_car_incl_cfg_t>(),
5197 1usize,
5198 concat!("Alignment of ", stringify!(ble_gap_cfg_car_incl_cfg_t))
5199 );
5200 assert_eq!(
5201 unsafe { &(*(::core::ptr::null::<ble_gap_cfg_car_incl_cfg_t>())).include_cfg as *const _ as usize },
5202 0usize,
5203 concat!(
5204 "Offset of field: ",
5205 stringify!(ble_gap_cfg_car_incl_cfg_t),
5206 "::",
5207 stringify!(include_cfg)
5208 )
5209 );
5210}
5211#[doc = "@brief Configuration structure for GAP configurations."]
5212#[repr(C)]
5213#[derive(Copy, Clone)]
5214pub union ble_gap_cfg_t {
5215 #[doc = "< Role count configuration, cfg_id is @ref BLE_GAP_CFG_ROLE_COUNT."]
5216 pub role_count_cfg: ble_gap_cfg_role_count_t,
5217 #[doc = "< Device name configuration, cfg_id is @ref BLE_GAP_CFG_DEVICE_NAME."]
5218 pub device_name_cfg: ble_gap_cfg_device_name_t,
5219 #[doc = "< Peripheral Preferred Connection Parameters characteristic include"]
5220 #[doc = "configuration, cfg_id is @ref BLE_GAP_CFG_PPCP_INCL_CONFIG."]
5221 pub ppcp_include_cfg: ble_gap_cfg_ppcp_incl_cfg_t,
5222 #[doc = "< Central Address Resolution characteristic include configuration,"]
5223 #[doc = "cfg_id is @ref BLE_GAP_CFG_CAR_INCL_CONFIG."]
5224 pub car_include_cfg: ble_gap_cfg_car_incl_cfg_t,
5225 _bindgen_union_align: [u32; 3usize],
5226}
5227#[test]
5228fn bindgen_test_layout_ble_gap_cfg_t() {
5229 assert_eq!(
5230 ::core::mem::size_of::<ble_gap_cfg_t>(),
5231 12usize,
5232 concat!("Size of: ", stringify!(ble_gap_cfg_t))
5233 );
5234 assert_eq!(
5235 ::core::mem::align_of::<ble_gap_cfg_t>(),
5236 4usize,
5237 concat!("Alignment of ", stringify!(ble_gap_cfg_t))
5238 );
5239 assert_eq!(
5240 unsafe { &(*(::core::ptr::null::<ble_gap_cfg_t>())).role_count_cfg as *const _ as usize },
5241 0usize,
5242 concat!(
5243 "Offset of field: ",
5244 stringify!(ble_gap_cfg_t),
5245 "::",
5246 stringify!(role_count_cfg)
5247 )
5248 );
5249 assert_eq!(
5250 unsafe { &(*(::core::ptr::null::<ble_gap_cfg_t>())).device_name_cfg as *const _ as usize },
5251 0usize,
5252 concat!(
5253 "Offset of field: ",
5254 stringify!(ble_gap_cfg_t),
5255 "::",
5256 stringify!(device_name_cfg)
5257 )
5258 );
5259 assert_eq!(
5260 unsafe { &(*(::core::ptr::null::<ble_gap_cfg_t>())).ppcp_include_cfg as *const _ as usize },
5261 0usize,
5262 concat!(
5263 "Offset of field: ",
5264 stringify!(ble_gap_cfg_t),
5265 "::",
5266 stringify!(ppcp_include_cfg)
5267 )
5268 );
5269 assert_eq!(
5270 unsafe { &(*(::core::ptr::null::<ble_gap_cfg_t>())).car_include_cfg as *const _ as usize },
5271 0usize,
5272 concat!(
5273 "Offset of field: ",
5274 stringify!(ble_gap_cfg_t),
5275 "::",
5276 stringify!(car_include_cfg)
5277 )
5278 );
5279}
5280#[doc = "@brief Channel Map option."]
5281#[doc = ""]
5282#[doc = " @details Used with @ref sd_ble_opt_get to get the current channel map"]
5283#[doc = " or @ref sd_ble_opt_set to set a new channel map. When setting the"]
5284#[doc = " channel map, it applies to all current and future connections. When getting the"]
5285#[doc = " current channel map, it applies to a single connection and the connection handle"]
5286#[doc = " must be supplied."]
5287#[doc = ""]
5288#[doc = " @note Setting the channel map may take some time, depending on connection parameters."]
5289#[doc = " The time taken may be different for each connection and the get operation will"]
5290#[doc = " return the previous channel map until the new one has taken effect."]
5291#[doc = ""]
5292#[doc = " @note After setting the channel map, by spec it can not be set again until at least 1 s has passed."]
5293#[doc = " See Bluetooth Specification Version 4.1 Volume 2, Part E, Section 7.3.46."]
5294#[doc = ""]
5295#[doc = " @retval ::NRF_SUCCESS Get or set successful."]
5296#[doc = " @retval ::NRF_ERROR_INVALID_PARAM One or more of the following is true:"]
5297#[doc = " - Less then two bits in @ref ch_map are set."]
5298#[doc = " - Bits for primary advertising channels (37-39) are set."]
5299#[doc = " @retval ::NRF_ERROR_BUSY Channel map was set again before enough time had passed."]
5300#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied for get."]
5301#[doc = ""]
5302#[repr(C)]
5303#[derive(Debug, Copy, Clone)]
5304pub struct ble_gap_opt_ch_map_t {
5305 #[doc = "< Connection Handle (only applicable for get)"]
5306 pub conn_handle: u16,
5307 #[doc = "< Channel Map (37-bit)."]
5308 pub ch_map: [u8; 5usize],
5309}
5310#[test]
5311fn bindgen_test_layout_ble_gap_opt_ch_map_t() {
5312 assert_eq!(
5313 ::core::mem::size_of::<ble_gap_opt_ch_map_t>(),
5314 8usize,
5315 concat!("Size of: ", stringify!(ble_gap_opt_ch_map_t))
5316 );
5317 assert_eq!(
5318 ::core::mem::align_of::<ble_gap_opt_ch_map_t>(),
5319 2usize,
5320 concat!("Alignment of ", stringify!(ble_gap_opt_ch_map_t))
5321 );
5322 assert_eq!(
5323 unsafe { &(*(::core::ptr::null::<ble_gap_opt_ch_map_t>())).conn_handle as *const _ as usize },
5324 0usize,
5325 concat!(
5326 "Offset of field: ",
5327 stringify!(ble_gap_opt_ch_map_t),
5328 "::",
5329 stringify!(conn_handle)
5330 )
5331 );
5332 assert_eq!(
5333 unsafe { &(*(::core::ptr::null::<ble_gap_opt_ch_map_t>())).ch_map as *const _ as usize },
5334 2usize,
5335 concat!(
5336 "Offset of field: ",
5337 stringify!(ble_gap_opt_ch_map_t),
5338 "::",
5339 stringify!(ch_map)
5340 )
5341 );
5342}
5343#[doc = "@brief Local connection latency option."]
5344#[doc = ""]
5345#[doc = " @details Local connection latency is a feature which enables the slave to improve"]
5346#[doc = " current consumption by ignoring the slave latency set by the peer. The"]
5347#[doc = " local connection latency can only be set to a multiple of the slave latency,"]
5348#[doc = " and cannot be longer than half of the supervision timeout."]
5349#[doc = ""]
5350#[doc = " @details Used with @ref sd_ble_opt_set to set the local connection latency. The"]
5351#[doc = " @ref sd_ble_opt_get is not supported for this option, but the actual"]
5352#[doc = " local connection latency (unless set to NULL) is set as a return parameter"]
5353#[doc = " when setting the option."]
5354#[doc = ""]
5355#[doc = " @note The latency set will be truncated down to the closest slave latency event"]
5356#[doc = " multiple, or the nearest multiple before half of the supervision timeout."]
5357#[doc = ""]
5358#[doc = " @note The local connection latency is disabled by default, and needs to be enabled for new"]
5359#[doc = " connections and whenever the connection is updated."]
5360#[doc = ""]
5361#[doc = " @retval ::NRF_SUCCESS Set successfully."]
5362#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED Get is not supported."]
5363#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter."]
5364#[repr(C)]
5365#[derive(Debug, Copy, Clone)]
5366pub struct ble_gap_opt_local_conn_latency_t {
5367 #[doc = "< Connection Handle"]
5368 pub conn_handle: u16,
5369 #[doc = "< Requested local connection latency."]
5370 pub requested_latency: u16,
5371 #[doc = "< Pointer to storage for the actual local connection latency (can be set to NULL to skip return value)."]
5372 pub p_actual_latency: *mut u16,
5373}
5374#[test]
5375fn bindgen_test_layout_ble_gap_opt_local_conn_latency_t() {
5376 assert_eq!(
5377 ::core::mem::size_of::<ble_gap_opt_local_conn_latency_t>(),
5378 8usize,
5379 concat!("Size of: ", stringify!(ble_gap_opt_local_conn_latency_t))
5380 );
5381 assert_eq!(
5382 ::core::mem::align_of::<ble_gap_opt_local_conn_latency_t>(),
5383 4usize,
5384 concat!("Alignment of ", stringify!(ble_gap_opt_local_conn_latency_t))
5385 );
5386 assert_eq!(
5387 unsafe { &(*(::core::ptr::null::<ble_gap_opt_local_conn_latency_t>())).conn_handle as *const _ as usize },
5388 0usize,
5389 concat!(
5390 "Offset of field: ",
5391 stringify!(ble_gap_opt_local_conn_latency_t),
5392 "::",
5393 stringify!(conn_handle)
5394 )
5395 );
5396 assert_eq!(
5397 unsafe { &(*(::core::ptr::null::<ble_gap_opt_local_conn_latency_t>())).requested_latency as *const _ as usize },
5398 2usize,
5399 concat!(
5400 "Offset of field: ",
5401 stringify!(ble_gap_opt_local_conn_latency_t),
5402 "::",
5403 stringify!(requested_latency)
5404 )
5405 );
5406 assert_eq!(
5407 unsafe { &(*(::core::ptr::null::<ble_gap_opt_local_conn_latency_t>())).p_actual_latency as *const _ as usize },
5408 4usize,
5409 concat!(
5410 "Offset of field: ",
5411 stringify!(ble_gap_opt_local_conn_latency_t),
5412 "::",
5413 stringify!(p_actual_latency)
5414 )
5415 );
5416}
5417#[doc = "@brief Disable slave latency"]
5418#[doc = ""]
5419#[doc = " @details Used with @ref sd_ble_opt_set to temporarily disable slave latency of a peripheral connection"]
5420#[doc = " (see @ref ble_gap_conn_params_t::slave_latency). And to re-enable it again. When disabled, the"]
5421#[doc = " peripheral will ignore the slave_latency set by the central."]
5422#[doc = ""]
5423#[doc = " @note Shall only be called on peripheral links."]
5424#[doc = ""]
5425#[doc = " @retval ::NRF_SUCCESS Set successfully."]
5426#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED Get is not supported."]
5427#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter."]
5428#[repr(C)]
5429#[derive(Debug, Copy, Clone)]
5430pub struct ble_gap_opt_slave_latency_disable_t {
5431 #[doc = "< Connection Handle"]
5432 pub conn_handle: u16,
5433 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
5434 pub __bindgen_padding_0: u8,
5435}
5436#[test]
5437fn bindgen_test_layout_ble_gap_opt_slave_latency_disable_t() {
5438 assert_eq!(
5439 ::core::mem::size_of::<ble_gap_opt_slave_latency_disable_t>(),
5440 4usize,
5441 concat!("Size of: ", stringify!(ble_gap_opt_slave_latency_disable_t))
5442 );
5443 assert_eq!(
5444 ::core::mem::align_of::<ble_gap_opt_slave_latency_disable_t>(),
5445 2usize,
5446 concat!("Alignment of ", stringify!(ble_gap_opt_slave_latency_disable_t))
5447 );
5448 assert_eq!(
5449 unsafe { &(*(::core::ptr::null::<ble_gap_opt_slave_latency_disable_t>())).conn_handle as *const _ as usize },
5450 0usize,
5451 concat!(
5452 "Offset of field: ",
5453 stringify!(ble_gap_opt_slave_latency_disable_t),
5454 "::",
5455 stringify!(conn_handle)
5456 )
5457 );
5458}
5459impl ble_gap_opt_slave_latency_disable_t {
5460 #[inline]
5461 pub fn disable(&self) -> u8 {
5462 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
5463 }
5464 #[inline]
5465 pub fn set_disable(&mut self, val: u8) {
5466 unsafe {
5467 let val: u8 = ::core::mem::transmute(val);
5468 self._bitfield_1.set(0usize, 1u8, val as u64)
5469 }
5470 }
5471 #[inline]
5472 pub fn new_bitfield_1(disable: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
5473 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
5474 __bindgen_bitfield_unit.set(0usize, 1u8, {
5475 let disable: u8 = unsafe { ::core::mem::transmute(disable) };
5476 disable as u64
5477 });
5478 __bindgen_bitfield_unit
5479 }
5480}
5481#[doc = "@brief Passkey Option."]
5482#[doc = ""]
5483#[doc = " @mscs"]
5484#[doc = " @mmsc{@ref BLE_GAP_PERIPH_BONDING_STATIC_PK_MSC}"]
5485#[doc = " @endmscs"]
5486#[doc = ""]
5487#[doc = " @details Structure containing the passkey to be used during pairing. This can be used with @ref"]
5488#[doc = " sd_ble_opt_set to make the SoftDevice use a preprogrammed passkey for authentication"]
5489#[doc = " instead of generating a random one."]
5490#[doc = ""]
5491#[doc = " @note Repeated pairing attempts using the same preprogrammed passkey makes pairing vulnerable to MITM attacks."]
5492#[doc = ""]
5493#[doc = " @note @ref sd_ble_opt_get is not supported for this option."]
5494#[doc = ""]
5495#[repr(C)]
5496#[derive(Debug, Copy, Clone)]
5497pub struct ble_gap_opt_passkey_t {
5498 #[doc = "< Pointer to 6-digit ASCII string (digit 0..9 only, no NULL termination) passkey to be used during pairing. If this is NULL, the SoftDevice will generate a random passkey if required."]
5499 pub p_passkey: *const u8,
5500}
5501#[test]
5502fn bindgen_test_layout_ble_gap_opt_passkey_t() {
5503 assert_eq!(
5504 ::core::mem::size_of::<ble_gap_opt_passkey_t>(),
5505 4usize,
5506 concat!("Size of: ", stringify!(ble_gap_opt_passkey_t))
5507 );
5508 assert_eq!(
5509 ::core::mem::align_of::<ble_gap_opt_passkey_t>(),
5510 4usize,
5511 concat!("Alignment of ", stringify!(ble_gap_opt_passkey_t))
5512 );
5513 assert_eq!(
5514 unsafe { &(*(::core::ptr::null::<ble_gap_opt_passkey_t>())).p_passkey as *const _ as usize },
5515 0usize,
5516 concat!(
5517 "Offset of field: ",
5518 stringify!(ble_gap_opt_passkey_t),
5519 "::",
5520 stringify!(p_passkey)
5521 )
5522 );
5523}
5524#[doc = "@brief Compatibility mode 1 option."]
5525#[doc = ""]
5526#[doc = " @details This can be used with @ref sd_ble_opt_set to enable and disable"]
5527#[doc = " compatibility mode 1. Compatibility mode 1 is disabled by default."]
5528#[doc = ""]
5529#[doc = " @note Compatibility mode 1 enables interoperability with devices that do not support a value of"]
5530#[doc = " 0 for the WinOffset parameter in the Link Layer CONNECT_IND packet. This applies to a"]
5531#[doc = " limited set of legacy peripheral devices from another vendor. Enabling this compatibility"]
5532#[doc = " mode will only have an effect if the local device will act as a central device and"]
5533#[doc = " initiate a connection to a peripheral device. In that case it may lead to the connection"]
5534#[doc = " creation taking up to one connection interval longer to complete for all connections."]
5535#[doc = ""]
5536#[doc = " @retval ::NRF_SUCCESS Set successfully."]
5537#[doc = " @retval ::NRF_ERROR_INVALID_STATE When connection creation is ongoing while mode 1 is set."]
5538#[repr(C, packed)]
5539#[derive(Debug, Copy, Clone)]
5540pub struct ble_gap_opt_compat_mode_1_t {
5541 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
5542}
5543#[test]
5544fn bindgen_test_layout_ble_gap_opt_compat_mode_1_t() {
5545 assert_eq!(
5546 ::core::mem::size_of::<ble_gap_opt_compat_mode_1_t>(),
5547 1usize,
5548 concat!("Size of: ", stringify!(ble_gap_opt_compat_mode_1_t))
5549 );
5550 assert_eq!(
5551 ::core::mem::align_of::<ble_gap_opt_compat_mode_1_t>(),
5552 1usize,
5553 concat!("Alignment of ", stringify!(ble_gap_opt_compat_mode_1_t))
5554 );
5555}
5556impl ble_gap_opt_compat_mode_1_t {
5557 #[inline]
5558 pub fn enable(&self) -> u8 {
5559 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
5560 }
5561 #[inline]
5562 pub fn set_enable(&mut self, val: u8) {
5563 unsafe {
5564 let val: u8 = ::core::mem::transmute(val);
5565 self._bitfield_1.set(0usize, 1u8, val as u64)
5566 }
5567 }
5568 #[inline]
5569 pub fn new_bitfield_1(enable: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
5570 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
5571 __bindgen_bitfield_unit.set(0usize, 1u8, {
5572 let enable: u8 = unsafe { ::core::mem::transmute(enable) };
5573 enable as u64
5574 });
5575 __bindgen_bitfield_unit
5576 }
5577}
5578#[doc = "@brief Authenticated payload timeout option."]
5579#[doc = ""]
5580#[doc = " @details This can be used with @ref sd_ble_opt_set to change the Authenticated payload timeout to a value other"]
5581#[doc = " than the default of @ref BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MAX."]
5582#[doc = ""]
5583#[doc = " @note The authenticated payload timeout event ::BLE_GAP_TIMEOUT_SRC_AUTH_PAYLOAD will be generated"]
5584#[doc = " if auth_payload_timeout time has elapsed without receiving a packet with a valid MIC on an encrypted"]
5585#[doc = " link."]
5586#[doc = ""]
5587#[doc = " @note The LE ping procedure will be initiated before the timer expires to give the peer a chance"]
5588#[doc = " to reset the timer. In addition the stack will try to prioritize running of LE ping over other"]
5589#[doc = " activities to increase chances of finishing LE ping before timer expires. To avoid side-effects"]
5590#[doc = " on other activities, it is recommended to use high timeout values."]
5591#[doc = " Recommended timeout > 2*(connInterval * (6 + connSlaveLatency))."]
5592#[doc = ""]
5593#[doc = " @retval ::NRF_SUCCESS Set successfully."]
5594#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. auth_payload_timeout was outside of allowed range."]
5595#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter."]
5596#[repr(C)]
5597#[derive(Debug, Copy, Clone)]
5598pub struct ble_gap_opt_auth_payload_timeout_t {
5599 #[doc = "< Connection Handle"]
5600 pub conn_handle: u16,
5601 #[doc = "< Requested timeout in 10 ms unit, see @ref BLE_GAP_AUTH_PAYLOAD_TIMEOUT."]
5602 pub auth_payload_timeout: u16,
5603}
5604#[test]
5605fn bindgen_test_layout_ble_gap_opt_auth_payload_timeout_t() {
5606 assert_eq!(
5607 ::core::mem::size_of::<ble_gap_opt_auth_payload_timeout_t>(),
5608 4usize,
5609 concat!("Size of: ", stringify!(ble_gap_opt_auth_payload_timeout_t))
5610 );
5611 assert_eq!(
5612 ::core::mem::align_of::<ble_gap_opt_auth_payload_timeout_t>(),
5613 2usize,
5614 concat!("Alignment of ", stringify!(ble_gap_opt_auth_payload_timeout_t))
5615 );
5616 assert_eq!(
5617 unsafe { &(*(::core::ptr::null::<ble_gap_opt_auth_payload_timeout_t>())).conn_handle as *const _ as usize },
5618 0usize,
5619 concat!(
5620 "Offset of field: ",
5621 stringify!(ble_gap_opt_auth_payload_timeout_t),
5622 "::",
5623 stringify!(conn_handle)
5624 )
5625 );
5626 assert_eq!(
5627 unsafe {
5628 &(*(::core::ptr::null::<ble_gap_opt_auth_payload_timeout_t>())).auth_payload_timeout as *const _ as usize
5629 },
5630 2usize,
5631 concat!(
5632 "Offset of field: ",
5633 stringify!(ble_gap_opt_auth_payload_timeout_t),
5634 "::",
5635 stringify!(auth_payload_timeout)
5636 )
5637 );
5638}
5639#[doc = "@brief Option structure for GAP options."]
5640#[repr(C)]
5641#[derive(Copy, Clone)]
5642pub union ble_gap_opt_t {
5643 #[doc = "< Parameters for the Channel Map option."]
5644 pub ch_map: ble_gap_opt_ch_map_t,
5645 #[doc = "< Parameters for the Local connection latency option"]
5646 pub local_conn_latency: ble_gap_opt_local_conn_latency_t,
5647 #[doc = "< Parameters for the Passkey option."]
5648 pub passkey: ble_gap_opt_passkey_t,
5649 #[doc = "< Parameters for the compatibility mode 1 option."]
5650 pub compat_mode_1: ble_gap_opt_compat_mode_1_t,
5651 #[doc = "< Parameters for the authenticated payload timeout option."]
5652 pub auth_payload_timeout: ble_gap_opt_auth_payload_timeout_t,
5653 #[doc = "< Parameters for the Disable slave latency option"]
5654 pub slave_latency_disable: ble_gap_opt_slave_latency_disable_t,
5655 _bindgen_union_align: [u32; 2usize],
5656}
5657#[test]
5658fn bindgen_test_layout_ble_gap_opt_t() {
5659 assert_eq!(
5660 ::core::mem::size_of::<ble_gap_opt_t>(),
5661 8usize,
5662 concat!("Size of: ", stringify!(ble_gap_opt_t))
5663 );
5664 assert_eq!(
5665 ::core::mem::align_of::<ble_gap_opt_t>(),
5666 4usize,
5667 concat!("Alignment of ", stringify!(ble_gap_opt_t))
5668 );
5669 assert_eq!(
5670 unsafe { &(*(::core::ptr::null::<ble_gap_opt_t>())).ch_map as *const _ as usize },
5671 0usize,
5672 concat!("Offset of field: ", stringify!(ble_gap_opt_t), "::", stringify!(ch_map))
5673 );
5674 assert_eq!(
5675 unsafe { &(*(::core::ptr::null::<ble_gap_opt_t>())).local_conn_latency as *const _ as usize },
5676 0usize,
5677 concat!(
5678 "Offset of field: ",
5679 stringify!(ble_gap_opt_t),
5680 "::",
5681 stringify!(local_conn_latency)
5682 )
5683 );
5684 assert_eq!(
5685 unsafe { &(*(::core::ptr::null::<ble_gap_opt_t>())).passkey as *const _ as usize },
5686 0usize,
5687 concat!(
5688 "Offset of field: ",
5689 stringify!(ble_gap_opt_t),
5690 "::",
5691 stringify!(passkey)
5692 )
5693 );
5694 assert_eq!(
5695 unsafe { &(*(::core::ptr::null::<ble_gap_opt_t>())).compat_mode_1 as *const _ as usize },
5696 0usize,
5697 concat!(
5698 "Offset of field: ",
5699 stringify!(ble_gap_opt_t),
5700 "::",
5701 stringify!(compat_mode_1)
5702 )
5703 );
5704 assert_eq!(
5705 unsafe { &(*(::core::ptr::null::<ble_gap_opt_t>())).auth_payload_timeout as *const _ as usize },
5706 0usize,
5707 concat!(
5708 "Offset of field: ",
5709 stringify!(ble_gap_opt_t),
5710 "::",
5711 stringify!(auth_payload_timeout)
5712 )
5713 );
5714 assert_eq!(
5715 unsafe { &(*(::core::ptr::null::<ble_gap_opt_t>())).slave_latency_disable as *const _ as usize },
5716 0usize,
5717 concat!(
5718 "Offset of field: ",
5719 stringify!(ble_gap_opt_t),
5720 "::",
5721 stringify!(slave_latency_disable)
5722 )
5723 );
5724}
5725#[doc = "@brief Connection event triggering parameters."]
5726#[repr(C)]
5727#[derive(Debug, Copy, Clone)]
5728pub struct ble_gap_conn_event_trigger_t {
5729 #[doc = "< PPI channel to use. This channel should be regarded as reserved until"]
5730 #[doc = "connection event PPI task triggering is stopped."]
5731 #[doc = "The PPI channel ID can not be one of the PPI channels reserved by"]
5732 #[doc = "the SoftDevice. See @ref NRF_SOC_SD_PPI_CHANNELS_SD_ENABLED_MSK."]
5733 pub ppi_ch_id: u8,
5734 #[doc = "< Task Endpoint to trigger."]
5735 pub task_endpoint: u32,
5736 #[doc = "< The connection event on which the task triggering should start."]
5737 pub conn_evt_counter_start: u16,
5738 #[doc = "< Trigger period. Valid range is [1, 32767]."]
5739 #[doc = "If the device is in slave role and slave latency is enabled,"]
5740 #[doc = "this parameter should be set to a multiple of (slave latency + 1)"]
5741 #[doc = "to ensure low power operation."]
5742 pub period_in_events: u16,
5743}
5744#[test]
5745fn bindgen_test_layout_ble_gap_conn_event_trigger_t() {
5746 assert_eq!(
5747 ::core::mem::size_of::<ble_gap_conn_event_trigger_t>(),
5748 12usize,
5749 concat!("Size of: ", stringify!(ble_gap_conn_event_trigger_t))
5750 );
5751 assert_eq!(
5752 ::core::mem::align_of::<ble_gap_conn_event_trigger_t>(),
5753 4usize,
5754 concat!("Alignment of ", stringify!(ble_gap_conn_event_trigger_t))
5755 );
5756 assert_eq!(
5757 unsafe { &(*(::core::ptr::null::<ble_gap_conn_event_trigger_t>())).ppi_ch_id as *const _ as usize },
5758 0usize,
5759 concat!(
5760 "Offset of field: ",
5761 stringify!(ble_gap_conn_event_trigger_t),
5762 "::",
5763 stringify!(ppi_ch_id)
5764 )
5765 );
5766 assert_eq!(
5767 unsafe { &(*(::core::ptr::null::<ble_gap_conn_event_trigger_t>())).task_endpoint as *const _ as usize },
5768 4usize,
5769 concat!(
5770 "Offset of field: ",
5771 stringify!(ble_gap_conn_event_trigger_t),
5772 "::",
5773 stringify!(task_endpoint)
5774 )
5775 );
5776 assert_eq!(
5777 unsafe {
5778 &(*(::core::ptr::null::<ble_gap_conn_event_trigger_t>())).conn_evt_counter_start as *const _ as usize
5779 },
5780 8usize,
5781 concat!(
5782 "Offset of field: ",
5783 stringify!(ble_gap_conn_event_trigger_t),
5784 "::",
5785 stringify!(conn_evt_counter_start)
5786 )
5787 );
5788 assert_eq!(
5789 unsafe { &(*(::core::ptr::null::<ble_gap_conn_event_trigger_t>())).period_in_events as *const _ as usize },
5790 10usize,
5791 concat!(
5792 "Offset of field: ",
5793 stringify!(ble_gap_conn_event_trigger_t),
5794 "::",
5795 stringify!(period_in_events)
5796 )
5797 );
5798}
5799
5800#[doc = "@brief Set the local Bluetooth identity address."]
5801#[doc = ""]
5802#[doc = " The local Bluetooth identity address is the address that identifies this device to other peers."]
5803#[doc = " The address type must be either @ref BLE_GAP_ADDR_TYPE_PUBLIC or @ref BLE_GAP_ADDR_TYPE_RANDOM_STATIC."]
5804#[doc = ""]
5805#[doc = " @note The identity address cannot be changed while advertising, scanning or creating a connection."]
5806#[doc = ""]
5807#[doc = " @note This address will be distributed to the peer during bonding."]
5808#[doc = " If the address changes, the address stored in the peer device will not be valid and the ability to"]
5809#[doc = " reconnect using the old address will be lost."]
5810#[doc = ""]
5811#[doc = " @note By default the SoftDevice will set an address of type @ref BLE_GAP_ADDR_TYPE_RANDOM_STATIC upon being"]
5812#[doc = " enabled. The address is a random number populated during the IC manufacturing process and remains unchanged"]
5813#[doc = " for the lifetime of each IC."]
5814#[doc = ""]
5815#[doc = " @mscs"]
5816#[doc = " @mmsc{@ref BLE_GAP_ADV_MSC}"]
5817#[doc = " @endmscs"]
5818#[doc = ""]
5819#[doc = " @param[in] p_addr Pointer to address structure."]
5820#[doc = ""]
5821#[doc = " @retval ::NRF_SUCCESS Address successfully set."]
5822#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
5823#[doc = " @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address."]
5824#[doc = " @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry."]
5825#[doc = " @retval ::NRF_ERROR_INVALID_STATE The identity address cannot be changed while advertising,"]
5826#[doc = " scanning or creating a connection."]
5827#[inline(always)]
5828pub unsafe fn sd_ble_gap_addr_set(p_addr: *const ble_gap_addr_t) -> u32 {
5829 let ret: u32;
5830 core::arch::asm!("svc 108",
5831 inout("r0") to_asm(p_addr) => ret,
5832 lateout("r1") _,
5833 lateout("r2") _,
5834 lateout("r3") _,
5835 lateout("r12") _,
5836 );
5837 ret
5838}
5839
5840#[doc = "@brief Get local Bluetooth identity address."]
5841#[doc = ""]
5842#[doc = " @note This will always return the identity address irrespective of the privacy settings,"]
5843#[doc = " i.e. the address type will always be either @ref BLE_GAP_ADDR_TYPE_PUBLIC or @ref BLE_GAP_ADDR_TYPE_RANDOM_STATIC."]
5844#[doc = ""]
5845#[doc = " @param[out] p_addr Pointer to address structure to be filled in."]
5846#[doc = ""]
5847#[doc = " @retval ::NRF_SUCCESS Address successfully retrieved."]
5848#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid or NULL pointer supplied."]
5849#[inline(always)]
5850pub unsafe fn sd_ble_gap_addr_get(p_addr: *mut ble_gap_addr_t) -> u32 {
5851 let ret: u32;
5852 core::arch::asm!("svc 109",
5853 inout("r0") to_asm(p_addr) => ret,
5854 lateout("r1") _,
5855 lateout("r2") _,
5856 lateout("r3") _,
5857 lateout("r12") _,
5858 );
5859 ret
5860}
5861
5862#[doc = "@brief Get the Bluetooth device address used by the advertiser."]
5863#[doc = ""]
5864#[doc = " @note This function will return the local Bluetooth address used in advertising PDUs. When"]
5865#[doc = " using privacy, the SoftDevice will generate a new private address every"]
5866#[doc = " @ref ble_gap_privacy_params_t::private_addr_cycle_s configured using"]
5867#[doc = " @ref sd_ble_gap_privacy_set. Hence depending on when the application calls this API, the"]
5868#[doc = " address returned may not be the latest address that is used in the advertising PDUs."]
5869#[doc = ""]
5870#[doc = " @param[in] adv_handle The advertising handle to get the address from."]
5871#[doc = " @param[out] p_addr Pointer to address structure to be filled in."]
5872#[doc = ""]
5873#[doc = " @retval ::NRF_SUCCESS Address successfully retrieved."]
5874#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid or NULL pointer supplied."]
5875#[doc = " @retval ::BLE_ERROR_INVALID_ADV_HANDLE The provided advertising handle was not found."]
5876#[doc = " @retval ::NRF_ERROR_INVALID_STATE The advertising set is currently not advertising."]
5877#[inline(always)]
5878pub unsafe fn sd_ble_gap_adv_addr_get(adv_handle: u8, p_addr: *mut ble_gap_addr_t) -> u32 {
5879 let ret: u32;
5880 core::arch::asm!("svc 147",
5881 inout("r0") to_asm(adv_handle) => ret,
5882 inout("r1") to_asm(p_addr) => _,
5883 lateout("r2") _,
5884 lateout("r3") _,
5885 lateout("r12") _,
5886 );
5887 ret
5888}
5889
5890#[doc = "@brief Set the active whitelist in the SoftDevice."]
5891#[doc = ""]
5892#[doc = " @note Only one whitelist can be used at a time and the whitelist is shared between the BLE roles."]
5893#[doc = " The whitelist cannot be set if a BLE role is using the whitelist."]
5894#[doc = ""]
5895#[doc = " @note If an address is resolved using the information in the device identity list, then the whitelist"]
5896#[doc = " filter policy applies to the peer identity address and not the resolvable address sent on air."]
5897#[doc = ""]
5898#[doc = " @mscs"]
5899#[doc = " @mmsc{@ref BLE_GAP_WL_SHARE_MSC}"]
5900#[doc = " @mmsc{@ref BLE_GAP_PRIVACY_SCAN_PRIVATE_SCAN_MSC}"]
5901#[doc = " @endmscs"]
5902#[doc = ""]
5903#[doc = " @param[in] pp_wl_addrs Pointer to a whitelist of peer addresses, if NULL the whitelist will be cleared."]
5904#[doc = " @param[in] len Length of the whitelist, maximum @ref BLE_GAP_WHITELIST_ADDR_MAX_COUNT."]
5905#[doc = ""]
5906#[doc = " @retval ::NRF_SUCCESS The whitelist is successfully set/cleared."]
5907#[doc = " @retval ::NRF_ERROR_INVALID_ADDR The whitelist (or one of its entries) provided is invalid."]
5908#[doc = " @retval ::BLE_ERROR_GAP_WHITELIST_IN_USE The whitelist is in use by a BLE role and cannot be set or cleared."]
5909#[doc = " @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address type is supplied."]
5910#[doc = " @retval ::NRF_ERROR_DATA_SIZE The given whitelist size is invalid (zero or too large); this can only return when"]
5911#[doc = " pp_wl_addrs is not NULL."]
5912#[inline(always)]
5913pub unsafe fn sd_ble_gap_whitelist_set(pp_wl_addrs: *const *const ble_gap_addr_t, len: u8) -> u32 {
5914 let ret: u32;
5915 core::arch::asm!("svc 110",
5916 inout("r0") to_asm(pp_wl_addrs) => ret,
5917 inout("r1") to_asm(len) => _,
5918 lateout("r2") _,
5919 lateout("r3") _,
5920 lateout("r12") _,
5921 );
5922 ret
5923}
5924
5925#[doc = "@brief Set device identity list."]
5926#[doc = ""]
5927#[doc = " @note Only one device identity list can be used at a time and the list is shared between the BLE roles."]
5928#[doc = " The device identity list cannot be set if a BLE role is using the list."]
5929#[doc = ""]
5930#[doc = " @param[in] pp_id_keys Pointer to an array of peer identity addresses and peer IRKs, if NULL the device identity list will be cleared."]
5931#[doc = " @param[in] pp_local_irks Pointer to an array of local IRKs. Each entry in the array maps to the entry in pp_id_keys at the same index."]
5932#[doc = " To fill in the list with the currently set device IRK for all peers, set to NULL."]
5933#[doc = " @param[in] len Length of the device identity list, maximum @ref BLE_GAP_DEVICE_IDENTITIES_MAX_COUNT."]
5934#[doc = ""]
5935#[doc = " @mscs"]
5936#[doc = " @mmsc{@ref BLE_GAP_PRIVACY_ADV_MSC}"]
5937#[doc = " @mmsc{@ref BLE_GAP_PRIVACY_SCAN_MSC}"]
5938#[doc = " @mmsc{@ref BLE_GAP_PRIVACY_SCAN_PRIVATE_SCAN_MSC}"]
5939#[doc = " @mmsc{@ref BLE_GAP_PRIVACY_ADV_DIR_PRIV_MSC}"]
5940#[doc = " @mmsc{@ref BLE_GAP_PERIPH_CONN_PRIV_MSC}"]
5941#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_CONN_PRIV_MSC}"]
5942#[doc = " @endmscs"]
5943#[doc = ""]
5944#[doc = " @retval ::NRF_SUCCESS The device identity list successfully set/cleared."]
5945#[doc = " @retval ::NRF_ERROR_INVALID_ADDR The device identity list (or one of its entries) provided is invalid."]
5946#[doc = " This code may be returned if the local IRK list also has an invalid entry."]
5947#[doc = " @retval ::BLE_ERROR_GAP_DEVICE_IDENTITIES_IN_USE The device identity list is in use and cannot be set or cleared."]
5948#[doc = " @retval ::BLE_ERROR_GAP_DEVICE_IDENTITIES_DUPLICATE The device identity list contains multiple entries with the same identity address."]
5949#[doc = " @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address type is supplied."]
5950#[doc = " @retval ::NRF_ERROR_DATA_SIZE The given device identity list size invalid (zero or too large); this can"]
5951#[doc = " only return when pp_id_keys is not NULL."]
5952#[inline(always)]
5953pub unsafe fn sd_ble_gap_device_identities_set(
5954 pp_id_keys: *const *const ble_gap_id_key_t,
5955 pp_local_irks: *const *const ble_gap_irk_t,
5956 len: u8,
5957) -> u32 {
5958 let ret: u32;
5959 core::arch::asm!("svc 111",
5960 inout("r0") to_asm(pp_id_keys) => ret,
5961 inout("r1") to_asm(pp_local_irks) => _,
5962 inout("r2") to_asm(len) => _,
5963 lateout("r3") _,
5964 lateout("r12") _,
5965 );
5966 ret
5967}
5968
5969#[doc = "@brief Set privacy settings."]
5970#[doc = ""]
5971#[doc = " @note Privacy settings cannot be changed while advertising, scanning or creating a connection."]
5972#[doc = ""]
5973#[doc = " @param[in] p_privacy_params Privacy settings."]
5974#[doc = ""]
5975#[doc = " @mscs"]
5976#[doc = " @mmsc{@ref BLE_GAP_PRIVACY_ADV_MSC}"]
5977#[doc = " @mmsc{@ref BLE_GAP_PRIVACY_SCAN_MSC}"]
5978#[doc = " @mmsc{@ref BLE_GAP_PRIVACY_ADV_DIR_PRIV_MSC}"]
5979#[doc = " @endmscs"]
5980#[doc = ""]
5981#[doc = " @retval ::NRF_SUCCESS Set successfully."]
5982#[doc = " @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry."]
5983#[doc = " @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address type is supplied."]
5984#[doc = " @retval ::NRF_ERROR_INVALID_ADDR The pointer to privacy settings is NULL or invalid."]
5985#[doc = " Otherwise, the p_device_irk pointer in privacy parameter is an invalid pointer."]
5986#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Out of range parameters are provided."]
5987#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED The SoftDevice does not support privacy if the Central Address Resolution"]
5988#[doc = "characteristic is not configured to be included and the SoftDevice is configured"]
5989#[doc = "to support central roles."]
5990#[doc = "See @ref ble_gap_cfg_car_incl_cfg_t and @ref ble_gap_cfg_role_count_t."]
5991#[doc = " @retval ::NRF_ERROR_INVALID_STATE Privacy settings cannot be changed while advertising, scanning"]
5992#[doc = " or creating a connection."]
5993#[inline(always)]
5994pub unsafe fn sd_ble_gap_privacy_set(p_privacy_params: *const ble_gap_privacy_params_t) -> u32 {
5995 let ret: u32;
5996 core::arch::asm!("svc 112",
5997 inout("r0") to_asm(p_privacy_params) => ret,
5998 lateout("r1") _,
5999 lateout("r2") _,
6000 lateout("r3") _,
6001 lateout("r12") _,
6002 );
6003 ret
6004}
6005
6006#[doc = "@brief Get privacy settings."]
6007#[doc = ""]
6008#[doc = " @note ::ble_gap_privacy_params_t::p_device_irk must be initialized to NULL or a valid address before this function is called."]
6009#[doc = " If it is initialized to a valid address, the address pointed to will contain the current device IRK on return."]
6010#[doc = ""]
6011#[doc = " @param[in,out] p_privacy_params Privacy settings."]
6012#[doc = ""]
6013#[doc = " @retval ::NRF_SUCCESS Privacy settings read."]
6014#[doc = " @retval ::NRF_ERROR_INVALID_ADDR The pointer given for returning the privacy settings may be NULL or invalid."]
6015#[doc = " Otherwise, the p_device_irk pointer in privacy parameter is an invalid pointer."]
6016#[inline(always)]
6017pub unsafe fn sd_ble_gap_privacy_get(p_privacy_params: *mut ble_gap_privacy_params_t) -> u32 {
6018 let ret: u32;
6019 core::arch::asm!("svc 113",
6020 inout("r0") to_asm(p_privacy_params) => ret,
6021 lateout("r1") _,
6022 lateout("r2") _,
6023 lateout("r3") _,
6024 lateout("r12") _,
6025 );
6026 ret
6027}
6028
6029#[doc = "@brief Configure an advertising set. Set, clear or update advertising and scan response data."]
6030#[doc = ""]
6031#[doc = " @note The format of the advertising data will be checked by this call to ensure interoperability."]
6032#[doc = " Limitations imposed by this API call to the data provided include having a flags data type in the scan response data and"]
6033#[doc = " duplicating the local name in the advertising data and scan response data."]
6034#[doc = ""]
6035#[doc = " @note In order to update advertising data while advertising, new advertising buffers must be provided."]
6036#[doc = ""]
6037#[doc = " @mscs"]
6038#[doc = " @mmsc{@ref BLE_GAP_ADV_MSC}"]
6039#[doc = " @mmsc{@ref BLE_GAP_WL_SHARE_MSC}"]
6040#[doc = " @endmscs"]
6041#[doc = ""]
6042#[doc = " @param[in,out] p_adv_handle Provide a pointer to a handle containing @ref BLE_GAP_ADV_SET_HANDLE_NOT_SET to configure"]
6043#[doc = " a new advertising set. On success, a new handle is then returned through the pointer."]
6044#[doc = " Provide a pointer to an existing advertising handle to configure an existing advertising set."]
6045#[doc = " @param[in] p_adv_data Advertising data. If set to NULL, no advertising data will be used. See @ref ble_gap_adv_data_t."]
6046#[doc = " @param[in] p_adv_params Advertising parameters. When this function is used to update advertising data while advertising,"]
6047#[doc = " this parameter must be NULL. See @ref ble_gap_adv_params_t."]
6048#[doc = ""]
6049#[doc = " @retval ::NRF_SUCCESS Advertising set successfully configured."]
6050#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied:"]
6051#[doc = " - Invalid advertising data configuration specified. See @ref ble_gap_adv_data_t."]
6052#[doc = " - Invalid configuration of p_adv_params. See @ref ble_gap_adv_params_t."]
6053#[doc = " - Use of whitelist requested but whitelist has not been set,"]
6054#[doc = " see @ref sd_ble_gap_whitelist_set."]
6055#[doc = " @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR ble_gap_adv_params_t::p_peer_addr is invalid."]
6056#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either:"]
6057#[doc = " - It is invalid to provide non-NULL advertising set parameters while advertising."]
6058#[doc = " - It is invalid to provide the same data buffers while advertising. To update"]
6059#[doc = " advertising data, provide new advertising buffers."]
6060#[doc = " @retval ::BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST Discoverable mode and whitelist incompatible."]
6061#[doc = " @retval ::BLE_ERROR_INVALID_ADV_HANDLE The provided advertising handle was not found. Use @ref BLE_GAP_ADV_SET_HANDLE_NOT_SET to"]
6062#[doc = " configure a new advertising handle."]
6063#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
6064#[doc = " @retval ::NRF_ERROR_INVALID_FLAGS Invalid combination of advertising flags supplied."]
6065#[doc = " @retval ::NRF_ERROR_INVALID_DATA Invalid data type(s) supplied. Check the advertising data format specification"]
6066#[doc = " given in Bluetooth Specification Version 5.0, Volume 3, Part C, Chapter 11."]
6067#[doc = " @retval ::NRF_ERROR_INVALID_LENGTH Invalid data length(s) supplied."]
6068#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED Unsupported data length or advertising parameter configuration."]
6069#[doc = " @retval ::NRF_ERROR_NO_MEM Not enough memory to configure a new advertising handle. Update an"]
6070#[doc = " existing advertising handle instead."]
6071#[doc = " @retval ::BLE_ERROR_GAP_UUID_LIST_MISMATCH Invalid UUID list supplied."]
6072#[inline(always)]
6073pub unsafe fn sd_ble_gap_adv_set_configure(
6074 p_adv_handle: *mut u8,
6075 p_adv_data: *const ble_gap_adv_data_t,
6076 p_adv_params: *const ble_gap_adv_params_t,
6077) -> u32 {
6078 let ret: u32;
6079 core::arch::asm!("svc 114",
6080 inout("r0") to_asm(p_adv_handle) => ret,
6081 inout("r1") to_asm(p_adv_data) => _,
6082 inout("r2") to_asm(p_adv_params) => _,
6083 lateout("r3") _,
6084 lateout("r12") _,
6085 );
6086 ret
6087}
6088
6089#[doc = "@brief Start advertising (GAP Discoverable, Connectable modes, Broadcast Procedure)."]
6090#[doc = ""]
6091#[doc = " @note Only one advertiser may be active at any time."]
6092#[doc = ""]
6093#[doc = " @events"]
6094#[doc = " @event{@ref BLE_GAP_EVT_CONNECTED, Generated after connection has been established through connectable advertising.}"]
6095#[doc = " @event{@ref BLE_GAP_EVT_ADV_SET_TERMINATED, Advertising set has terminated.}"]
6096#[doc = " @event{@ref BLE_GAP_EVT_SCAN_REQ_REPORT, A scan request was received.}"]
6097#[doc = " @endevents"]
6098#[doc = ""]
6099#[doc = " @mscs"]
6100#[doc = " @mmsc{@ref BLE_GAP_ADV_MSC}"]
6101#[doc = " @mmsc{@ref BLE_GAP_PERIPH_CONN_PRIV_MSC}"]
6102#[doc = " @mmsc{@ref BLE_GAP_PRIVACY_ADV_DIR_PRIV_MSC}"]
6103#[doc = " @mmsc{@ref BLE_GAP_WL_SHARE_MSC}"]
6104#[doc = " @endmscs"]
6105#[doc = ""]
6106#[doc = " @param[in] adv_handle Advertising handle to advertise on, received from @ref sd_ble_gap_adv_set_configure."]
6107#[doc = " @param[in] conn_cfg_tag Tag identifying a configuration set by @ref sd_ble_cfg_set or"]
6108#[doc = " @ref BLE_CONN_CFG_TAG_DEFAULT to use the default connection configuration. For non-connectable"]
6109#[doc = " advertising, this is ignored."]
6110#[doc = ""]
6111#[doc = " @retval ::NRF_SUCCESS The BLE stack has started advertising."]
6112#[doc = " @retval ::NRF_ERROR_INVALID_STATE adv_handle is not configured or already advertising."]
6113#[doc = " @retval ::NRF_ERROR_CONN_COUNT The limit of available connections for this connection configuration"]
6114#[doc = " tag has been reached; connectable advertiser cannot be started."]
6115#[doc = " To increase the number of available connections,"]
6116#[doc = " use @ref sd_ble_cfg_set with @ref BLE_GAP_CFG_ROLE_COUNT or @ref BLE_CONN_CFG_GAP."]
6117#[doc = " @retval ::BLE_ERROR_INVALID_ADV_HANDLE Advertising handle not found. Configure a new adveriting handle with @ref sd_ble_gap_adv_set_configure."]
6118#[doc = " @retval ::NRF_ERROR_NOT_FOUND conn_cfg_tag not found."]
6119#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied:"]
6120#[doc = " - Invalid configuration of p_adv_params. See @ref ble_gap_adv_params_t."]
6121#[doc = " - Use of whitelist requested but whitelist has not been set, see @ref sd_ble_gap_whitelist_set."]
6122#[doc = " @retval ::NRF_ERROR_RESOURCES Either:"]
6123#[doc = " - adv_handle is configured with connectable advertising, but the event_length parameter"]
6124#[doc = " associated with conn_cfg_tag is too small to be able to establish a connection on"]
6125#[doc = " the selected advertising phys. Use @ref sd_ble_cfg_set to increase the event length."]
6126#[doc = " - Not enough BLE role slots available."]
6127#[doc = "Stop one or more currently active roles (Central, Peripheral, Broadcaster or Observer) and try again."]
6128#[doc = " - p_adv_params is configured with connectable advertising, but the event_length parameter"]
6129#[doc = " associated with conn_cfg_tag is too small to be able to establish a connection on"]
6130#[doc = " the selected advertising phys. Use @ref sd_ble_cfg_set to increase the event length."]
6131#[inline(always)]
6132pub unsafe fn sd_ble_gap_adv_start(adv_handle: u8, conn_cfg_tag: u8) -> u32 {
6133 let ret: u32;
6134 core::arch::asm!("svc 115",
6135 inout("r0") to_asm(adv_handle) => ret,
6136 inout("r1") to_asm(conn_cfg_tag) => _,
6137 lateout("r2") _,
6138 lateout("r3") _,
6139 lateout("r12") _,
6140 );
6141 ret
6142}
6143
6144#[doc = "@brief Stop advertising (GAP Discoverable, Connectable modes, Broadcast Procedure)."]
6145#[doc = ""]
6146#[doc = " @mscs"]
6147#[doc = " @mmsc{@ref BLE_GAP_ADV_MSC}"]
6148#[doc = " @mmsc{@ref BLE_GAP_WL_SHARE_MSC}"]
6149#[doc = " @endmscs"]
6150#[doc = ""]
6151#[doc = " @param[in] adv_handle The advertising handle that should stop advertising."]
6152#[doc = ""]
6153#[doc = " @retval ::NRF_SUCCESS The BLE stack has stopped advertising."]
6154#[doc = " @retval ::BLE_ERROR_INVALID_ADV_HANDLE Invalid advertising handle."]
6155#[doc = " @retval ::NRF_ERROR_INVALID_STATE The advertising handle is not advertising."]
6156#[inline(always)]
6157pub unsafe fn sd_ble_gap_adv_stop(adv_handle: u8) -> u32 {
6158 let ret: u32;
6159 core::arch::asm!("svc 116",
6160 inout("r0") to_asm(adv_handle) => ret,
6161 lateout("r1") _,
6162 lateout("r2") _,
6163 lateout("r3") _,
6164 lateout("r12") _,
6165 );
6166 ret
6167}
6168
6169#[doc = "@brief Update connection parameters."]
6170#[doc = ""]
6171#[doc = " @details In the central role this will initiate a Link Layer connection parameter update procedure,"]
6172#[doc = " otherwise in the peripheral role, this will send the corresponding L2CAP request and wait for"]
6173#[doc = " the central to perform the procedure. In both cases, and regardless of success or failure, the application"]
6174#[doc = " will be informed of the result with a @ref BLE_GAP_EVT_CONN_PARAM_UPDATE event."]
6175#[doc = ""]
6176#[doc = " @details This function can be used as a central both to reply to a @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST or to start the procedure unrequested."]
6177#[doc = ""]
6178#[doc = " @events"]
6179#[doc = " @event{@ref BLE_GAP_EVT_CONN_PARAM_UPDATE, Result of the connection parameter update procedure.}"]
6180#[doc = " @endevents"]
6181#[doc = ""]
6182#[doc = " @mscs"]
6183#[doc = " @mmsc{@ref BLE_GAP_CPU_MSC}"]
6184#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_ENC_AUTH_MUTEX_MSC}"]
6185#[doc = " @mmsc{@ref BLE_GAP_MULTILINK_CPU_MSC}"]
6186#[doc = " @mmsc{@ref BLE_GAP_MULTILINK_CTRL_PROC_MSC}"]
6187#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_CPU_MSC}"]
6188#[doc = " @endmscs"]
6189#[doc = ""]
6190#[doc = " @param[in] conn_handle Connection handle."]
6191#[doc = " @param[in] p_conn_params Pointer to desired connection parameters. If NULL is provided on a peripheral role,"]
6192#[doc = " the parameters in the PPCP characteristic of the GAP service will be used instead."]
6193#[doc = " If NULL is provided on a central role and in response to a @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST, the peripheral request will be rejected"]
6194#[doc = ""]
6195#[doc = " @retval ::NRF_SUCCESS The Connection Update procedure has been started successfully."]
6196#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
6197#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check parameter limits and constraints."]
6198#[doc = " @retval ::NRF_ERROR_INVALID_STATE Disconnection in progress or link has not been established."]
6199#[doc = " @retval ::NRF_ERROR_BUSY Procedure already in progress, wait for pending procedures to complete and retry."]
6200#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
6201#[doc = " @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation."]
6202#[inline(always)]
6203pub unsafe fn sd_ble_gap_conn_param_update(conn_handle: u16, p_conn_params: *const ble_gap_conn_params_t) -> u32 {
6204 let ret: u32;
6205 core::arch::asm!("svc 117",
6206 inout("r0") to_asm(conn_handle) => ret,
6207 inout("r1") to_asm(p_conn_params) => _,
6208 lateout("r2") _,
6209 lateout("r3") _,
6210 lateout("r12") _,
6211 );
6212 ret
6213}
6214
6215#[doc = "@brief Disconnect (GAP Link Termination)."]
6216#[doc = ""]
6217#[doc = " @details This call initiates the disconnection procedure, and its completion will be communicated to the application"]
6218#[doc = " with a @ref BLE_GAP_EVT_DISCONNECTED event."]
6219#[doc = ""]
6220#[doc = " @events"]
6221#[doc = " @event{@ref BLE_GAP_EVT_DISCONNECTED, Generated when disconnection procedure is complete.}"]
6222#[doc = " @endevents"]
6223#[doc = ""]
6224#[doc = " @mscs"]
6225#[doc = " @mmsc{@ref BLE_GAP_CONN_MSC}"]
6226#[doc = " @endmscs"]
6227#[doc = ""]
6228#[doc = " @param[in] conn_handle Connection handle."]
6229#[doc = " @param[in] hci_status_code HCI status code, see @ref BLE_HCI_STATUS_CODES (accepted values are @ref BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION and @ref BLE_HCI_CONN_INTERVAL_UNACCEPTABLE)."]
6230#[doc = ""]
6231#[doc = " @retval ::NRF_SUCCESS The disconnection procedure has been started successfully."]
6232#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
6233#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
6234#[doc = " @retval ::NRF_ERROR_INVALID_STATE Disconnection in progress or link has not been established."]
6235#[inline(always)]
6236pub unsafe fn sd_ble_gap_disconnect(conn_handle: u16, hci_status_code: u8) -> u32 {
6237 let ret: u32;
6238 core::arch::asm!("svc 118",
6239 inout("r0") to_asm(conn_handle) => ret,
6240 inout("r1") to_asm(hci_status_code) => _,
6241 lateout("r2") _,
6242 lateout("r3") _,
6243 lateout("r12") _,
6244 );
6245 ret
6246}
6247
6248#[doc = "@brief Set the radio's transmit power."]
6249#[doc = ""]
6250#[doc = " @param[in] role The role to set the transmit power for, see @ref BLE_GAP_TX_POWER_ROLES for"]
6251#[doc = " possible roles."]
6252#[doc = " @param[in] handle The handle parameter is interpreted depending on role:"]
6253#[doc = " - If role is @ref BLE_GAP_TX_POWER_ROLE_CONN, this value is the specific connection handle."]
6254#[doc = " - If role is @ref BLE_GAP_TX_POWER_ROLE_ADV, the advertising set identified with the advertising handle,"]
6255#[doc = " will use the specified transmit power, and include it in the advertising packet headers if"]
6256#[doc = " @ref ble_gap_adv_properties_t::include_tx_power set."]
6257#[doc = " - For all other roles handle is ignored."]
6258#[doc = " @param[in] tx_power Radio transmit power in dBm (see note for accepted values)."]
6259#[doc = ""]
6260#[doc = " @note Supported tx_power values: -40dBm, -20dBm, -16dBm, -12dBm, -8dBm, -4dBm, 0dBm, +2dBm, +3dBm, +4dBm, +5dBm, +6dBm, +7dBm and +8dBm."]
6261#[doc = " @note The initiator will have the same transmit power as the scanner."]
6262#[doc = " @note When a connection is created it will inherit the transmit power from the initiator or"]
6263#[doc = " advertiser leading to the connection."]
6264#[doc = ""]
6265#[doc = " @retval ::NRF_SUCCESS Successfully changed the transmit power."]
6266#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
6267#[doc = " @retval ::BLE_ERROR_INVALID_ADV_HANDLE Advertising handle not found."]
6268#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
6269#[inline(always)]
6270pub unsafe fn sd_ble_gap_tx_power_set(role: u8, handle: u16, tx_power: i8) -> u32 {
6271 let ret: u32;
6272 core::arch::asm!("svc 119",
6273 inout("r0") to_asm(role) => ret,
6274 inout("r1") to_asm(handle) => _,
6275 inout("r2") to_asm(tx_power) => _,
6276 lateout("r3") _,
6277 lateout("r12") _,
6278 );
6279 ret
6280}
6281
6282#[doc = "@brief Set GAP Appearance value."]
6283#[doc = ""]
6284#[doc = " @param[in] appearance Appearance (16-bit), see @ref BLE_APPEARANCES."]
6285#[doc = ""]
6286#[doc = " @retval ::NRF_SUCCESS Appearance value set successfully."]
6287#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
6288#[inline(always)]
6289pub unsafe fn sd_ble_gap_appearance_set(appearance: u16) -> u32 {
6290 let ret: u32;
6291 core::arch::asm!("svc 120",
6292 inout("r0") to_asm(appearance) => ret,
6293 lateout("r1") _,
6294 lateout("r2") _,
6295 lateout("r3") _,
6296 lateout("r12") _,
6297 );
6298 ret
6299}
6300
6301#[doc = "@brief Get GAP Appearance value."]
6302#[doc = ""]
6303#[doc = " @param[out] p_appearance Pointer to appearance (16-bit) to be filled in, see @ref BLE_APPEARANCES."]
6304#[doc = ""]
6305#[doc = " @retval ::NRF_SUCCESS Appearance value retrieved successfully."]
6306#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
6307#[inline(always)]
6308pub unsafe fn sd_ble_gap_appearance_get(p_appearance: *mut u16) -> u32 {
6309 let ret: u32;
6310 core::arch::asm!("svc 121",
6311 inout("r0") to_asm(p_appearance) => ret,
6312 lateout("r1") _,
6313 lateout("r2") _,
6314 lateout("r3") _,
6315 lateout("r12") _,
6316 );
6317 ret
6318}
6319
6320#[doc = "@brief Set GAP Peripheral Preferred Connection Parameters."]
6321#[doc = ""]
6322#[doc = " @param[in] p_conn_params Pointer to a @ref ble_gap_conn_params_t structure with the desired parameters."]
6323#[doc = ""]
6324#[doc = " @retval ::NRF_SUCCESS Peripheral Preferred Connection Parameters set successfully."]
6325#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
6326#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
6327#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED The characteristic is not included in the Attribute Table,"]
6328#[doc = "see @ref ble_gap_cfg_ppcp_incl_cfg_t."]
6329#[inline(always)]
6330pub unsafe fn sd_ble_gap_ppcp_set(p_conn_params: *const ble_gap_conn_params_t) -> u32 {
6331 let ret: u32;
6332 core::arch::asm!("svc 122",
6333 inout("r0") to_asm(p_conn_params) => ret,
6334 lateout("r1") _,
6335 lateout("r2") _,
6336 lateout("r3") _,
6337 lateout("r12") _,
6338 );
6339 ret
6340}
6341
6342#[doc = "@brief Get GAP Peripheral Preferred Connection Parameters."]
6343#[doc = ""]
6344#[doc = " @param[out] p_conn_params Pointer to a @ref ble_gap_conn_params_t structure where the parameters will be stored."]
6345#[doc = ""]
6346#[doc = " @retval ::NRF_SUCCESS Peripheral Preferred Connection Parameters retrieved successfully."]
6347#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
6348#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED The characteristic is not included in the Attribute Table,"]
6349#[doc = "see @ref ble_gap_cfg_ppcp_incl_cfg_t."]
6350#[inline(always)]
6351pub unsafe fn sd_ble_gap_ppcp_get(p_conn_params: *mut ble_gap_conn_params_t) -> u32 {
6352 let ret: u32;
6353 core::arch::asm!("svc 123",
6354 inout("r0") to_asm(p_conn_params) => ret,
6355 lateout("r1") _,
6356 lateout("r2") _,
6357 lateout("r3") _,
6358 lateout("r12") _,
6359 );
6360 ret
6361}
6362
6363#[doc = "@brief Set GAP device name."]
6364#[doc = ""]
6365#[doc = " @note If the device name is located in application flash memory (see @ref ble_gap_cfg_device_name_t),"]
6366#[doc = " it cannot be changed. Then @ref NRF_ERROR_FORBIDDEN will be returned."]
6367#[doc = ""]
6368#[doc = " @param[in] p_write_perm Write permissions for the Device Name characteristic, see @ref ble_gap_conn_sec_mode_t."]
6369#[doc = " @param[in] p_dev_name Pointer to a UTF-8 encoded, <b>non NULL-terminated</b> string."]
6370#[doc = " @param[in] len Length of the UTF-8, <b>non NULL-terminated</b> string pointed to by p_dev_name in octets (must be smaller or equal than @ref BLE_GAP_DEVNAME_MAX_LEN)."]
6371#[doc = ""]
6372#[doc = " @retval ::NRF_SUCCESS GAP device name and permissions set successfully."]
6373#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
6374#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
6375#[doc = " @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied."]
6376#[doc = " @retval ::NRF_ERROR_FORBIDDEN Device name is not writable."]
6377#[inline(always)]
6378pub unsafe fn sd_ble_gap_device_name_set(
6379 p_write_perm: *const ble_gap_conn_sec_mode_t,
6380 p_dev_name: *const u8,
6381 len: u16,
6382) -> u32 {
6383 let ret: u32;
6384 core::arch::asm!("svc 124",
6385 inout("r0") to_asm(p_write_perm) => ret,
6386 inout("r1") to_asm(p_dev_name) => _,
6387 inout("r2") to_asm(len) => _,
6388 lateout("r3") _,
6389 lateout("r12") _,
6390 );
6391 ret
6392}
6393
6394#[doc = "@brief Get GAP device name."]
6395#[doc = ""]
6396#[doc = " @note If the device name is longer than the size of the supplied buffer,"]
6397#[doc = " p_len will return the complete device name length,"]
6398#[doc = " and not the number of bytes actually returned in p_dev_name."]
6399#[doc = " The application may use this information to allocate a suitable buffer size."]
6400#[doc = ""]
6401#[doc = " @param[out] p_dev_name Pointer to an empty buffer where the UTF-8 <b>non NULL-terminated</b> string will be placed. Set to NULL to obtain the complete device name length."]
6402#[doc = " @param[in,out] p_len Length of the buffer pointed by p_dev_name, complete device name length on output."]
6403#[doc = ""]
6404#[doc = " @retval ::NRF_SUCCESS GAP device name retrieved successfully."]
6405#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
6406#[doc = " @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied."]
6407#[inline(always)]
6408pub unsafe fn sd_ble_gap_device_name_get(p_dev_name: *mut u8, p_len: *mut u16) -> u32 {
6409 let ret: u32;
6410 core::arch::asm!("svc 125",
6411 inout("r0") to_asm(p_dev_name) => ret,
6412 inout("r1") to_asm(p_len) => _,
6413 lateout("r2") _,
6414 lateout("r3") _,
6415 lateout("r12") _,
6416 );
6417 ret
6418}
6419
6420#[doc = "@brief Initiate the GAP Authentication procedure."]
6421#[doc = ""]
6422#[doc = " @details In the central role, this function will send an SMP Pairing Request (or an SMP Pairing Failed if rejected),"]
6423#[doc = " otherwise in the peripheral role, an SMP Security Request will be sent."]
6424#[doc = ""]
6425#[doc = " @events"]
6426#[doc = " @event{Depending on the security parameters set and the packet exchanges with the peer\\, the following events may be generated:}"]
6427#[doc = " @event{@ref BLE_GAP_EVT_SEC_PARAMS_REQUEST}"]
6428#[doc = " @event{@ref BLE_GAP_EVT_SEC_INFO_REQUEST}"]
6429#[doc = " @event{@ref BLE_GAP_EVT_PASSKEY_DISPLAY}"]
6430#[doc = " @event{@ref BLE_GAP_EVT_KEY_PRESSED}"]
6431#[doc = " @event{@ref BLE_GAP_EVT_AUTH_KEY_REQUEST}"]
6432#[doc = " @event{@ref BLE_GAP_EVT_LESC_DHKEY_REQUEST}"]
6433#[doc = " @event{@ref BLE_GAP_EVT_CONN_SEC_UPDATE}"]
6434#[doc = " @event{@ref BLE_GAP_EVT_AUTH_STATUS}"]
6435#[doc = " @event{@ref BLE_GAP_EVT_TIMEOUT}"]
6436#[doc = " @endevents"]
6437#[doc = ""]
6438#[doc = " @mscs"]
6439#[doc = " @mmsc{@ref BLE_GAP_PERIPH_SEC_REQ_MSC}"]
6440#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_SEC_REQ_MSC}"]
6441#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_ENC_AUTH_MUTEX_MSC}"]
6442#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_PAIRING_JW_MSC}"]
6443#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_BONDING_JW_MSC}"]
6444#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_MSC}"]
6445#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_OOB_MSC}"]
6446#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_PAIRING_JW_MSC}"]
6447#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC}"]
6448#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_PD_MSC}"]
6449#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC}"]
6450#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC}"]
6451#[doc = " @endmscs"]
6452#[doc = ""]
6453#[doc = " @param[in] conn_handle Connection handle."]
6454#[doc = " @param[in] p_sec_params Pointer to the @ref ble_gap_sec_params_t structure with the security parameters to be used during the pairing or bonding procedure."]
6455#[doc = " In the peripheral role, only the bond, mitm, lesc and keypress fields of this structure are used."]
6456#[doc = " In the central role, this pointer may be NULL to reject a Security Request."]
6457#[doc = ""]
6458#[doc = " @retval ::NRF_SUCCESS Successfully initiated authentication procedure."]
6459#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
6460#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
6461#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either:"]
6462#[doc = " - No link has been established."]
6463#[doc = " - An encryption is already executing or queued."]
6464#[doc = " @retval ::NRF_ERROR_NO_MEM The maximum number of authentication procedures that can run in parallel for the given role is reached."]
6465#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
6466#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED Setting of sign or link fields in @ref ble_gap_sec_kdist_t not supported."]
6467#[doc = " Distribution of own Identity Information is only supported if the Central"]
6468#[doc = " Address Resolution characteristic is configured to be included or"]
6469#[doc = " the Softdevice is configured to support peripheral roles only."]
6470#[doc = " See @ref ble_gap_cfg_car_incl_cfg_t and @ref ble_gap_cfg_role_count_t."]
6471#[doc = " @retval ::NRF_ERROR_TIMEOUT A SMP timeout has occurred, and further SMP operations on this link is prohibited."]
6472#[inline(always)]
6473pub unsafe fn sd_ble_gap_authenticate(conn_handle: u16, p_sec_params: *const ble_gap_sec_params_t) -> u32 {
6474 let ret: u32;
6475 core::arch::asm!("svc 126",
6476 inout("r0") to_asm(conn_handle) => ret,
6477 inout("r1") to_asm(p_sec_params) => _,
6478 lateout("r2") _,
6479 lateout("r3") _,
6480 lateout("r12") _,
6481 );
6482 ret
6483}
6484
6485#[doc = "@brief Reply with GAP security parameters."]
6486#[doc = ""]
6487#[doc = " @details This function is only used to reply to a @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST, calling it at other times will result in an @ref NRF_ERROR_INVALID_STATE."]
6488#[doc = " @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters."]
6489#[doc = ""]
6490#[doc = " @events"]
6491#[doc = " @event{This function is used during authentication procedures, see the list of events in the documentation of @ref sd_ble_gap_authenticate.}"]
6492#[doc = " @endevents"]
6493#[doc = ""]
6494#[doc = " @mscs"]
6495#[doc = " @mmsc{@ref BLE_GAP_PERIPH_PAIRING_JW_MSC}"]
6496#[doc = " @mmsc{@ref BLE_GAP_PERIPH_BONDING_JW_MSC}"]
6497#[doc = " @mmsc{@ref BLE_GAP_PERIPH_BONDING_PK_PERIPH_MSC}"]
6498#[doc = " @mmsc{@ref BLE_GAP_PERIPH_BONDING_PK_CENTRAL_OOB_MSC}"]
6499#[doc = " @mmsc{@ref BLE_GAP_PERIPH_BONDING_STATIC_PK_MSC}"]
6500#[doc = " @mmsc{@ref BLE_GAP_PERIPH_PAIRING_CONFIRM_FAIL_MSC}"]
6501#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_PAIRING_JW_MSC}"]
6502#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_NC_MSC}"]
6503#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_PD_MSC}"]
6504#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC}"]
6505#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC}"]
6506#[doc = " @mmsc{@ref BLE_GAP_PERIPH_PAIRING_KS_TOO_SMALL_MSC}"]
6507#[doc = " @mmsc{@ref BLE_GAP_PERIPH_PAIRING_APP_ERROR_MSC}"]
6508#[doc = " @mmsc{@ref BLE_GAP_PERIPH_PAIRING_REMOTE_PAIRING_FAIL_MSC}"]
6509#[doc = " @mmsc{@ref BLE_GAP_PERIPH_PAIRING_TIMEOUT_MSC}"]
6510#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_PAIRING_JW_MSC}"]
6511#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_BONDING_JW_MSC}"]
6512#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_MSC}"]
6513#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_OOB_MSC}"]
6514#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_PAIRING_JW_MSC}"]
6515#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC}"]
6516#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_PD_MSC}"]
6517#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC}"]
6518#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC}"]
6519#[doc = " @endmscs"]
6520#[doc = ""]
6521#[doc = " @param[in] conn_handle Connection handle."]
6522#[doc = " @param[in] sec_status Security status, see @ref BLE_GAP_SEC_STATUS."]
6523#[doc = " @param[in] p_sec_params Pointer to a @ref ble_gap_sec_params_t security parameters structure. In the central role this must be set to NULL, as the parameters have"]
6524#[doc = " already been provided during a previous call to @ref sd_ble_gap_authenticate."]
6525#[doc = " @param[in,out] p_sec_keyset Pointer to a @ref ble_gap_sec_keyset_t security keyset structure. Any keys generated and/or distributed as a result of the ongoing security procedure"]
6526#[doc = " will be stored into the memory referenced by the pointers inside this structure. The keys will be stored and available to the application"]
6527#[doc = " upon reception of a @ref BLE_GAP_EVT_AUTH_STATUS event."]
6528#[doc = " Note that the SoftDevice expects the application to provide memory for storing the"]
6529#[doc = " peer's keys. So it must be ensured that the relevant pointers inside this structure are not NULL. The pointers to the local key"]
6530#[doc = " can, however, be NULL, in which case, the local key data will not be available to the application upon reception of the"]
6531#[doc = " @ref BLE_GAP_EVT_AUTH_STATUS event."]
6532#[doc = ""]
6533#[doc = " @retval ::NRF_SUCCESS Successfully accepted security parameter from the application."]
6534#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
6535#[doc = " @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry."]
6536#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
6537#[doc = " @retval ::NRF_ERROR_INVALID_STATE Security parameters has not been requested."]
6538#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
6539#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED Setting of sign or link fields in @ref ble_gap_sec_kdist_t not supported."]
6540#[doc = " Distribution of own Identity Information is only supported if the Central"]
6541#[doc = " Address Resolution characteristic is configured to be included or"]
6542#[doc = " the Softdevice is configured to support peripheral roles only."]
6543#[doc = " See @ref ble_gap_cfg_car_incl_cfg_t and @ref ble_gap_cfg_role_count_t."]
6544#[inline(always)]
6545pub unsafe fn sd_ble_gap_sec_params_reply(
6546 conn_handle: u16,
6547 sec_status: u8,
6548 p_sec_params: *const ble_gap_sec_params_t,
6549 p_sec_keyset: *const ble_gap_sec_keyset_t,
6550) -> u32 {
6551 let ret: u32;
6552 core::arch::asm!("svc 127",
6553 inout("r0") to_asm(conn_handle) => ret,
6554 inout("r1") to_asm(sec_status) => _,
6555 inout("r2") to_asm(p_sec_params) => _,
6556 inout("r3") to_asm(p_sec_keyset) => _,
6557 lateout("r12") _,
6558 );
6559 ret
6560}
6561
6562#[doc = "@brief Reply with an authentication key."]
6563#[doc = ""]
6564#[doc = " @details This function is only used to reply to a @ref BLE_GAP_EVT_AUTH_KEY_REQUEST or a @ref BLE_GAP_EVT_PASSKEY_DISPLAY, calling it at other times will result in an @ref NRF_ERROR_INVALID_STATE."]
6565#[doc = " @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters."]
6566#[doc = ""]
6567#[doc = " @events"]
6568#[doc = " @event{This function is used during authentication procedures\\, see the list of events in the documentation of @ref sd_ble_gap_authenticate.}"]
6569#[doc = " @endevents"]
6570#[doc = ""]
6571#[doc = " @mscs"]
6572#[doc = " @mmsc{@ref BLE_GAP_PERIPH_BONDING_PK_CENTRAL_OOB_MSC}"]
6573#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_NC_MSC}"]
6574#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC}"]
6575#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_OOB_MSC}"]
6576#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC}"]
6577#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC}"]
6578#[doc = " @endmscs"]
6579#[doc = ""]
6580#[doc = " @param[in] conn_handle Connection handle."]
6581#[doc = " @param[in] key_type See @ref BLE_GAP_AUTH_KEY_TYPES."]
6582#[doc = " @param[in] p_key If key type is @ref BLE_GAP_AUTH_KEY_TYPE_NONE, then NULL."]
6583#[doc = " If key type is @ref BLE_GAP_AUTH_KEY_TYPE_PASSKEY, then a 6-byte ASCII string (digit 0..9 only, no NULL termination)"]
6584#[doc = " or NULL when confirming LE Secure Connections Numeric Comparison."]
6585#[doc = " If key type is @ref BLE_GAP_AUTH_KEY_TYPE_OOB, then a 16-byte OOB key value in little-endian format."]
6586#[doc = ""]
6587#[doc = " @retval ::NRF_SUCCESS Authentication key successfully set."]
6588#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
6589#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
6590#[doc = " @retval ::NRF_ERROR_INVALID_STATE Authentication key has not been requested."]
6591#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
6592#[inline(always)]
6593pub unsafe fn sd_ble_gap_auth_key_reply(conn_handle: u16, key_type: u8, p_key: *const u8) -> u32 {
6594 let ret: u32;
6595 core::arch::asm!("svc 128",
6596 inout("r0") to_asm(conn_handle) => ret,
6597 inout("r1") to_asm(key_type) => _,
6598 inout("r2") to_asm(p_key) => _,
6599 lateout("r3") _,
6600 lateout("r12") _,
6601 );
6602 ret
6603}
6604
6605#[doc = "@brief Reply with an LE Secure connections DHKey."]
6606#[doc = ""]
6607#[doc = " @details This function is only used to reply to a @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST, calling it at other times will result in an @ref NRF_ERROR_INVALID_STATE."]
6608#[doc = " @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters."]
6609#[doc = ""]
6610#[doc = " @events"]
6611#[doc = " @event{This function is used during authentication procedures\\, see the list of events in the documentation of @ref sd_ble_gap_authenticate.}"]
6612#[doc = " @endevents"]
6613#[doc = ""]
6614#[doc = " @mscs"]
6615#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_PAIRING_JW_MSC}"]
6616#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_NC_MSC}"]
6617#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_PD_MSC}"]
6618#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC}"]
6619#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC}"]
6620#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_PAIRING_JW_MSC}"]
6621#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC}"]
6622#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_PD_MSC}"]
6623#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC}"]
6624#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC}"]
6625#[doc = " @endmscs"]
6626#[doc = ""]
6627#[doc = " @param[in] conn_handle Connection handle."]
6628#[doc = " @param[in] p_dhkey LE Secure Connections DHKey."]
6629#[doc = ""]
6630#[doc = " @retval ::NRF_SUCCESS DHKey successfully set."]
6631#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
6632#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
6633#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either:"]
6634#[doc = " - The peer is not authenticated."]
6635#[doc = " - The application has not pulled a @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST event."]
6636#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
6637#[inline(always)]
6638pub unsafe fn sd_ble_gap_lesc_dhkey_reply(conn_handle: u16, p_dhkey: *const ble_gap_lesc_dhkey_t) -> u32 {
6639 let ret: u32;
6640 core::arch::asm!("svc 129",
6641 inout("r0") to_asm(conn_handle) => ret,
6642 inout("r1") to_asm(p_dhkey) => _,
6643 lateout("r2") _,
6644 lateout("r3") _,
6645 lateout("r12") _,
6646 );
6647 ret
6648}
6649
6650#[doc = "@brief Notify the peer of a local keypress."]
6651#[doc = ""]
6652#[doc = " @mscs"]
6653#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC}"]
6654#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC}"]
6655#[doc = " @endmscs"]
6656#[doc = ""]
6657#[doc = " @param[in] conn_handle Connection handle."]
6658#[doc = " @param[in] kp_not See @ref BLE_GAP_KP_NOT_TYPES."]
6659#[doc = ""]
6660#[doc = " @retval ::NRF_SUCCESS Keypress notification successfully queued for transmission."]
6661#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
6662#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either:"]
6663#[doc = " - Authentication key not requested."]
6664#[doc = " - Passkey has not been entered."]
6665#[doc = " - Keypresses have not been enabled by both peers."]
6666#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
6667#[doc = " @retval ::NRF_ERROR_BUSY The BLE stack is busy. Retry at later time."]
6668#[inline(always)]
6669pub unsafe fn sd_ble_gap_keypress_notify(conn_handle: u16, kp_not: u8) -> u32 {
6670 let ret: u32;
6671 core::arch::asm!("svc 130",
6672 inout("r0") to_asm(conn_handle) => ret,
6673 inout("r1") to_asm(kp_not) => _,
6674 lateout("r2") _,
6675 lateout("r3") _,
6676 lateout("r12") _,
6677 );
6678 ret
6679}
6680
6681#[doc = "@brief Generate a set of OOB data to send to a peer out of band."]
6682#[doc = ""]
6683#[doc = " @note The @ref ble_gap_addr_t included in the OOB data returned will be the currently active one (or, if a connection has already been established,"]
6684#[doc = " the one used during connection setup). The application may manually overwrite it with an updated value."]
6685#[doc = ""]
6686#[doc = " @mscs"]
6687#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC}"]
6688#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC}"]
6689#[doc = " @endmscs"]
6690#[doc = ""]
6691#[doc = " @param[in] conn_handle Connection handle. Can be @ref BLE_CONN_HANDLE_INVALID if a BLE connection has not been established yet."]
6692#[doc = " @param[in] p_pk_own LE Secure Connections local P-256 Public Key."]
6693#[doc = " @param[out] p_oobd_own The OOB data to be sent out of band to a peer."]
6694#[doc = ""]
6695#[doc = " @retval ::NRF_SUCCESS OOB data successfully generated."]
6696#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
6697#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
6698#[inline(always)]
6699pub unsafe fn sd_ble_gap_lesc_oob_data_get(
6700 conn_handle: u16,
6701 p_pk_own: *const ble_gap_lesc_p256_pk_t,
6702 p_oobd_own: *mut ble_gap_lesc_oob_data_t,
6703) -> u32 {
6704 let ret: u32;
6705 core::arch::asm!("svc 131",
6706 inout("r0") to_asm(conn_handle) => ret,
6707 inout("r1") to_asm(p_pk_own) => _,
6708 inout("r2") to_asm(p_oobd_own) => _,
6709 lateout("r3") _,
6710 lateout("r12") _,
6711 );
6712 ret
6713}
6714
6715#[doc = "@brief Provide the OOB data sent/received out of band."]
6716#[doc = ""]
6717#[doc = " @note An authentication procedure with OOB selected as an algorithm must be in progress when calling this function."]
6718#[doc = " @note A @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST event with the oobd_req set to 1 must have been received prior to calling this function."]
6719#[doc = ""]
6720#[doc = " @events"]
6721#[doc = " @event{This function is used during authentication procedures\\, see the list of events in the documentation of @ref sd_ble_gap_authenticate.}"]
6722#[doc = " @endevents"]
6723#[doc = ""]
6724#[doc = " @mscs"]
6725#[doc = " @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC}"]
6726#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC}"]
6727#[doc = " @endmscs"]
6728#[doc = ""]
6729#[doc = " @param[in] conn_handle Connection handle."]
6730#[doc = " @param[in] p_oobd_own The OOB data sent out of band to a peer or NULL if the peer has not received OOB data."]
6731#[doc = " Must correspond to @ref ble_gap_sec_params_t::oob flag in @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST."]
6732#[doc = " @param[in] p_oobd_peer The OOB data received out of band from a peer or NULL if none received."]
6733#[doc = " Must correspond to @ref ble_gap_sec_params_t::oob flag"]
6734#[doc = " in @ref sd_ble_gap_authenticate in the central role or"]
6735#[doc = " in @ref sd_ble_gap_sec_params_reply in the peripheral role."]
6736#[doc = ""]
6737#[doc = " @retval ::NRF_SUCCESS OOB data accepted."]
6738#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
6739#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either:"]
6740#[doc = " - Authentication key not requested"]
6741#[doc = " - Not expecting LESC OOB data"]
6742#[doc = " - Have not actually exchanged passkeys."]
6743#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
6744#[inline(always)]
6745pub unsafe fn sd_ble_gap_lesc_oob_data_set(
6746 conn_handle: u16,
6747 p_oobd_own: *const ble_gap_lesc_oob_data_t,
6748 p_oobd_peer: *const ble_gap_lesc_oob_data_t,
6749) -> u32 {
6750 let ret: u32;
6751 core::arch::asm!("svc 132",
6752 inout("r0") to_asm(conn_handle) => ret,
6753 inout("r1") to_asm(p_oobd_own) => _,
6754 inout("r2") to_asm(p_oobd_peer) => _,
6755 lateout("r3") _,
6756 lateout("r12") _,
6757 );
6758 ret
6759}
6760
6761#[doc = "@brief Initiate GAP Encryption procedure."]
6762#[doc = ""]
6763#[doc = " @details In the central role, this function will initiate the encryption procedure using the encryption information provided."]
6764#[doc = ""]
6765#[doc = " @events"]
6766#[doc = " @event{@ref BLE_GAP_EVT_CONN_SEC_UPDATE, The connection security has been updated.}"]
6767#[doc = " @endevents"]
6768#[doc = ""]
6769#[doc = " @mscs"]
6770#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_ENC_AUTH_MUTEX_MSC}"]
6771#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_ENC_MSC}"]
6772#[doc = " @mmsc{@ref BLE_GAP_MULTILINK_CTRL_PROC_MSC}"]
6773#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_SEC_REQ_MSC}"]
6774#[doc = " @endmscs"]
6775#[doc = ""]
6776#[doc = " @param[in] conn_handle Connection handle."]
6777#[doc = " @param[in] p_master_id Pointer to a @ref ble_gap_master_id_t master identification structure."]
6778#[doc = " @param[in] p_enc_info Pointer to a @ref ble_gap_enc_info_t encryption information structure."]
6779#[doc = ""]
6780#[doc = " @retval ::NRF_SUCCESS Successfully initiated authentication procedure."]
6781#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
6782#[doc = " @retval ::NRF_ERROR_INVALID_STATE No link has been established."]
6783#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
6784#[doc = " @retval ::BLE_ERROR_INVALID_ROLE Operation is not supported in the Peripheral role."]
6785#[doc = " @retval ::NRF_ERROR_BUSY Procedure already in progress or not allowed at this time, wait for pending procedures to complete and retry."]
6786#[inline(always)]
6787pub unsafe fn sd_ble_gap_encrypt(
6788 conn_handle: u16,
6789 p_master_id: *const ble_gap_master_id_t,
6790 p_enc_info: *const ble_gap_enc_info_t,
6791) -> u32 {
6792 let ret: u32;
6793 core::arch::asm!("svc 133",
6794 inout("r0") to_asm(conn_handle) => ret,
6795 inout("r1") to_asm(p_master_id) => _,
6796 inout("r2") to_asm(p_enc_info) => _,
6797 lateout("r3") _,
6798 lateout("r12") _,
6799 );
6800 ret
6801}
6802
6803#[doc = "@brief Reply with GAP security information."]
6804#[doc = ""]
6805#[doc = " @details This function is only used to reply to a @ref BLE_GAP_EVT_SEC_INFO_REQUEST, calling it at other times will result in @ref NRF_ERROR_INVALID_STATE."]
6806#[doc = " @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters."]
6807#[doc = " @note Data signing is not yet supported, and p_sign_info must therefore be NULL."]
6808#[doc = ""]
6809#[doc = " @mscs"]
6810#[doc = " @mmsc{@ref BLE_GAP_PERIPH_ENC_MSC}"]
6811#[doc = " @endmscs"]
6812#[doc = ""]
6813#[doc = " @param[in] conn_handle Connection handle."]
6814#[doc = " @param[in] p_enc_info Pointer to a @ref ble_gap_enc_info_t encryption information structure. May be NULL to signal none is available."]
6815#[doc = " @param[in] p_id_info Pointer to a @ref ble_gap_irk_t identity information structure. May be NULL to signal none is available."]
6816#[doc = " @param[in] p_sign_info Pointer to a @ref ble_gap_sign_info_t signing information structure. May be NULL to signal none is available."]
6817#[doc = ""]
6818#[doc = " @retval ::NRF_SUCCESS Successfully accepted security information."]
6819#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
6820#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either:"]
6821#[doc = " - No link has been established."]
6822#[doc = " - No @ref BLE_GAP_EVT_SEC_REQUEST pending."]
6823#[doc = " - Encryption information provided by the app without being requested. See @ref ble_gap_evt_sec_info_request_t::enc_info."]
6824#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
6825#[inline(always)]
6826pub unsafe fn sd_ble_gap_sec_info_reply(
6827 conn_handle: u16,
6828 p_enc_info: *const ble_gap_enc_info_t,
6829 p_id_info: *const ble_gap_irk_t,
6830 p_sign_info: *const ble_gap_sign_info_t,
6831) -> u32 {
6832 let ret: u32;
6833 core::arch::asm!("svc 134",
6834 inout("r0") to_asm(conn_handle) => ret,
6835 inout("r1") to_asm(p_enc_info) => _,
6836 inout("r2") to_asm(p_id_info) => _,
6837 inout("r3") to_asm(p_sign_info) => _,
6838 lateout("r12") _,
6839 );
6840 ret
6841}
6842
6843#[doc = "@brief Get the current connection security."]
6844#[doc = ""]
6845#[doc = " @param[in] conn_handle Connection handle."]
6846#[doc = " @param[out] p_conn_sec Pointer to a @ref ble_gap_conn_sec_t structure to be filled in."]
6847#[doc = ""]
6848#[doc = " @retval ::NRF_SUCCESS Current connection security successfully retrieved."]
6849#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
6850#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
6851#[inline(always)]
6852pub unsafe fn sd_ble_gap_conn_sec_get(conn_handle: u16, p_conn_sec: *mut ble_gap_conn_sec_t) -> u32 {
6853 let ret: u32;
6854 core::arch::asm!("svc 135",
6855 inout("r0") to_asm(conn_handle) => ret,
6856 inout("r1") to_asm(p_conn_sec) => _,
6857 lateout("r2") _,
6858 lateout("r3") _,
6859 lateout("r12") _,
6860 );
6861 ret
6862}
6863
6864#[doc = "@brief Start reporting the received signal strength to the application."]
6865#[doc = ""]
6866#[doc = " A new event is reported whenever the RSSI value changes, until @ref sd_ble_gap_rssi_stop is called."]
6867#[doc = ""]
6868#[doc = " @events"]
6869#[doc = " @event{@ref BLE_GAP_EVT_RSSI_CHANGED, New RSSI data available. How often the event is generated is"]
6870#[doc = " dependent on the settings of the <code>threshold_dbm</code>"]
6871#[doc = " and <code>skip_count</code> input parameters.}"]
6872#[doc = " @endevents"]
6873#[doc = ""]
6874#[doc = " @mscs"]
6875#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_RSSI_READ_MSC}"]
6876#[doc = " @mmsc{@ref BLE_GAP_RSSI_FILT_MSC}"]
6877#[doc = " @endmscs"]
6878#[doc = ""]
6879#[doc = " @param[in] conn_handle Connection handle."]
6880#[doc = " @param[in] threshold_dbm Minimum change in dBm before triggering the @ref BLE_GAP_EVT_RSSI_CHANGED event. Events are disabled if threshold_dbm equals @ref BLE_GAP_RSSI_THRESHOLD_INVALID."]
6881#[doc = " @param[in] skip_count Number of RSSI samples with a change of threshold_dbm or more before sending a new @ref BLE_GAP_EVT_RSSI_CHANGED event."]
6882#[doc = ""]
6883#[doc = " @retval ::NRF_SUCCESS Successfully activated RSSI reporting."]
6884#[doc = " @retval ::NRF_ERROR_INVALID_STATE RSSI reporting is already ongoing."]
6885#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
6886#[inline(always)]
6887pub unsafe fn sd_ble_gap_rssi_start(conn_handle: u16, threshold_dbm: u8, skip_count: u8) -> u32 {
6888 let ret: u32;
6889 core::arch::asm!("svc 136",
6890 inout("r0") to_asm(conn_handle) => ret,
6891 inout("r1") to_asm(threshold_dbm) => _,
6892 inout("r2") to_asm(skip_count) => _,
6893 lateout("r3") _,
6894 lateout("r12") _,
6895 );
6896 ret
6897}
6898
6899#[doc = "@brief Stop reporting the received signal strength."]
6900#[doc = ""]
6901#[doc = " @note An RSSI change detected before the call but not yet received by the application"]
6902#[doc = " may be reported after @ref sd_ble_gap_rssi_stop has been called."]
6903#[doc = ""]
6904#[doc = " @mscs"]
6905#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_RSSI_READ_MSC}"]
6906#[doc = " @mmsc{@ref BLE_GAP_RSSI_FILT_MSC}"]
6907#[doc = " @endmscs"]
6908#[doc = ""]
6909#[doc = " @param[in] conn_handle Connection handle."]
6910#[doc = ""]
6911#[doc = " @retval ::NRF_SUCCESS Successfully deactivated RSSI reporting."]
6912#[doc = " @retval ::NRF_ERROR_INVALID_STATE RSSI reporting is not ongoing."]
6913#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
6914#[inline(always)]
6915pub unsafe fn sd_ble_gap_rssi_stop(conn_handle: u16) -> u32 {
6916 let ret: u32;
6917 core::arch::asm!("svc 137",
6918 inout("r0") to_asm(conn_handle) => ret,
6919 lateout("r1") _,
6920 lateout("r2") _,
6921 lateout("r3") _,
6922 lateout("r12") _,
6923 );
6924 ret
6925}
6926
6927#[doc = "@brief Get the received signal strength for the last connection event."]
6928#[doc = ""]
6929#[doc = " @ref sd_ble_gap_rssi_start must be called to start reporting RSSI before using this function. @ref NRF_ERROR_NOT_FOUND"]
6930#[doc = " will be returned until RSSI was sampled for the first time after calling @ref sd_ble_gap_rssi_start."]
6931#[doc = " @note ERRATA-153 requires the rssi sample to be compensated based on a temperature measurement."]
6932#[doc = " @mscs"]
6933#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_RSSI_READ_MSC}"]
6934#[doc = " @endmscs"]
6935#[doc = ""]
6936#[doc = " @param[in] conn_handle Connection handle."]
6937#[doc = " @param[out] p_rssi Pointer to the location where the RSSI measurement shall be stored."]
6938#[doc = " @param[out] p_ch_index Pointer to the location where Channel Index for the RSSI measurement shall be stored."]
6939#[doc = ""]
6940#[doc = " @retval ::NRF_SUCCESS Successfully read the RSSI."]
6941#[doc = " @retval ::NRF_ERROR_NOT_FOUND No sample is available."]
6942#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
6943#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
6944#[doc = " @retval ::NRF_ERROR_INVALID_STATE RSSI reporting is not ongoing."]
6945#[inline(always)]
6946pub unsafe fn sd_ble_gap_rssi_get(conn_handle: u16, p_rssi: *mut i8, p_ch_index: *mut u8) -> u32 {
6947 let ret: u32;
6948 core::arch::asm!("svc 142",
6949 inout("r0") to_asm(conn_handle) => ret,
6950 inout("r1") to_asm(p_rssi) => _,
6951 inout("r2") to_asm(p_ch_index) => _,
6952 lateout("r3") _,
6953 lateout("r12") _,
6954 );
6955 ret
6956}
6957
6958#[doc = "@brief Start or continue scanning (GAP Discovery procedure, Observer Procedure)."]
6959#[doc = ""]
6960#[doc = " @note A call to this function will require the application to keep the memory pointed by"]
6961#[doc = " p_adv_report_buffer alive until the buffer is released. The buffer is released when the scanner is stopped"]
6962#[doc = " or when this function is called with another buffer."]
6963#[doc = ""]
6964#[doc = " @note The scanner will automatically stop in the following cases:"]
6965#[doc = " - @ref sd_ble_gap_scan_stop is called."]
6966#[doc = " - @ref sd_ble_gap_connect is called."]
6967#[doc = " - A @ref BLE_GAP_EVT_TIMEOUT with source set to @ref BLE_GAP_TIMEOUT_SRC_SCAN is received."]
6968#[doc = " - When a @ref BLE_GAP_EVT_ADV_REPORT event is received and @ref ble_gap_adv_report_type_t::status is not set to"]
6969#[doc = " @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA. In this case scanning is only paused to let the application"]
6970#[doc = " access received data. The application must call this function to continue scanning, or call @ref sd_ble_gap_scan_stop"]
6971#[doc = " to stop scanning."]
6972#[doc = ""]
6973#[doc = " @note If a @ref BLE_GAP_EVT_ADV_REPORT event is received with @ref ble_gap_adv_report_type_t::status set to"]
6974#[doc = " @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA, the scanner will continue scanning, and the application will"]
6975#[doc = " receive more reports from this advertising event. The following reports will include the old and new received data."]
6976#[doc = ""]
6977#[doc = " @events"]
6978#[doc = " @event{@ref BLE_GAP_EVT_ADV_REPORT, An advertising or scan response packet has been received.}"]
6979#[doc = " @event{@ref BLE_GAP_EVT_TIMEOUT, Scanner has timed out.}"]
6980#[doc = " @endevents"]
6981#[doc = ""]
6982#[doc = " @mscs"]
6983#[doc = " @mmsc{@ref BLE_GAP_SCAN_MSC}"]
6984#[doc = " @mmsc{@ref BLE_GAP_WL_SHARE_MSC}"]
6985#[doc = " @endmscs"]
6986#[doc = ""]
6987#[doc = " @param[in] p_scan_params Pointer to scan parameters structure. When this function is used to continue"]
6988#[doc = " scanning, this parameter must be NULL."]
6989#[doc = " @param[in] p_adv_report_buffer Pointer to buffer used to store incoming advertising data."]
6990#[doc = " The memory pointed to should be kept alive until the scanning is stopped."]
6991#[doc = " See @ref BLE_GAP_SCAN_BUFFER_SIZE for minimum and maximum buffer size."]
6992#[doc = " If the scanner receives advertising data larger than can be stored in the buffer,"]
6993#[doc = " a @ref BLE_GAP_EVT_ADV_REPORT will be raised with @ref ble_gap_adv_report_type_t::status"]
6994#[doc = " set to @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_TRUNCATED."]
6995#[doc = ""]
6996#[doc = " @retval ::NRF_SUCCESS Successfully initiated scanning procedure."]
6997#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
6998#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either:"]
6999#[doc = " - Scanning is already ongoing and p_scan_params was not NULL"]
7000#[doc = " - Scanning is not running and p_scan_params was NULL."]
7001#[doc = " - The scanner has timed out when this function is called to continue scanning."]
7002#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. See @ref ble_gap_scan_params_t."]
7003#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED Unsupported parameters supplied. See @ref ble_gap_scan_params_t."]
7004#[doc = " @retval ::NRF_ERROR_INVALID_LENGTH The provided buffer length is invalid. See @ref BLE_GAP_SCAN_BUFFER_MIN."]
7005#[doc = " @retval ::NRF_ERROR_RESOURCES Not enough BLE role slots available."]
7006#[doc = " Stop one or more currently active roles (Central, Peripheral or Broadcaster) and try again"]
7007#[inline(always)]
7008pub unsafe fn sd_ble_gap_scan_start(
7009 p_scan_params: *const ble_gap_scan_params_t,
7010 p_adv_report_buffer: *const ble_data_t,
7011) -> u32 {
7012 let ret: u32;
7013 core::arch::asm!("svc 138",
7014 inout("r0") to_asm(p_scan_params) => ret,
7015 inout("r1") to_asm(p_adv_report_buffer) => _,
7016 lateout("r2") _,
7017 lateout("r3") _,
7018 lateout("r12") _,
7019 );
7020 ret
7021}
7022
7023#[doc = "@brief Stop scanning (GAP Discovery procedure, Observer Procedure)."]
7024#[doc = ""]
7025#[doc = " @note The buffer provided in @ref sd_ble_gap_scan_start is released."]
7026#[doc = ""]
7027#[doc = " @mscs"]
7028#[doc = " @mmsc{@ref BLE_GAP_SCAN_MSC}"]
7029#[doc = " @mmsc{@ref BLE_GAP_WL_SHARE_MSC}"]
7030#[doc = " @endmscs"]
7031#[doc = ""]
7032#[doc = " @retval ::NRF_SUCCESS Successfully stopped scanning procedure."]
7033#[doc = " @retval ::NRF_ERROR_INVALID_STATE Not in the scanning state."]
7034#[inline(always)]
7035pub unsafe fn sd_ble_gap_scan_stop() -> u32 {
7036 let ret: u32;
7037 core::arch::asm!("svc 139",
7038 lateout("r0") ret,
7039 lateout("r1") _,
7040 lateout("r2") _,
7041 lateout("r3") _,
7042 lateout("r12") _,
7043 );
7044 ret
7045}
7046
7047#[doc = "@brief Create a connection (GAP Link Establishment)."]
7048#[doc = ""]
7049#[doc = " @note If a scanning procedure is currently in progress it will be automatically stopped when calling this function."]
7050#[doc = " The scanning procedure will be stopped even if the function returns an error."]
7051#[doc = ""]
7052#[doc = " @events"]
7053#[doc = " @event{@ref BLE_GAP_EVT_CONNECTED, A connection was established.}"]
7054#[doc = " @event{@ref BLE_GAP_EVT_TIMEOUT, Failed to establish a connection.}"]
7055#[doc = " @endevents"]
7056#[doc = ""]
7057#[doc = " @mscs"]
7058#[doc = " @mmsc{@ref BLE_GAP_WL_SHARE_MSC}"]
7059#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_CONN_PRIV_MSC}"]
7060#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_CONN_MSC}"]
7061#[doc = " @endmscs"]
7062#[doc = ""]
7063#[doc = " @param[in] p_peer_addr Pointer to peer identity address. If @ref ble_gap_scan_params_t::filter_policy is set to use"]
7064#[doc = " whitelist, then p_peer_addr is ignored."]
7065#[doc = " @param[in] p_scan_params Pointer to scan parameters structure."]
7066#[doc = " @param[in] p_conn_params Pointer to desired connection parameters."]
7067#[doc = " @param[in] conn_cfg_tag Tag identifying a configuration set by @ref sd_ble_cfg_set or"]
7068#[doc = " @ref BLE_CONN_CFG_TAG_DEFAULT to use the default connection configuration."]
7069#[doc = ""]
7070#[doc = " @retval ::NRF_SUCCESS Successfully initiated connection procedure."]
7071#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid parameter(s) pointer supplied."]
7072#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
7073#[doc = " - Invalid parameter(s) in p_scan_params or p_conn_params."]
7074#[doc = " - Use of whitelist requested but whitelist has not been set, see @ref sd_ble_gap_whitelist_set."]
7075#[doc = " - Peer address was not present in the device identity list, see @ref sd_ble_gap_device_identities_set."]
7076#[doc = " @retval ::NRF_ERROR_NOT_FOUND conn_cfg_tag not found."]
7077#[doc = " @retval ::NRF_ERROR_INVALID_STATE The SoftDevice is in an invalid state to perform this operation. This may be due to an"]
7078#[doc = " existing locally initiated connect procedure, which must complete before initiating again."]
7079#[doc = " @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid Peer address."]
7080#[doc = " @retval ::NRF_ERROR_CONN_COUNT The limit of available connections for this connection configuration tag has been reached."]
7081#[doc = " To increase the number of available connections,"]
7082#[doc = " use @ref sd_ble_cfg_set with @ref BLE_GAP_CFG_ROLE_COUNT or @ref BLE_CONN_CFG_GAP."]
7083#[doc = " @retval ::NRF_ERROR_RESOURCES Either:"]
7084#[doc = " - Not enough BLE role slots available."]
7085#[doc = " Stop one or more currently active roles (Central, Peripheral or Observer) and try again."]
7086#[doc = " - The event_length parameter associated with conn_cfg_tag is too small to be able to"]
7087#[doc = " establish a connection on the selected @ref ble_gap_scan_params_t::scan_phys."]
7088#[doc = " Use @ref sd_ble_cfg_set to increase the event length."]
7089#[inline(always)]
7090pub unsafe fn sd_ble_gap_connect(
7091 p_peer_addr: *const ble_gap_addr_t,
7092 p_scan_params: *const ble_gap_scan_params_t,
7093 p_conn_params: *const ble_gap_conn_params_t,
7094 conn_cfg_tag: u8,
7095) -> u32 {
7096 let ret: u32;
7097 core::arch::asm!("svc 140",
7098 inout("r0") to_asm(p_peer_addr) => ret,
7099 inout("r1") to_asm(p_scan_params) => _,
7100 inout("r2") to_asm(p_conn_params) => _,
7101 inout("r3") to_asm(conn_cfg_tag) => _,
7102 lateout("r12") _,
7103 );
7104 ret
7105}
7106
7107#[doc = "@brief Cancel a connection establishment."]
7108#[doc = ""]
7109#[doc = " @mscs"]
7110#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_CONN_MSC}"]
7111#[doc = " @endmscs"]
7112#[doc = ""]
7113#[doc = " @retval ::NRF_SUCCESS Successfully canceled an ongoing connection procedure."]
7114#[doc = " @retval ::NRF_ERROR_INVALID_STATE No locally initiated connect procedure started or connection"]
7115#[doc = " completed occurred."]
7116#[inline(always)]
7117pub unsafe fn sd_ble_gap_connect_cancel() -> u32 {
7118 let ret: u32;
7119 core::arch::asm!("svc 141",
7120 lateout("r0") ret,
7121 lateout("r1") _,
7122 lateout("r2") _,
7123 lateout("r3") _,
7124 lateout("r12") _,
7125 );
7126 ret
7127}
7128
7129#[doc = "@brief Initiate or respond to a PHY Update Procedure"]
7130#[doc = ""]
7131#[doc = " @details This function is used to initiate or respond to a PHY Update Procedure. It will always"]
7132#[doc = " generate a @ref BLE_GAP_EVT_PHY_UPDATE event if successfully executed."]
7133#[doc = " If this function is used to initiate a PHY Update procedure and the only option"]
7134#[doc = " provided in @ref ble_gap_phys_t::tx_phys and @ref ble_gap_phys_t::rx_phys is the"]
7135#[doc = " currently active PHYs in the respective directions, the SoftDevice will generate a"]
7136#[doc = " @ref BLE_GAP_EVT_PHY_UPDATE with the current PHYs set and will not initiate the"]
7137#[doc = " procedure in the Link Layer."]
7138#[doc = ""]
7139#[doc = " If @ref ble_gap_phys_t::tx_phys or @ref ble_gap_phys_t::rx_phys is @ref BLE_GAP_PHY_AUTO,"]
7140#[doc = " then the stack will select PHYs based on the peer's PHY preferences and the local link"]
7141#[doc = " configuration. The PHY Update procedure will for this case result in a PHY combination"]
7142#[doc = " that respects the time constraints configured with @ref sd_ble_cfg_set and the current"]
7143#[doc = " link layer data length."]
7144#[doc = ""]
7145#[doc = " When acting as a central, the SoftDevice will select the fastest common PHY in each direction."]
7146#[doc = ""]
7147#[doc = " If the peer does not support the PHY Update Procedure, then the resulting"]
7148#[doc = " @ref BLE_GAP_EVT_PHY_UPDATE event will have a status set to"]
7149#[doc = " @ref BLE_HCI_UNSUPPORTED_REMOTE_FEATURE."]
7150#[doc = ""]
7151#[doc = " If the PHY Update procedure was rejected by the peer due to a procedure collision, the status"]
7152#[doc = " will be @ref BLE_HCI_STATUS_CODE_LMP_ERROR_TRANSACTION_COLLISION or"]
7153#[doc = " @ref BLE_HCI_DIFFERENT_TRANSACTION_COLLISION."]
7154#[doc = " If the peer responds to the PHY Update procedure with invalid parameters, the status"]
7155#[doc = " will be @ref BLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS."]
7156#[doc = " If the PHY Update procedure was rejected by the peer for a different reason, the status will"]
7157#[doc = " contain the reason as specified by the peer."]
7158#[doc = ""]
7159#[doc = " @events"]
7160#[doc = " @event{@ref BLE_GAP_EVT_PHY_UPDATE, Result of the PHY Update Procedure.}"]
7161#[doc = " @endevents"]
7162#[doc = ""]
7163#[doc = " @mscs"]
7164#[doc = " @mmsc{@ref BLE_GAP_CENTRAL_PHY_UPDATE}"]
7165#[doc = " @mmsc{@ref BLE_GAP_PERIPHERAL_PHY_UPDATE}"]
7166#[doc = " @endmscs"]
7167#[doc = ""]
7168#[doc = " @param[in] conn_handle Connection handle to indicate the connection for which the PHY Update is requested."]
7169#[doc = " @param[in] p_gap_phys Pointer to PHY structure."]
7170#[doc = ""]
7171#[doc = " @retval ::NRF_SUCCESS Successfully requested a PHY Update."]
7172#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
7173#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
7174#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
7175#[doc = " @retval ::NRF_ERROR_INVALID_STATE No link has been established."]
7176#[doc = " @retval ::NRF_ERROR_RESOURCES The connection event length configured for this link is not sufficient for the combination of"]
7177#[doc = " @ref ble_gap_phys_t::tx_phys, @ref ble_gap_phys_t::rx_phys, and @ref ble_gap_data_length_params_t."]
7178#[doc = " The connection event length is configured with @ref BLE_CONN_CFG_GAP using @ref sd_ble_cfg_set."]
7179#[doc = " @retval ::NRF_ERROR_BUSY Procedure is already in progress or not allowed at this time. Process pending events and wait for the pending procedure to complete and retry."]
7180#[doc = ""]
7181#[inline(always)]
7182pub unsafe fn sd_ble_gap_phy_update(conn_handle: u16, p_gap_phys: *const ble_gap_phys_t) -> u32 {
7183 let ret: u32;
7184 core::arch::asm!("svc 143",
7185 inout("r0") to_asm(conn_handle) => ret,
7186 inout("r1") to_asm(p_gap_phys) => _,
7187 lateout("r2") _,
7188 lateout("r3") _,
7189 lateout("r12") _,
7190 );
7191 ret
7192}
7193
7194#[doc = "@brief Initiate or respond to a Data Length Update Procedure."]
7195#[doc = ""]
7196#[doc = " @note If the application uses @ref BLE_GAP_DATA_LENGTH_AUTO for one or more members of"]
7197#[doc = " p_dl_params, the SoftDevice will choose the highest value supported in current"]
7198#[doc = " configuration and connection parameters."]
7199#[doc = " @note If the link PHY is Coded, the SoftDevice will ensure that the MaxTxTime and/or MaxRxTime"]
7200#[doc = " used in the Data Length Update procedure is at least 2704 us. Otherwise, MaxTxTime and"]
7201#[doc = " MaxRxTime will be limited to maximum 2120 us."]
7202#[doc = ""]
7203#[doc = " @param[in] conn_handle Connection handle."]
7204#[doc = " @param[in] p_dl_params Pointer to local parameters to be used in Data Length Update"]
7205#[doc = " Procedure. Set any member to @ref BLE_GAP_DATA_LENGTH_AUTO to let"]
7206#[doc = " the SoftDevice automatically decide the value for that member."]
7207#[doc = " Set to NULL to use automatic values for all members."]
7208#[doc = " @param[out] p_dl_limitation Pointer to limitation to be written when local device does not"]
7209#[doc = " have enough resources or does not support the requested Data Length"]
7210#[doc = " Update parameters. Ignored if NULL."]
7211#[doc = ""]
7212#[doc = " @mscs"]
7213#[doc = " @mmsc{@ref BLE_GAP_DATA_LENGTH_UPDATE_PROCEDURE_MSC}"]
7214#[doc = " @endmscs"]
7215#[doc = ""]
7216#[doc = " @retval ::NRF_SUCCESS Successfully set Data Length Extension initiation/response parameters."]
7217#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
7218#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter supplied."]
7219#[doc = " @retval ::NRF_ERROR_INVALID_STATE No link has been established."]
7220#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameters supplied."]
7221#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED The requested parameters are not supported by the SoftDevice. Inspect"]
7222#[doc = " p_dl_limitation to see which parameter is not supported."]
7223#[doc = " @retval ::NRF_ERROR_RESOURCES The connection event length configured for this link is not sufficient for the requested parameters."]
7224#[doc = " Use @ref sd_ble_cfg_set with @ref BLE_CONN_CFG_GAP to increase the connection event length."]
7225#[doc = " Inspect p_dl_limitation to see where the limitation is."]
7226#[doc = " @retval ::NRF_ERROR_BUSY Peer has already initiated a Data Length Update Procedure. Process the"]
7227#[doc = " pending @ref BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST event to respond."]
7228#[inline(always)]
7229pub unsafe fn sd_ble_gap_data_length_update(
7230 conn_handle: u16,
7231 p_dl_params: *const ble_gap_data_length_params_t,
7232 p_dl_limitation: *mut ble_gap_data_length_limitation_t,
7233) -> u32 {
7234 let ret: u32;
7235 core::arch::asm!("svc 144",
7236 inout("r0") to_asm(conn_handle) => ret,
7237 inout("r1") to_asm(p_dl_params) => _,
7238 inout("r2") to_asm(p_dl_limitation) => _,
7239 lateout("r3") _,
7240 lateout("r12") _,
7241 );
7242 ret
7243}
7244
7245#[doc = "@brief Start the Quality of Service (QoS) channel survey module."]
7246#[doc = ""]
7247#[doc = " @details The channel survey module provides measurements of the energy levels on"]
7248#[doc = " the Bluetooth Low Energy channels. When the module is enabled, @ref BLE_GAP_EVT_QOS_CHANNEL_SURVEY_REPORT"]
7249#[doc = " events will periodically report the measured energy levels for each channel."]
7250#[doc = ""]
7251#[doc = " @note The measurements are scheduled with lower priority than other Bluetooth Low Energy roles,"]
7252#[doc = " Radio Timeslot API events and Flash API events."]
7253#[doc = ""]
7254#[doc = " @note The channel survey module will attempt to do measurements so that the average interval"]
7255#[doc = " between measurements will be interval_us. However due to the channel survey module"]
7256#[doc = " having the lowest priority of all roles and modules, this may not be possible. In that"]
7257#[doc = " case fewer than expected channel survey reports may be given."]
7258#[doc = ""]
7259#[doc = " @note In order to use the channel survey module, @ref ble_gap_cfg_role_count_t::qos_channel_survey_role_available"]
7260#[doc = " must be set. This is done using @ref sd_ble_cfg_set."]
7261#[doc = ""]
7262#[doc = " @param[in] interval_us Requested average interval for the measurements and reports. See"]
7263#[doc = " @ref BLE_GAP_QOS_CHANNEL_SURVEY_INTERVALS for valid ranges. If set"]
7264#[doc = " to @ref BLE_GAP_QOS_CHANNEL_SURVEY_INTERVAL_CONTINUOUS, the channel"]
7265#[doc = " survey role will be scheduled at every available opportunity."]
7266#[doc = ""]
7267#[doc = " @retval ::NRF_SUCCESS The module is successfully started."]
7268#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter supplied. interval_us is out of the"]
7269#[doc = " allowed range."]
7270#[doc = " @retval ::NRF_ERROR_INVALID_STATE Trying to start the module when already running."]
7271#[doc = " @retval ::NRF_ERROR_RESOURCES The channel survey module is not available to the application."]
7272#[doc = " Set @ref ble_gap_cfg_role_count_t::qos_channel_survey_role_available using"]
7273#[doc = " @ref sd_ble_cfg_set."]
7274#[inline(always)]
7275pub unsafe fn sd_ble_gap_qos_channel_survey_start(interval_us: u32) -> u32 {
7276 let ret: u32;
7277 core::arch::asm!("svc 145",
7278 inout("r0") to_asm(interval_us) => ret,
7279 lateout("r1") _,
7280 lateout("r2") _,
7281 lateout("r3") _,
7282 lateout("r12") _,
7283 );
7284 ret
7285}
7286
7287#[doc = "@brief Stop the Quality of Service (QoS) channel survey module."]
7288#[doc = ""]
7289#[doc = " @note The SoftDevice may generate one @ref BLE_GAP_EVT_QOS_CHANNEL_SURVEY_REPORT event after this"]
7290#[doc = " function is called."]
7291#[doc = ""]
7292#[doc = " @retval ::NRF_SUCCESS The module is successfully stopped."]
7293#[doc = " @retval ::NRF_ERROR_INVALID_STATE Trying to stop the module when it is not running."]
7294#[inline(always)]
7295pub unsafe fn sd_ble_gap_qos_channel_survey_stop() -> u32 {
7296 let ret: u32;
7297 core::arch::asm!("svc 146",
7298 lateout("r0") ret,
7299 lateout("r1") _,
7300 lateout("r2") _,
7301 lateout("r3") _,
7302 lateout("r12") _,
7303 );
7304 ret
7305}
7306
7307#[doc = "@brief Obtain the next connection event counter value."]
7308#[doc = ""]
7309#[doc = " @details The connection event counter is initialized to zero on the first connection event. The value is incremented"]
7310#[doc = " by one for each connection event. For more information see Bluetooth Core Specification v5.0, Vol 6, Part B,"]
7311#[doc = " Section 4.5.1."]
7312#[doc = ""]
7313#[doc = " @note The connection event counter obtained through this API will be outdated if this API is called"]
7314#[doc = " at the same time as the connection event counter is incremented."]
7315#[doc = ""]
7316#[doc = " @note This API will always return the last connection event counter + 1."]
7317#[doc = " The actual connection event may be multiple connection events later if:"]
7318#[doc = " - Slave latency is enabled and there is no data to transmit or receive."]
7319#[doc = " - Another role is scheduled with a higher priority at the same time as the next connection event."]
7320#[doc = ""]
7321#[doc = " @param[in] conn_handle Connection handle."]
7322#[doc = " @param[out] p_counter Pointer to the variable where the next connection event counter will be written."]
7323#[doc = ""]
7324#[doc = " @retval ::NRF_SUCCESS The connection event counter was successfully retrieved."]
7325#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter supplied."]
7326#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
7327#[inline(always)]
7328pub unsafe fn sd_ble_gap_next_conn_evt_counter_get(conn_handle: u16, p_counter: *mut u16) -> u32 {
7329 let ret: u32;
7330 core::arch::asm!("svc 148",
7331 inout("r0") to_asm(conn_handle) => ret,
7332 inout("r1") to_asm(p_counter) => _,
7333 lateout("r2") _,
7334 lateout("r3") _,
7335 lateout("r12") _,
7336 );
7337 ret
7338}
7339
7340#[doc = "@brief Start triggering a given task on connection event start."]
7341#[doc = ""]
7342#[doc = " @details When enabled, this feature will trigger a PPI task at the start of connection events."]
7343#[doc = " The application can configure the SoftDevice to trigger every N connection events starting from"]
7344#[doc = " a given connection event counter. See also @ref ble_gap_conn_event_trigger_t."]
7345#[doc = ""]
7346#[doc = " @param[in] conn_handle Connection handle."]
7347#[doc = " @param[in] p_params Connection event trigger parameters."]
7348#[doc = ""]
7349#[doc = " @retval ::NRF_SUCCESS Success."]
7350#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
7351#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
7352#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter supplied. See @ref ble_gap_conn_event_trigger_t."]
7353#[doc = " @retval ::NRF_ERROR_INVALID_STATE Either:"]
7354#[doc = " - Trying to start connection event triggering when it is already ongoing."]
7355#[doc = " - @ref ble_gap_conn_event_trigger_t::conn_evt_counter_start is in the past."]
7356#[doc = " Use @ref sd_ble_gap_next_conn_evt_counter_get to find a new value"]
7357#[doc = "to be used as ble_gap_conn_event_trigger_t::conn_evt_counter_start."]
7358#[inline(always)]
7359pub unsafe fn sd_ble_gap_conn_evt_trigger_start(
7360 conn_handle: u16,
7361 p_params: *const ble_gap_conn_event_trigger_t,
7362) -> u32 {
7363 let ret: u32;
7364 core::arch::asm!("svc 149",
7365 inout("r0") to_asm(conn_handle) => ret,
7366 inout("r1") to_asm(p_params) => _,
7367 lateout("r2") _,
7368 lateout("r3") _,
7369 lateout("r12") _,
7370 );
7371 ret
7372}
7373
7374#[doc = "@brief Stop triggering the task configured using @ref sd_ble_gap_conn_evt_trigger_start."]
7375#[doc = ""]
7376#[doc = " @param[in] conn_handle Connection handle."]
7377#[doc = ""]
7378#[doc = " @retval ::NRF_SUCCESS Success."]
7379#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied."]
7380#[doc = " @retval ::NRF_ERROR_INVALID_STATE Trying to stop connection event triggering when it is not enabled."]
7381#[inline(always)]
7382pub unsafe fn sd_ble_gap_conn_evt_trigger_stop(conn_handle: u16) -> u32 {
7383 let ret: u32;
7384 core::arch::asm!("svc 150",
7385 inout("r0") to_asm(conn_handle) => ret,
7386 lateout("r1") _,
7387 lateout("r2") _,
7388 lateout("r3") _,
7389 lateout("r12") _,
7390 );
7391 ret
7392}
7393
7394#[doc = "< Set up an L2CAP channel."]
7395pub const BLE_L2CAP_SVCS_SD_BLE_L2CAP_CH_SETUP: BLE_L2CAP_SVCS = 184;
7396#[doc = "< Release an L2CAP channel."]
7397pub const BLE_L2CAP_SVCS_SD_BLE_L2CAP_CH_RELEASE: BLE_L2CAP_SVCS = 185;
7398#[doc = "< Receive an SDU on an L2CAP channel."]
7399pub const BLE_L2CAP_SVCS_SD_BLE_L2CAP_CH_RX: BLE_L2CAP_SVCS = 186;
7400#[doc = "< Transmit an SDU on an L2CAP channel."]
7401pub const BLE_L2CAP_SVCS_SD_BLE_L2CAP_CH_TX: BLE_L2CAP_SVCS = 187;
7402#[doc = "< Advanced SDU reception flow control."]
7403pub const BLE_L2CAP_SVCS_SD_BLE_L2CAP_CH_FLOW_CONTROL: BLE_L2CAP_SVCS = 188;
7404#[doc = "@brief L2CAP API SVC numbers."]
7405pub type BLE_L2CAP_SVCS = self::c_uint;
7406#[doc = "< L2CAP Channel Setup Request event."]
7407#[doc = "\\n See @ref ble_l2cap_evt_ch_setup_request_t."]
7408pub const BLE_L2CAP_EVTS_BLE_L2CAP_EVT_CH_SETUP_REQUEST: BLE_L2CAP_EVTS = 112;
7409#[doc = "< L2CAP Channel Setup Refused event."]
7410#[doc = "\\n See @ref ble_l2cap_evt_ch_setup_refused_t."]
7411pub const BLE_L2CAP_EVTS_BLE_L2CAP_EVT_CH_SETUP_REFUSED: BLE_L2CAP_EVTS = 113;
7412#[doc = "< L2CAP Channel Setup Completed event."]
7413#[doc = "\\n See @ref ble_l2cap_evt_ch_setup_t."]
7414pub const BLE_L2CAP_EVTS_BLE_L2CAP_EVT_CH_SETUP: BLE_L2CAP_EVTS = 114;
7415#[doc = "< L2CAP Channel Released event."]
7416#[doc = "\\n No additional event structure applies."]
7417pub const BLE_L2CAP_EVTS_BLE_L2CAP_EVT_CH_RELEASED: BLE_L2CAP_EVTS = 115;
7418#[doc = "< L2CAP Channel SDU data buffer released event."]
7419#[doc = "\\n See @ref ble_l2cap_evt_ch_sdu_buf_released_t."]
7420pub const BLE_L2CAP_EVTS_BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED: BLE_L2CAP_EVTS = 116;
7421#[doc = "< L2CAP Channel Credit received."]
7422#[doc = "\\n See @ref ble_l2cap_evt_ch_credit_t."]
7423pub const BLE_L2CAP_EVTS_BLE_L2CAP_EVT_CH_CREDIT: BLE_L2CAP_EVTS = 117;
7424#[doc = "< L2CAP Channel SDU received."]
7425#[doc = "\\n See @ref ble_l2cap_evt_ch_rx_t."]
7426pub const BLE_L2CAP_EVTS_BLE_L2CAP_EVT_CH_RX: BLE_L2CAP_EVTS = 118;
7427#[doc = "< L2CAP Channel SDU transmitted."]
7428#[doc = "\\n See @ref ble_l2cap_evt_ch_tx_t."]
7429pub const BLE_L2CAP_EVTS_BLE_L2CAP_EVT_CH_TX: BLE_L2CAP_EVTS = 119;
7430#[doc = "@brief L2CAP Event IDs."]
7431pub type BLE_L2CAP_EVTS = self::c_uint;
7432#[doc = " @brief BLE L2CAP connection configuration parameters, set with @ref sd_ble_cfg_set."]
7433#[doc = ""]
7434#[doc = " @note These parameters are set per connection, so all L2CAP channels created on this connection"]
7435#[doc = " will have the same parameters."]
7436#[doc = ""]
7437#[doc = " @retval ::NRF_ERROR_INVALID_PARAM One or more of the following is true:"]
7438#[doc = " - rx_mps is smaller than @ref BLE_L2CAP_MPS_MIN."]
7439#[doc = " - tx_mps is smaller than @ref BLE_L2CAP_MPS_MIN."]
7440#[doc = " - ch_count is greater than @ref BLE_L2CAP_CH_COUNT_MAX."]
7441#[doc = " @retval ::NRF_ERROR_NO_MEM rx_mps or tx_mps is set too high."]
7442#[repr(C)]
7443#[derive(Debug, Copy, Clone)]
7444pub struct ble_l2cap_conn_cfg_t {
7445 #[doc = "< The maximum L2CAP PDU payload size, in bytes, that L2CAP shall"]
7446 #[doc = "be able to receive on L2CAP channels on connections with this"]
7447 #[doc = "configuration. The minimum value is @ref BLE_L2CAP_MPS_MIN."]
7448 pub rx_mps: u16,
7449 #[doc = "< The maximum L2CAP PDU payload size, in bytes, that L2CAP shall"]
7450 #[doc = "be able to transmit on L2CAP channels on connections with this"]
7451 #[doc = "configuration. The minimum value is @ref BLE_L2CAP_MPS_MIN."]
7452 pub tx_mps: u16,
7453 #[doc = "< Number of SDU data buffers that can be queued for reception per"]
7454 #[doc = "L2CAP channel. The minimum value is one."]
7455 pub rx_queue_size: u8,
7456 #[doc = "< Number of SDU data buffers that can be queued for transmission"]
7457 #[doc = "per L2CAP channel. The minimum value is one."]
7458 pub tx_queue_size: u8,
7459 #[doc = "< Number of L2CAP channels the application can create per connection"]
7460 #[doc = "with this configuration. The default value is zero, the maximum"]
7461 #[doc = "value is @ref BLE_L2CAP_CH_COUNT_MAX."]
7462 #[doc = "@note if this parameter is set to zero, all other parameters in"]
7463 #[doc = "@ref ble_l2cap_conn_cfg_t are ignored."]
7464 pub ch_count: u8,
7465}
7466#[test]
7467fn bindgen_test_layout_ble_l2cap_conn_cfg_t() {
7468 assert_eq!(
7469 ::core::mem::size_of::<ble_l2cap_conn_cfg_t>(),
7470 8usize,
7471 concat!("Size of: ", stringify!(ble_l2cap_conn_cfg_t))
7472 );
7473 assert_eq!(
7474 ::core::mem::align_of::<ble_l2cap_conn_cfg_t>(),
7475 2usize,
7476 concat!("Alignment of ", stringify!(ble_l2cap_conn_cfg_t))
7477 );
7478 assert_eq!(
7479 unsafe { &(*(::core::ptr::null::<ble_l2cap_conn_cfg_t>())).rx_mps as *const _ as usize },
7480 0usize,
7481 concat!(
7482 "Offset of field: ",
7483 stringify!(ble_l2cap_conn_cfg_t),
7484 "::",
7485 stringify!(rx_mps)
7486 )
7487 );
7488 assert_eq!(
7489 unsafe { &(*(::core::ptr::null::<ble_l2cap_conn_cfg_t>())).tx_mps as *const _ as usize },
7490 2usize,
7491 concat!(
7492 "Offset of field: ",
7493 stringify!(ble_l2cap_conn_cfg_t),
7494 "::",
7495 stringify!(tx_mps)
7496 )
7497 );
7498 assert_eq!(
7499 unsafe { &(*(::core::ptr::null::<ble_l2cap_conn_cfg_t>())).rx_queue_size as *const _ as usize },
7500 4usize,
7501 concat!(
7502 "Offset of field: ",
7503 stringify!(ble_l2cap_conn_cfg_t),
7504 "::",
7505 stringify!(rx_queue_size)
7506 )
7507 );
7508 assert_eq!(
7509 unsafe { &(*(::core::ptr::null::<ble_l2cap_conn_cfg_t>())).tx_queue_size as *const _ as usize },
7510 5usize,
7511 concat!(
7512 "Offset of field: ",
7513 stringify!(ble_l2cap_conn_cfg_t),
7514 "::",
7515 stringify!(tx_queue_size)
7516 )
7517 );
7518 assert_eq!(
7519 unsafe { &(*(::core::ptr::null::<ble_l2cap_conn_cfg_t>())).ch_count as *const _ as usize },
7520 6usize,
7521 concat!(
7522 "Offset of field: ",
7523 stringify!(ble_l2cap_conn_cfg_t),
7524 "::",
7525 stringify!(ch_count)
7526 )
7527 );
7528}
7529#[doc = "@brief L2CAP channel RX parameters."]
7530#[repr(C)]
7531#[derive(Debug, Copy, Clone)]
7532pub struct ble_l2cap_ch_rx_params_t {
7533 #[doc = "< The maximum L2CAP SDU size, in bytes, that L2CAP shall be able to"]
7534 #[doc = "receive on this L2CAP channel."]
7535 #[doc = "- Must be equal to or greater than @ref BLE_L2CAP_MTU_MIN."]
7536 pub rx_mtu: u16,
7537 #[doc = "< The maximum L2CAP PDU payload size, in bytes, that L2CAP shall be"]
7538 #[doc = "able to receive on this L2CAP channel."]
7539 #[doc = "- Must be equal to or greater than @ref BLE_L2CAP_MPS_MIN."]
7540 #[doc = "- Must be equal to or less than @ref ble_l2cap_conn_cfg_t::rx_mps."]
7541 pub rx_mps: u16,
7542 #[doc = "< SDU data buffer for reception."]
7543 #[doc = "- If @ref ble_data_t::p_data is non-NULL, initial credits are"]
7544 #[doc = "issued to the peer."]
7545 #[doc = "- If @ref ble_data_t::p_data is NULL, no initial credits are"]
7546 #[doc = "issued to the peer."]
7547 pub sdu_buf: ble_data_t,
7548}
7549#[test]
7550fn bindgen_test_layout_ble_l2cap_ch_rx_params_t() {
7551 assert_eq!(
7552 ::core::mem::size_of::<ble_l2cap_ch_rx_params_t>(),
7553 12usize,
7554 concat!("Size of: ", stringify!(ble_l2cap_ch_rx_params_t))
7555 );
7556 assert_eq!(
7557 ::core::mem::align_of::<ble_l2cap_ch_rx_params_t>(),
7558 4usize,
7559 concat!("Alignment of ", stringify!(ble_l2cap_ch_rx_params_t))
7560 );
7561 assert_eq!(
7562 unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_rx_params_t>())).rx_mtu as *const _ as usize },
7563 0usize,
7564 concat!(
7565 "Offset of field: ",
7566 stringify!(ble_l2cap_ch_rx_params_t),
7567 "::",
7568 stringify!(rx_mtu)
7569 )
7570 );
7571 assert_eq!(
7572 unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_rx_params_t>())).rx_mps as *const _ as usize },
7573 2usize,
7574 concat!(
7575 "Offset of field: ",
7576 stringify!(ble_l2cap_ch_rx_params_t),
7577 "::",
7578 stringify!(rx_mps)
7579 )
7580 );
7581 assert_eq!(
7582 unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_rx_params_t>())).sdu_buf as *const _ as usize },
7583 4usize,
7584 concat!(
7585 "Offset of field: ",
7586 stringify!(ble_l2cap_ch_rx_params_t),
7587 "::",
7588 stringify!(sdu_buf)
7589 )
7590 );
7591}
7592#[doc = "@brief L2CAP channel setup parameters."]
7593#[repr(C)]
7594#[derive(Debug, Copy, Clone)]
7595pub struct ble_l2cap_ch_setup_params_t {
7596 #[doc = "< L2CAP channel RX parameters."]
7597 pub rx_params: ble_l2cap_ch_rx_params_t,
7598 #[doc = "< LE Protocol/Service Multiplexer. Used when requesting"]
7599 #[doc = "setup of an L2CAP channel, ignored otherwise."]
7600 pub le_psm: u16,
7601 #[doc = "< Status code, see @ref BLE_L2CAP_CH_STATUS_CODES."]
7602 #[doc = "Used when replying to a setup request of an L2CAP"]
7603 #[doc = "channel, ignored otherwise."]
7604 pub status: u16,
7605}
7606#[test]
7607fn bindgen_test_layout_ble_l2cap_ch_setup_params_t() {
7608 assert_eq!(
7609 ::core::mem::size_of::<ble_l2cap_ch_setup_params_t>(),
7610 16usize,
7611 concat!("Size of: ", stringify!(ble_l2cap_ch_setup_params_t))
7612 );
7613 assert_eq!(
7614 ::core::mem::align_of::<ble_l2cap_ch_setup_params_t>(),
7615 4usize,
7616 concat!("Alignment of ", stringify!(ble_l2cap_ch_setup_params_t))
7617 );
7618 assert_eq!(
7619 unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_setup_params_t>())).rx_params as *const _ as usize },
7620 0usize,
7621 concat!(
7622 "Offset of field: ",
7623 stringify!(ble_l2cap_ch_setup_params_t),
7624 "::",
7625 stringify!(rx_params)
7626 )
7627 );
7628 assert_eq!(
7629 unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_setup_params_t>())).le_psm as *const _ as usize },
7630 12usize,
7631 concat!(
7632 "Offset of field: ",
7633 stringify!(ble_l2cap_ch_setup_params_t),
7634 "::",
7635 stringify!(le_psm)
7636 )
7637 );
7638 assert_eq!(
7639 unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_setup_params_t>())).status as *const _ as usize },
7640 14usize,
7641 concat!(
7642 "Offset of field: ",
7643 stringify!(ble_l2cap_ch_setup_params_t),
7644 "::",
7645 stringify!(status)
7646 )
7647 );
7648}
7649#[doc = "@brief L2CAP channel TX parameters."]
7650#[repr(C)]
7651#[derive(Debug, Copy, Clone)]
7652pub struct ble_l2cap_ch_tx_params_t {
7653 #[doc = "< The maximum L2CAP SDU size, in bytes, that L2CAP is able to"]
7654 #[doc = "transmit on this L2CAP channel."]
7655 pub tx_mtu: u16,
7656 #[doc = "< The maximum L2CAP PDU payload size, in bytes, that the peer is"]
7657 #[doc = "able to receive on this L2CAP channel."]
7658 pub peer_mps: u16,
7659 #[doc = "< The maximum L2CAP PDU payload size, in bytes, that L2CAP is able"]
7660 #[doc = "to transmit on this L2CAP channel. This is effective tx_mps,"]
7661 #[doc = "selected by the SoftDevice as"]
7662 #[doc = "MIN( @ref ble_l2cap_ch_tx_params_t::peer_mps, @ref ble_l2cap_conn_cfg_t::tx_mps )"]
7663 pub tx_mps: u16,
7664 #[doc = "< Initial credits given by the peer."]
7665 pub credits: u16,
7666}
7667#[test]
7668fn bindgen_test_layout_ble_l2cap_ch_tx_params_t() {
7669 assert_eq!(
7670 ::core::mem::size_of::<ble_l2cap_ch_tx_params_t>(),
7671 8usize,
7672 concat!("Size of: ", stringify!(ble_l2cap_ch_tx_params_t))
7673 );
7674 assert_eq!(
7675 ::core::mem::align_of::<ble_l2cap_ch_tx_params_t>(),
7676 2usize,
7677 concat!("Alignment of ", stringify!(ble_l2cap_ch_tx_params_t))
7678 );
7679 assert_eq!(
7680 unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_tx_params_t>())).tx_mtu as *const _ as usize },
7681 0usize,
7682 concat!(
7683 "Offset of field: ",
7684 stringify!(ble_l2cap_ch_tx_params_t),
7685 "::",
7686 stringify!(tx_mtu)
7687 )
7688 );
7689 assert_eq!(
7690 unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_tx_params_t>())).peer_mps as *const _ as usize },
7691 2usize,
7692 concat!(
7693 "Offset of field: ",
7694 stringify!(ble_l2cap_ch_tx_params_t),
7695 "::",
7696 stringify!(peer_mps)
7697 )
7698 );
7699 assert_eq!(
7700 unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_tx_params_t>())).tx_mps as *const _ as usize },
7701 4usize,
7702 concat!(
7703 "Offset of field: ",
7704 stringify!(ble_l2cap_ch_tx_params_t),
7705 "::",
7706 stringify!(tx_mps)
7707 )
7708 );
7709 assert_eq!(
7710 unsafe { &(*(::core::ptr::null::<ble_l2cap_ch_tx_params_t>())).credits as *const _ as usize },
7711 6usize,
7712 concat!(
7713 "Offset of field: ",
7714 stringify!(ble_l2cap_ch_tx_params_t),
7715 "::",
7716 stringify!(credits)
7717 )
7718 );
7719}
7720#[doc = "@brief L2CAP Channel Setup Request event."]
7721#[repr(C)]
7722#[derive(Debug, Copy, Clone)]
7723pub struct ble_l2cap_evt_ch_setup_request_t {
7724 #[doc = "< L2CAP channel TX parameters."]
7725 pub tx_params: ble_l2cap_ch_tx_params_t,
7726 #[doc = "< LE Protocol/Service Multiplexer."]
7727 pub le_psm: u16,
7728}
7729#[test]
7730fn bindgen_test_layout_ble_l2cap_evt_ch_setup_request_t() {
7731 assert_eq!(
7732 ::core::mem::size_of::<ble_l2cap_evt_ch_setup_request_t>(),
7733 10usize,
7734 concat!("Size of: ", stringify!(ble_l2cap_evt_ch_setup_request_t))
7735 );
7736 assert_eq!(
7737 ::core::mem::align_of::<ble_l2cap_evt_ch_setup_request_t>(),
7738 2usize,
7739 concat!("Alignment of ", stringify!(ble_l2cap_evt_ch_setup_request_t))
7740 );
7741 assert_eq!(
7742 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_setup_request_t>())).tx_params as *const _ as usize },
7743 0usize,
7744 concat!(
7745 "Offset of field: ",
7746 stringify!(ble_l2cap_evt_ch_setup_request_t),
7747 "::",
7748 stringify!(tx_params)
7749 )
7750 );
7751 assert_eq!(
7752 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_setup_request_t>())).le_psm as *const _ as usize },
7753 8usize,
7754 concat!(
7755 "Offset of field: ",
7756 stringify!(ble_l2cap_evt_ch_setup_request_t),
7757 "::",
7758 stringify!(le_psm)
7759 )
7760 );
7761}
7762#[doc = "@brief L2CAP Channel Setup Refused event."]
7763#[repr(C)]
7764#[derive(Debug, Copy, Clone)]
7765pub struct ble_l2cap_evt_ch_setup_refused_t {
7766 #[doc = "< Source, see @ref BLE_L2CAP_CH_SETUP_REFUSED_SRCS"]
7767 pub source: u8,
7768 #[doc = "< Status code, see @ref BLE_L2CAP_CH_STATUS_CODES"]
7769 pub status: u16,
7770}
7771#[test]
7772fn bindgen_test_layout_ble_l2cap_evt_ch_setup_refused_t() {
7773 assert_eq!(
7774 ::core::mem::size_of::<ble_l2cap_evt_ch_setup_refused_t>(),
7775 4usize,
7776 concat!("Size of: ", stringify!(ble_l2cap_evt_ch_setup_refused_t))
7777 );
7778 assert_eq!(
7779 ::core::mem::align_of::<ble_l2cap_evt_ch_setup_refused_t>(),
7780 2usize,
7781 concat!("Alignment of ", stringify!(ble_l2cap_evt_ch_setup_refused_t))
7782 );
7783 assert_eq!(
7784 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_setup_refused_t>())).source as *const _ as usize },
7785 0usize,
7786 concat!(
7787 "Offset of field: ",
7788 stringify!(ble_l2cap_evt_ch_setup_refused_t),
7789 "::",
7790 stringify!(source)
7791 )
7792 );
7793 assert_eq!(
7794 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_setup_refused_t>())).status as *const _ as usize },
7795 2usize,
7796 concat!(
7797 "Offset of field: ",
7798 stringify!(ble_l2cap_evt_ch_setup_refused_t),
7799 "::",
7800 stringify!(status)
7801 )
7802 );
7803}
7804#[doc = "@brief L2CAP Channel Setup Completed event."]
7805#[repr(C)]
7806#[derive(Debug, Copy, Clone)]
7807pub struct ble_l2cap_evt_ch_setup_t {
7808 #[doc = "< L2CAP channel TX parameters."]
7809 pub tx_params: ble_l2cap_ch_tx_params_t,
7810}
7811#[test]
7812fn bindgen_test_layout_ble_l2cap_evt_ch_setup_t() {
7813 assert_eq!(
7814 ::core::mem::size_of::<ble_l2cap_evt_ch_setup_t>(),
7815 8usize,
7816 concat!("Size of: ", stringify!(ble_l2cap_evt_ch_setup_t))
7817 );
7818 assert_eq!(
7819 ::core::mem::align_of::<ble_l2cap_evt_ch_setup_t>(),
7820 2usize,
7821 concat!("Alignment of ", stringify!(ble_l2cap_evt_ch_setup_t))
7822 );
7823 assert_eq!(
7824 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_setup_t>())).tx_params as *const _ as usize },
7825 0usize,
7826 concat!(
7827 "Offset of field: ",
7828 stringify!(ble_l2cap_evt_ch_setup_t),
7829 "::",
7830 stringify!(tx_params)
7831 )
7832 );
7833}
7834#[doc = "@brief L2CAP Channel SDU Data Buffer Released event."]
7835#[repr(C)]
7836#[derive(Debug, Copy, Clone)]
7837pub struct ble_l2cap_evt_ch_sdu_buf_released_t {
7838 #[doc = "< Returned reception or transmission SDU data buffer. The SoftDevice"]
7839 #[doc = "returns SDU data buffers supplied by the application, which have"]
7840 #[doc = "not yet been returned previously via a @ref BLE_L2CAP_EVT_CH_RX or"]
7841 #[doc = "@ref BLE_L2CAP_EVT_CH_TX event."]
7842 pub sdu_buf: ble_data_t,
7843}
7844#[test]
7845fn bindgen_test_layout_ble_l2cap_evt_ch_sdu_buf_released_t() {
7846 assert_eq!(
7847 ::core::mem::size_of::<ble_l2cap_evt_ch_sdu_buf_released_t>(),
7848 8usize,
7849 concat!("Size of: ", stringify!(ble_l2cap_evt_ch_sdu_buf_released_t))
7850 );
7851 assert_eq!(
7852 ::core::mem::align_of::<ble_l2cap_evt_ch_sdu_buf_released_t>(),
7853 4usize,
7854 concat!("Alignment of ", stringify!(ble_l2cap_evt_ch_sdu_buf_released_t))
7855 );
7856 assert_eq!(
7857 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_sdu_buf_released_t>())).sdu_buf as *const _ as usize },
7858 0usize,
7859 concat!(
7860 "Offset of field: ",
7861 stringify!(ble_l2cap_evt_ch_sdu_buf_released_t),
7862 "::",
7863 stringify!(sdu_buf)
7864 )
7865 );
7866}
7867#[doc = "@brief L2CAP Channel Credit received event."]
7868#[repr(C)]
7869#[derive(Debug, Copy, Clone)]
7870pub struct ble_l2cap_evt_ch_credit_t {
7871 #[doc = "< Additional credits given by the peer."]
7872 pub credits: u16,
7873}
7874#[test]
7875fn bindgen_test_layout_ble_l2cap_evt_ch_credit_t() {
7876 assert_eq!(
7877 ::core::mem::size_of::<ble_l2cap_evt_ch_credit_t>(),
7878 2usize,
7879 concat!("Size of: ", stringify!(ble_l2cap_evt_ch_credit_t))
7880 );
7881 assert_eq!(
7882 ::core::mem::align_of::<ble_l2cap_evt_ch_credit_t>(),
7883 2usize,
7884 concat!("Alignment of ", stringify!(ble_l2cap_evt_ch_credit_t))
7885 );
7886 assert_eq!(
7887 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_credit_t>())).credits as *const _ as usize },
7888 0usize,
7889 concat!(
7890 "Offset of field: ",
7891 stringify!(ble_l2cap_evt_ch_credit_t),
7892 "::",
7893 stringify!(credits)
7894 )
7895 );
7896}
7897#[doc = "@brief L2CAP Channel received SDU event."]
7898#[repr(C)]
7899#[derive(Debug, Copy, Clone)]
7900pub struct ble_l2cap_evt_ch_rx_t {
7901 #[doc = "< Total SDU length, in bytes."]
7902 pub sdu_len: u16,
7903 #[doc = "< SDU data buffer."]
7904 #[doc = "@note If there is not enough space in the buffer"]
7905 #[doc = "(sdu_buf.len < sdu_len) then the rest of the SDU will be"]
7906 #[doc = "silently discarded by the SoftDevice."]
7907 pub sdu_buf: ble_data_t,
7908}
7909#[test]
7910fn bindgen_test_layout_ble_l2cap_evt_ch_rx_t() {
7911 assert_eq!(
7912 ::core::mem::size_of::<ble_l2cap_evt_ch_rx_t>(),
7913 12usize,
7914 concat!("Size of: ", stringify!(ble_l2cap_evt_ch_rx_t))
7915 );
7916 assert_eq!(
7917 ::core::mem::align_of::<ble_l2cap_evt_ch_rx_t>(),
7918 4usize,
7919 concat!("Alignment of ", stringify!(ble_l2cap_evt_ch_rx_t))
7920 );
7921 assert_eq!(
7922 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_rx_t>())).sdu_len as *const _ as usize },
7923 0usize,
7924 concat!(
7925 "Offset of field: ",
7926 stringify!(ble_l2cap_evt_ch_rx_t),
7927 "::",
7928 stringify!(sdu_len)
7929 )
7930 );
7931 assert_eq!(
7932 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_rx_t>())).sdu_buf as *const _ as usize },
7933 4usize,
7934 concat!(
7935 "Offset of field: ",
7936 stringify!(ble_l2cap_evt_ch_rx_t),
7937 "::",
7938 stringify!(sdu_buf)
7939 )
7940 );
7941}
7942#[doc = "@brief L2CAP Channel transmitted SDU event."]
7943#[repr(C)]
7944#[derive(Debug, Copy, Clone)]
7945pub struct ble_l2cap_evt_ch_tx_t {
7946 #[doc = "< SDU data buffer."]
7947 pub sdu_buf: ble_data_t,
7948}
7949#[test]
7950fn bindgen_test_layout_ble_l2cap_evt_ch_tx_t() {
7951 assert_eq!(
7952 ::core::mem::size_of::<ble_l2cap_evt_ch_tx_t>(),
7953 8usize,
7954 concat!("Size of: ", stringify!(ble_l2cap_evt_ch_tx_t))
7955 );
7956 assert_eq!(
7957 ::core::mem::align_of::<ble_l2cap_evt_ch_tx_t>(),
7958 4usize,
7959 concat!("Alignment of ", stringify!(ble_l2cap_evt_ch_tx_t))
7960 );
7961 assert_eq!(
7962 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_ch_tx_t>())).sdu_buf as *const _ as usize },
7963 0usize,
7964 concat!(
7965 "Offset of field: ",
7966 stringify!(ble_l2cap_evt_ch_tx_t),
7967 "::",
7968 stringify!(sdu_buf)
7969 )
7970 );
7971}
7972#[doc = "@brief L2CAP event structure."]
7973#[repr(C)]
7974#[derive(Copy, Clone)]
7975pub struct ble_l2cap_evt_t {
7976 #[doc = "< Connection Handle on which the event occured."]
7977 pub conn_handle: u16,
7978 #[doc = "< Local Channel ID of the L2CAP channel, or"]
7979 #[doc = "@ref BLE_L2CAP_CID_INVALID if not present."]
7980 pub local_cid: u16,
7981 #[doc = "< Event Parameters."]
7982 pub params: ble_l2cap_evt_t__bindgen_ty_1,
7983}
7984#[repr(C)]
7985#[derive(Copy, Clone)]
7986pub union ble_l2cap_evt_t__bindgen_ty_1 {
7987 #[doc = "< L2CAP Channel Setup Request Event Parameters."]
7988 pub ch_setup_request: ble_l2cap_evt_ch_setup_request_t,
7989 #[doc = "< L2CAP Channel Setup Refused Event Parameters."]
7990 pub ch_setup_refused: ble_l2cap_evt_ch_setup_refused_t,
7991 #[doc = "< L2CAP Channel Setup Completed Event Parameters."]
7992 pub ch_setup: ble_l2cap_evt_ch_setup_t,
7993 #[doc = "< L2CAP Channel SDU Data Buffer Released Event Parameters."]
7994 pub ch_sdu_buf_released: ble_l2cap_evt_ch_sdu_buf_released_t,
7995 #[doc = "< L2CAP Channel Credit Received Event Parameters."]
7996 pub credit: ble_l2cap_evt_ch_credit_t,
7997 #[doc = "< L2CAP Channel SDU Received Event Parameters."]
7998 pub rx: ble_l2cap_evt_ch_rx_t,
7999 #[doc = "< L2CAP Channel SDU Transmitted Event Parameters."]
8000 pub tx: ble_l2cap_evt_ch_tx_t,
8001 _bindgen_union_align: [u32; 3usize],
8002}
8003#[test]
8004fn bindgen_test_layout_ble_l2cap_evt_t__bindgen_ty_1() {
8005 assert_eq!(
8006 ::core::mem::size_of::<ble_l2cap_evt_t__bindgen_ty_1>(),
8007 12usize,
8008 concat!("Size of: ", stringify!(ble_l2cap_evt_t__bindgen_ty_1))
8009 );
8010 assert_eq!(
8011 ::core::mem::align_of::<ble_l2cap_evt_t__bindgen_ty_1>(),
8012 4usize,
8013 concat!("Alignment of ", stringify!(ble_l2cap_evt_t__bindgen_ty_1))
8014 );
8015 assert_eq!(
8016 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t__bindgen_ty_1>())).ch_setup_request as *const _ as usize },
8017 0usize,
8018 concat!(
8019 "Offset of field: ",
8020 stringify!(ble_l2cap_evt_t__bindgen_ty_1),
8021 "::",
8022 stringify!(ch_setup_request)
8023 )
8024 );
8025 assert_eq!(
8026 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t__bindgen_ty_1>())).ch_setup_refused as *const _ as usize },
8027 0usize,
8028 concat!(
8029 "Offset of field: ",
8030 stringify!(ble_l2cap_evt_t__bindgen_ty_1),
8031 "::",
8032 stringify!(ch_setup_refused)
8033 )
8034 );
8035 assert_eq!(
8036 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t__bindgen_ty_1>())).ch_setup as *const _ as usize },
8037 0usize,
8038 concat!(
8039 "Offset of field: ",
8040 stringify!(ble_l2cap_evt_t__bindgen_ty_1),
8041 "::",
8042 stringify!(ch_setup)
8043 )
8044 );
8045 assert_eq!(
8046 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t__bindgen_ty_1>())).ch_sdu_buf_released as *const _ as usize },
8047 0usize,
8048 concat!(
8049 "Offset of field: ",
8050 stringify!(ble_l2cap_evt_t__bindgen_ty_1),
8051 "::",
8052 stringify!(ch_sdu_buf_released)
8053 )
8054 );
8055 assert_eq!(
8056 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t__bindgen_ty_1>())).credit as *const _ as usize },
8057 0usize,
8058 concat!(
8059 "Offset of field: ",
8060 stringify!(ble_l2cap_evt_t__bindgen_ty_1),
8061 "::",
8062 stringify!(credit)
8063 )
8064 );
8065 assert_eq!(
8066 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t__bindgen_ty_1>())).rx as *const _ as usize },
8067 0usize,
8068 concat!(
8069 "Offset of field: ",
8070 stringify!(ble_l2cap_evt_t__bindgen_ty_1),
8071 "::",
8072 stringify!(rx)
8073 )
8074 );
8075 assert_eq!(
8076 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t__bindgen_ty_1>())).tx as *const _ as usize },
8077 0usize,
8078 concat!(
8079 "Offset of field: ",
8080 stringify!(ble_l2cap_evt_t__bindgen_ty_1),
8081 "::",
8082 stringify!(tx)
8083 )
8084 );
8085}
8086#[test]
8087fn bindgen_test_layout_ble_l2cap_evt_t() {
8088 assert_eq!(
8089 ::core::mem::size_of::<ble_l2cap_evt_t>(),
8090 16usize,
8091 concat!("Size of: ", stringify!(ble_l2cap_evt_t))
8092 );
8093 assert_eq!(
8094 ::core::mem::align_of::<ble_l2cap_evt_t>(),
8095 4usize,
8096 concat!("Alignment of ", stringify!(ble_l2cap_evt_t))
8097 );
8098 assert_eq!(
8099 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t>())).conn_handle as *const _ as usize },
8100 0usize,
8101 concat!(
8102 "Offset of field: ",
8103 stringify!(ble_l2cap_evt_t),
8104 "::",
8105 stringify!(conn_handle)
8106 )
8107 );
8108 assert_eq!(
8109 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t>())).local_cid as *const _ as usize },
8110 2usize,
8111 concat!(
8112 "Offset of field: ",
8113 stringify!(ble_l2cap_evt_t),
8114 "::",
8115 stringify!(local_cid)
8116 )
8117 );
8118 assert_eq!(
8119 unsafe { &(*(::core::ptr::null::<ble_l2cap_evt_t>())).params as *const _ as usize },
8120 4usize,
8121 concat!(
8122 "Offset of field: ",
8123 stringify!(ble_l2cap_evt_t),
8124 "::",
8125 stringify!(params)
8126 )
8127 );
8128}
8129
8130#[doc = "@brief Set up an L2CAP channel."]
8131#[doc = ""]
8132#[doc = " @details This function is used to:"]
8133#[doc = " - Request setup of an L2CAP channel: sends an LE Credit Based Connection Request packet to a peer."]
8134#[doc = " - Reply to a setup request of an L2CAP channel (if called in response to a"]
8135#[doc = " @ref BLE_L2CAP_EVT_CH_SETUP_REQUEST event): sends an LE Credit Based Connection"]
8136#[doc = " Response packet to a peer."]
8137#[doc = ""]
8138#[doc = " @note A call to this function will require the application to keep the SDU data buffer alive"]
8139#[doc = " until the SDU data buffer is returned in @ref BLE_L2CAP_EVT_CH_RX or"]
8140#[doc = " @ref BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED event."]
8141#[doc = ""]
8142#[doc = " @events"]
8143#[doc = " @event{@ref BLE_L2CAP_EVT_CH_SETUP, Setup successful.}"]
8144#[doc = " @event{@ref BLE_L2CAP_EVT_CH_SETUP_REFUSED, Setup failed.}"]
8145#[doc = " @endevents"]
8146#[doc = ""]
8147#[doc = " @mscs"]
8148#[doc = " @mmsc{@ref BLE_L2CAP_CH_SETUP_MSC}"]
8149#[doc = " @endmscs"]
8150#[doc = ""]
8151#[doc = " @param[in] conn_handle Connection Handle."]
8152#[doc = " @param[in,out] p_local_cid Pointer to a uint16_t containing Local Channel ID of the L2CAP channel:"]
8153#[doc = " - As input: @ref BLE_L2CAP_CID_INVALID when requesting setup of an L2CAP"]
8154#[doc = " channel or local_cid provided in the @ref BLE_L2CAP_EVT_CH_SETUP_REQUEST"]
8155#[doc = " event when replying to a setup request of an L2CAP channel."]
8156#[doc = " - As output: local_cid for this channel."]
8157#[doc = " @param[in] p_params L2CAP channel parameters."]
8158#[doc = ""]
8159#[doc = " @retval ::NRF_SUCCESS Successfully queued request or response for transmission."]
8160#[doc = " @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry."]
8161#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
8162#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
8163#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
8164#[doc = " @retval ::NRF_ERROR_INVALID_LENGTH Supplied higher rx_mps than has been configured on this link."]
8165#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (L2CAP channel already set up)."]
8166#[doc = " @retval ::NRF_ERROR_NOT_FOUND CID not found."]
8167#[doc = " @retval ::NRF_ERROR_RESOURCES The limit has been reached for available L2CAP channels,"]
8168#[doc = " see @ref ble_l2cap_conn_cfg_t::ch_count."]
8169#[inline(always)]
8170pub unsafe fn sd_ble_l2cap_ch_setup(
8171 conn_handle: u16,
8172 p_local_cid: *mut u16,
8173 p_params: *const ble_l2cap_ch_setup_params_t,
8174) -> u32 {
8175 let ret: u32;
8176 core::arch::asm!("svc 184",
8177 inout("r0") to_asm(conn_handle) => ret,
8178 inout("r1") to_asm(p_local_cid) => _,
8179 inout("r2") to_asm(p_params) => _,
8180 lateout("r3") _,
8181 lateout("r12") _,
8182 );
8183 ret
8184}
8185
8186#[doc = "@brief Release an L2CAP channel."]
8187#[doc = ""]
8188#[doc = " @details This sends a Disconnection Request packet to a peer."]
8189#[doc = ""]
8190#[doc = " @events"]
8191#[doc = " @event{@ref BLE_L2CAP_EVT_CH_RELEASED, Release complete.}"]
8192#[doc = " @endevents"]
8193#[doc = ""]
8194#[doc = " @mscs"]
8195#[doc = " @mmsc{@ref BLE_L2CAP_CH_RELEASE_MSC}"]
8196#[doc = " @endmscs"]
8197#[doc = ""]
8198#[doc = " @param[in] conn_handle Connection Handle."]
8199#[doc = " @param[in] local_cid Local Channel ID of the L2CAP channel."]
8200#[doc = ""]
8201#[doc = " @retval ::NRF_SUCCESS Successfully queued request for transmission."]
8202#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
8203#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (Setup or release is"]
8204#[doc = " in progress for the L2CAP channel)."]
8205#[doc = " @retval ::NRF_ERROR_NOT_FOUND CID not found."]
8206#[inline(always)]
8207pub unsafe fn sd_ble_l2cap_ch_release(conn_handle: u16, local_cid: u16) -> u32 {
8208 let ret: u32;
8209 core::arch::asm!("svc 185",
8210 inout("r0") to_asm(conn_handle) => ret,
8211 inout("r1") to_asm(local_cid) => _,
8212 lateout("r2") _,
8213 lateout("r3") _,
8214 lateout("r12") _,
8215 );
8216 ret
8217}
8218
8219#[doc = "@brief Receive an SDU on an L2CAP channel."]
8220#[doc = ""]
8221#[doc = " @details This may issue additional credits to the peer using an LE Flow Control Credit packet."]
8222#[doc = ""]
8223#[doc = " @note A call to this function will require the application to keep the memory pointed by"]
8224#[doc = " @ref ble_data_t::p_data alive until the SDU data buffer is returned in @ref BLE_L2CAP_EVT_CH_RX"]
8225#[doc = " or @ref BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED event."]
8226#[doc = ""]
8227#[doc = " @note The SoftDevice can queue up to @ref ble_l2cap_conn_cfg_t::rx_queue_size SDU data buffers"]
8228#[doc = " for reception per L2CAP channel."]
8229#[doc = ""]
8230#[doc = " @events"]
8231#[doc = " @event{@ref BLE_L2CAP_EVT_CH_RX, The SDU is received.}"]
8232#[doc = " @endevents"]
8233#[doc = ""]
8234#[doc = " @mscs"]
8235#[doc = " @mmsc{@ref BLE_L2CAP_CH_RX_MSC}"]
8236#[doc = " @endmscs"]
8237#[doc = ""]
8238#[doc = " @param[in] conn_handle Connection Handle."]
8239#[doc = " @param[in] local_cid Local Channel ID of the L2CAP channel."]
8240#[doc = " @param[in] p_sdu_buf Pointer to the SDU data buffer."]
8241#[doc = ""]
8242#[doc = " @retval ::NRF_SUCCESS Buffer accepted."]
8243#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
8244#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
8245#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (Setup or release is"]
8246#[doc = " in progress for an L2CAP channel)."]
8247#[doc = " @retval ::NRF_ERROR_NOT_FOUND CID not found."]
8248#[doc = " @retval ::NRF_ERROR_RESOURCES Too many SDU data buffers supplied. Wait for a"]
8249#[doc = " @ref BLE_L2CAP_EVT_CH_RX event and retry."]
8250#[inline(always)]
8251pub unsafe fn sd_ble_l2cap_ch_rx(conn_handle: u16, local_cid: u16, p_sdu_buf: *const ble_data_t) -> u32 {
8252 let ret: u32;
8253 core::arch::asm!("svc 186",
8254 inout("r0") to_asm(conn_handle) => ret,
8255 inout("r1") to_asm(local_cid) => _,
8256 inout("r2") to_asm(p_sdu_buf) => _,
8257 lateout("r3") _,
8258 lateout("r12") _,
8259 );
8260 ret
8261}
8262
8263#[doc = "@brief Transmit an SDU on an L2CAP channel."]
8264#[doc = ""]
8265#[doc = " @note A call to this function will require the application to keep the memory pointed by"]
8266#[doc = " @ref ble_data_t::p_data alive until the SDU data buffer is returned in @ref BLE_L2CAP_EVT_CH_TX"]
8267#[doc = " or @ref BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED event."]
8268#[doc = ""]
8269#[doc = " @note The SoftDevice can queue up to @ref ble_l2cap_conn_cfg_t::tx_queue_size SDUs for"]
8270#[doc = " transmission per L2CAP channel."]
8271#[doc = ""]
8272#[doc = " @note The application can keep track of the available credits for transmission by following"]
8273#[doc = " the procedure below:"]
8274#[doc = " - Store initial credits given by the peer in a variable."]
8275#[doc = " (Initial credits are provided in a @ref BLE_L2CAP_EVT_CH_SETUP event.)"]
8276#[doc = " - Decrement the variable, which stores the currently available credits, by"]
8277#[doc = " ceiling((@ref ble_data_t::len + 2) / tx_mps) when a call to this function returns"]
8278#[doc = " @ref NRF_SUCCESS. (tx_mps is provided in a @ref BLE_L2CAP_EVT_CH_SETUP event.)"]
8279#[doc = " - Increment the variable, which stores the currently available credits, by additional"]
8280#[doc = " credits given by the peer in a @ref BLE_L2CAP_EVT_CH_CREDIT event."]
8281#[doc = ""]
8282#[doc = " @events"]
8283#[doc = " @event{@ref BLE_L2CAP_EVT_CH_TX, The SDU is transmitted.}"]
8284#[doc = " @endevents"]
8285#[doc = ""]
8286#[doc = " @mscs"]
8287#[doc = " @mmsc{@ref BLE_L2CAP_CH_TX_MSC}"]
8288#[doc = " @endmscs"]
8289#[doc = ""]
8290#[doc = " @param[in] conn_handle Connection Handle."]
8291#[doc = " @param[in] local_cid Local Channel ID of the L2CAP channel."]
8292#[doc = " @param[in] p_sdu_buf Pointer to the SDU data buffer."]
8293#[doc = ""]
8294#[doc = " @retval ::NRF_SUCCESS Successfully queued L2CAP SDU for transmission."]
8295#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
8296#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
8297#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (Setup or release is"]
8298#[doc = " in progress for the L2CAP channel)."]
8299#[doc = " @retval ::NRF_ERROR_NOT_FOUND CID not found."]
8300#[doc = " @retval ::NRF_ERROR_DATA_SIZE Invalid SDU length supplied, must not be more than"]
8301#[doc = " @ref ble_l2cap_ch_tx_params_t::tx_mtu provided in"]
8302#[doc = " @ref BLE_L2CAP_EVT_CH_SETUP event."]
8303#[doc = " @retval ::NRF_ERROR_RESOURCES Too many SDUs queued for transmission. Wait for a"]
8304#[doc = " @ref BLE_L2CAP_EVT_CH_TX event and retry."]
8305#[inline(always)]
8306pub unsafe fn sd_ble_l2cap_ch_tx(conn_handle: u16, local_cid: u16, p_sdu_buf: *const ble_data_t) -> u32 {
8307 let ret: u32;
8308 core::arch::asm!("svc 187",
8309 inout("r0") to_asm(conn_handle) => ret,
8310 inout("r1") to_asm(local_cid) => _,
8311 inout("r2") to_asm(p_sdu_buf) => _,
8312 lateout("r3") _,
8313 lateout("r12") _,
8314 );
8315 ret
8316}
8317
8318#[doc = "@brief Advanced SDU reception flow control."]
8319#[doc = ""]
8320#[doc = " @details Adjust the way the SoftDevice issues credits to the peer."]
8321#[doc = " This may issue additional credits to the peer using an LE Flow Control Credit packet."]
8322#[doc = ""]
8323#[doc = " @mscs"]
8324#[doc = " @mmsc{@ref BLE_L2CAP_CH_FLOW_CONTROL_MSC}"]
8325#[doc = " @endmscs"]
8326#[doc = ""]
8327#[doc = " @param[in] conn_handle Connection Handle."]
8328#[doc = " @param[in] local_cid Local Channel ID of the L2CAP channel or @ref BLE_L2CAP_CID_INVALID to set"]
8329#[doc = " the value that will be used for newly created channels."]
8330#[doc = " @param[in] credits Number of credits that the SoftDevice will make sure the peer has every"]
8331#[doc = " time it starts using a new reception buffer."]
8332#[doc = " - @ref BLE_L2CAP_CREDITS_DEFAULT is the default value the SoftDevice will"]
8333#[doc = " use if this function is not called."]
8334#[doc = " - If set to zero, the SoftDevice will stop issuing credits for new reception"]
8335#[doc = " buffers the application provides or has provided. SDU reception that is"]
8336#[doc = " currently ongoing will be allowed to complete."]
8337#[doc = " @param[out] p_credits NULL or pointer to a uint16_t. If a valid pointer is provided, it will be"]
8338#[doc = " written by the SoftDevice with the number of credits that is or will be"]
8339#[doc = " available to the peer. If the value written by the SoftDevice is 0 when"]
8340#[doc = " credits parameter was set to 0, the peer will not be able to send more"]
8341#[doc = " data until more credits are provided by calling this function again with"]
8342#[doc = " credits > 0. This parameter is ignored when local_cid is set to"]
8343#[doc = " @ref BLE_L2CAP_CID_INVALID."]
8344#[doc = ""]
8345#[doc = " @note Application should take care when setting number of credits higher than default value. In"]
8346#[doc = " this case the application must make sure that the SoftDevice always has reception buffers"]
8347#[doc = " available (see @ref sd_ble_l2cap_ch_rx) for that channel. If the SoftDevice does not have"]
8348#[doc = " such buffers available, packets may be NACKed on the Link Layer and all Bluetooth traffic"]
8349#[doc = " on the connection handle may be stalled until the SoftDevice again has an available"]
8350#[doc = " reception buffer. This applies even if the application has used this call to set the"]
8351#[doc = " credits back to default, or zero."]
8352#[doc = ""]
8353#[doc = " @retval ::NRF_SUCCESS Flow control parameters accepted."]
8354#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
8355#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
8356#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (Setup or release is"]
8357#[doc = " in progress for an L2CAP channel)."]
8358#[doc = " @retval ::NRF_ERROR_NOT_FOUND CID not found."]
8359#[inline(always)]
8360pub unsafe fn sd_ble_l2cap_ch_flow_control(conn_handle: u16, local_cid: u16, credits: u16, p_credits: *mut u16) -> u32 {
8361 let ret: u32;
8362 core::arch::asm!("svc 188",
8363 inout("r0") to_asm(conn_handle) => ret,
8364 inout("r1") to_asm(local_cid) => _,
8365 inout("r2") to_asm(credits) => _,
8366 inout("r3") to_asm(p_credits) => _,
8367 lateout("r12") _,
8368 );
8369 ret
8370}
8371
8372#[doc = " @brief BLE GATT connection configuration parameters, set with @ref sd_ble_cfg_set."]
8373#[doc = ""]
8374#[doc = " @retval ::NRF_ERROR_INVALID_PARAM att_mtu is smaller than @ref BLE_GATT_ATT_MTU_DEFAULT."]
8375#[repr(C)]
8376#[derive(Debug, Copy, Clone)]
8377pub struct ble_gatt_conn_cfg_t {
8378 #[doc = "< Maximum size of ATT packet the SoftDevice can send or receive."]
8379 #[doc = "The default and minimum value is @ref BLE_GATT_ATT_MTU_DEFAULT."]
8380 #[doc = "@mscs"]
8381 #[doc = "@mmsc{@ref BLE_GATTC_MTU_EXCHANGE}"]
8382 #[doc = "@mmsc{@ref BLE_GATTS_MTU_EXCHANGE}"]
8383 #[doc = "@endmscs"]
8384 pub att_mtu: u16,
8385}
8386#[test]
8387fn bindgen_test_layout_ble_gatt_conn_cfg_t() {
8388 assert_eq!(
8389 ::core::mem::size_of::<ble_gatt_conn_cfg_t>(),
8390 2usize,
8391 concat!("Size of: ", stringify!(ble_gatt_conn_cfg_t))
8392 );
8393 assert_eq!(
8394 ::core::mem::align_of::<ble_gatt_conn_cfg_t>(),
8395 2usize,
8396 concat!("Alignment of ", stringify!(ble_gatt_conn_cfg_t))
8397 );
8398 assert_eq!(
8399 unsafe { &(*(::core::ptr::null::<ble_gatt_conn_cfg_t>())).att_mtu as *const _ as usize },
8400 0usize,
8401 concat!(
8402 "Offset of field: ",
8403 stringify!(ble_gatt_conn_cfg_t),
8404 "::",
8405 stringify!(att_mtu)
8406 )
8407 );
8408}
8409#[doc = "@brief GATT Characteristic Properties."]
8410#[repr(C, packed)]
8411#[derive(Debug, Copy, Clone)]
8412pub struct ble_gatt_char_props_t {
8413 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
8414}
8415#[test]
8416fn bindgen_test_layout_ble_gatt_char_props_t() {
8417 assert_eq!(
8418 ::core::mem::size_of::<ble_gatt_char_props_t>(),
8419 1usize,
8420 concat!("Size of: ", stringify!(ble_gatt_char_props_t))
8421 );
8422 assert_eq!(
8423 ::core::mem::align_of::<ble_gatt_char_props_t>(),
8424 1usize,
8425 concat!("Alignment of ", stringify!(ble_gatt_char_props_t))
8426 );
8427}
8428impl ble_gatt_char_props_t {
8429 #[inline]
8430 pub fn broadcast(&self) -> u8 {
8431 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
8432 }
8433 #[inline]
8434 pub fn set_broadcast(&mut self, val: u8) {
8435 unsafe {
8436 let val: u8 = ::core::mem::transmute(val);
8437 self._bitfield_1.set(0usize, 1u8, val as u64)
8438 }
8439 }
8440 #[inline]
8441 pub fn read(&self) -> u8 {
8442 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
8443 }
8444 #[inline]
8445 pub fn set_read(&mut self, val: u8) {
8446 unsafe {
8447 let val: u8 = ::core::mem::transmute(val);
8448 self._bitfield_1.set(1usize, 1u8, val as u64)
8449 }
8450 }
8451 #[inline]
8452 pub fn write_wo_resp(&self) -> u8 {
8453 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
8454 }
8455 #[inline]
8456 pub fn set_write_wo_resp(&mut self, val: u8) {
8457 unsafe {
8458 let val: u8 = ::core::mem::transmute(val);
8459 self._bitfield_1.set(2usize, 1u8, val as u64)
8460 }
8461 }
8462 #[inline]
8463 pub fn write(&self) -> u8 {
8464 unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
8465 }
8466 #[inline]
8467 pub fn set_write(&mut self, val: u8) {
8468 unsafe {
8469 let val: u8 = ::core::mem::transmute(val);
8470 self._bitfield_1.set(3usize, 1u8, val as u64)
8471 }
8472 }
8473 #[inline]
8474 pub fn notify(&self) -> u8 {
8475 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u8) }
8476 }
8477 #[inline]
8478 pub fn set_notify(&mut self, val: u8) {
8479 unsafe {
8480 let val: u8 = ::core::mem::transmute(val);
8481 self._bitfield_1.set(4usize, 1u8, val as u64)
8482 }
8483 }
8484 #[inline]
8485 pub fn indicate(&self) -> u8 {
8486 unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u8) }
8487 }
8488 #[inline]
8489 pub fn set_indicate(&mut self, val: u8) {
8490 unsafe {
8491 let val: u8 = ::core::mem::transmute(val);
8492 self._bitfield_1.set(5usize, 1u8, val as u64)
8493 }
8494 }
8495 #[inline]
8496 pub fn auth_signed_wr(&self) -> u8 {
8497 unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u8) }
8498 }
8499 #[inline]
8500 pub fn set_auth_signed_wr(&mut self, val: u8) {
8501 unsafe {
8502 let val: u8 = ::core::mem::transmute(val);
8503 self._bitfield_1.set(6usize, 1u8, val as u64)
8504 }
8505 }
8506 #[inline]
8507 pub fn new_bitfield_1(
8508 broadcast: u8,
8509 read: u8,
8510 write_wo_resp: u8,
8511 write: u8,
8512 notify: u8,
8513 indicate: u8,
8514 auth_signed_wr: u8,
8515 ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
8516 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
8517 __bindgen_bitfield_unit.set(0usize, 1u8, {
8518 let broadcast: u8 = unsafe { ::core::mem::transmute(broadcast) };
8519 broadcast as u64
8520 });
8521 __bindgen_bitfield_unit.set(1usize, 1u8, {
8522 let read: u8 = unsafe { ::core::mem::transmute(read) };
8523 read as u64
8524 });
8525 __bindgen_bitfield_unit.set(2usize, 1u8, {
8526 let write_wo_resp: u8 = unsafe { ::core::mem::transmute(write_wo_resp) };
8527 write_wo_resp as u64
8528 });
8529 __bindgen_bitfield_unit.set(3usize, 1u8, {
8530 let write: u8 = unsafe { ::core::mem::transmute(write) };
8531 write as u64
8532 });
8533 __bindgen_bitfield_unit.set(4usize, 1u8, {
8534 let notify: u8 = unsafe { ::core::mem::transmute(notify) };
8535 notify as u64
8536 });
8537 __bindgen_bitfield_unit.set(5usize, 1u8, {
8538 let indicate: u8 = unsafe { ::core::mem::transmute(indicate) };
8539 indicate as u64
8540 });
8541 __bindgen_bitfield_unit.set(6usize, 1u8, {
8542 let auth_signed_wr: u8 = unsafe { ::core::mem::transmute(auth_signed_wr) };
8543 auth_signed_wr as u64
8544 });
8545 __bindgen_bitfield_unit
8546 }
8547}
8548#[doc = "@brief GATT Characteristic Extended Properties."]
8549#[repr(C, packed)]
8550#[derive(Debug, Copy, Clone)]
8551pub struct ble_gatt_char_ext_props_t {
8552 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
8553}
8554#[test]
8555fn bindgen_test_layout_ble_gatt_char_ext_props_t() {
8556 assert_eq!(
8557 ::core::mem::size_of::<ble_gatt_char_ext_props_t>(),
8558 1usize,
8559 concat!("Size of: ", stringify!(ble_gatt_char_ext_props_t))
8560 );
8561 assert_eq!(
8562 ::core::mem::align_of::<ble_gatt_char_ext_props_t>(),
8563 1usize,
8564 concat!("Alignment of ", stringify!(ble_gatt_char_ext_props_t))
8565 );
8566}
8567impl ble_gatt_char_ext_props_t {
8568 #[inline]
8569 pub fn reliable_wr(&self) -> u8 {
8570 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
8571 }
8572 #[inline]
8573 pub fn set_reliable_wr(&mut self, val: u8) {
8574 unsafe {
8575 let val: u8 = ::core::mem::transmute(val);
8576 self._bitfield_1.set(0usize, 1u8, val as u64)
8577 }
8578 }
8579 #[inline]
8580 pub fn wr_aux(&self) -> u8 {
8581 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
8582 }
8583 #[inline]
8584 pub fn set_wr_aux(&mut self, val: u8) {
8585 unsafe {
8586 let val: u8 = ::core::mem::transmute(val);
8587 self._bitfield_1.set(1usize, 1u8, val as u64)
8588 }
8589 }
8590 #[inline]
8591 pub fn new_bitfield_1(reliable_wr: u8, wr_aux: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
8592 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
8593 __bindgen_bitfield_unit.set(0usize, 1u8, {
8594 let reliable_wr: u8 = unsafe { ::core::mem::transmute(reliable_wr) };
8595 reliable_wr as u64
8596 });
8597 __bindgen_bitfield_unit.set(1usize, 1u8, {
8598 let wr_aux: u8 = unsafe { ::core::mem::transmute(wr_aux) };
8599 wr_aux as u64
8600 });
8601 __bindgen_bitfield_unit
8602 }
8603}
8604#[doc = "< Primary Service Discovery."]
8605pub const BLE_GATTC_SVCS_SD_BLE_GATTC_PRIMARY_SERVICES_DISCOVER: BLE_GATTC_SVCS = 155;
8606#[doc = "< Relationship Discovery."]
8607pub const BLE_GATTC_SVCS_SD_BLE_GATTC_RELATIONSHIPS_DISCOVER: BLE_GATTC_SVCS = 156;
8608#[doc = "< Characteristic Discovery."]
8609pub const BLE_GATTC_SVCS_SD_BLE_GATTC_CHARACTERISTICS_DISCOVER: BLE_GATTC_SVCS = 157;
8610#[doc = "< Characteristic Descriptor Discovery."]
8611pub const BLE_GATTC_SVCS_SD_BLE_GATTC_DESCRIPTORS_DISCOVER: BLE_GATTC_SVCS = 158;
8612#[doc = "< Attribute Information Discovery."]
8613pub const BLE_GATTC_SVCS_SD_BLE_GATTC_ATTR_INFO_DISCOVER: BLE_GATTC_SVCS = 159;
8614#[doc = "< Read Characteristic Value by UUID."]
8615pub const BLE_GATTC_SVCS_SD_BLE_GATTC_CHAR_VALUE_BY_UUID_READ: BLE_GATTC_SVCS = 160;
8616#[doc = "< Generic read."]
8617pub const BLE_GATTC_SVCS_SD_BLE_GATTC_READ: BLE_GATTC_SVCS = 161;
8618#[doc = "< Read multiple Characteristic Values."]
8619pub const BLE_GATTC_SVCS_SD_BLE_GATTC_CHAR_VALUES_READ: BLE_GATTC_SVCS = 162;
8620#[doc = "< Generic write."]
8621pub const BLE_GATTC_SVCS_SD_BLE_GATTC_WRITE: BLE_GATTC_SVCS = 163;
8622#[doc = "< Handle Value Confirmation."]
8623pub const BLE_GATTC_SVCS_SD_BLE_GATTC_HV_CONFIRM: BLE_GATTC_SVCS = 164;
8624#[doc = "< Exchange MTU Request."]
8625pub const BLE_GATTC_SVCS_SD_BLE_GATTC_EXCHANGE_MTU_REQUEST: BLE_GATTC_SVCS = 165;
8626#[doc = "@brief GATTC API SVC numbers."]
8627pub type BLE_GATTC_SVCS = self::c_uint;
8628#[doc = "< Primary Service Discovery Response event. \\n See @ref ble_gattc_evt_prim_srvc_disc_rsp_t."]
8629pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP: BLE_GATTC_EVTS = 48;
8630#[doc = "< Relationship Discovery Response event. \\n See @ref ble_gattc_evt_rel_disc_rsp_t."]
8631pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_REL_DISC_RSP: BLE_GATTC_EVTS = 49;
8632#[doc = "< Characteristic Discovery Response event. \\n See @ref ble_gattc_evt_char_disc_rsp_t."]
8633pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_CHAR_DISC_RSP: BLE_GATTC_EVTS = 50;
8634#[doc = "< Descriptor Discovery Response event. \\n See @ref ble_gattc_evt_desc_disc_rsp_t."]
8635pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_DESC_DISC_RSP: BLE_GATTC_EVTS = 51;
8636#[doc = "< Attribute Information Response event. \\n See @ref ble_gattc_evt_attr_info_disc_rsp_t."]
8637pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_ATTR_INFO_DISC_RSP: BLE_GATTC_EVTS = 52;
8638#[doc = "< Read By UUID Response event. \\n See @ref ble_gattc_evt_char_val_by_uuid_read_rsp_t."]
8639pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP: BLE_GATTC_EVTS = 53;
8640#[doc = "< Read Response event. \\n See @ref ble_gattc_evt_read_rsp_t."]
8641pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_READ_RSP: BLE_GATTC_EVTS = 54;
8642#[doc = "< Read multiple Response event. \\n See @ref ble_gattc_evt_char_vals_read_rsp_t."]
8643pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_CHAR_VALS_READ_RSP: BLE_GATTC_EVTS = 55;
8644#[doc = "< Write Response event. \\n See @ref ble_gattc_evt_write_rsp_t."]
8645pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_WRITE_RSP: BLE_GATTC_EVTS = 56;
8646#[doc = "< Handle Value Notification or Indication event. \\n Confirm indication with @ref sd_ble_gattc_hv_confirm. \\n See @ref ble_gattc_evt_hvx_t."]
8647pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_HVX: BLE_GATTC_EVTS = 57;
8648#[doc = "< Exchange MTU Response event. \\n See @ref ble_gattc_evt_exchange_mtu_rsp_t."]
8649pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_EXCHANGE_MTU_RSP: BLE_GATTC_EVTS = 58;
8650#[doc = "< Timeout event. \\n See @ref ble_gattc_evt_timeout_t."]
8651pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_TIMEOUT: BLE_GATTC_EVTS = 59;
8652#[doc = "< Write without Response transmission complete. \\n See @ref ble_gattc_evt_write_cmd_tx_complete_t."]
8653pub const BLE_GATTC_EVTS_BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE: BLE_GATTC_EVTS = 60;
8654#[doc = " @brief GATT Client Event IDs."]
8655pub type BLE_GATTC_EVTS = self::c_uint;
8656#[doc = " @brief BLE GATTC connection configuration parameters, set with @ref sd_ble_cfg_set."]
8657#[repr(C)]
8658#[derive(Debug, Copy, Clone)]
8659pub struct ble_gattc_conn_cfg_t {
8660 #[doc = "< The guaranteed minimum number of Write without Response that can be queued for transmission."]
8661 #[doc = "The default value is @ref BLE_GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT"]
8662 pub write_cmd_tx_queue_size: u8,
8663}
8664#[test]
8665fn bindgen_test_layout_ble_gattc_conn_cfg_t() {
8666 assert_eq!(
8667 ::core::mem::size_of::<ble_gattc_conn_cfg_t>(),
8668 1usize,
8669 concat!("Size of: ", stringify!(ble_gattc_conn_cfg_t))
8670 );
8671 assert_eq!(
8672 ::core::mem::align_of::<ble_gattc_conn_cfg_t>(),
8673 1usize,
8674 concat!("Alignment of ", stringify!(ble_gattc_conn_cfg_t))
8675 );
8676 assert_eq!(
8677 unsafe { &(*(::core::ptr::null::<ble_gattc_conn_cfg_t>())).write_cmd_tx_queue_size as *const _ as usize },
8678 0usize,
8679 concat!(
8680 "Offset of field: ",
8681 stringify!(ble_gattc_conn_cfg_t),
8682 "::",
8683 stringify!(write_cmd_tx_queue_size)
8684 )
8685 );
8686}
8687#[doc = "@brief Operation Handle Range."]
8688#[repr(C)]
8689#[derive(Debug, Copy, Clone)]
8690pub struct ble_gattc_handle_range_t {
8691 #[doc = "< Start Handle."]
8692 pub start_handle: u16,
8693 #[doc = "< End Handle."]
8694 pub end_handle: u16,
8695}
8696#[test]
8697fn bindgen_test_layout_ble_gattc_handle_range_t() {
8698 assert_eq!(
8699 ::core::mem::size_of::<ble_gattc_handle_range_t>(),
8700 4usize,
8701 concat!("Size of: ", stringify!(ble_gattc_handle_range_t))
8702 );
8703 assert_eq!(
8704 ::core::mem::align_of::<ble_gattc_handle_range_t>(),
8705 2usize,
8706 concat!("Alignment of ", stringify!(ble_gattc_handle_range_t))
8707 );
8708 assert_eq!(
8709 unsafe { &(*(::core::ptr::null::<ble_gattc_handle_range_t>())).start_handle as *const _ as usize },
8710 0usize,
8711 concat!(
8712 "Offset of field: ",
8713 stringify!(ble_gattc_handle_range_t),
8714 "::",
8715 stringify!(start_handle)
8716 )
8717 );
8718 assert_eq!(
8719 unsafe { &(*(::core::ptr::null::<ble_gattc_handle_range_t>())).end_handle as *const _ as usize },
8720 2usize,
8721 concat!(
8722 "Offset of field: ",
8723 stringify!(ble_gattc_handle_range_t),
8724 "::",
8725 stringify!(end_handle)
8726 )
8727 );
8728}
8729#[doc = "@brief GATT service."]
8730#[repr(C)]
8731#[derive(Debug, Copy, Clone)]
8732pub struct ble_gattc_service_t {
8733 #[doc = "< Service UUID."]
8734 pub uuid: ble_uuid_t,
8735 #[doc = "< Service Handle Range."]
8736 pub handle_range: ble_gattc_handle_range_t,
8737}
8738#[test]
8739fn bindgen_test_layout_ble_gattc_service_t() {
8740 assert_eq!(
8741 ::core::mem::size_of::<ble_gattc_service_t>(),
8742 8usize,
8743 concat!("Size of: ", stringify!(ble_gattc_service_t))
8744 );
8745 assert_eq!(
8746 ::core::mem::align_of::<ble_gattc_service_t>(),
8747 2usize,
8748 concat!("Alignment of ", stringify!(ble_gattc_service_t))
8749 );
8750 assert_eq!(
8751 unsafe { &(*(::core::ptr::null::<ble_gattc_service_t>())).uuid as *const _ as usize },
8752 0usize,
8753 concat!(
8754 "Offset of field: ",
8755 stringify!(ble_gattc_service_t),
8756 "::",
8757 stringify!(uuid)
8758 )
8759 );
8760 assert_eq!(
8761 unsafe { &(*(::core::ptr::null::<ble_gattc_service_t>())).handle_range as *const _ as usize },
8762 4usize,
8763 concat!(
8764 "Offset of field: ",
8765 stringify!(ble_gattc_service_t),
8766 "::",
8767 stringify!(handle_range)
8768 )
8769 );
8770}
8771#[doc = "@brief GATT include."]
8772#[repr(C)]
8773#[derive(Debug, Copy, Clone)]
8774pub struct ble_gattc_include_t {
8775 #[doc = "< Include Handle."]
8776 pub handle: u16,
8777 #[doc = "< Handle of the included service."]
8778 pub included_srvc: ble_gattc_service_t,
8779}
8780#[test]
8781fn bindgen_test_layout_ble_gattc_include_t() {
8782 assert_eq!(
8783 ::core::mem::size_of::<ble_gattc_include_t>(),
8784 10usize,
8785 concat!("Size of: ", stringify!(ble_gattc_include_t))
8786 );
8787 assert_eq!(
8788 ::core::mem::align_of::<ble_gattc_include_t>(),
8789 2usize,
8790 concat!("Alignment of ", stringify!(ble_gattc_include_t))
8791 );
8792 assert_eq!(
8793 unsafe { &(*(::core::ptr::null::<ble_gattc_include_t>())).handle as *const _ as usize },
8794 0usize,
8795 concat!(
8796 "Offset of field: ",
8797 stringify!(ble_gattc_include_t),
8798 "::",
8799 stringify!(handle)
8800 )
8801 );
8802 assert_eq!(
8803 unsafe { &(*(::core::ptr::null::<ble_gattc_include_t>())).included_srvc as *const _ as usize },
8804 2usize,
8805 concat!(
8806 "Offset of field: ",
8807 stringify!(ble_gattc_include_t),
8808 "::",
8809 stringify!(included_srvc)
8810 )
8811 );
8812}
8813#[doc = "@brief GATT characteristic."]
8814#[repr(C)]
8815#[derive(Debug, Copy, Clone)]
8816pub struct ble_gattc_char_t {
8817 #[doc = "< Characteristic UUID."]
8818 pub uuid: ble_uuid_t,
8819 #[doc = "< Characteristic Properties."]
8820 pub char_props: ble_gatt_char_props_t,
8821 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
8822 #[doc = "< Handle of the Characteristic Declaration."]
8823 pub handle_decl: u16,
8824 #[doc = "< Handle of the Characteristic Value."]
8825 pub handle_value: u16,
8826}
8827#[test]
8828fn bindgen_test_layout_ble_gattc_char_t() {
8829 assert_eq!(
8830 ::core::mem::size_of::<ble_gattc_char_t>(),
8831 10usize,
8832 concat!("Size of: ", stringify!(ble_gattc_char_t))
8833 );
8834 assert_eq!(
8835 ::core::mem::align_of::<ble_gattc_char_t>(),
8836 2usize,
8837 concat!("Alignment of ", stringify!(ble_gattc_char_t))
8838 );
8839 assert_eq!(
8840 unsafe { &(*(::core::ptr::null::<ble_gattc_char_t>())).uuid as *const _ as usize },
8841 0usize,
8842 concat!(
8843 "Offset of field: ",
8844 stringify!(ble_gattc_char_t),
8845 "::",
8846 stringify!(uuid)
8847 )
8848 );
8849 assert_eq!(
8850 unsafe { &(*(::core::ptr::null::<ble_gattc_char_t>())).char_props as *const _ as usize },
8851 4usize,
8852 concat!(
8853 "Offset of field: ",
8854 stringify!(ble_gattc_char_t),
8855 "::",
8856 stringify!(char_props)
8857 )
8858 );
8859 assert_eq!(
8860 unsafe { &(*(::core::ptr::null::<ble_gattc_char_t>())).handle_decl as *const _ as usize },
8861 6usize,
8862 concat!(
8863 "Offset of field: ",
8864 stringify!(ble_gattc_char_t),
8865 "::",
8866 stringify!(handle_decl)
8867 )
8868 );
8869 assert_eq!(
8870 unsafe { &(*(::core::ptr::null::<ble_gattc_char_t>())).handle_value as *const _ as usize },
8871 8usize,
8872 concat!(
8873 "Offset of field: ",
8874 stringify!(ble_gattc_char_t),
8875 "::",
8876 stringify!(handle_value)
8877 )
8878 );
8879}
8880impl ble_gattc_char_t {
8881 #[inline]
8882 pub fn char_ext_props(&self) -> u8 {
8883 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
8884 }
8885 #[inline]
8886 pub fn set_char_ext_props(&mut self, val: u8) {
8887 unsafe {
8888 let val: u8 = ::core::mem::transmute(val);
8889 self._bitfield_1.set(0usize, 1u8, val as u64)
8890 }
8891 }
8892 #[inline]
8893 pub fn new_bitfield_1(char_ext_props: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
8894 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
8895 __bindgen_bitfield_unit.set(0usize, 1u8, {
8896 let char_ext_props: u8 = unsafe { ::core::mem::transmute(char_ext_props) };
8897 char_ext_props as u64
8898 });
8899 __bindgen_bitfield_unit
8900 }
8901}
8902#[doc = "@brief GATT descriptor."]
8903#[repr(C)]
8904#[derive(Debug, Copy, Clone)]
8905pub struct ble_gattc_desc_t {
8906 #[doc = "< Descriptor Handle."]
8907 pub handle: u16,
8908 #[doc = "< Descriptor UUID."]
8909 pub uuid: ble_uuid_t,
8910}
8911#[test]
8912fn bindgen_test_layout_ble_gattc_desc_t() {
8913 assert_eq!(
8914 ::core::mem::size_of::<ble_gattc_desc_t>(),
8915 6usize,
8916 concat!("Size of: ", stringify!(ble_gattc_desc_t))
8917 );
8918 assert_eq!(
8919 ::core::mem::align_of::<ble_gattc_desc_t>(),
8920 2usize,
8921 concat!("Alignment of ", stringify!(ble_gattc_desc_t))
8922 );
8923 assert_eq!(
8924 unsafe { &(*(::core::ptr::null::<ble_gattc_desc_t>())).handle as *const _ as usize },
8925 0usize,
8926 concat!(
8927 "Offset of field: ",
8928 stringify!(ble_gattc_desc_t),
8929 "::",
8930 stringify!(handle)
8931 )
8932 );
8933 assert_eq!(
8934 unsafe { &(*(::core::ptr::null::<ble_gattc_desc_t>())).uuid as *const _ as usize },
8935 2usize,
8936 concat!(
8937 "Offset of field: ",
8938 stringify!(ble_gattc_desc_t),
8939 "::",
8940 stringify!(uuid)
8941 )
8942 );
8943}
8944#[doc = "@brief Write Parameters."]
8945#[repr(C)]
8946#[derive(Debug, Copy, Clone)]
8947pub struct ble_gattc_write_params_t {
8948 #[doc = "< Write Operation to be performed, see @ref BLE_GATT_WRITE_OPS."]
8949 pub write_op: u8,
8950 #[doc = "< Flags, see @ref BLE_GATT_EXEC_WRITE_FLAGS."]
8951 pub flags: u8,
8952 #[doc = "< Handle to the attribute to be written."]
8953 pub handle: u16,
8954 #[doc = "< Offset in bytes. @note For WRITE_CMD and WRITE_REQ, offset must be 0."]
8955 pub offset: u16,
8956 #[doc = "< Length of data in bytes."]
8957 pub len: u16,
8958 #[doc = "< Pointer to the value data."]
8959 pub p_value: *const u8,
8960}
8961#[test]
8962fn bindgen_test_layout_ble_gattc_write_params_t() {
8963 assert_eq!(
8964 ::core::mem::size_of::<ble_gattc_write_params_t>(),
8965 12usize,
8966 concat!("Size of: ", stringify!(ble_gattc_write_params_t))
8967 );
8968 assert_eq!(
8969 ::core::mem::align_of::<ble_gattc_write_params_t>(),
8970 4usize,
8971 concat!("Alignment of ", stringify!(ble_gattc_write_params_t))
8972 );
8973 assert_eq!(
8974 unsafe { &(*(::core::ptr::null::<ble_gattc_write_params_t>())).write_op as *const _ as usize },
8975 0usize,
8976 concat!(
8977 "Offset of field: ",
8978 stringify!(ble_gattc_write_params_t),
8979 "::",
8980 stringify!(write_op)
8981 )
8982 );
8983 assert_eq!(
8984 unsafe { &(*(::core::ptr::null::<ble_gattc_write_params_t>())).flags as *const _ as usize },
8985 1usize,
8986 concat!(
8987 "Offset of field: ",
8988 stringify!(ble_gattc_write_params_t),
8989 "::",
8990 stringify!(flags)
8991 )
8992 );
8993 assert_eq!(
8994 unsafe { &(*(::core::ptr::null::<ble_gattc_write_params_t>())).handle as *const _ as usize },
8995 2usize,
8996 concat!(
8997 "Offset of field: ",
8998 stringify!(ble_gattc_write_params_t),
8999 "::",
9000 stringify!(handle)
9001 )
9002 );
9003 assert_eq!(
9004 unsafe { &(*(::core::ptr::null::<ble_gattc_write_params_t>())).offset as *const _ as usize },
9005 4usize,
9006 concat!(
9007 "Offset of field: ",
9008 stringify!(ble_gattc_write_params_t),
9009 "::",
9010 stringify!(offset)
9011 )
9012 );
9013 assert_eq!(
9014 unsafe { &(*(::core::ptr::null::<ble_gattc_write_params_t>())).len as *const _ as usize },
9015 6usize,
9016 concat!(
9017 "Offset of field: ",
9018 stringify!(ble_gattc_write_params_t),
9019 "::",
9020 stringify!(len)
9021 )
9022 );
9023 assert_eq!(
9024 unsafe { &(*(::core::ptr::null::<ble_gattc_write_params_t>())).p_value as *const _ as usize },
9025 8usize,
9026 concat!(
9027 "Offset of field: ",
9028 stringify!(ble_gattc_write_params_t),
9029 "::",
9030 stringify!(p_value)
9031 )
9032 );
9033}
9034#[doc = "@brief Attribute Information for 16-bit Attribute UUID."]
9035#[repr(C)]
9036#[derive(Debug, Copy, Clone)]
9037pub struct ble_gattc_attr_info16_t {
9038 #[doc = "< Attribute handle."]
9039 pub handle: u16,
9040 #[doc = "< 16-bit Attribute UUID."]
9041 pub uuid: ble_uuid_t,
9042}
9043#[test]
9044fn bindgen_test_layout_ble_gattc_attr_info16_t() {
9045 assert_eq!(
9046 ::core::mem::size_of::<ble_gattc_attr_info16_t>(),
9047 6usize,
9048 concat!("Size of: ", stringify!(ble_gattc_attr_info16_t))
9049 );
9050 assert_eq!(
9051 ::core::mem::align_of::<ble_gattc_attr_info16_t>(),
9052 2usize,
9053 concat!("Alignment of ", stringify!(ble_gattc_attr_info16_t))
9054 );
9055 assert_eq!(
9056 unsafe { &(*(::core::ptr::null::<ble_gattc_attr_info16_t>())).handle as *const _ as usize },
9057 0usize,
9058 concat!(
9059 "Offset of field: ",
9060 stringify!(ble_gattc_attr_info16_t),
9061 "::",
9062 stringify!(handle)
9063 )
9064 );
9065 assert_eq!(
9066 unsafe { &(*(::core::ptr::null::<ble_gattc_attr_info16_t>())).uuid as *const _ as usize },
9067 2usize,
9068 concat!(
9069 "Offset of field: ",
9070 stringify!(ble_gattc_attr_info16_t),
9071 "::",
9072 stringify!(uuid)
9073 )
9074 );
9075}
9076#[doc = "@brief Attribute Information for 128-bit Attribute UUID."]
9077#[repr(C)]
9078#[derive(Debug, Copy, Clone)]
9079pub struct ble_gattc_attr_info128_t {
9080 #[doc = "< Attribute handle."]
9081 pub handle: u16,
9082 #[doc = "< 128-bit Attribute UUID."]
9083 pub uuid: ble_uuid128_t,
9084}
9085#[test]
9086fn bindgen_test_layout_ble_gattc_attr_info128_t() {
9087 assert_eq!(
9088 ::core::mem::size_of::<ble_gattc_attr_info128_t>(),
9089 18usize,
9090 concat!("Size of: ", stringify!(ble_gattc_attr_info128_t))
9091 );
9092 assert_eq!(
9093 ::core::mem::align_of::<ble_gattc_attr_info128_t>(),
9094 2usize,
9095 concat!("Alignment of ", stringify!(ble_gattc_attr_info128_t))
9096 );
9097 assert_eq!(
9098 unsafe { &(*(::core::ptr::null::<ble_gattc_attr_info128_t>())).handle as *const _ as usize },
9099 0usize,
9100 concat!(
9101 "Offset of field: ",
9102 stringify!(ble_gattc_attr_info128_t),
9103 "::",
9104 stringify!(handle)
9105 )
9106 );
9107 assert_eq!(
9108 unsafe { &(*(::core::ptr::null::<ble_gattc_attr_info128_t>())).uuid as *const _ as usize },
9109 2usize,
9110 concat!(
9111 "Offset of field: ",
9112 stringify!(ble_gattc_attr_info128_t),
9113 "::",
9114 stringify!(uuid)
9115 )
9116 );
9117}
9118#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP."]
9119#[repr(C)]
9120#[derive(Debug)]
9121pub struct ble_gattc_evt_prim_srvc_disc_rsp_t {
9122 #[doc = "< Service count."]
9123 pub count: u16,
9124 #[doc = "< Service data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
9125 #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
9126 pub services: __IncompleteArrayField<ble_gattc_service_t>,
9127}
9128#[test]
9129fn bindgen_test_layout_ble_gattc_evt_prim_srvc_disc_rsp_t() {
9130 assert_eq!(
9131 ::core::mem::size_of::<ble_gattc_evt_prim_srvc_disc_rsp_t>(),
9132 2usize,
9133 concat!("Size of: ", stringify!(ble_gattc_evt_prim_srvc_disc_rsp_t))
9134 );
9135 assert_eq!(
9136 ::core::mem::align_of::<ble_gattc_evt_prim_srvc_disc_rsp_t>(),
9137 2usize,
9138 concat!("Alignment of ", stringify!(ble_gattc_evt_prim_srvc_disc_rsp_t))
9139 );
9140 assert_eq!(
9141 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_prim_srvc_disc_rsp_t>())).count as *const _ as usize },
9142 0usize,
9143 concat!(
9144 "Offset of field: ",
9145 stringify!(ble_gattc_evt_prim_srvc_disc_rsp_t),
9146 "::",
9147 stringify!(count)
9148 )
9149 );
9150 assert_eq!(
9151 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_prim_srvc_disc_rsp_t>())).services as *const _ as usize },
9152 2usize,
9153 concat!(
9154 "Offset of field: ",
9155 stringify!(ble_gattc_evt_prim_srvc_disc_rsp_t),
9156 "::",
9157 stringify!(services)
9158 )
9159 );
9160}
9161#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_REL_DISC_RSP."]
9162#[repr(C)]
9163#[derive(Debug)]
9164pub struct ble_gattc_evt_rel_disc_rsp_t {
9165 #[doc = "< Include count."]
9166 pub count: u16,
9167 #[doc = "< Include data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
9168 #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
9169 pub includes: __IncompleteArrayField<ble_gattc_include_t>,
9170}
9171#[test]
9172fn bindgen_test_layout_ble_gattc_evt_rel_disc_rsp_t() {
9173 assert_eq!(
9174 ::core::mem::size_of::<ble_gattc_evt_rel_disc_rsp_t>(),
9175 2usize,
9176 concat!("Size of: ", stringify!(ble_gattc_evt_rel_disc_rsp_t))
9177 );
9178 assert_eq!(
9179 ::core::mem::align_of::<ble_gattc_evt_rel_disc_rsp_t>(),
9180 2usize,
9181 concat!("Alignment of ", stringify!(ble_gattc_evt_rel_disc_rsp_t))
9182 );
9183 assert_eq!(
9184 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_rel_disc_rsp_t>())).count as *const _ as usize },
9185 0usize,
9186 concat!(
9187 "Offset of field: ",
9188 stringify!(ble_gattc_evt_rel_disc_rsp_t),
9189 "::",
9190 stringify!(count)
9191 )
9192 );
9193 assert_eq!(
9194 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_rel_disc_rsp_t>())).includes as *const _ as usize },
9195 2usize,
9196 concat!(
9197 "Offset of field: ",
9198 stringify!(ble_gattc_evt_rel_disc_rsp_t),
9199 "::",
9200 stringify!(includes)
9201 )
9202 );
9203}
9204#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_CHAR_DISC_RSP."]
9205#[repr(C)]
9206#[derive(Debug)]
9207pub struct ble_gattc_evt_char_disc_rsp_t {
9208 #[doc = "< Characteristic count."]
9209 pub count: u16,
9210 #[doc = "< Characteristic data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
9211 #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
9212 pub chars: __IncompleteArrayField<ble_gattc_char_t>,
9213}
9214#[test]
9215fn bindgen_test_layout_ble_gattc_evt_char_disc_rsp_t() {
9216 assert_eq!(
9217 ::core::mem::size_of::<ble_gattc_evt_char_disc_rsp_t>(),
9218 2usize,
9219 concat!("Size of: ", stringify!(ble_gattc_evt_char_disc_rsp_t))
9220 );
9221 assert_eq!(
9222 ::core::mem::align_of::<ble_gattc_evt_char_disc_rsp_t>(),
9223 2usize,
9224 concat!("Alignment of ", stringify!(ble_gattc_evt_char_disc_rsp_t))
9225 );
9226 assert_eq!(
9227 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_char_disc_rsp_t>())).count as *const _ as usize },
9228 0usize,
9229 concat!(
9230 "Offset of field: ",
9231 stringify!(ble_gattc_evt_char_disc_rsp_t),
9232 "::",
9233 stringify!(count)
9234 )
9235 );
9236 assert_eq!(
9237 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_char_disc_rsp_t>())).chars as *const _ as usize },
9238 2usize,
9239 concat!(
9240 "Offset of field: ",
9241 stringify!(ble_gattc_evt_char_disc_rsp_t),
9242 "::",
9243 stringify!(chars)
9244 )
9245 );
9246}
9247#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_DESC_DISC_RSP."]
9248#[repr(C)]
9249#[derive(Debug)]
9250pub struct ble_gattc_evt_desc_disc_rsp_t {
9251 #[doc = "< Descriptor count."]
9252 pub count: u16,
9253 #[doc = "< Descriptor data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
9254 #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
9255 pub descs: __IncompleteArrayField<ble_gattc_desc_t>,
9256}
9257#[test]
9258fn bindgen_test_layout_ble_gattc_evt_desc_disc_rsp_t() {
9259 assert_eq!(
9260 ::core::mem::size_of::<ble_gattc_evt_desc_disc_rsp_t>(),
9261 2usize,
9262 concat!("Size of: ", stringify!(ble_gattc_evt_desc_disc_rsp_t))
9263 );
9264 assert_eq!(
9265 ::core::mem::align_of::<ble_gattc_evt_desc_disc_rsp_t>(),
9266 2usize,
9267 concat!("Alignment of ", stringify!(ble_gattc_evt_desc_disc_rsp_t))
9268 );
9269 assert_eq!(
9270 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_desc_disc_rsp_t>())).count as *const _ as usize },
9271 0usize,
9272 concat!(
9273 "Offset of field: ",
9274 stringify!(ble_gattc_evt_desc_disc_rsp_t),
9275 "::",
9276 stringify!(count)
9277 )
9278 );
9279 assert_eq!(
9280 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_desc_disc_rsp_t>())).descs as *const _ as usize },
9281 2usize,
9282 concat!(
9283 "Offset of field: ",
9284 stringify!(ble_gattc_evt_desc_disc_rsp_t),
9285 "::",
9286 stringify!(descs)
9287 )
9288 );
9289}
9290#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_ATTR_INFO_DISC_RSP."]
9291#[repr(C)]
9292pub struct ble_gattc_evt_attr_info_disc_rsp_t {
9293 #[doc = "< Attribute count."]
9294 pub count: u16,
9295 #[doc = "< Attribute information format, see @ref BLE_GATTC_ATTR_INFO_FORMAT."]
9296 pub format: u8,
9297 #[doc = "< Attribute information union."]
9298 pub info: ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1,
9299}
9300#[repr(C)]
9301pub struct ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1 {
9302 #[doc = "< Attribute information for 16-bit Attribute UUID."]
9303 #[doc = "@note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
9304 #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
9305 pub attr_info16: __BindgenUnionField<[ble_gattc_attr_info16_t; 0usize]>,
9306 #[doc = "< Attribute information for 128-bit Attribute UUID."]
9307 #[doc = "@note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
9308 #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
9309 pub attr_info128: __BindgenUnionField<[ble_gattc_attr_info128_t; 0usize]>,
9310 pub bindgen_union_field: [u16; 0usize],
9311}
9312#[test]
9313fn bindgen_test_layout_ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1() {
9314 assert_eq!(
9315 ::core::mem::size_of::<ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1>(),
9316 0usize,
9317 concat!(
9318 "Size of: ",
9319 stringify!(ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1)
9320 )
9321 );
9322 assert_eq!(
9323 ::core::mem::align_of::<ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1>(),
9324 2usize,
9325 concat!(
9326 "Alignment of ",
9327 stringify!(ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1)
9328 )
9329 );
9330 assert_eq!(
9331 unsafe {
9332 &(*(::core::ptr::null::<ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1>())).attr_info16 as *const _
9333 as usize
9334 },
9335 0usize,
9336 concat!(
9337 "Offset of field: ",
9338 stringify!(ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1),
9339 "::",
9340 stringify!(attr_info16)
9341 )
9342 );
9343 assert_eq!(
9344 unsafe {
9345 &(*(::core::ptr::null::<ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1>())).attr_info128 as *const _
9346 as usize
9347 },
9348 0usize,
9349 concat!(
9350 "Offset of field: ",
9351 stringify!(ble_gattc_evt_attr_info_disc_rsp_t__bindgen_ty_1),
9352 "::",
9353 stringify!(attr_info128)
9354 )
9355 );
9356}
9357#[test]
9358fn bindgen_test_layout_ble_gattc_evt_attr_info_disc_rsp_t() {
9359 assert_eq!(
9360 ::core::mem::size_of::<ble_gattc_evt_attr_info_disc_rsp_t>(),
9361 4usize,
9362 concat!("Size of: ", stringify!(ble_gattc_evt_attr_info_disc_rsp_t))
9363 );
9364 assert_eq!(
9365 ::core::mem::align_of::<ble_gattc_evt_attr_info_disc_rsp_t>(),
9366 2usize,
9367 concat!("Alignment of ", stringify!(ble_gattc_evt_attr_info_disc_rsp_t))
9368 );
9369 assert_eq!(
9370 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_attr_info_disc_rsp_t>())).count as *const _ as usize },
9371 0usize,
9372 concat!(
9373 "Offset of field: ",
9374 stringify!(ble_gattc_evt_attr_info_disc_rsp_t),
9375 "::",
9376 stringify!(count)
9377 )
9378 );
9379 assert_eq!(
9380 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_attr_info_disc_rsp_t>())).format as *const _ as usize },
9381 2usize,
9382 concat!(
9383 "Offset of field: ",
9384 stringify!(ble_gattc_evt_attr_info_disc_rsp_t),
9385 "::",
9386 stringify!(format)
9387 )
9388 );
9389 assert_eq!(
9390 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_attr_info_disc_rsp_t>())).info as *const _ as usize },
9391 4usize,
9392 concat!(
9393 "Offset of field: ",
9394 stringify!(ble_gattc_evt_attr_info_disc_rsp_t),
9395 "::",
9396 stringify!(info)
9397 )
9398 );
9399}
9400#[doc = "@brief GATT read by UUID handle value pair."]
9401#[repr(C)]
9402#[derive(Debug, Copy, Clone)]
9403pub struct ble_gattc_handle_value_t {
9404 #[doc = "< Attribute Handle."]
9405 pub handle: u16,
9406 #[doc = "< Pointer to the Attribute Value, length is available in @ref ble_gattc_evt_char_val_by_uuid_read_rsp_t::value_len."]
9407 pub p_value: *mut u8,
9408}
9409#[test]
9410fn bindgen_test_layout_ble_gattc_handle_value_t() {
9411 assert_eq!(
9412 ::core::mem::size_of::<ble_gattc_handle_value_t>(),
9413 8usize,
9414 concat!("Size of: ", stringify!(ble_gattc_handle_value_t))
9415 );
9416 assert_eq!(
9417 ::core::mem::align_of::<ble_gattc_handle_value_t>(),
9418 4usize,
9419 concat!("Alignment of ", stringify!(ble_gattc_handle_value_t))
9420 );
9421 assert_eq!(
9422 unsafe { &(*(::core::ptr::null::<ble_gattc_handle_value_t>())).handle as *const _ as usize },
9423 0usize,
9424 concat!(
9425 "Offset of field: ",
9426 stringify!(ble_gattc_handle_value_t),
9427 "::",
9428 stringify!(handle)
9429 )
9430 );
9431 assert_eq!(
9432 unsafe { &(*(::core::ptr::null::<ble_gattc_handle_value_t>())).p_value as *const _ as usize },
9433 4usize,
9434 concat!(
9435 "Offset of field: ",
9436 stringify!(ble_gattc_handle_value_t),
9437 "::",
9438 stringify!(p_value)
9439 )
9440 );
9441}
9442#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP."]
9443#[repr(C)]
9444#[derive(Debug)]
9445pub struct ble_gattc_evt_char_val_by_uuid_read_rsp_t {
9446 #[doc = "< Handle-Value Pair Count."]
9447 pub count: u16,
9448 #[doc = "< Length of the value in Handle-Value(s) list."]
9449 pub value_len: u16,
9450 #[doc = "< Handle-Value(s) list. To iterate through the list use @ref sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter."]
9451 #[doc = "@note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
9452 #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
9453 pub handle_value: __IncompleteArrayField<u8>,
9454}
9455#[test]
9456fn bindgen_test_layout_ble_gattc_evt_char_val_by_uuid_read_rsp_t() {
9457 assert_eq!(
9458 ::core::mem::size_of::<ble_gattc_evt_char_val_by_uuid_read_rsp_t>(),
9459 4usize,
9460 concat!("Size of: ", stringify!(ble_gattc_evt_char_val_by_uuid_read_rsp_t))
9461 );
9462 assert_eq!(
9463 ::core::mem::align_of::<ble_gattc_evt_char_val_by_uuid_read_rsp_t>(),
9464 2usize,
9465 concat!("Alignment of ", stringify!(ble_gattc_evt_char_val_by_uuid_read_rsp_t))
9466 );
9467 assert_eq!(
9468 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_char_val_by_uuid_read_rsp_t>())).count as *const _ as usize },
9469 0usize,
9470 concat!(
9471 "Offset of field: ",
9472 stringify!(ble_gattc_evt_char_val_by_uuid_read_rsp_t),
9473 "::",
9474 stringify!(count)
9475 )
9476 );
9477 assert_eq!(
9478 unsafe {
9479 &(*(::core::ptr::null::<ble_gattc_evt_char_val_by_uuid_read_rsp_t>())).value_len as *const _ as usize
9480 },
9481 2usize,
9482 concat!(
9483 "Offset of field: ",
9484 stringify!(ble_gattc_evt_char_val_by_uuid_read_rsp_t),
9485 "::",
9486 stringify!(value_len)
9487 )
9488 );
9489 assert_eq!(
9490 unsafe {
9491 &(*(::core::ptr::null::<ble_gattc_evt_char_val_by_uuid_read_rsp_t>())).handle_value as *const _ as usize
9492 },
9493 4usize,
9494 concat!(
9495 "Offset of field: ",
9496 stringify!(ble_gattc_evt_char_val_by_uuid_read_rsp_t),
9497 "::",
9498 stringify!(handle_value)
9499 )
9500 );
9501}
9502#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_READ_RSP."]
9503#[repr(C)]
9504#[derive(Debug)]
9505pub struct ble_gattc_evt_read_rsp_t {
9506 #[doc = "< Attribute Handle."]
9507 pub handle: u16,
9508 #[doc = "< Offset of the attribute data."]
9509 pub offset: u16,
9510 #[doc = "< Attribute data length."]
9511 pub len: u16,
9512 #[doc = "< Attribute data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
9513 #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
9514 pub data: __IncompleteArrayField<u8>,
9515}
9516#[test]
9517fn bindgen_test_layout_ble_gattc_evt_read_rsp_t() {
9518 assert_eq!(
9519 ::core::mem::size_of::<ble_gattc_evt_read_rsp_t>(),
9520 6usize,
9521 concat!("Size of: ", stringify!(ble_gattc_evt_read_rsp_t))
9522 );
9523 assert_eq!(
9524 ::core::mem::align_of::<ble_gattc_evt_read_rsp_t>(),
9525 2usize,
9526 concat!("Alignment of ", stringify!(ble_gattc_evt_read_rsp_t))
9527 );
9528 assert_eq!(
9529 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_read_rsp_t>())).handle as *const _ as usize },
9530 0usize,
9531 concat!(
9532 "Offset of field: ",
9533 stringify!(ble_gattc_evt_read_rsp_t),
9534 "::",
9535 stringify!(handle)
9536 )
9537 );
9538 assert_eq!(
9539 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_read_rsp_t>())).offset as *const _ as usize },
9540 2usize,
9541 concat!(
9542 "Offset of field: ",
9543 stringify!(ble_gattc_evt_read_rsp_t),
9544 "::",
9545 stringify!(offset)
9546 )
9547 );
9548 assert_eq!(
9549 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_read_rsp_t>())).len as *const _ as usize },
9550 4usize,
9551 concat!(
9552 "Offset of field: ",
9553 stringify!(ble_gattc_evt_read_rsp_t),
9554 "::",
9555 stringify!(len)
9556 )
9557 );
9558 assert_eq!(
9559 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_read_rsp_t>())).data as *const _ as usize },
9560 6usize,
9561 concat!(
9562 "Offset of field: ",
9563 stringify!(ble_gattc_evt_read_rsp_t),
9564 "::",
9565 stringify!(data)
9566 )
9567 );
9568}
9569#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_CHAR_VALS_READ_RSP."]
9570#[repr(C)]
9571#[derive(Debug)]
9572pub struct ble_gattc_evt_char_vals_read_rsp_t {
9573 #[doc = "< Concatenated Attribute values length."]
9574 pub len: u16,
9575 #[doc = "< Attribute values. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
9576 #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
9577 pub values: __IncompleteArrayField<u8>,
9578}
9579#[test]
9580fn bindgen_test_layout_ble_gattc_evt_char_vals_read_rsp_t() {
9581 assert_eq!(
9582 ::core::mem::size_of::<ble_gattc_evt_char_vals_read_rsp_t>(),
9583 2usize,
9584 concat!("Size of: ", stringify!(ble_gattc_evt_char_vals_read_rsp_t))
9585 );
9586 assert_eq!(
9587 ::core::mem::align_of::<ble_gattc_evt_char_vals_read_rsp_t>(),
9588 2usize,
9589 concat!("Alignment of ", stringify!(ble_gattc_evt_char_vals_read_rsp_t))
9590 );
9591 assert_eq!(
9592 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_char_vals_read_rsp_t>())).len as *const _ as usize },
9593 0usize,
9594 concat!(
9595 "Offset of field: ",
9596 stringify!(ble_gattc_evt_char_vals_read_rsp_t),
9597 "::",
9598 stringify!(len)
9599 )
9600 );
9601 assert_eq!(
9602 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_char_vals_read_rsp_t>())).values as *const _ as usize },
9603 2usize,
9604 concat!(
9605 "Offset of field: ",
9606 stringify!(ble_gattc_evt_char_vals_read_rsp_t),
9607 "::",
9608 stringify!(values)
9609 )
9610 );
9611}
9612#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_WRITE_RSP."]
9613#[repr(C)]
9614#[derive(Debug)]
9615pub struct ble_gattc_evt_write_rsp_t {
9616 #[doc = "< Attribute Handle."]
9617 pub handle: u16,
9618 #[doc = "< Type of write operation, see @ref BLE_GATT_WRITE_OPS."]
9619 pub write_op: u8,
9620 #[doc = "< Data offset."]
9621 pub offset: u16,
9622 #[doc = "< Data length."]
9623 pub len: u16,
9624 #[doc = "< Data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
9625 #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
9626 pub data: __IncompleteArrayField<u8>,
9627}
9628#[test]
9629fn bindgen_test_layout_ble_gattc_evt_write_rsp_t() {
9630 assert_eq!(
9631 ::core::mem::size_of::<ble_gattc_evt_write_rsp_t>(),
9632 8usize,
9633 concat!("Size of: ", stringify!(ble_gattc_evt_write_rsp_t))
9634 );
9635 assert_eq!(
9636 ::core::mem::align_of::<ble_gattc_evt_write_rsp_t>(),
9637 2usize,
9638 concat!("Alignment of ", stringify!(ble_gattc_evt_write_rsp_t))
9639 );
9640 assert_eq!(
9641 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_write_rsp_t>())).handle as *const _ as usize },
9642 0usize,
9643 concat!(
9644 "Offset of field: ",
9645 stringify!(ble_gattc_evt_write_rsp_t),
9646 "::",
9647 stringify!(handle)
9648 )
9649 );
9650 assert_eq!(
9651 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_write_rsp_t>())).write_op as *const _ as usize },
9652 2usize,
9653 concat!(
9654 "Offset of field: ",
9655 stringify!(ble_gattc_evt_write_rsp_t),
9656 "::",
9657 stringify!(write_op)
9658 )
9659 );
9660 assert_eq!(
9661 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_write_rsp_t>())).offset as *const _ as usize },
9662 4usize,
9663 concat!(
9664 "Offset of field: ",
9665 stringify!(ble_gattc_evt_write_rsp_t),
9666 "::",
9667 stringify!(offset)
9668 )
9669 );
9670 assert_eq!(
9671 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_write_rsp_t>())).len as *const _ as usize },
9672 6usize,
9673 concat!(
9674 "Offset of field: ",
9675 stringify!(ble_gattc_evt_write_rsp_t),
9676 "::",
9677 stringify!(len)
9678 )
9679 );
9680 assert_eq!(
9681 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_write_rsp_t>())).data as *const _ as usize },
9682 8usize,
9683 concat!(
9684 "Offset of field: ",
9685 stringify!(ble_gattc_evt_write_rsp_t),
9686 "::",
9687 stringify!(data)
9688 )
9689 );
9690}
9691#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_HVX."]
9692#[repr(C)]
9693#[derive(Debug)]
9694pub struct ble_gattc_evt_hvx_t {
9695 #[doc = "< Handle to which the HVx operation applies."]
9696 pub handle: u16,
9697 #[doc = "< Indication or Notification, see @ref BLE_GATT_HVX_TYPES."]
9698 pub type_: u8,
9699 #[doc = "< Attribute data length."]
9700 pub len: u16,
9701 #[doc = "< Attribute data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
9702 #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
9703 pub data: __IncompleteArrayField<u8>,
9704}
9705#[test]
9706fn bindgen_test_layout_ble_gattc_evt_hvx_t() {
9707 assert_eq!(
9708 ::core::mem::size_of::<ble_gattc_evt_hvx_t>(),
9709 6usize,
9710 concat!("Size of: ", stringify!(ble_gattc_evt_hvx_t))
9711 );
9712 assert_eq!(
9713 ::core::mem::align_of::<ble_gattc_evt_hvx_t>(),
9714 2usize,
9715 concat!("Alignment of ", stringify!(ble_gattc_evt_hvx_t))
9716 );
9717 assert_eq!(
9718 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_hvx_t>())).handle as *const _ as usize },
9719 0usize,
9720 concat!(
9721 "Offset of field: ",
9722 stringify!(ble_gattc_evt_hvx_t),
9723 "::",
9724 stringify!(handle)
9725 )
9726 );
9727 assert_eq!(
9728 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_hvx_t>())).type_ as *const _ as usize },
9729 2usize,
9730 concat!(
9731 "Offset of field: ",
9732 stringify!(ble_gattc_evt_hvx_t),
9733 "::",
9734 stringify!(type_)
9735 )
9736 );
9737 assert_eq!(
9738 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_hvx_t>())).len as *const _ as usize },
9739 4usize,
9740 concat!(
9741 "Offset of field: ",
9742 stringify!(ble_gattc_evt_hvx_t),
9743 "::",
9744 stringify!(len)
9745 )
9746 );
9747 assert_eq!(
9748 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_hvx_t>())).data as *const _ as usize },
9749 6usize,
9750 concat!(
9751 "Offset of field: ",
9752 stringify!(ble_gattc_evt_hvx_t),
9753 "::",
9754 stringify!(data)
9755 )
9756 );
9757}
9758#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_EXCHANGE_MTU_RSP."]
9759#[repr(C)]
9760#[derive(Debug, Copy, Clone)]
9761pub struct ble_gattc_evt_exchange_mtu_rsp_t {
9762 #[doc = "< Server RX MTU size."]
9763 pub server_rx_mtu: u16,
9764}
9765#[test]
9766fn bindgen_test_layout_ble_gattc_evt_exchange_mtu_rsp_t() {
9767 assert_eq!(
9768 ::core::mem::size_of::<ble_gattc_evt_exchange_mtu_rsp_t>(),
9769 2usize,
9770 concat!("Size of: ", stringify!(ble_gattc_evt_exchange_mtu_rsp_t))
9771 );
9772 assert_eq!(
9773 ::core::mem::align_of::<ble_gattc_evt_exchange_mtu_rsp_t>(),
9774 2usize,
9775 concat!("Alignment of ", stringify!(ble_gattc_evt_exchange_mtu_rsp_t))
9776 );
9777 assert_eq!(
9778 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_exchange_mtu_rsp_t>())).server_rx_mtu as *const _ as usize },
9779 0usize,
9780 concat!(
9781 "Offset of field: ",
9782 stringify!(ble_gattc_evt_exchange_mtu_rsp_t),
9783 "::",
9784 stringify!(server_rx_mtu)
9785 )
9786 );
9787}
9788#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_TIMEOUT."]
9789#[repr(C)]
9790#[derive(Debug, Copy, Clone)]
9791pub struct ble_gattc_evt_timeout_t {
9792 #[doc = "< Timeout source, see @ref BLE_GATT_TIMEOUT_SOURCES."]
9793 pub src: u8,
9794}
9795#[test]
9796fn bindgen_test_layout_ble_gattc_evt_timeout_t() {
9797 assert_eq!(
9798 ::core::mem::size_of::<ble_gattc_evt_timeout_t>(),
9799 1usize,
9800 concat!("Size of: ", stringify!(ble_gattc_evt_timeout_t))
9801 );
9802 assert_eq!(
9803 ::core::mem::align_of::<ble_gattc_evt_timeout_t>(),
9804 1usize,
9805 concat!("Alignment of ", stringify!(ble_gattc_evt_timeout_t))
9806 );
9807 assert_eq!(
9808 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_timeout_t>())).src as *const _ as usize },
9809 0usize,
9810 concat!(
9811 "Offset of field: ",
9812 stringify!(ble_gattc_evt_timeout_t),
9813 "::",
9814 stringify!(src)
9815 )
9816 );
9817}
9818#[doc = "@brief Event structure for @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE."]
9819#[repr(C)]
9820#[derive(Debug, Copy, Clone)]
9821pub struct ble_gattc_evt_write_cmd_tx_complete_t {
9822 #[doc = "< Number of write without response transmissions completed."]
9823 pub count: u8,
9824}
9825#[test]
9826fn bindgen_test_layout_ble_gattc_evt_write_cmd_tx_complete_t() {
9827 assert_eq!(
9828 ::core::mem::size_of::<ble_gattc_evt_write_cmd_tx_complete_t>(),
9829 1usize,
9830 concat!("Size of: ", stringify!(ble_gattc_evt_write_cmd_tx_complete_t))
9831 );
9832 assert_eq!(
9833 ::core::mem::align_of::<ble_gattc_evt_write_cmd_tx_complete_t>(),
9834 1usize,
9835 concat!("Alignment of ", stringify!(ble_gattc_evt_write_cmd_tx_complete_t))
9836 );
9837 assert_eq!(
9838 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_write_cmd_tx_complete_t>())).count as *const _ as usize },
9839 0usize,
9840 concat!(
9841 "Offset of field: ",
9842 stringify!(ble_gattc_evt_write_cmd_tx_complete_t),
9843 "::",
9844 stringify!(count)
9845 )
9846 );
9847}
9848#[doc = "@brief GATTC event structure."]
9849#[repr(C)]
9850pub struct ble_gattc_evt_t {
9851 #[doc = "< Connection Handle on which event occurred."]
9852 pub conn_handle: u16,
9853 #[doc = "< GATT status code for the operation, see @ref BLE_GATT_STATUS_CODES."]
9854 pub gatt_status: u16,
9855 #[doc = "< In case of error: The handle causing the error. In all other cases @ref BLE_GATT_HANDLE_INVALID."]
9856 pub error_handle: u16,
9857 #[doc = "< Event Parameters. @note Only valid if @ref gatt_status == @ref BLE_GATT_STATUS_SUCCESS."]
9858 pub params: ble_gattc_evt_t__bindgen_ty_1,
9859}
9860#[repr(C)]
9861pub struct ble_gattc_evt_t__bindgen_ty_1 {
9862 #[doc = "< Primary Service Discovery Response Event Parameters."]
9863 pub prim_srvc_disc_rsp: __BindgenUnionField<ble_gattc_evt_prim_srvc_disc_rsp_t>,
9864 #[doc = "< Relationship Discovery Response Event Parameters."]
9865 pub rel_disc_rsp: __BindgenUnionField<ble_gattc_evt_rel_disc_rsp_t>,
9866 #[doc = "< Characteristic Discovery Response Event Parameters."]
9867 pub char_disc_rsp: __BindgenUnionField<ble_gattc_evt_char_disc_rsp_t>,
9868 #[doc = "< Descriptor Discovery Response Event Parameters."]
9869 pub desc_disc_rsp: __BindgenUnionField<ble_gattc_evt_desc_disc_rsp_t>,
9870 #[doc = "< Characteristic Value Read by UUID Response Event Parameters."]
9871 pub char_val_by_uuid_read_rsp: __BindgenUnionField<ble_gattc_evt_char_val_by_uuid_read_rsp_t>,
9872 #[doc = "< Read Response Event Parameters."]
9873 pub read_rsp: __BindgenUnionField<ble_gattc_evt_read_rsp_t>,
9874 #[doc = "< Characteristic Values Read Response Event Parameters."]
9875 pub char_vals_read_rsp: __BindgenUnionField<ble_gattc_evt_char_vals_read_rsp_t>,
9876 #[doc = "< Write Response Event Parameters."]
9877 pub write_rsp: __BindgenUnionField<ble_gattc_evt_write_rsp_t>,
9878 #[doc = "< Handle Value Notification/Indication Event Parameters."]
9879 pub hvx: __BindgenUnionField<ble_gattc_evt_hvx_t>,
9880 #[doc = "< Exchange MTU Response Event Parameters."]
9881 pub exchange_mtu_rsp: __BindgenUnionField<ble_gattc_evt_exchange_mtu_rsp_t>,
9882 #[doc = "< Timeout Event Parameters."]
9883 pub timeout: __BindgenUnionField<ble_gattc_evt_timeout_t>,
9884 #[doc = "< Attribute Information Discovery Event Parameters."]
9885 pub attr_info_disc_rsp: __BindgenUnionField<ble_gattc_evt_attr_info_disc_rsp_t>,
9886 #[doc = "< Write without Response transmission complete Event Parameters."]
9887 pub write_cmd_tx_complete: __BindgenUnionField<ble_gattc_evt_write_cmd_tx_complete_t>,
9888 pub bindgen_union_field: [u16; 4usize],
9889}
9890#[test]
9891fn bindgen_test_layout_ble_gattc_evt_t__bindgen_ty_1() {
9892 assert_eq!(
9893 ::core::mem::size_of::<ble_gattc_evt_t__bindgen_ty_1>(),
9894 8usize,
9895 concat!("Size of: ", stringify!(ble_gattc_evt_t__bindgen_ty_1))
9896 );
9897 assert_eq!(
9898 ::core::mem::align_of::<ble_gattc_evt_t__bindgen_ty_1>(),
9899 2usize,
9900 concat!("Alignment of ", stringify!(ble_gattc_evt_t__bindgen_ty_1))
9901 );
9902 assert_eq!(
9903 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).prim_srvc_disc_rsp as *const _ as usize },
9904 0usize,
9905 concat!(
9906 "Offset of field: ",
9907 stringify!(ble_gattc_evt_t__bindgen_ty_1),
9908 "::",
9909 stringify!(prim_srvc_disc_rsp)
9910 )
9911 );
9912 assert_eq!(
9913 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).rel_disc_rsp as *const _ as usize },
9914 0usize,
9915 concat!(
9916 "Offset of field: ",
9917 stringify!(ble_gattc_evt_t__bindgen_ty_1),
9918 "::",
9919 stringify!(rel_disc_rsp)
9920 )
9921 );
9922 assert_eq!(
9923 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).char_disc_rsp as *const _ as usize },
9924 0usize,
9925 concat!(
9926 "Offset of field: ",
9927 stringify!(ble_gattc_evt_t__bindgen_ty_1),
9928 "::",
9929 stringify!(char_disc_rsp)
9930 )
9931 );
9932 assert_eq!(
9933 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).desc_disc_rsp as *const _ as usize },
9934 0usize,
9935 concat!(
9936 "Offset of field: ",
9937 stringify!(ble_gattc_evt_t__bindgen_ty_1),
9938 "::",
9939 stringify!(desc_disc_rsp)
9940 )
9941 );
9942 assert_eq!(
9943 unsafe {
9944 &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).char_val_by_uuid_read_rsp as *const _ as usize
9945 },
9946 0usize,
9947 concat!(
9948 "Offset of field: ",
9949 stringify!(ble_gattc_evt_t__bindgen_ty_1),
9950 "::",
9951 stringify!(char_val_by_uuid_read_rsp)
9952 )
9953 );
9954 assert_eq!(
9955 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).read_rsp as *const _ as usize },
9956 0usize,
9957 concat!(
9958 "Offset of field: ",
9959 stringify!(ble_gattc_evt_t__bindgen_ty_1),
9960 "::",
9961 stringify!(read_rsp)
9962 )
9963 );
9964 assert_eq!(
9965 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).char_vals_read_rsp as *const _ as usize },
9966 0usize,
9967 concat!(
9968 "Offset of field: ",
9969 stringify!(ble_gattc_evt_t__bindgen_ty_1),
9970 "::",
9971 stringify!(char_vals_read_rsp)
9972 )
9973 );
9974 assert_eq!(
9975 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).write_rsp as *const _ as usize },
9976 0usize,
9977 concat!(
9978 "Offset of field: ",
9979 stringify!(ble_gattc_evt_t__bindgen_ty_1),
9980 "::",
9981 stringify!(write_rsp)
9982 )
9983 );
9984 assert_eq!(
9985 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).hvx as *const _ as usize },
9986 0usize,
9987 concat!(
9988 "Offset of field: ",
9989 stringify!(ble_gattc_evt_t__bindgen_ty_1),
9990 "::",
9991 stringify!(hvx)
9992 )
9993 );
9994 assert_eq!(
9995 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).exchange_mtu_rsp as *const _ as usize },
9996 0usize,
9997 concat!(
9998 "Offset of field: ",
9999 stringify!(ble_gattc_evt_t__bindgen_ty_1),
10000 "::",
10001 stringify!(exchange_mtu_rsp)
10002 )
10003 );
10004 assert_eq!(
10005 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).timeout as *const _ as usize },
10006 0usize,
10007 concat!(
10008 "Offset of field: ",
10009 stringify!(ble_gattc_evt_t__bindgen_ty_1),
10010 "::",
10011 stringify!(timeout)
10012 )
10013 );
10014 assert_eq!(
10015 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).attr_info_disc_rsp as *const _ as usize },
10016 0usize,
10017 concat!(
10018 "Offset of field: ",
10019 stringify!(ble_gattc_evt_t__bindgen_ty_1),
10020 "::",
10021 stringify!(attr_info_disc_rsp)
10022 )
10023 );
10024 assert_eq!(
10025 unsafe {
10026 &(*(::core::ptr::null::<ble_gattc_evt_t__bindgen_ty_1>())).write_cmd_tx_complete as *const _ as usize
10027 },
10028 0usize,
10029 concat!(
10030 "Offset of field: ",
10031 stringify!(ble_gattc_evt_t__bindgen_ty_1),
10032 "::",
10033 stringify!(write_cmd_tx_complete)
10034 )
10035 );
10036}
10037#[test]
10038fn bindgen_test_layout_ble_gattc_evt_t() {
10039 assert_eq!(
10040 ::core::mem::size_of::<ble_gattc_evt_t>(),
10041 14usize,
10042 concat!("Size of: ", stringify!(ble_gattc_evt_t))
10043 );
10044 assert_eq!(
10045 ::core::mem::align_of::<ble_gattc_evt_t>(),
10046 2usize,
10047 concat!("Alignment of ", stringify!(ble_gattc_evt_t))
10048 );
10049 assert_eq!(
10050 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t>())).conn_handle as *const _ as usize },
10051 0usize,
10052 concat!(
10053 "Offset of field: ",
10054 stringify!(ble_gattc_evt_t),
10055 "::",
10056 stringify!(conn_handle)
10057 )
10058 );
10059 assert_eq!(
10060 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t>())).gatt_status as *const _ as usize },
10061 2usize,
10062 concat!(
10063 "Offset of field: ",
10064 stringify!(ble_gattc_evt_t),
10065 "::",
10066 stringify!(gatt_status)
10067 )
10068 );
10069 assert_eq!(
10070 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t>())).error_handle as *const _ as usize },
10071 4usize,
10072 concat!(
10073 "Offset of field: ",
10074 stringify!(ble_gattc_evt_t),
10075 "::",
10076 stringify!(error_handle)
10077 )
10078 );
10079 assert_eq!(
10080 unsafe { &(*(::core::ptr::null::<ble_gattc_evt_t>())).params as *const _ as usize },
10081 6usize,
10082 concat!(
10083 "Offset of field: ",
10084 stringify!(ble_gattc_evt_t),
10085 "::",
10086 stringify!(params)
10087 )
10088 );
10089}
10090
10091#[doc = "@brief Initiate or continue a GATT Primary Service Discovery procedure."]
10092#[doc = ""]
10093#[doc = " @details This function initiates or resumes a Primary Service discovery procedure, starting from the supplied handle."]
10094#[doc = " If the last service has not been reached, this function must be called again with an updated start handle value to continue the search."]
10095#[doc = ""]
10096#[doc = " @note If any of the discovered services have 128-bit UUIDs which are not present in the table provided to ble_vs_uuids_assign, a UUID structure with"]
10097#[doc = " type @ref BLE_UUID_TYPE_UNKNOWN will be received in the corresponding event."]
10098#[doc = ""]
10099#[doc = " @events"]
10100#[doc = " @event{@ref BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP}"]
10101#[doc = " @endevents"]
10102#[doc = ""]
10103#[doc = " @mscs"]
10104#[doc = " @mmsc{@ref BLE_GATTC_PRIM_SRVC_DISC_MSC}"]
10105#[doc = " @endmscs"]
10106#[doc = ""]
10107#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
10108#[doc = " @param[in] start_handle Handle to start searching from."]
10109#[doc = " @param[in] p_srvc_uuid Pointer to the service UUID to be found. If it is NULL, all primary services will be returned."]
10110#[doc = ""]
10111#[doc = " @retval ::NRF_SUCCESS Successfully started or resumed the Primary Service Discovery procedure."]
10112#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
10113#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State."]
10114#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
10115#[doc = " @retval ::NRF_ERROR_BUSY Client procedure already in progress."]
10116#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
10117#[inline(always)]
10118pub unsafe fn sd_ble_gattc_primary_services_discover(
10119 conn_handle: u16,
10120 start_handle: u16,
10121 p_srvc_uuid: *const ble_uuid_t,
10122) -> u32 {
10123 let ret: u32;
10124 core::arch::asm!("svc 155",
10125 inout("r0") to_asm(conn_handle) => ret,
10126 inout("r1") to_asm(start_handle) => _,
10127 inout("r2") to_asm(p_srvc_uuid) => _,
10128 lateout("r3") _,
10129 lateout("r12") _,
10130 );
10131 ret
10132}
10133
10134#[doc = "@brief Initiate or continue a GATT Relationship Discovery procedure."]
10135#[doc = ""]
10136#[doc = " @details This function initiates or resumes the Find Included Services sub-procedure. If the last included service has not been reached,"]
10137#[doc = " this must be called again with an updated handle range to continue the search."]
10138#[doc = ""]
10139#[doc = " @events"]
10140#[doc = " @event{@ref BLE_GATTC_EVT_REL_DISC_RSP}"]
10141#[doc = " @endevents"]
10142#[doc = ""]
10143#[doc = " @mscs"]
10144#[doc = " @mmsc{@ref BLE_GATTC_REL_DISC_MSC}"]
10145#[doc = " @endmscs"]
10146#[doc = ""]
10147#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
10148#[doc = " @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on."]
10149#[doc = ""]
10150#[doc = " @retval ::NRF_SUCCESS Successfully started or resumed the Relationship Discovery procedure."]
10151#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
10152#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State."]
10153#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
10154#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
10155#[doc = " @retval ::NRF_ERROR_BUSY Client procedure already in progress."]
10156#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
10157#[inline(always)]
10158pub unsafe fn sd_ble_gattc_relationships_discover(
10159 conn_handle: u16,
10160 p_handle_range: *const ble_gattc_handle_range_t,
10161) -> u32 {
10162 let ret: u32;
10163 core::arch::asm!("svc 156",
10164 inout("r0") to_asm(conn_handle) => ret,
10165 inout("r1") to_asm(p_handle_range) => _,
10166 lateout("r2") _,
10167 lateout("r3") _,
10168 lateout("r12") _,
10169 );
10170 ret
10171}
10172
10173#[doc = "@brief Initiate or continue a GATT Characteristic Discovery procedure."]
10174#[doc = ""]
10175#[doc = " @details This function initiates or resumes a Characteristic discovery procedure. If the last Characteristic has not been reached,"]
10176#[doc = " this must be called again with an updated handle range to continue the discovery."]
10177#[doc = ""]
10178#[doc = " @note If any of the discovered characteristics have 128-bit UUIDs which are not present in the table provided to ble_vs_uuids_assign, a UUID structure with"]
10179#[doc = " type @ref BLE_UUID_TYPE_UNKNOWN will be received in the corresponding event."]
10180#[doc = ""]
10181#[doc = " @events"]
10182#[doc = " @event{@ref BLE_GATTC_EVT_CHAR_DISC_RSP}"]
10183#[doc = " @endevents"]
10184#[doc = ""]
10185#[doc = " @mscs"]
10186#[doc = " @mmsc{@ref BLE_GATTC_CHAR_DISC_MSC}"]
10187#[doc = " @endmscs"]
10188#[doc = ""]
10189#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
10190#[doc = " @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on."]
10191#[doc = ""]
10192#[doc = " @retval ::NRF_SUCCESS Successfully started or resumed the Characteristic Discovery procedure."]
10193#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
10194#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State."]
10195#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
10196#[doc = " @retval ::NRF_ERROR_BUSY Client procedure already in progress."]
10197#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
10198#[inline(always)]
10199pub unsafe fn sd_ble_gattc_characteristics_discover(
10200 conn_handle: u16,
10201 p_handle_range: *const ble_gattc_handle_range_t,
10202) -> u32 {
10203 let ret: u32;
10204 core::arch::asm!("svc 157",
10205 inout("r0") to_asm(conn_handle) => ret,
10206 inout("r1") to_asm(p_handle_range) => _,
10207 lateout("r2") _,
10208 lateout("r3") _,
10209 lateout("r12") _,
10210 );
10211 ret
10212}
10213
10214#[doc = "@brief Initiate or continue a GATT Characteristic Descriptor Discovery procedure."]
10215#[doc = ""]
10216#[doc = " @details This function initiates or resumes a Characteristic Descriptor discovery procedure. If the last Descriptor has not been reached,"]
10217#[doc = " this must be called again with an updated handle range to continue the discovery."]
10218#[doc = ""]
10219#[doc = " @events"]
10220#[doc = " @event{@ref BLE_GATTC_EVT_DESC_DISC_RSP}"]
10221#[doc = " @endevents"]
10222#[doc = ""]
10223#[doc = " @mscs"]
10224#[doc = " @mmsc{@ref BLE_GATTC_DESC_DISC_MSC}"]
10225#[doc = " @endmscs"]
10226#[doc = ""]
10227#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
10228#[doc = " @param[in] p_handle_range A pointer to the range of handles of the Characteristic to perform this procedure on."]
10229#[doc = ""]
10230#[doc = " @retval ::NRF_SUCCESS Successfully started or resumed the Descriptor Discovery procedure."]
10231#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
10232#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State."]
10233#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
10234#[doc = " @retval ::NRF_ERROR_BUSY Client procedure already in progress."]
10235#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
10236#[inline(always)]
10237pub unsafe fn sd_ble_gattc_descriptors_discover(
10238 conn_handle: u16,
10239 p_handle_range: *const ble_gattc_handle_range_t,
10240) -> u32 {
10241 let ret: u32;
10242 core::arch::asm!("svc 158",
10243 inout("r0") to_asm(conn_handle) => ret,
10244 inout("r1") to_asm(p_handle_range) => _,
10245 lateout("r2") _,
10246 lateout("r3") _,
10247 lateout("r12") _,
10248 );
10249 ret
10250}
10251
10252#[doc = "@brief Initiate or continue a GATT Read using Characteristic UUID procedure."]
10253#[doc = ""]
10254#[doc = " @details This function initiates or resumes a Read using Characteristic UUID procedure. If the last Characteristic has not been reached,"]
10255#[doc = " this must be called again with an updated handle range to continue the discovery."]
10256#[doc = ""]
10257#[doc = " @events"]
10258#[doc = " @event{@ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP}"]
10259#[doc = " @endevents"]
10260#[doc = ""]
10261#[doc = " @mscs"]
10262#[doc = " @mmsc{@ref BLE_GATTC_READ_UUID_MSC}"]
10263#[doc = " @endmscs"]
10264#[doc = ""]
10265#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
10266#[doc = " @param[in] p_uuid Pointer to a Characteristic value UUID to read."]
10267#[doc = " @param[in] p_handle_range A pointer to the range of handles to perform this procedure on."]
10268#[doc = ""]
10269#[doc = " @retval ::NRF_SUCCESS Successfully started or resumed the Read using Characteristic UUID procedure."]
10270#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
10271#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State."]
10272#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
10273#[doc = " @retval ::NRF_ERROR_BUSY Client procedure already in progress."]
10274#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
10275#[inline(always)]
10276pub unsafe fn sd_ble_gattc_char_value_by_uuid_read(
10277 conn_handle: u16,
10278 p_uuid: *const ble_uuid_t,
10279 p_handle_range: *const ble_gattc_handle_range_t,
10280) -> u32 {
10281 let ret: u32;
10282 core::arch::asm!("svc 160",
10283 inout("r0") to_asm(conn_handle) => ret,
10284 inout("r1") to_asm(p_uuid) => _,
10285 inout("r2") to_asm(p_handle_range) => _,
10286 lateout("r3") _,
10287 lateout("r12") _,
10288 );
10289 ret
10290}
10291
10292#[doc = "@brief Initiate or continue a GATT Read (Long) Characteristic or Descriptor procedure."]
10293#[doc = ""]
10294#[doc = " @details This function initiates or resumes a GATT Read (Long) Characteristic or Descriptor procedure. If the Characteristic or Descriptor"]
10295#[doc = " to be read is longer than ATT_MTU - 1, this function must be called multiple times with appropriate offset to read the"]
10296#[doc = " complete value."]
10297#[doc = ""]
10298#[doc = " @events"]
10299#[doc = " @event{@ref BLE_GATTC_EVT_READ_RSP}"]
10300#[doc = " @endevents"]
10301#[doc = ""]
10302#[doc = " @mscs"]
10303#[doc = " @mmsc{@ref BLE_GATTC_VALUE_READ_MSC}"]
10304#[doc = " @endmscs"]
10305#[doc = ""]
10306#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
10307#[doc = " @param[in] handle The handle of the attribute to be read."]
10308#[doc = " @param[in] offset Offset into the attribute value to be read."]
10309#[doc = ""]
10310#[doc = " @retval ::NRF_SUCCESS Successfully started or resumed the Read (Long) procedure."]
10311#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
10312#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State."]
10313#[doc = " @retval ::NRF_ERROR_BUSY Client procedure already in progress."]
10314#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
10315#[inline(always)]
10316pub unsafe fn sd_ble_gattc_read(conn_handle: u16, handle: u16, offset: u16) -> u32 {
10317 let ret: u32;
10318 core::arch::asm!("svc 161",
10319 inout("r0") to_asm(conn_handle) => ret,
10320 inout("r1") to_asm(handle) => _,
10321 inout("r2") to_asm(offset) => _,
10322 lateout("r3") _,
10323 lateout("r12") _,
10324 );
10325 ret
10326}
10327
10328#[doc = "@brief Initiate a GATT Read Multiple Characteristic Values procedure."]
10329#[doc = ""]
10330#[doc = " @details This function initiates a GATT Read Multiple Characteristic Values procedure."]
10331#[doc = ""]
10332#[doc = " @events"]
10333#[doc = " @event{@ref BLE_GATTC_EVT_CHAR_VALS_READ_RSP}"]
10334#[doc = " @endevents"]
10335#[doc = ""]
10336#[doc = " @mscs"]
10337#[doc = " @mmsc{@ref BLE_GATTC_READ_MULT_MSC}"]
10338#[doc = " @endmscs"]
10339#[doc = ""]
10340#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
10341#[doc = " @param[in] p_handles A pointer to the handle(s) of the attribute(s) to be read."]
10342#[doc = " @param[in] handle_count The number of handles in p_handles."]
10343#[doc = ""]
10344#[doc = " @retval ::NRF_SUCCESS Successfully started the Read Multiple Characteristic Values procedure."]
10345#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
10346#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State."]
10347#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
10348#[doc = " @retval ::NRF_ERROR_BUSY Client procedure already in progress."]
10349#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
10350#[inline(always)]
10351pub unsafe fn sd_ble_gattc_char_values_read(conn_handle: u16, p_handles: *const u16, handle_count: u16) -> u32 {
10352 let ret: u32;
10353 core::arch::asm!("svc 162",
10354 inout("r0") to_asm(conn_handle) => ret,
10355 inout("r1") to_asm(p_handles) => _,
10356 inout("r2") to_asm(handle_count) => _,
10357 lateout("r3") _,
10358 lateout("r12") _,
10359 );
10360 ret
10361}
10362
10363#[doc = "@brief Perform a Write (Characteristic Value or Descriptor, with or without response, signed or not, long or reliable) procedure."]
10364#[doc = ""]
10365#[doc = " @details This function can perform all write procedures described in GATT."]
10366#[doc = ""]
10367#[doc = " @note Only one write with response procedure can be ongoing per connection at a time."]
10368#[doc = " If the application tries to write with response while another write with response procedure is ongoing,"]
10369#[doc = " the function call will return @ref NRF_ERROR_BUSY."]
10370#[doc = " A @ref BLE_GATTC_EVT_WRITE_RSP event will be issued as soon as the write response arrives from the peer."]
10371#[doc = ""]
10372#[doc = " @note The number of Write without Response that can be queued is configured by @ref ble_gattc_conn_cfg_t::write_cmd_tx_queue_size"]
10373#[doc = " When the queue is full, the function call will return @ref NRF_ERROR_RESOURCES."]
10374#[doc = " A @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE event will be issued as soon as the transmission of the write without response is complete."]
10375#[doc = ""]
10376#[doc = " @note The application can keep track of the available queue element count for writes without responses by following the procedure below:"]
10377#[doc = " - Store initial queue element count in a variable."]
10378#[doc = " - Decrement the variable, which stores the currently available queue element count, by one when a call to this function returns @ref NRF_SUCCESS."]
10379#[doc = " - Increment the variable, which stores the current available queue element count, by the count variable in @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE event."]
10380#[doc = ""]
10381#[doc = " @events"]
10382#[doc = " @event{@ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE, Write without response transmission complete.}"]
10383#[doc = " @event{@ref BLE_GATTC_EVT_WRITE_RSP, Write response received from the peer.}"]
10384#[doc = " @endevents"]
10385#[doc = ""]
10386#[doc = " @mscs"]
10387#[doc = " @mmsc{@ref BLE_GATTC_VALUE_WRITE_WITHOUT_RESP_MSC}"]
10388#[doc = " @mmsc{@ref BLE_GATTC_VALUE_WRITE_MSC}"]
10389#[doc = " @mmsc{@ref BLE_GATTC_VALUE_LONG_WRITE_MSC}"]
10390#[doc = " @mmsc{@ref BLE_GATTC_VALUE_RELIABLE_WRITE_MSC}"]
10391#[doc = " @endmscs"]
10392#[doc = ""]
10393#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
10394#[doc = " @param[in] p_write_params A pointer to a write parameters structure."]
10395#[doc = ""]
10396#[doc = " @retval ::NRF_SUCCESS Successfully started the Write procedure."]
10397#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
10398#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State."]
10399#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
10400#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
10401#[doc = " @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied."]
10402#[doc = " @retval ::NRF_ERROR_BUSY For write with response, procedure already in progress. Wait for a @ref BLE_GATTC_EVT_WRITE_RSP event and retry."]
10403#[doc = " @retval ::NRF_ERROR_RESOURCES Too many writes without responses queued."]
10404#[doc = " Wait for a @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE event and retry."]
10405#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
10406#[inline(always)]
10407pub unsafe fn sd_ble_gattc_write(conn_handle: u16, p_write_params: *const ble_gattc_write_params_t) -> u32 {
10408 let ret: u32;
10409 core::arch::asm!("svc 163",
10410 inout("r0") to_asm(conn_handle) => ret,
10411 inout("r1") to_asm(p_write_params) => _,
10412 lateout("r2") _,
10413 lateout("r3") _,
10414 lateout("r12") _,
10415 );
10416 ret
10417}
10418
10419#[doc = "@brief Send a Handle Value Confirmation to the GATT Server."]
10420#[doc = ""]
10421#[doc = " @mscs"]
10422#[doc = " @mmsc{@ref BLE_GATTC_HVI_MSC}"]
10423#[doc = " @endmscs"]
10424#[doc = ""]
10425#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
10426#[doc = " @param[in] handle The handle of the attribute in the indication."]
10427#[doc = ""]
10428#[doc = " @retval ::NRF_SUCCESS Successfully queued the Handle Value Confirmation for transmission."]
10429#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
10430#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State or no Indication pending to be confirmed."]
10431#[doc = " @retval ::BLE_ERROR_INVALID_ATTR_HANDLE Invalid attribute handle."]
10432#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
10433#[inline(always)]
10434pub unsafe fn sd_ble_gattc_hv_confirm(conn_handle: u16, handle: u16) -> u32 {
10435 let ret: u32;
10436 core::arch::asm!("svc 164",
10437 inout("r0") to_asm(conn_handle) => ret,
10438 inout("r1") to_asm(handle) => _,
10439 lateout("r2") _,
10440 lateout("r3") _,
10441 lateout("r12") _,
10442 );
10443 ret
10444}
10445
10446#[doc = "@brief Discovers information about a range of attributes on a GATT server."]
10447#[doc = ""]
10448#[doc = " @events"]
10449#[doc = " @event{@ref BLE_GATTC_EVT_ATTR_INFO_DISC_RSP, Generated when information about a range of attributes has been received.}"]
10450#[doc = " @endevents"]
10451#[doc = ""]
10452#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
10453#[doc = " @param[in] p_handle_range The range of handles to request information about."]
10454#[doc = ""]
10455#[doc = " @retval ::NRF_SUCCESS Successfully started an attribute information discovery procedure."]
10456#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle."]
10457#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid connection state"]
10458#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
10459#[doc = " @retval ::NRF_ERROR_BUSY Client procedure already in progress."]
10460#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
10461#[inline(always)]
10462pub unsafe fn sd_ble_gattc_attr_info_discover(
10463 conn_handle: u16,
10464 p_handle_range: *const ble_gattc_handle_range_t,
10465) -> u32 {
10466 let ret: u32;
10467 core::arch::asm!("svc 159",
10468 inout("r0") to_asm(conn_handle) => ret,
10469 inout("r1") to_asm(p_handle_range) => _,
10470 lateout("r2") _,
10471 lateout("r3") _,
10472 lateout("r12") _,
10473 );
10474 ret
10475}
10476
10477#[doc = "@brief Start an ATT_MTU exchange by sending an Exchange MTU Request to the server."]
10478#[doc = ""]
10479#[doc = " @details The SoftDevice sets ATT_MTU to the minimum of:"]
10480#[doc = " - The Client RX MTU value, and"]
10481#[doc = " - The Server RX MTU value from @ref BLE_GATTC_EVT_EXCHANGE_MTU_RSP."]
10482#[doc = ""]
10483#[doc = " However, the SoftDevice never sets ATT_MTU lower than @ref BLE_GATT_ATT_MTU_DEFAULT."]
10484#[doc = ""]
10485#[doc = " @events"]
10486#[doc = " @event{@ref BLE_GATTC_EVT_EXCHANGE_MTU_RSP}"]
10487#[doc = " @endevents"]
10488#[doc = ""]
10489#[doc = " @mscs"]
10490#[doc = " @mmsc{@ref BLE_GATTC_MTU_EXCHANGE}"]
10491#[doc = " @endmscs"]
10492#[doc = ""]
10493#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
10494#[doc = " @param[in] client_rx_mtu Client RX MTU size."]
10495#[doc = " - The minimum value is @ref BLE_GATT_ATT_MTU_DEFAULT."]
10496#[doc = " - The maximum value is @ref ble_gatt_conn_cfg_t::att_mtu in the connection configuration"]
10497#[doc = "used for this connection."]
10498#[doc = " - The value must be equal to Server RX MTU size given in @ref sd_ble_gatts_exchange_mtu_reply"]
10499#[doc = " if an ATT_MTU exchange has already been performed in the other direction."]
10500#[doc = ""]
10501#[doc = " @retval ::NRF_SUCCESS Successfully sent request to the server."]
10502#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle."]
10503#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid connection state or an ATT_MTU exchange was already requested once."]
10504#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid Client RX MTU size supplied."]
10505#[doc = " @retval ::NRF_ERROR_BUSY Client procedure already in progress."]
10506#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
10507#[inline(always)]
10508pub unsafe fn sd_ble_gattc_exchange_mtu_request(conn_handle: u16, client_rx_mtu: u16) -> u32 {
10509 let ret: u32;
10510 core::arch::asm!("svc 165",
10511 inout("r0") to_asm(conn_handle) => ret,
10512 inout("r1") to_asm(client_rx_mtu) => _,
10513 lateout("r2") _,
10514 lateout("r3") _,
10515 lateout("r12") _,
10516 );
10517 ret
10518}
10519
10520#[doc = "< Add a service."]
10521pub const BLE_GATTS_SVCS_SD_BLE_GATTS_SERVICE_ADD: BLE_GATTS_SVCS = 168;
10522#[doc = "< Add an included service."]
10523pub const BLE_GATTS_SVCS_SD_BLE_GATTS_INCLUDE_ADD: BLE_GATTS_SVCS = 169;
10524#[doc = "< Add a characteristic."]
10525pub const BLE_GATTS_SVCS_SD_BLE_GATTS_CHARACTERISTIC_ADD: BLE_GATTS_SVCS = 170;
10526#[doc = "< Add a generic attribute."]
10527pub const BLE_GATTS_SVCS_SD_BLE_GATTS_DESCRIPTOR_ADD: BLE_GATTS_SVCS = 171;
10528#[doc = "< Set an attribute value."]
10529pub const BLE_GATTS_SVCS_SD_BLE_GATTS_VALUE_SET: BLE_GATTS_SVCS = 172;
10530#[doc = "< Get an attribute value."]
10531pub const BLE_GATTS_SVCS_SD_BLE_GATTS_VALUE_GET: BLE_GATTS_SVCS = 173;
10532#[doc = "< Handle Value Notification or Indication."]
10533pub const BLE_GATTS_SVCS_SD_BLE_GATTS_HVX: BLE_GATTS_SVCS = 174;
10534#[doc = "< Perform a Service Changed Indication to one or more peers."]
10535pub const BLE_GATTS_SVCS_SD_BLE_GATTS_SERVICE_CHANGED: BLE_GATTS_SVCS = 175;
10536#[doc = "< Reply to an authorization request for a read or write operation on one or more attributes."]
10537pub const BLE_GATTS_SVCS_SD_BLE_GATTS_RW_AUTHORIZE_REPLY: BLE_GATTS_SVCS = 176;
10538#[doc = "< Set the persistent system attributes for a connection."]
10539pub const BLE_GATTS_SVCS_SD_BLE_GATTS_SYS_ATTR_SET: BLE_GATTS_SVCS = 177;
10540#[doc = "< Retrieve the persistent system attributes."]
10541pub const BLE_GATTS_SVCS_SD_BLE_GATTS_SYS_ATTR_GET: BLE_GATTS_SVCS = 178;
10542#[doc = "< Retrieve the first valid user handle."]
10543pub const BLE_GATTS_SVCS_SD_BLE_GATTS_INITIAL_USER_HANDLE_GET: BLE_GATTS_SVCS = 179;
10544#[doc = "< Retrieve the UUID and/or metadata of an attribute."]
10545pub const BLE_GATTS_SVCS_SD_BLE_GATTS_ATTR_GET: BLE_GATTS_SVCS = 180;
10546#[doc = "< Reply to Exchange MTU Request."]
10547pub const BLE_GATTS_SVCS_SD_BLE_GATTS_EXCHANGE_MTU_REPLY: BLE_GATTS_SVCS = 181;
10548#[doc = " @brief GATTS API SVC numbers."]
10549pub type BLE_GATTS_SVCS = self::c_uint;
10550#[doc = "< Write operation performed. \\n See @ref ble_gatts_evt_write_t."]
10551pub const BLE_GATTS_EVTS_BLE_GATTS_EVT_WRITE: BLE_GATTS_EVTS = 80;
10552#[doc = "< Read/Write Authorization request. \\n Reply with @ref sd_ble_gatts_rw_authorize_reply. \\n See @ref ble_gatts_evt_rw_authorize_request_t."]
10553pub const BLE_GATTS_EVTS_BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST: BLE_GATTS_EVTS = 81;
10554#[doc = "< A persistent system attribute access is pending. \\n Respond with @ref sd_ble_gatts_sys_attr_set. \\n See @ref ble_gatts_evt_sys_attr_missing_t."]
10555pub const BLE_GATTS_EVTS_BLE_GATTS_EVT_SYS_ATTR_MISSING: BLE_GATTS_EVTS = 82;
10556#[doc = "< Handle Value Confirmation. \\n See @ref ble_gatts_evt_hvc_t."]
10557pub const BLE_GATTS_EVTS_BLE_GATTS_EVT_HVC: BLE_GATTS_EVTS = 83;
10558#[doc = "< Service Changed Confirmation. \\n No additional event structure applies."]
10559pub const BLE_GATTS_EVTS_BLE_GATTS_EVT_SC_CONFIRM: BLE_GATTS_EVTS = 84;
10560#[doc = "< Exchange MTU Request. \\n Reply with @ref sd_ble_gatts_exchange_mtu_reply. \\n See @ref ble_gatts_evt_exchange_mtu_request_t."]
10561pub const BLE_GATTS_EVTS_BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST: BLE_GATTS_EVTS = 85;
10562#[doc = "< Peer failed to respond to an ATT request in time. \\n See @ref ble_gatts_evt_timeout_t."]
10563pub const BLE_GATTS_EVTS_BLE_GATTS_EVT_TIMEOUT: BLE_GATTS_EVTS = 86;
10564#[doc = "< Handle Value Notification transmission complete. \\n See @ref ble_gatts_evt_hvn_tx_complete_t."]
10565pub const BLE_GATTS_EVTS_BLE_GATTS_EVT_HVN_TX_COMPLETE: BLE_GATTS_EVTS = 87;
10566#[doc = " @brief GATT Server Event IDs."]
10567pub type BLE_GATTS_EVTS = self::c_uint;
10568#[doc = "< Service changed configuration."]
10569pub const BLE_GATTS_CFGS_BLE_GATTS_CFG_SERVICE_CHANGED: BLE_GATTS_CFGS = 160;
10570#[doc = "< Attribute table size configuration."]
10571pub const BLE_GATTS_CFGS_BLE_GATTS_CFG_ATTR_TAB_SIZE: BLE_GATTS_CFGS = 161;
10572#[doc = "@brief GATTS Configuration IDs."]
10573#[doc = ""]
10574#[doc = " IDs that uniquely identify a GATTS configuration."]
10575pub type BLE_GATTS_CFGS = self::c_uint;
10576#[doc = " @brief BLE GATTS connection configuration parameters, set with @ref sd_ble_cfg_set."]
10577#[repr(C)]
10578#[derive(Debug, Copy, Clone)]
10579pub struct ble_gatts_conn_cfg_t {
10580 #[doc = "< Minimum guaranteed number of Handle Value Notifications that can be queued for transmission."]
10581 #[doc = "The default value is @ref BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT"]
10582 pub hvn_tx_queue_size: u8,
10583}
10584#[test]
10585fn bindgen_test_layout_ble_gatts_conn_cfg_t() {
10586 assert_eq!(
10587 ::core::mem::size_of::<ble_gatts_conn_cfg_t>(),
10588 1usize,
10589 concat!("Size of: ", stringify!(ble_gatts_conn_cfg_t))
10590 );
10591 assert_eq!(
10592 ::core::mem::align_of::<ble_gatts_conn_cfg_t>(),
10593 1usize,
10594 concat!("Alignment of ", stringify!(ble_gatts_conn_cfg_t))
10595 );
10596 assert_eq!(
10597 unsafe { &(*(::core::ptr::null::<ble_gatts_conn_cfg_t>())).hvn_tx_queue_size as *const _ as usize },
10598 0usize,
10599 concat!(
10600 "Offset of field: ",
10601 stringify!(ble_gatts_conn_cfg_t),
10602 "::",
10603 stringify!(hvn_tx_queue_size)
10604 )
10605 );
10606}
10607#[doc = "@brief Attribute metadata."]
10608#[repr(C)]
10609#[derive(Debug, Copy, Clone)]
10610pub struct ble_gatts_attr_md_t {
10611 #[doc = "< Read permissions."]
10612 pub read_perm: ble_gap_conn_sec_mode_t,
10613 #[doc = "< Write permissions."]
10614 pub write_perm: ble_gap_conn_sec_mode_t,
10615 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
10616}
10617#[test]
10618fn bindgen_test_layout_ble_gatts_attr_md_t() {
10619 assert_eq!(
10620 ::core::mem::size_of::<ble_gatts_attr_md_t>(),
10621 3usize,
10622 concat!("Size of: ", stringify!(ble_gatts_attr_md_t))
10623 );
10624 assert_eq!(
10625 ::core::mem::align_of::<ble_gatts_attr_md_t>(),
10626 1usize,
10627 concat!("Alignment of ", stringify!(ble_gatts_attr_md_t))
10628 );
10629 assert_eq!(
10630 unsafe { &(*(::core::ptr::null::<ble_gatts_attr_md_t>())).read_perm as *const _ as usize },
10631 0usize,
10632 concat!(
10633 "Offset of field: ",
10634 stringify!(ble_gatts_attr_md_t),
10635 "::",
10636 stringify!(read_perm)
10637 )
10638 );
10639 assert_eq!(
10640 unsafe { &(*(::core::ptr::null::<ble_gatts_attr_md_t>())).write_perm as *const _ as usize },
10641 1usize,
10642 concat!(
10643 "Offset of field: ",
10644 stringify!(ble_gatts_attr_md_t),
10645 "::",
10646 stringify!(write_perm)
10647 )
10648 );
10649}
10650impl ble_gatts_attr_md_t {
10651 #[inline]
10652 pub fn vlen(&self) -> u8 {
10653 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
10654 }
10655 #[inline]
10656 pub fn set_vlen(&mut self, val: u8) {
10657 unsafe {
10658 let val: u8 = ::core::mem::transmute(val);
10659 self._bitfield_1.set(0usize, 1u8, val as u64)
10660 }
10661 }
10662 #[inline]
10663 pub fn vloc(&self) -> u8 {
10664 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 2u8) as u8) }
10665 }
10666 #[inline]
10667 pub fn set_vloc(&mut self, val: u8) {
10668 unsafe {
10669 let val: u8 = ::core::mem::transmute(val);
10670 self._bitfield_1.set(1usize, 2u8, val as u64)
10671 }
10672 }
10673 #[inline]
10674 pub fn rd_auth(&self) -> u8 {
10675 unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
10676 }
10677 #[inline]
10678 pub fn set_rd_auth(&mut self, val: u8) {
10679 unsafe {
10680 let val: u8 = ::core::mem::transmute(val);
10681 self._bitfield_1.set(3usize, 1u8, val as u64)
10682 }
10683 }
10684 #[inline]
10685 pub fn wr_auth(&self) -> u8 {
10686 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u8) }
10687 }
10688 #[inline]
10689 pub fn set_wr_auth(&mut self, val: u8) {
10690 unsafe {
10691 let val: u8 = ::core::mem::transmute(val);
10692 self._bitfield_1.set(4usize, 1u8, val as u64)
10693 }
10694 }
10695 #[inline]
10696 pub fn new_bitfield_1(vlen: u8, vloc: u8, rd_auth: u8, wr_auth: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
10697 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
10698 __bindgen_bitfield_unit.set(0usize, 1u8, {
10699 let vlen: u8 = unsafe { ::core::mem::transmute(vlen) };
10700 vlen as u64
10701 });
10702 __bindgen_bitfield_unit.set(1usize, 2u8, {
10703 let vloc: u8 = unsafe { ::core::mem::transmute(vloc) };
10704 vloc as u64
10705 });
10706 __bindgen_bitfield_unit.set(3usize, 1u8, {
10707 let rd_auth: u8 = unsafe { ::core::mem::transmute(rd_auth) };
10708 rd_auth as u64
10709 });
10710 __bindgen_bitfield_unit.set(4usize, 1u8, {
10711 let wr_auth: u8 = unsafe { ::core::mem::transmute(wr_auth) };
10712 wr_auth as u64
10713 });
10714 __bindgen_bitfield_unit
10715 }
10716}
10717#[doc = "@brief GATT Attribute."]
10718#[repr(C)]
10719#[derive(Debug, Copy, Clone)]
10720pub struct ble_gatts_attr_t {
10721 #[doc = "< Pointer to the attribute UUID."]
10722 pub p_uuid: *const ble_uuid_t,
10723 #[doc = "< Pointer to the attribute metadata structure."]
10724 pub p_attr_md: *const ble_gatts_attr_md_t,
10725 #[doc = "< Initial attribute value length in bytes."]
10726 pub init_len: u16,
10727 #[doc = "< Initial attribute value offset in bytes. If different from zero, the first init_offs bytes of the attribute value will be left uninitialized."]
10728 pub init_offs: u16,
10729 #[doc = "< Maximum attribute value length in bytes, see @ref BLE_GATTS_ATTR_LENS_MAX for maximum values."]
10730 pub max_len: u16,
10731 #[doc = "< Pointer to the attribute data. Please note that if the @ref BLE_GATTS_VLOC_USER value location is selected in the attribute metadata, this will have to point to a buffer"]
10732 #[doc = "that remains valid through the lifetime of the attribute. This excludes usage of automatic variables that may go out of scope or any other temporary location."]
10733 #[doc = "The stack may access that memory directly without the application's knowledge. For writable characteristics, this value must not be a location in flash memory."]
10734 pub p_value: *mut u8,
10735}
10736#[test]
10737fn bindgen_test_layout_ble_gatts_attr_t() {
10738 assert_eq!(
10739 ::core::mem::size_of::<ble_gatts_attr_t>(),
10740 20usize,
10741 concat!("Size of: ", stringify!(ble_gatts_attr_t))
10742 );
10743 assert_eq!(
10744 ::core::mem::align_of::<ble_gatts_attr_t>(),
10745 4usize,
10746 concat!("Alignment of ", stringify!(ble_gatts_attr_t))
10747 );
10748 assert_eq!(
10749 unsafe { &(*(::core::ptr::null::<ble_gatts_attr_t>())).p_uuid as *const _ as usize },
10750 0usize,
10751 concat!(
10752 "Offset of field: ",
10753 stringify!(ble_gatts_attr_t),
10754 "::",
10755 stringify!(p_uuid)
10756 )
10757 );
10758 assert_eq!(
10759 unsafe { &(*(::core::ptr::null::<ble_gatts_attr_t>())).p_attr_md as *const _ as usize },
10760 4usize,
10761 concat!(
10762 "Offset of field: ",
10763 stringify!(ble_gatts_attr_t),
10764 "::",
10765 stringify!(p_attr_md)
10766 )
10767 );
10768 assert_eq!(
10769 unsafe { &(*(::core::ptr::null::<ble_gatts_attr_t>())).init_len as *const _ as usize },
10770 8usize,
10771 concat!(
10772 "Offset of field: ",
10773 stringify!(ble_gatts_attr_t),
10774 "::",
10775 stringify!(init_len)
10776 )
10777 );
10778 assert_eq!(
10779 unsafe { &(*(::core::ptr::null::<ble_gatts_attr_t>())).init_offs as *const _ as usize },
10780 10usize,
10781 concat!(
10782 "Offset of field: ",
10783 stringify!(ble_gatts_attr_t),
10784 "::",
10785 stringify!(init_offs)
10786 )
10787 );
10788 assert_eq!(
10789 unsafe { &(*(::core::ptr::null::<ble_gatts_attr_t>())).max_len as *const _ as usize },
10790 12usize,
10791 concat!(
10792 "Offset of field: ",
10793 stringify!(ble_gatts_attr_t),
10794 "::",
10795 stringify!(max_len)
10796 )
10797 );
10798 assert_eq!(
10799 unsafe { &(*(::core::ptr::null::<ble_gatts_attr_t>())).p_value as *const _ as usize },
10800 16usize,
10801 concat!(
10802 "Offset of field: ",
10803 stringify!(ble_gatts_attr_t),
10804 "::",
10805 stringify!(p_value)
10806 )
10807 );
10808}
10809#[doc = "@brief GATT Attribute Value."]
10810#[repr(C)]
10811#[derive(Debug, Copy, Clone)]
10812pub struct ble_gatts_value_t {
10813 #[doc = "< Length in bytes to be written or read. Length in bytes written or read after successful return."]
10814 pub len: u16,
10815 #[doc = "< Attribute value offset."]
10816 pub offset: u16,
10817 #[doc = "< Pointer to where value is stored or will be stored."]
10818 #[doc = "If value is stored in user memory, only the attribute length is updated when p_value == NULL."]
10819 #[doc = "Set to NULL when reading to obtain the complete length of the attribute value"]
10820 pub p_value: *mut u8,
10821}
10822#[test]
10823fn bindgen_test_layout_ble_gatts_value_t() {
10824 assert_eq!(
10825 ::core::mem::size_of::<ble_gatts_value_t>(),
10826 8usize,
10827 concat!("Size of: ", stringify!(ble_gatts_value_t))
10828 );
10829 assert_eq!(
10830 ::core::mem::align_of::<ble_gatts_value_t>(),
10831 4usize,
10832 concat!("Alignment of ", stringify!(ble_gatts_value_t))
10833 );
10834 assert_eq!(
10835 unsafe { &(*(::core::ptr::null::<ble_gatts_value_t>())).len as *const _ as usize },
10836 0usize,
10837 concat!(
10838 "Offset of field: ",
10839 stringify!(ble_gatts_value_t),
10840 "::",
10841 stringify!(len)
10842 )
10843 );
10844 assert_eq!(
10845 unsafe { &(*(::core::ptr::null::<ble_gatts_value_t>())).offset as *const _ as usize },
10846 2usize,
10847 concat!(
10848 "Offset of field: ",
10849 stringify!(ble_gatts_value_t),
10850 "::",
10851 stringify!(offset)
10852 )
10853 );
10854 assert_eq!(
10855 unsafe { &(*(::core::ptr::null::<ble_gatts_value_t>())).p_value as *const _ as usize },
10856 4usize,
10857 concat!(
10858 "Offset of field: ",
10859 stringify!(ble_gatts_value_t),
10860 "::",
10861 stringify!(p_value)
10862 )
10863 );
10864}
10865#[doc = "@brief GATT Characteristic Presentation Format."]
10866#[repr(C)]
10867#[derive(Debug, Copy, Clone)]
10868pub struct ble_gatts_char_pf_t {
10869 #[doc = "< Format of the value, see @ref BLE_GATT_CPF_FORMATS."]
10870 pub format: u8,
10871 #[doc = "< Exponent for integer data types."]
10872 pub exponent: i8,
10873 #[doc = "< Unit from Bluetooth Assigned Numbers."]
10874 pub unit: u16,
10875 #[doc = "< Namespace from Bluetooth Assigned Numbers, see @ref BLE_GATT_CPF_NAMESPACES."]
10876 pub name_space: u8,
10877 #[doc = "< Namespace description from Bluetooth Assigned Numbers, see @ref BLE_GATT_CPF_NAMESPACES."]
10878 pub desc: u16,
10879}
10880#[test]
10881fn bindgen_test_layout_ble_gatts_char_pf_t() {
10882 assert_eq!(
10883 ::core::mem::size_of::<ble_gatts_char_pf_t>(),
10884 8usize,
10885 concat!("Size of: ", stringify!(ble_gatts_char_pf_t))
10886 );
10887 assert_eq!(
10888 ::core::mem::align_of::<ble_gatts_char_pf_t>(),
10889 2usize,
10890 concat!("Alignment of ", stringify!(ble_gatts_char_pf_t))
10891 );
10892 assert_eq!(
10893 unsafe { &(*(::core::ptr::null::<ble_gatts_char_pf_t>())).format as *const _ as usize },
10894 0usize,
10895 concat!(
10896 "Offset of field: ",
10897 stringify!(ble_gatts_char_pf_t),
10898 "::",
10899 stringify!(format)
10900 )
10901 );
10902 assert_eq!(
10903 unsafe { &(*(::core::ptr::null::<ble_gatts_char_pf_t>())).exponent as *const _ as usize },
10904 1usize,
10905 concat!(
10906 "Offset of field: ",
10907 stringify!(ble_gatts_char_pf_t),
10908 "::",
10909 stringify!(exponent)
10910 )
10911 );
10912 assert_eq!(
10913 unsafe { &(*(::core::ptr::null::<ble_gatts_char_pf_t>())).unit as *const _ as usize },
10914 2usize,
10915 concat!(
10916 "Offset of field: ",
10917 stringify!(ble_gatts_char_pf_t),
10918 "::",
10919 stringify!(unit)
10920 )
10921 );
10922 assert_eq!(
10923 unsafe { &(*(::core::ptr::null::<ble_gatts_char_pf_t>())).name_space as *const _ as usize },
10924 4usize,
10925 concat!(
10926 "Offset of field: ",
10927 stringify!(ble_gatts_char_pf_t),
10928 "::",
10929 stringify!(name_space)
10930 )
10931 );
10932 assert_eq!(
10933 unsafe { &(*(::core::ptr::null::<ble_gatts_char_pf_t>())).desc as *const _ as usize },
10934 6usize,
10935 concat!(
10936 "Offset of field: ",
10937 stringify!(ble_gatts_char_pf_t),
10938 "::",
10939 stringify!(desc)
10940 )
10941 );
10942}
10943#[doc = "@brief GATT Characteristic metadata."]
10944#[repr(C)]
10945#[derive(Debug, Copy, Clone)]
10946pub struct ble_gatts_char_md_t {
10947 #[doc = "< Characteristic Properties."]
10948 pub char_props: ble_gatt_char_props_t,
10949 #[doc = "< Characteristic Extended Properties."]
10950 pub char_ext_props: ble_gatt_char_ext_props_t,
10951 #[doc = "< Pointer to a UTF-8 encoded string (non-NULL terminated), NULL if the descriptor is not required."]
10952 pub p_char_user_desc: *const u8,
10953 #[doc = "< The maximum size in bytes of the user description descriptor."]
10954 pub char_user_desc_max_size: u16,
10955 #[doc = "< The size of the user description, must be smaller or equal to char_user_desc_max_size."]
10956 pub char_user_desc_size: u16,
10957 #[doc = "< Pointer to a presentation format structure or NULL if the CPF descriptor is not required."]
10958 pub p_char_pf: *const ble_gatts_char_pf_t,
10959 #[doc = "< Attribute metadata for the User Description descriptor, or NULL for default values."]
10960 pub p_user_desc_md: *const ble_gatts_attr_md_t,
10961 #[doc = "< Attribute metadata for the Client Characteristic Configuration Descriptor, or NULL for default values."]
10962 pub p_cccd_md: *const ble_gatts_attr_md_t,
10963 #[doc = "< Attribute metadata for the Server Characteristic Configuration Descriptor, or NULL for default values."]
10964 pub p_sccd_md: *const ble_gatts_attr_md_t,
10965}
10966#[test]
10967fn bindgen_test_layout_ble_gatts_char_md_t() {
10968 assert_eq!(
10969 ::core::mem::size_of::<ble_gatts_char_md_t>(),
10970 28usize,
10971 concat!("Size of: ", stringify!(ble_gatts_char_md_t))
10972 );
10973 assert_eq!(
10974 ::core::mem::align_of::<ble_gatts_char_md_t>(),
10975 4usize,
10976 concat!("Alignment of ", stringify!(ble_gatts_char_md_t))
10977 );
10978 assert_eq!(
10979 unsafe { &(*(::core::ptr::null::<ble_gatts_char_md_t>())).char_props as *const _ as usize },
10980 0usize,
10981 concat!(
10982 "Offset of field: ",
10983 stringify!(ble_gatts_char_md_t),
10984 "::",
10985 stringify!(char_props)
10986 )
10987 );
10988 assert_eq!(
10989 unsafe { &(*(::core::ptr::null::<ble_gatts_char_md_t>())).char_ext_props as *const _ as usize },
10990 1usize,
10991 concat!(
10992 "Offset of field: ",
10993 stringify!(ble_gatts_char_md_t),
10994 "::",
10995 stringify!(char_ext_props)
10996 )
10997 );
10998 assert_eq!(
10999 unsafe { &(*(::core::ptr::null::<ble_gatts_char_md_t>())).p_char_user_desc as *const _ as usize },
11000 4usize,
11001 concat!(
11002 "Offset of field: ",
11003 stringify!(ble_gatts_char_md_t),
11004 "::",
11005 stringify!(p_char_user_desc)
11006 )
11007 );
11008 assert_eq!(
11009 unsafe { &(*(::core::ptr::null::<ble_gatts_char_md_t>())).char_user_desc_max_size as *const _ as usize },
11010 8usize,
11011 concat!(
11012 "Offset of field: ",
11013 stringify!(ble_gatts_char_md_t),
11014 "::",
11015 stringify!(char_user_desc_max_size)
11016 )
11017 );
11018 assert_eq!(
11019 unsafe { &(*(::core::ptr::null::<ble_gatts_char_md_t>())).char_user_desc_size as *const _ as usize },
11020 10usize,
11021 concat!(
11022 "Offset of field: ",
11023 stringify!(ble_gatts_char_md_t),
11024 "::",
11025 stringify!(char_user_desc_size)
11026 )
11027 );
11028 assert_eq!(
11029 unsafe { &(*(::core::ptr::null::<ble_gatts_char_md_t>())).p_char_pf as *const _ as usize },
11030 12usize,
11031 concat!(
11032 "Offset of field: ",
11033 stringify!(ble_gatts_char_md_t),
11034 "::",
11035 stringify!(p_char_pf)
11036 )
11037 );
11038 assert_eq!(
11039 unsafe { &(*(::core::ptr::null::<ble_gatts_char_md_t>())).p_user_desc_md as *const _ as usize },
11040 16usize,
11041 concat!(
11042 "Offset of field: ",
11043 stringify!(ble_gatts_char_md_t),
11044 "::",
11045 stringify!(p_user_desc_md)
11046 )
11047 );
11048 assert_eq!(
11049 unsafe { &(*(::core::ptr::null::<ble_gatts_char_md_t>())).p_cccd_md as *const _ as usize },
11050 20usize,
11051 concat!(
11052 "Offset of field: ",
11053 stringify!(ble_gatts_char_md_t),
11054 "::",
11055 stringify!(p_cccd_md)
11056 )
11057 );
11058 assert_eq!(
11059 unsafe { &(*(::core::ptr::null::<ble_gatts_char_md_t>())).p_sccd_md as *const _ as usize },
11060 24usize,
11061 concat!(
11062 "Offset of field: ",
11063 stringify!(ble_gatts_char_md_t),
11064 "::",
11065 stringify!(p_sccd_md)
11066 )
11067 );
11068}
11069#[doc = "@brief GATT Characteristic Definition Handles."]
11070#[repr(C)]
11071#[derive(Debug, Copy, Clone)]
11072pub struct ble_gatts_char_handles_t {
11073 #[doc = "< Handle to the characteristic value."]
11074 pub value_handle: u16,
11075 #[doc = "< Handle to the User Description descriptor, or @ref BLE_GATT_HANDLE_INVALID if not present."]
11076 pub user_desc_handle: u16,
11077 #[doc = "< Handle to the Client Characteristic Configuration Descriptor, or @ref BLE_GATT_HANDLE_INVALID if not present."]
11078 pub cccd_handle: u16,
11079 #[doc = "< Handle to the Server Characteristic Configuration Descriptor, or @ref BLE_GATT_HANDLE_INVALID if not present."]
11080 pub sccd_handle: u16,
11081}
11082#[test]
11083fn bindgen_test_layout_ble_gatts_char_handles_t() {
11084 assert_eq!(
11085 ::core::mem::size_of::<ble_gatts_char_handles_t>(),
11086 8usize,
11087 concat!("Size of: ", stringify!(ble_gatts_char_handles_t))
11088 );
11089 assert_eq!(
11090 ::core::mem::align_of::<ble_gatts_char_handles_t>(),
11091 2usize,
11092 concat!("Alignment of ", stringify!(ble_gatts_char_handles_t))
11093 );
11094 assert_eq!(
11095 unsafe { &(*(::core::ptr::null::<ble_gatts_char_handles_t>())).value_handle as *const _ as usize },
11096 0usize,
11097 concat!(
11098 "Offset of field: ",
11099 stringify!(ble_gatts_char_handles_t),
11100 "::",
11101 stringify!(value_handle)
11102 )
11103 );
11104 assert_eq!(
11105 unsafe { &(*(::core::ptr::null::<ble_gatts_char_handles_t>())).user_desc_handle as *const _ as usize },
11106 2usize,
11107 concat!(
11108 "Offset of field: ",
11109 stringify!(ble_gatts_char_handles_t),
11110 "::",
11111 stringify!(user_desc_handle)
11112 )
11113 );
11114 assert_eq!(
11115 unsafe { &(*(::core::ptr::null::<ble_gatts_char_handles_t>())).cccd_handle as *const _ as usize },
11116 4usize,
11117 concat!(
11118 "Offset of field: ",
11119 stringify!(ble_gatts_char_handles_t),
11120 "::",
11121 stringify!(cccd_handle)
11122 )
11123 );
11124 assert_eq!(
11125 unsafe { &(*(::core::ptr::null::<ble_gatts_char_handles_t>())).sccd_handle as *const _ as usize },
11126 6usize,
11127 concat!(
11128 "Offset of field: ",
11129 stringify!(ble_gatts_char_handles_t),
11130 "::",
11131 stringify!(sccd_handle)
11132 )
11133 );
11134}
11135#[doc = "@brief GATT HVx parameters."]
11136#[repr(C)]
11137#[derive(Debug, Copy, Clone)]
11138pub struct ble_gatts_hvx_params_t {
11139 #[doc = "< Characteristic Value Handle."]
11140 pub handle: u16,
11141 #[doc = "< Indication or Notification, see @ref BLE_GATT_HVX_TYPES."]
11142 pub type_: u8,
11143 #[doc = "< Offset within the attribute value."]
11144 pub offset: u16,
11145 #[doc = "< Length in bytes to be written, length in bytes written after return."]
11146 pub p_len: *mut u16,
11147 #[doc = "< Actual data content, use NULL to use the current attribute value."]
11148 pub p_data: *const u8,
11149}
11150#[test]
11151fn bindgen_test_layout_ble_gatts_hvx_params_t() {
11152 assert_eq!(
11153 ::core::mem::size_of::<ble_gatts_hvx_params_t>(),
11154 16usize,
11155 concat!("Size of: ", stringify!(ble_gatts_hvx_params_t))
11156 );
11157 assert_eq!(
11158 ::core::mem::align_of::<ble_gatts_hvx_params_t>(),
11159 4usize,
11160 concat!("Alignment of ", stringify!(ble_gatts_hvx_params_t))
11161 );
11162 assert_eq!(
11163 unsafe { &(*(::core::ptr::null::<ble_gatts_hvx_params_t>())).handle as *const _ as usize },
11164 0usize,
11165 concat!(
11166 "Offset of field: ",
11167 stringify!(ble_gatts_hvx_params_t),
11168 "::",
11169 stringify!(handle)
11170 )
11171 );
11172 assert_eq!(
11173 unsafe { &(*(::core::ptr::null::<ble_gatts_hvx_params_t>())).type_ as *const _ as usize },
11174 2usize,
11175 concat!(
11176 "Offset of field: ",
11177 stringify!(ble_gatts_hvx_params_t),
11178 "::",
11179 stringify!(type_)
11180 )
11181 );
11182 assert_eq!(
11183 unsafe { &(*(::core::ptr::null::<ble_gatts_hvx_params_t>())).offset as *const _ as usize },
11184 4usize,
11185 concat!(
11186 "Offset of field: ",
11187 stringify!(ble_gatts_hvx_params_t),
11188 "::",
11189 stringify!(offset)
11190 )
11191 );
11192 assert_eq!(
11193 unsafe { &(*(::core::ptr::null::<ble_gatts_hvx_params_t>())).p_len as *const _ as usize },
11194 8usize,
11195 concat!(
11196 "Offset of field: ",
11197 stringify!(ble_gatts_hvx_params_t),
11198 "::",
11199 stringify!(p_len)
11200 )
11201 );
11202 assert_eq!(
11203 unsafe { &(*(::core::ptr::null::<ble_gatts_hvx_params_t>())).p_data as *const _ as usize },
11204 12usize,
11205 concat!(
11206 "Offset of field: ",
11207 stringify!(ble_gatts_hvx_params_t),
11208 "::",
11209 stringify!(p_data)
11210 )
11211 );
11212}
11213#[doc = "@brief GATT Authorization parameters."]
11214#[repr(C)]
11215#[derive(Debug, Copy, Clone)]
11216pub struct ble_gatts_authorize_params_t {
11217 #[doc = "< GATT status code for the operation, see @ref BLE_GATT_STATUS_CODES."]
11218 pub gatt_status: u16,
11219 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
11220 #[doc = "< Offset of the attribute value being updated."]
11221 pub offset: u16,
11222 #[doc = "< Length in bytes of the value in p_data pointer, see @ref BLE_GATTS_ATTR_LENS_MAX."]
11223 pub len: u16,
11224 #[doc = "< Pointer to new value used to update the attribute value."]
11225 pub p_data: *const u8,
11226}
11227#[test]
11228fn bindgen_test_layout_ble_gatts_authorize_params_t() {
11229 assert_eq!(
11230 ::core::mem::size_of::<ble_gatts_authorize_params_t>(),
11231 12usize,
11232 concat!("Size of: ", stringify!(ble_gatts_authorize_params_t))
11233 );
11234 assert_eq!(
11235 ::core::mem::align_of::<ble_gatts_authorize_params_t>(),
11236 4usize,
11237 concat!("Alignment of ", stringify!(ble_gatts_authorize_params_t))
11238 );
11239 assert_eq!(
11240 unsafe { &(*(::core::ptr::null::<ble_gatts_authorize_params_t>())).gatt_status as *const _ as usize },
11241 0usize,
11242 concat!(
11243 "Offset of field: ",
11244 stringify!(ble_gatts_authorize_params_t),
11245 "::",
11246 stringify!(gatt_status)
11247 )
11248 );
11249 assert_eq!(
11250 unsafe { &(*(::core::ptr::null::<ble_gatts_authorize_params_t>())).offset as *const _ as usize },
11251 4usize,
11252 concat!(
11253 "Offset of field: ",
11254 stringify!(ble_gatts_authorize_params_t),
11255 "::",
11256 stringify!(offset)
11257 )
11258 );
11259 assert_eq!(
11260 unsafe { &(*(::core::ptr::null::<ble_gatts_authorize_params_t>())).len as *const _ as usize },
11261 6usize,
11262 concat!(
11263 "Offset of field: ",
11264 stringify!(ble_gatts_authorize_params_t),
11265 "::",
11266 stringify!(len)
11267 )
11268 );
11269 assert_eq!(
11270 unsafe { &(*(::core::ptr::null::<ble_gatts_authorize_params_t>())).p_data as *const _ as usize },
11271 8usize,
11272 concat!(
11273 "Offset of field: ",
11274 stringify!(ble_gatts_authorize_params_t),
11275 "::",
11276 stringify!(p_data)
11277 )
11278 );
11279}
11280impl ble_gatts_authorize_params_t {
11281 #[inline]
11282 pub fn update(&self) -> u8 {
11283 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
11284 }
11285 #[inline]
11286 pub fn set_update(&mut self, val: u8) {
11287 unsafe {
11288 let val: u8 = ::core::mem::transmute(val);
11289 self._bitfield_1.set(0usize, 1u8, val as u64)
11290 }
11291 }
11292 #[inline]
11293 pub fn new_bitfield_1(update: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
11294 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
11295 __bindgen_bitfield_unit.set(0usize, 1u8, {
11296 let update: u8 = unsafe { ::core::mem::transmute(update) };
11297 update as u64
11298 });
11299 __bindgen_bitfield_unit
11300 }
11301}
11302#[doc = "@brief GATT Read or Write Authorize Reply parameters."]
11303#[repr(C)]
11304#[derive(Copy, Clone)]
11305pub struct ble_gatts_rw_authorize_reply_params_t {
11306 #[doc = "< Type of authorize operation, see @ref BLE_GATTS_AUTHORIZE_TYPES."]
11307 pub type_: u8,
11308 #[doc = "< Reply Parameters."]
11309 pub params: ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1,
11310}
11311#[repr(C)]
11312#[derive(Copy, Clone)]
11313pub union ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1 {
11314 #[doc = "< Read authorization parameters."]
11315 pub read: ble_gatts_authorize_params_t,
11316 #[doc = "< Write authorization parameters."]
11317 pub write: ble_gatts_authorize_params_t,
11318 _bindgen_union_align: [u32; 3usize],
11319}
11320#[test]
11321fn bindgen_test_layout_ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1() {
11322 assert_eq!(
11323 ::core::mem::size_of::<ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1>(),
11324 12usize,
11325 concat!(
11326 "Size of: ",
11327 stringify!(ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1)
11328 )
11329 );
11330 assert_eq!(
11331 ::core::mem::align_of::<ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1>(),
11332 4usize,
11333 concat!(
11334 "Alignment of ",
11335 stringify!(ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1)
11336 )
11337 );
11338 assert_eq!(
11339 unsafe {
11340 &(*(::core::ptr::null::<ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1>())).read as *const _ as usize
11341 },
11342 0usize,
11343 concat!(
11344 "Offset of field: ",
11345 stringify!(ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1),
11346 "::",
11347 stringify!(read)
11348 )
11349 );
11350 assert_eq!(
11351 unsafe {
11352 &(*(::core::ptr::null::<ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1>())).write as *const _ as usize
11353 },
11354 0usize,
11355 concat!(
11356 "Offset of field: ",
11357 stringify!(ble_gatts_rw_authorize_reply_params_t__bindgen_ty_1),
11358 "::",
11359 stringify!(write)
11360 )
11361 );
11362}
11363#[test]
11364fn bindgen_test_layout_ble_gatts_rw_authorize_reply_params_t() {
11365 assert_eq!(
11366 ::core::mem::size_of::<ble_gatts_rw_authorize_reply_params_t>(),
11367 16usize,
11368 concat!("Size of: ", stringify!(ble_gatts_rw_authorize_reply_params_t))
11369 );
11370 assert_eq!(
11371 ::core::mem::align_of::<ble_gatts_rw_authorize_reply_params_t>(),
11372 4usize,
11373 concat!("Alignment of ", stringify!(ble_gatts_rw_authorize_reply_params_t))
11374 );
11375 assert_eq!(
11376 unsafe { &(*(::core::ptr::null::<ble_gatts_rw_authorize_reply_params_t>())).type_ as *const _ as usize },
11377 0usize,
11378 concat!(
11379 "Offset of field: ",
11380 stringify!(ble_gatts_rw_authorize_reply_params_t),
11381 "::",
11382 stringify!(type_)
11383 )
11384 );
11385 assert_eq!(
11386 unsafe { &(*(::core::ptr::null::<ble_gatts_rw_authorize_reply_params_t>())).params as *const _ as usize },
11387 4usize,
11388 concat!(
11389 "Offset of field: ",
11390 stringify!(ble_gatts_rw_authorize_reply_params_t),
11391 "::",
11392 stringify!(params)
11393 )
11394 );
11395}
11396#[doc = "@brief Service Changed Inclusion configuration parameters, set with @ref sd_ble_cfg_set."]
11397#[repr(C, packed)]
11398#[derive(Debug, Copy, Clone)]
11399pub struct ble_gatts_cfg_service_changed_t {
11400 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
11401}
11402#[test]
11403fn bindgen_test_layout_ble_gatts_cfg_service_changed_t() {
11404 assert_eq!(
11405 ::core::mem::size_of::<ble_gatts_cfg_service_changed_t>(),
11406 1usize,
11407 concat!("Size of: ", stringify!(ble_gatts_cfg_service_changed_t))
11408 );
11409 assert_eq!(
11410 ::core::mem::align_of::<ble_gatts_cfg_service_changed_t>(),
11411 1usize,
11412 concat!("Alignment of ", stringify!(ble_gatts_cfg_service_changed_t))
11413 );
11414}
11415impl ble_gatts_cfg_service_changed_t {
11416 #[inline]
11417 pub fn service_changed(&self) -> u8 {
11418 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
11419 }
11420 #[inline]
11421 pub fn set_service_changed(&mut self, val: u8) {
11422 unsafe {
11423 let val: u8 = ::core::mem::transmute(val);
11424 self._bitfield_1.set(0usize, 1u8, val as u64)
11425 }
11426 }
11427 #[inline]
11428 pub fn new_bitfield_1(service_changed: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
11429 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
11430 __bindgen_bitfield_unit.set(0usize, 1u8, {
11431 let service_changed: u8 = unsafe { ::core::mem::transmute(service_changed) };
11432 service_changed as u64
11433 });
11434 __bindgen_bitfield_unit
11435 }
11436}
11437#[doc = "@brief Attribute table size configuration parameters, set with @ref sd_ble_cfg_set."]
11438#[doc = ""]
11439#[doc = " @retval ::NRF_ERROR_INVALID_LENGTH One or more of the following is true:"]
11440#[doc = " - The specified Attribute Table size is too small."]
11441#[doc = " The minimum acceptable size is defined by @ref BLE_GATTS_ATTR_TAB_SIZE_MIN."]
11442#[doc = " - The specified Attribute Table size is not a multiple of 4."]
11443#[repr(C)]
11444#[derive(Debug, Copy, Clone)]
11445pub struct ble_gatts_cfg_attr_tab_size_t {
11446 #[doc = "< Attribute table size. Default is @ref BLE_GATTS_ATTR_TAB_SIZE_DEFAULT, minimum is @ref BLE_GATTS_ATTR_TAB_SIZE_MIN."]
11447 pub attr_tab_size: u32,
11448}
11449#[test]
11450fn bindgen_test_layout_ble_gatts_cfg_attr_tab_size_t() {
11451 assert_eq!(
11452 ::core::mem::size_of::<ble_gatts_cfg_attr_tab_size_t>(),
11453 4usize,
11454 concat!("Size of: ", stringify!(ble_gatts_cfg_attr_tab_size_t))
11455 );
11456 assert_eq!(
11457 ::core::mem::align_of::<ble_gatts_cfg_attr_tab_size_t>(),
11458 4usize,
11459 concat!("Alignment of ", stringify!(ble_gatts_cfg_attr_tab_size_t))
11460 );
11461 assert_eq!(
11462 unsafe { &(*(::core::ptr::null::<ble_gatts_cfg_attr_tab_size_t>())).attr_tab_size as *const _ as usize },
11463 0usize,
11464 concat!(
11465 "Offset of field: ",
11466 stringify!(ble_gatts_cfg_attr_tab_size_t),
11467 "::",
11468 stringify!(attr_tab_size)
11469 )
11470 );
11471}
11472#[doc = "@brief Config structure for GATTS configurations."]
11473#[repr(C)]
11474#[derive(Copy, Clone)]
11475pub union ble_gatts_cfg_t {
11476 #[doc = "< Include service changed characteristic, cfg_id is @ref BLE_GATTS_CFG_SERVICE_CHANGED."]
11477 pub service_changed: ble_gatts_cfg_service_changed_t,
11478 #[doc = "< Attribute table size, cfg_id is @ref BLE_GATTS_CFG_ATTR_TAB_SIZE."]
11479 pub attr_tab_size: ble_gatts_cfg_attr_tab_size_t,
11480 _bindgen_union_align: u32,
11481}
11482#[test]
11483fn bindgen_test_layout_ble_gatts_cfg_t() {
11484 assert_eq!(
11485 ::core::mem::size_of::<ble_gatts_cfg_t>(),
11486 4usize,
11487 concat!("Size of: ", stringify!(ble_gatts_cfg_t))
11488 );
11489 assert_eq!(
11490 ::core::mem::align_of::<ble_gatts_cfg_t>(),
11491 4usize,
11492 concat!("Alignment of ", stringify!(ble_gatts_cfg_t))
11493 );
11494 assert_eq!(
11495 unsafe { &(*(::core::ptr::null::<ble_gatts_cfg_t>())).service_changed as *const _ as usize },
11496 0usize,
11497 concat!(
11498 "Offset of field: ",
11499 stringify!(ble_gatts_cfg_t),
11500 "::",
11501 stringify!(service_changed)
11502 )
11503 );
11504 assert_eq!(
11505 unsafe { &(*(::core::ptr::null::<ble_gatts_cfg_t>())).attr_tab_size as *const _ as usize },
11506 0usize,
11507 concat!(
11508 "Offset of field: ",
11509 stringify!(ble_gatts_cfg_t),
11510 "::",
11511 stringify!(attr_tab_size)
11512 )
11513 );
11514}
11515#[doc = "@brief Event structure for @ref BLE_GATTS_EVT_WRITE."]
11516#[repr(C)]
11517#[derive(Debug)]
11518pub struct ble_gatts_evt_write_t {
11519 #[doc = "< Attribute Handle."]
11520 pub handle: u16,
11521 #[doc = "< Attribute UUID."]
11522 pub uuid: ble_uuid_t,
11523 #[doc = "< Type of write operation, see @ref BLE_GATTS_OPS."]
11524 pub op: u8,
11525 #[doc = "< Writing operation deferred due to authorization requirement. Application may use @ref sd_ble_gatts_value_set to finalize the writing operation."]
11526 pub auth_required: u8,
11527 #[doc = "< Offset for the write operation."]
11528 pub offset: u16,
11529 #[doc = "< Length of the received data."]
11530 pub len: u16,
11531 #[doc = "< Received data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation."]
11532 #[doc = "See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members."]
11533 pub data: __IncompleteArrayField<u8>,
11534}
11535#[test]
11536fn bindgen_test_layout_ble_gatts_evt_write_t() {
11537 assert_eq!(
11538 ::core::mem::size_of::<ble_gatts_evt_write_t>(),
11539 12usize,
11540 concat!("Size of: ", stringify!(ble_gatts_evt_write_t))
11541 );
11542 assert_eq!(
11543 ::core::mem::align_of::<ble_gatts_evt_write_t>(),
11544 2usize,
11545 concat!("Alignment of ", stringify!(ble_gatts_evt_write_t))
11546 );
11547 assert_eq!(
11548 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_write_t>())).handle as *const _ as usize },
11549 0usize,
11550 concat!(
11551 "Offset of field: ",
11552 stringify!(ble_gatts_evt_write_t),
11553 "::",
11554 stringify!(handle)
11555 )
11556 );
11557 assert_eq!(
11558 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_write_t>())).uuid as *const _ as usize },
11559 2usize,
11560 concat!(
11561 "Offset of field: ",
11562 stringify!(ble_gatts_evt_write_t),
11563 "::",
11564 stringify!(uuid)
11565 )
11566 );
11567 assert_eq!(
11568 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_write_t>())).op as *const _ as usize },
11569 6usize,
11570 concat!(
11571 "Offset of field: ",
11572 stringify!(ble_gatts_evt_write_t),
11573 "::",
11574 stringify!(op)
11575 )
11576 );
11577 assert_eq!(
11578 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_write_t>())).auth_required as *const _ as usize },
11579 7usize,
11580 concat!(
11581 "Offset of field: ",
11582 stringify!(ble_gatts_evt_write_t),
11583 "::",
11584 stringify!(auth_required)
11585 )
11586 );
11587 assert_eq!(
11588 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_write_t>())).offset as *const _ as usize },
11589 8usize,
11590 concat!(
11591 "Offset of field: ",
11592 stringify!(ble_gatts_evt_write_t),
11593 "::",
11594 stringify!(offset)
11595 )
11596 );
11597 assert_eq!(
11598 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_write_t>())).len as *const _ as usize },
11599 10usize,
11600 concat!(
11601 "Offset of field: ",
11602 stringify!(ble_gatts_evt_write_t),
11603 "::",
11604 stringify!(len)
11605 )
11606 );
11607 assert_eq!(
11608 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_write_t>())).data as *const _ as usize },
11609 12usize,
11610 concat!(
11611 "Offset of field: ",
11612 stringify!(ble_gatts_evt_write_t),
11613 "::",
11614 stringify!(data)
11615 )
11616 );
11617}
11618#[doc = "@brief Event substructure for authorized read requests, see @ref ble_gatts_evt_rw_authorize_request_t."]
11619#[repr(C)]
11620#[derive(Debug, Copy, Clone)]
11621pub struct ble_gatts_evt_read_t {
11622 #[doc = "< Attribute Handle."]
11623 pub handle: u16,
11624 #[doc = "< Attribute UUID."]
11625 pub uuid: ble_uuid_t,
11626 #[doc = "< Offset for the read operation."]
11627 pub offset: u16,
11628}
11629#[test]
11630fn bindgen_test_layout_ble_gatts_evt_read_t() {
11631 assert_eq!(
11632 ::core::mem::size_of::<ble_gatts_evt_read_t>(),
11633 8usize,
11634 concat!("Size of: ", stringify!(ble_gatts_evt_read_t))
11635 );
11636 assert_eq!(
11637 ::core::mem::align_of::<ble_gatts_evt_read_t>(),
11638 2usize,
11639 concat!("Alignment of ", stringify!(ble_gatts_evt_read_t))
11640 );
11641 assert_eq!(
11642 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_read_t>())).handle as *const _ as usize },
11643 0usize,
11644 concat!(
11645 "Offset of field: ",
11646 stringify!(ble_gatts_evt_read_t),
11647 "::",
11648 stringify!(handle)
11649 )
11650 );
11651 assert_eq!(
11652 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_read_t>())).uuid as *const _ as usize },
11653 2usize,
11654 concat!(
11655 "Offset of field: ",
11656 stringify!(ble_gatts_evt_read_t),
11657 "::",
11658 stringify!(uuid)
11659 )
11660 );
11661 assert_eq!(
11662 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_read_t>())).offset as *const _ as usize },
11663 6usize,
11664 concat!(
11665 "Offset of field: ",
11666 stringify!(ble_gatts_evt_read_t),
11667 "::",
11668 stringify!(offset)
11669 )
11670 );
11671}
11672#[doc = "@brief Event structure for @ref BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST."]
11673#[repr(C)]
11674pub struct ble_gatts_evt_rw_authorize_request_t {
11675 #[doc = "< Type of authorize operation, see @ref BLE_GATTS_AUTHORIZE_TYPES."]
11676 pub type_: u8,
11677 #[doc = "< Request Parameters."]
11678 pub request: ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1,
11679}
11680#[repr(C)]
11681pub struct ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1 {
11682 #[doc = "< Attribute Read Parameters."]
11683 pub read: __BindgenUnionField<ble_gatts_evt_read_t>,
11684 #[doc = "< Attribute Write Parameters."]
11685 pub write: __BindgenUnionField<ble_gatts_evt_write_t>,
11686 pub bindgen_union_field: [u16; 6usize],
11687}
11688#[test]
11689fn bindgen_test_layout_ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1() {
11690 assert_eq!(
11691 ::core::mem::size_of::<ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1>(),
11692 12usize,
11693 concat!(
11694 "Size of: ",
11695 stringify!(ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1)
11696 )
11697 );
11698 assert_eq!(
11699 ::core::mem::align_of::<ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1>(),
11700 2usize,
11701 concat!(
11702 "Alignment of ",
11703 stringify!(ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1)
11704 )
11705 );
11706 assert_eq!(
11707 unsafe {
11708 &(*(::core::ptr::null::<ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1>())).read as *const _ as usize
11709 },
11710 0usize,
11711 concat!(
11712 "Offset of field: ",
11713 stringify!(ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1),
11714 "::",
11715 stringify!(read)
11716 )
11717 );
11718 assert_eq!(
11719 unsafe {
11720 &(*(::core::ptr::null::<ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1>())).write as *const _ as usize
11721 },
11722 0usize,
11723 concat!(
11724 "Offset of field: ",
11725 stringify!(ble_gatts_evt_rw_authorize_request_t__bindgen_ty_1),
11726 "::",
11727 stringify!(write)
11728 )
11729 );
11730}
11731#[test]
11732fn bindgen_test_layout_ble_gatts_evt_rw_authorize_request_t() {
11733 assert_eq!(
11734 ::core::mem::size_of::<ble_gatts_evt_rw_authorize_request_t>(),
11735 14usize,
11736 concat!("Size of: ", stringify!(ble_gatts_evt_rw_authorize_request_t))
11737 );
11738 assert_eq!(
11739 ::core::mem::align_of::<ble_gatts_evt_rw_authorize_request_t>(),
11740 2usize,
11741 concat!("Alignment of ", stringify!(ble_gatts_evt_rw_authorize_request_t))
11742 );
11743 assert_eq!(
11744 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_rw_authorize_request_t>())).type_ as *const _ as usize },
11745 0usize,
11746 concat!(
11747 "Offset of field: ",
11748 stringify!(ble_gatts_evt_rw_authorize_request_t),
11749 "::",
11750 stringify!(type_)
11751 )
11752 );
11753 assert_eq!(
11754 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_rw_authorize_request_t>())).request as *const _ as usize },
11755 2usize,
11756 concat!(
11757 "Offset of field: ",
11758 stringify!(ble_gatts_evt_rw_authorize_request_t),
11759 "::",
11760 stringify!(request)
11761 )
11762 );
11763}
11764#[doc = "@brief Event structure for @ref BLE_GATTS_EVT_SYS_ATTR_MISSING."]
11765#[repr(C)]
11766#[derive(Debug, Copy, Clone)]
11767pub struct ble_gatts_evt_sys_attr_missing_t {
11768 #[doc = "< Hint (currently unused)."]
11769 pub hint: u8,
11770}
11771#[test]
11772fn bindgen_test_layout_ble_gatts_evt_sys_attr_missing_t() {
11773 assert_eq!(
11774 ::core::mem::size_of::<ble_gatts_evt_sys_attr_missing_t>(),
11775 1usize,
11776 concat!("Size of: ", stringify!(ble_gatts_evt_sys_attr_missing_t))
11777 );
11778 assert_eq!(
11779 ::core::mem::align_of::<ble_gatts_evt_sys_attr_missing_t>(),
11780 1usize,
11781 concat!("Alignment of ", stringify!(ble_gatts_evt_sys_attr_missing_t))
11782 );
11783 assert_eq!(
11784 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_sys_attr_missing_t>())).hint as *const _ as usize },
11785 0usize,
11786 concat!(
11787 "Offset of field: ",
11788 stringify!(ble_gatts_evt_sys_attr_missing_t),
11789 "::",
11790 stringify!(hint)
11791 )
11792 );
11793}
11794#[doc = "@brief Event structure for @ref BLE_GATTS_EVT_HVC."]
11795#[repr(C)]
11796#[derive(Debug, Copy, Clone)]
11797pub struct ble_gatts_evt_hvc_t {
11798 #[doc = "< Attribute Handle."]
11799 pub handle: u16,
11800}
11801#[test]
11802fn bindgen_test_layout_ble_gatts_evt_hvc_t() {
11803 assert_eq!(
11804 ::core::mem::size_of::<ble_gatts_evt_hvc_t>(),
11805 2usize,
11806 concat!("Size of: ", stringify!(ble_gatts_evt_hvc_t))
11807 );
11808 assert_eq!(
11809 ::core::mem::align_of::<ble_gatts_evt_hvc_t>(),
11810 2usize,
11811 concat!("Alignment of ", stringify!(ble_gatts_evt_hvc_t))
11812 );
11813 assert_eq!(
11814 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_hvc_t>())).handle as *const _ as usize },
11815 0usize,
11816 concat!(
11817 "Offset of field: ",
11818 stringify!(ble_gatts_evt_hvc_t),
11819 "::",
11820 stringify!(handle)
11821 )
11822 );
11823}
11824#[doc = "@brief Event structure for @ref BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST."]
11825#[repr(C)]
11826#[derive(Debug, Copy, Clone)]
11827pub struct ble_gatts_evt_exchange_mtu_request_t {
11828 #[doc = "< Client RX MTU size."]
11829 pub client_rx_mtu: u16,
11830}
11831#[test]
11832fn bindgen_test_layout_ble_gatts_evt_exchange_mtu_request_t() {
11833 assert_eq!(
11834 ::core::mem::size_of::<ble_gatts_evt_exchange_mtu_request_t>(),
11835 2usize,
11836 concat!("Size of: ", stringify!(ble_gatts_evt_exchange_mtu_request_t))
11837 );
11838 assert_eq!(
11839 ::core::mem::align_of::<ble_gatts_evt_exchange_mtu_request_t>(),
11840 2usize,
11841 concat!("Alignment of ", stringify!(ble_gatts_evt_exchange_mtu_request_t))
11842 );
11843 assert_eq!(
11844 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_exchange_mtu_request_t>())).client_rx_mtu as *const _ as usize },
11845 0usize,
11846 concat!(
11847 "Offset of field: ",
11848 stringify!(ble_gatts_evt_exchange_mtu_request_t),
11849 "::",
11850 stringify!(client_rx_mtu)
11851 )
11852 );
11853}
11854#[doc = "@brief Event structure for @ref BLE_GATTS_EVT_TIMEOUT."]
11855#[repr(C)]
11856#[derive(Debug, Copy, Clone)]
11857pub struct ble_gatts_evt_timeout_t {
11858 #[doc = "< Timeout source, see @ref BLE_GATT_TIMEOUT_SOURCES."]
11859 pub src: u8,
11860}
11861#[test]
11862fn bindgen_test_layout_ble_gatts_evt_timeout_t() {
11863 assert_eq!(
11864 ::core::mem::size_of::<ble_gatts_evt_timeout_t>(),
11865 1usize,
11866 concat!("Size of: ", stringify!(ble_gatts_evt_timeout_t))
11867 );
11868 assert_eq!(
11869 ::core::mem::align_of::<ble_gatts_evt_timeout_t>(),
11870 1usize,
11871 concat!("Alignment of ", stringify!(ble_gatts_evt_timeout_t))
11872 );
11873 assert_eq!(
11874 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_timeout_t>())).src as *const _ as usize },
11875 0usize,
11876 concat!(
11877 "Offset of field: ",
11878 stringify!(ble_gatts_evt_timeout_t),
11879 "::",
11880 stringify!(src)
11881 )
11882 );
11883}
11884#[doc = "@brief Event structure for @ref BLE_GATTS_EVT_HVN_TX_COMPLETE."]
11885#[repr(C)]
11886#[derive(Debug, Copy, Clone)]
11887pub struct ble_gatts_evt_hvn_tx_complete_t {
11888 #[doc = "< Number of notification transmissions completed."]
11889 pub count: u8,
11890}
11891#[test]
11892fn bindgen_test_layout_ble_gatts_evt_hvn_tx_complete_t() {
11893 assert_eq!(
11894 ::core::mem::size_of::<ble_gatts_evt_hvn_tx_complete_t>(),
11895 1usize,
11896 concat!("Size of: ", stringify!(ble_gatts_evt_hvn_tx_complete_t))
11897 );
11898 assert_eq!(
11899 ::core::mem::align_of::<ble_gatts_evt_hvn_tx_complete_t>(),
11900 1usize,
11901 concat!("Alignment of ", stringify!(ble_gatts_evt_hvn_tx_complete_t))
11902 );
11903 assert_eq!(
11904 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_hvn_tx_complete_t>())).count as *const _ as usize },
11905 0usize,
11906 concat!(
11907 "Offset of field: ",
11908 stringify!(ble_gatts_evt_hvn_tx_complete_t),
11909 "::",
11910 stringify!(count)
11911 )
11912 );
11913}
11914#[doc = "@brief GATTS event structure."]
11915#[repr(C)]
11916pub struct ble_gatts_evt_t {
11917 #[doc = "< Connection Handle on which the event occurred."]
11918 pub conn_handle: u16,
11919 #[doc = "< Event Parameters."]
11920 pub params: ble_gatts_evt_t__bindgen_ty_1,
11921}
11922#[repr(C)]
11923pub struct ble_gatts_evt_t__bindgen_ty_1 {
11924 #[doc = "< Write Event Parameters."]
11925 pub write: __BindgenUnionField<ble_gatts_evt_write_t>,
11926 #[doc = "< Read or Write Authorize Request Parameters."]
11927 pub authorize_request: __BindgenUnionField<ble_gatts_evt_rw_authorize_request_t>,
11928 #[doc = "< System attributes missing."]
11929 pub sys_attr_missing: __BindgenUnionField<ble_gatts_evt_sys_attr_missing_t>,
11930 #[doc = "< Handle Value Confirmation Event Parameters."]
11931 pub hvc: __BindgenUnionField<ble_gatts_evt_hvc_t>,
11932 #[doc = "< Exchange MTU Request Event Parameters."]
11933 pub exchange_mtu_request: __BindgenUnionField<ble_gatts_evt_exchange_mtu_request_t>,
11934 #[doc = "< Timeout Event."]
11935 pub timeout: __BindgenUnionField<ble_gatts_evt_timeout_t>,
11936 #[doc = "< Handle Value Notification transmission complete Event Parameters."]
11937 pub hvn_tx_complete: __BindgenUnionField<ble_gatts_evt_hvn_tx_complete_t>,
11938 pub bindgen_union_field: [u16; 7usize],
11939}
11940#[test]
11941fn bindgen_test_layout_ble_gatts_evt_t__bindgen_ty_1() {
11942 assert_eq!(
11943 ::core::mem::size_of::<ble_gatts_evt_t__bindgen_ty_1>(),
11944 14usize,
11945 concat!("Size of: ", stringify!(ble_gatts_evt_t__bindgen_ty_1))
11946 );
11947 assert_eq!(
11948 ::core::mem::align_of::<ble_gatts_evt_t__bindgen_ty_1>(),
11949 2usize,
11950 concat!("Alignment of ", stringify!(ble_gatts_evt_t__bindgen_ty_1))
11951 );
11952 assert_eq!(
11953 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_t__bindgen_ty_1>())).write as *const _ as usize },
11954 0usize,
11955 concat!(
11956 "Offset of field: ",
11957 stringify!(ble_gatts_evt_t__bindgen_ty_1),
11958 "::",
11959 stringify!(write)
11960 )
11961 );
11962 assert_eq!(
11963 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_t__bindgen_ty_1>())).authorize_request as *const _ as usize },
11964 0usize,
11965 concat!(
11966 "Offset of field: ",
11967 stringify!(ble_gatts_evt_t__bindgen_ty_1),
11968 "::",
11969 stringify!(authorize_request)
11970 )
11971 );
11972 assert_eq!(
11973 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_t__bindgen_ty_1>())).sys_attr_missing as *const _ as usize },
11974 0usize,
11975 concat!(
11976 "Offset of field: ",
11977 stringify!(ble_gatts_evt_t__bindgen_ty_1),
11978 "::",
11979 stringify!(sys_attr_missing)
11980 )
11981 );
11982 assert_eq!(
11983 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_t__bindgen_ty_1>())).hvc as *const _ as usize },
11984 0usize,
11985 concat!(
11986 "Offset of field: ",
11987 stringify!(ble_gatts_evt_t__bindgen_ty_1),
11988 "::",
11989 stringify!(hvc)
11990 )
11991 );
11992 assert_eq!(
11993 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_t__bindgen_ty_1>())).exchange_mtu_request as *const _ as usize },
11994 0usize,
11995 concat!(
11996 "Offset of field: ",
11997 stringify!(ble_gatts_evt_t__bindgen_ty_1),
11998 "::",
11999 stringify!(exchange_mtu_request)
12000 )
12001 );
12002 assert_eq!(
12003 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_t__bindgen_ty_1>())).timeout as *const _ as usize },
12004 0usize,
12005 concat!(
12006 "Offset of field: ",
12007 stringify!(ble_gatts_evt_t__bindgen_ty_1),
12008 "::",
12009 stringify!(timeout)
12010 )
12011 );
12012 assert_eq!(
12013 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_t__bindgen_ty_1>())).hvn_tx_complete as *const _ as usize },
12014 0usize,
12015 concat!(
12016 "Offset of field: ",
12017 stringify!(ble_gatts_evt_t__bindgen_ty_1),
12018 "::",
12019 stringify!(hvn_tx_complete)
12020 )
12021 );
12022}
12023#[test]
12024fn bindgen_test_layout_ble_gatts_evt_t() {
12025 assert_eq!(
12026 ::core::mem::size_of::<ble_gatts_evt_t>(),
12027 16usize,
12028 concat!("Size of: ", stringify!(ble_gatts_evt_t))
12029 );
12030 assert_eq!(
12031 ::core::mem::align_of::<ble_gatts_evt_t>(),
12032 2usize,
12033 concat!("Alignment of ", stringify!(ble_gatts_evt_t))
12034 );
12035 assert_eq!(
12036 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_t>())).conn_handle as *const _ as usize },
12037 0usize,
12038 concat!(
12039 "Offset of field: ",
12040 stringify!(ble_gatts_evt_t),
12041 "::",
12042 stringify!(conn_handle)
12043 )
12044 );
12045 assert_eq!(
12046 unsafe { &(*(::core::ptr::null::<ble_gatts_evt_t>())).params as *const _ as usize },
12047 2usize,
12048 concat!(
12049 "Offset of field: ",
12050 stringify!(ble_gatts_evt_t),
12051 "::",
12052 stringify!(params)
12053 )
12054 );
12055}
12056
12057#[doc = "@brief Add a service declaration to the Attribute Table."]
12058#[doc = ""]
12059#[doc = " @note Secondary Services are only relevant in the context of the entity that references them, it is therefore forbidden to"]
12060#[doc = " add a secondary service declaration that is not referenced by another service later in the Attribute Table."]
12061#[doc = ""]
12062#[doc = " @mscs"]
12063#[doc = " @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC}"]
12064#[doc = " @endmscs"]
12065#[doc = ""]
12066#[doc = " @param[in] type Toggles between primary and secondary services, see @ref BLE_GATTS_SRVC_TYPES."]
12067#[doc = " @param[in] p_uuid Pointer to service UUID."]
12068#[doc = " @param[out] p_handle Pointer to a 16-bit word where the assigned handle will be stored."]
12069#[doc = ""]
12070#[doc = " @retval ::NRF_SUCCESS Successfully added a service declaration."]
12071#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
12072#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, Vendor Specific UUIDs need to be present in the table."]
12073#[doc = " @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, certain UUIDs are reserved for the stack."]
12074#[doc = " @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation."]
12075#[inline(always)]
12076pub unsafe fn sd_ble_gatts_service_add(type_: u8, p_uuid: *const ble_uuid_t, p_handle: *mut u16) -> u32 {
12077 let ret: u32;
12078 core::arch::asm!("svc 168",
12079 inout("r0") to_asm(type_) => ret,
12080 inout("r1") to_asm(p_uuid) => _,
12081 inout("r2") to_asm(p_handle) => _,
12082 lateout("r3") _,
12083 lateout("r12") _,
12084 );
12085 ret
12086}
12087
12088#[doc = "@brief Add an include declaration to the Attribute Table."]
12089#[doc = ""]
12090#[doc = " @note It is currently only possible to add an include declaration to the last added service (i.e. only sequential population is supported at this time)."]
12091#[doc = ""]
12092#[doc = " @note The included service must already be present in the Attribute Table prior to this call."]
12093#[doc = ""]
12094#[doc = " @mscs"]
12095#[doc = " @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC}"]
12096#[doc = " @endmscs"]
12097#[doc = ""]
12098#[doc = " @param[in] service_handle Handle of the service where the included service is to be placed, if @ref BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially."]
12099#[doc = " @param[in] inc_srvc_handle Handle of the included service."]
12100#[doc = " @param[out] p_include_handle Pointer to a 16-bit word where the assigned handle will be stored."]
12101#[doc = ""]
12102#[doc = " @retval ::NRF_SUCCESS Successfully added an include declaration."]
12103#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
12104#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, handle values need to match previously added services."]
12105#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation, a service context is required."]
12106#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED Feature is not supported, service_handle must be that of the last added service."]
12107#[doc = " @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, self inclusions are not allowed."]
12108#[doc = " @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation."]
12109#[doc = " @retval ::NRF_ERROR_NOT_FOUND Attribute not found."]
12110#[inline(always)]
12111pub unsafe fn sd_ble_gatts_include_add(service_handle: u16, inc_srvc_handle: u16, p_include_handle: *mut u16) -> u32 {
12112 let ret: u32;
12113 core::arch::asm!("svc 169",
12114 inout("r0") to_asm(service_handle) => ret,
12115 inout("r1") to_asm(inc_srvc_handle) => _,
12116 inout("r2") to_asm(p_include_handle) => _,
12117 lateout("r3") _,
12118 lateout("r12") _,
12119 );
12120 ret
12121}
12122
12123#[doc = "@brief Add a characteristic declaration, a characteristic value declaration and optional characteristic descriptor declarations to the Attribute Table."]
12124#[doc = ""]
12125#[doc = " @note It is currently only possible to add a characteristic to the last added service (i.e. only sequential population is supported at this time)."]
12126#[doc = ""]
12127#[doc = " @note Several restrictions apply to the parameters, such as matching permissions between the user description descriptor and the writable auxiliaries bits,"]
12128#[doc = " readable (no security) and writable (selectable) CCCDs and SCCDs and valid presentation format values."]
12129#[doc = ""]
12130#[doc = " @note If no metadata is provided for the optional descriptors, their permissions will be derived from the characteristic permissions."]
12131#[doc = ""]
12132#[doc = " @mscs"]
12133#[doc = " @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC}"]
12134#[doc = " @endmscs"]
12135#[doc = ""]
12136#[doc = " @param[in] service_handle Handle of the service where the characteristic is to be placed, if @ref BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially."]
12137#[doc = " @param[in] p_char_md Characteristic metadata."]
12138#[doc = " @param[in] p_attr_char_value Pointer to the attribute structure corresponding to the characteristic value."]
12139#[doc = " @param[out] p_handles Pointer to the structure where the assigned handles will be stored."]
12140#[doc = ""]
12141#[doc = " @retval ::NRF_SUCCESS Successfully added a characteristic."]
12142#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
12143#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, service handle, Vendor Specific UUIDs, lengths, and permissions need to adhere to the constraints."]
12144#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation, a service context is required."]
12145#[doc = " @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, certain UUIDs are reserved for the stack."]
12146#[doc = " @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation."]
12147#[doc = " @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied, attribute lengths are restricted by @ref BLE_GATTS_ATTR_LENS_MAX."]
12148#[inline(always)]
12149pub unsafe fn sd_ble_gatts_characteristic_add(
12150 service_handle: u16,
12151 p_char_md: *const ble_gatts_char_md_t,
12152 p_attr_char_value: *const ble_gatts_attr_t,
12153 p_handles: *mut ble_gatts_char_handles_t,
12154) -> u32 {
12155 let ret: u32;
12156 core::arch::asm!("svc 170",
12157 inout("r0") to_asm(service_handle) => ret,
12158 inout("r1") to_asm(p_char_md) => _,
12159 inout("r2") to_asm(p_attr_char_value) => _,
12160 inout("r3") to_asm(p_handles) => _,
12161 lateout("r12") _,
12162 );
12163 ret
12164}
12165
12166#[doc = "@brief Add a descriptor to the Attribute Table."]
12167#[doc = ""]
12168#[doc = " @note It is currently only possible to add a descriptor to the last added characteristic (i.e. only sequential population is supported at this time)."]
12169#[doc = ""]
12170#[doc = " @mscs"]
12171#[doc = " @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC}"]
12172#[doc = " @endmscs"]
12173#[doc = ""]
12174#[doc = " @param[in] char_handle Handle of the characteristic where the descriptor is to be placed, if @ref BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially."]
12175#[doc = " @param[in] p_attr Pointer to the attribute structure."]
12176#[doc = " @param[out] p_handle Pointer to a 16-bit word where the assigned handle will be stored."]
12177#[doc = ""]
12178#[doc = " @retval ::NRF_SUCCESS Successfully added a descriptor."]
12179#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
12180#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, characteristic handle, Vendor Specific UUIDs, lengths, and permissions need to adhere to the constraints."]
12181#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation, a characteristic context is required."]
12182#[doc = " @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, certain UUIDs are reserved for the stack."]
12183#[doc = " @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation."]
12184#[doc = " @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied, attribute lengths are restricted by @ref BLE_GATTS_ATTR_LENS_MAX."]
12185#[inline(always)]
12186pub unsafe fn sd_ble_gatts_descriptor_add(
12187 char_handle: u16,
12188 p_attr: *const ble_gatts_attr_t,
12189 p_handle: *mut u16,
12190) -> u32 {
12191 let ret: u32;
12192 core::arch::asm!("svc 171",
12193 inout("r0") to_asm(char_handle) => ret,
12194 inout("r1") to_asm(p_attr) => _,
12195 inout("r2") to_asm(p_handle) => _,
12196 lateout("r3") _,
12197 lateout("r12") _,
12198 );
12199 ret
12200}
12201
12202#[doc = "@brief Set the value of a given attribute."]
12203#[doc = ""]
12204#[doc = " @note Values other than system attributes can be set at any time, regardless of whether any active connections exist."]
12205#[doc = ""]
12206#[doc = " @mscs"]
12207#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_QUEUE_FULL_MSC}"]
12208#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_NOAUTH_MSC}"]
12209#[doc = " @endmscs"]
12210#[doc = ""]
12211#[doc = " @param[in] conn_handle Connection handle. Ignored if the value does not belong to a system attribute."]
12212#[doc = " @param[in] handle Attribute handle."]
12213#[doc = " @param[in,out] p_value Attribute value information."]
12214#[doc = ""]
12215#[doc = " @retval ::NRF_SUCCESS Successfully set the value of the attribute."]
12216#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
12217#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
12218#[doc = " @retval ::NRF_ERROR_NOT_FOUND Attribute not found."]
12219#[doc = " @retval ::NRF_ERROR_FORBIDDEN Forbidden handle supplied, certain attributes are not modifiable by the application."]
12220#[doc = " @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied, attribute lengths are restricted by @ref BLE_GATTS_ATTR_LENS_MAX."]
12221#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied on a system attribute."]
12222#[inline(always)]
12223pub unsafe fn sd_ble_gatts_value_set(conn_handle: u16, handle: u16, p_value: *mut ble_gatts_value_t) -> u32 {
12224 let ret: u32;
12225 core::arch::asm!("svc 172",
12226 inout("r0") to_asm(conn_handle) => ret,
12227 inout("r1") to_asm(handle) => _,
12228 inout("r2") to_asm(p_value) => _,
12229 lateout("r3") _,
12230 lateout("r12") _,
12231 );
12232 ret
12233}
12234
12235#[doc = "@brief Get the value of a given attribute."]
12236#[doc = ""]
12237#[doc = " @note If the attribute value is longer than the size of the supplied buffer,"]
12238#[doc = " @ref ble_gatts_value_t::len will return the total attribute value length (excluding offset),"]
12239#[doc = " and not the number of bytes actually returned in @ref ble_gatts_value_t::p_value."]
12240#[doc = " The application may use this information to allocate a suitable buffer size."]
12241#[doc = ""]
12242#[doc = " @note When retrieving system attribute values with this function, the connection handle"]
12243#[doc = " may refer to an already disconnected connection. Refer to the documentation of"]
12244#[doc = " @ref sd_ble_gatts_sys_attr_get for further information."]
12245#[doc = ""]
12246#[doc = " @param[in] conn_handle Connection handle. Ignored if the value does not belong to a system attribute."]
12247#[doc = " @param[in] handle Attribute handle."]
12248#[doc = " @param[in,out] p_value Attribute value information."]
12249#[doc = ""]
12250#[doc = " @retval ::NRF_SUCCESS Successfully retrieved the value of the attribute."]
12251#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
12252#[doc = " @retval ::NRF_ERROR_NOT_FOUND Attribute not found."]
12253#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid attribute offset supplied."]
12254#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied on a system attribute."]
12255#[doc = " @retval ::BLE_ERROR_GATTS_SYS_ATTR_MISSING System attributes missing, use @ref sd_ble_gatts_sys_attr_set to set them to a known value."]
12256#[inline(always)]
12257pub unsafe fn sd_ble_gatts_value_get(conn_handle: u16, handle: u16, p_value: *mut ble_gatts_value_t) -> u32 {
12258 let ret: u32;
12259 core::arch::asm!("svc 173",
12260 inout("r0") to_asm(conn_handle) => ret,
12261 inout("r1") to_asm(handle) => _,
12262 inout("r2") to_asm(p_value) => _,
12263 lateout("r3") _,
12264 lateout("r12") _,
12265 );
12266 ret
12267}
12268
12269#[doc = "@brief Notify or Indicate an attribute value."]
12270#[doc = ""]
12271#[doc = " @details This function checks for the relevant Client Characteristic Configuration descriptor value to verify that the relevant operation"]
12272#[doc = " (notification or indication) has been enabled by the client. It is also able to update the attribute value before issuing the PDU, so that"]
12273#[doc = " the application can atomically perform a value update and a server initiated transaction with a single API call."]
12274#[doc = ""]
12275#[doc = " @note The local attribute value may be updated even if an outgoing packet is not sent to the peer due to an error during execution."]
12276#[doc = " The Attribute Table has been updated if one of the following error codes is returned: @ref NRF_ERROR_INVALID_STATE, @ref NRF_ERROR_BUSY,"]
12277#[doc = " @ref NRF_ERROR_FORBIDDEN, @ref BLE_ERROR_GATTS_SYS_ATTR_MISSING and @ref NRF_ERROR_RESOURCES."]
12278#[doc = " The caller can check whether the value has been updated by looking at the contents of *(@ref ble_gatts_hvx_params_t::p_len)."]
12279#[doc = ""]
12280#[doc = " @note Only one indication procedure can be ongoing per connection at a time."]
12281#[doc = " If the application tries to indicate an attribute value while another indication procedure is ongoing,"]
12282#[doc = " the function call will return @ref NRF_ERROR_BUSY."]
12283#[doc = " A @ref BLE_GATTS_EVT_HVC event will be issued as soon as the confirmation arrives from the peer."]
12284#[doc = ""]
12285#[doc = " @note The number of Handle Value Notifications that can be queued is configured by @ref ble_gatts_conn_cfg_t::hvn_tx_queue_size"]
12286#[doc = " When the queue is full, the function call will return @ref NRF_ERROR_RESOURCES."]
12287#[doc = " A @ref BLE_GATTS_EVT_HVN_TX_COMPLETE event will be issued as soon as the transmission of the notification is complete."]
12288#[doc = ""]
12289#[doc = " @note The application can keep track of the available queue element count for notifications by following the procedure below:"]
12290#[doc = " - Store initial queue element count in a variable."]
12291#[doc = " - Decrement the variable, which stores the currently available queue element count, by one when a call to this function returns @ref NRF_SUCCESS."]
12292#[doc = " - Increment the variable, which stores the current available queue element count, by the count variable in @ref BLE_GATTS_EVT_HVN_TX_COMPLETE event."]
12293#[doc = ""]
12294#[doc = " @events"]
12295#[doc = " @event{@ref BLE_GATTS_EVT_HVN_TX_COMPLETE, Notification transmission complete.}"]
12296#[doc = " @event{@ref BLE_GATTS_EVT_HVC, Confirmation received from the peer.}"]
12297#[doc = " @endevents"]
12298#[doc = ""]
12299#[doc = " @mscs"]
12300#[doc = " @mmsc{@ref BLE_GATTS_HVX_SYS_ATTRS_MISSING_MSC}"]
12301#[doc = " @mmsc{@ref BLE_GATTS_HVN_MSC}"]
12302#[doc = " @mmsc{@ref BLE_GATTS_HVI_MSC}"]
12303#[doc = " @mmsc{@ref BLE_GATTS_HVX_DISABLED_MSC}"]
12304#[doc = " @endmscs"]
12305#[doc = ""]
12306#[doc = " @param[in] conn_handle Connection handle."]
12307#[doc = " @param[in,out] p_hvx_params Pointer to an HVx parameters structure. If @ref ble_gatts_hvx_params_t::p_data"]
12308#[doc = " contains a non-NULL pointer the attribute value will be updated with the contents"]
12309#[doc = " pointed by it before sending the notification or indication. If the attribute value"]
12310#[doc = " is updated, @ref ble_gatts_hvx_params_t::p_len is updated by the SoftDevice to"]
12311#[doc = " contain the number of actual bytes written, else it will be set to 0."]
12312#[doc = ""]
12313#[doc = " @retval ::NRF_SUCCESS Successfully queued a notification or indication for transmission, and optionally updated the attribute value."]
12314#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
12315#[doc = " @retval ::NRF_ERROR_INVALID_STATE One or more of the following is true:"]
12316#[doc = " - Invalid Connection State"]
12317#[doc = " - Notifications and/or indications not enabled in the CCCD"]
12318#[doc = " - An ATT_MTU exchange is ongoing"]
12319#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
12320#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
12321#[doc = " @retval ::BLE_ERROR_INVALID_ATTR_HANDLE Invalid attribute handle(s) supplied. Only attributes added directly by the application are available to notify and indicate."]
12322#[doc = " @retval ::BLE_ERROR_GATTS_INVALID_ATTR_TYPE Invalid attribute type(s) supplied, only characteristic values may be notified and indicated."]
12323#[doc = " @retval ::NRF_ERROR_NOT_FOUND Attribute not found."]
12324#[doc = " @retval ::NRF_ERROR_FORBIDDEN The connection's current security level is lower than the one required by the write permissions of the CCCD associated with this characteristic."]
12325#[doc = " @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied."]
12326#[doc = " @retval ::NRF_ERROR_BUSY For @ref BLE_GATT_HVX_INDICATION Procedure already in progress. Wait for a @ref BLE_GATTS_EVT_HVC event and retry."]
12327#[doc = " @retval ::BLE_ERROR_GATTS_SYS_ATTR_MISSING System attributes missing, use @ref sd_ble_gatts_sys_attr_set to set them to a known value."]
12328#[doc = " @retval ::NRF_ERROR_RESOURCES Too many notifications queued."]
12329#[doc = " Wait for a @ref BLE_GATTS_EVT_HVN_TX_COMPLETE event and retry."]
12330#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
12331#[inline(always)]
12332pub unsafe fn sd_ble_gatts_hvx(conn_handle: u16, p_hvx_params: *const ble_gatts_hvx_params_t) -> u32 {
12333 let ret: u32;
12334 core::arch::asm!("svc 174",
12335 inout("r0") to_asm(conn_handle) => ret,
12336 inout("r1") to_asm(p_hvx_params) => _,
12337 lateout("r2") _,
12338 lateout("r3") _,
12339 lateout("r12") _,
12340 );
12341 ret
12342}
12343
12344#[doc = "@brief Indicate the Service Changed attribute value."]
12345#[doc = ""]
12346#[doc = " @details This call will send a Handle Value Indication to one or more peers connected to inform them that the Attribute"]
12347#[doc = " Table layout has changed. As soon as the peer has confirmed the indication, a @ref BLE_GATTS_EVT_SC_CONFIRM event will"]
12348#[doc = " be issued."]
12349#[doc = ""]
12350#[doc = " @note Some of the restrictions and limitations that apply to @ref sd_ble_gatts_hvx also apply here."]
12351#[doc = ""]
12352#[doc = " @events"]
12353#[doc = " @event{@ref BLE_GATTS_EVT_SC_CONFIRM, Confirmation of attribute table change received from peer.}"]
12354#[doc = " @endevents"]
12355#[doc = ""]
12356#[doc = " @mscs"]
12357#[doc = " @mmsc{@ref BLE_GATTS_SC_MSC}"]
12358#[doc = " @endmscs"]
12359#[doc = ""]
12360#[doc = " @param[in] conn_handle Connection handle."]
12361#[doc = " @param[in] start_handle Start of affected attribute handle range."]
12362#[doc = " @param[in] end_handle End of affected attribute handle range."]
12363#[doc = ""]
12364#[doc = " @retval ::NRF_SUCCESS Successfully queued the Service Changed indication for transmission."]
12365#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
12366#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED Service Changed not enabled at initialization. See @ref"]
12367#[doc = " sd_ble_cfg_set and @ref ble_gatts_cfg_service_changed_t."]
12368#[doc = " @retval ::NRF_ERROR_INVALID_STATE One or more of the following is true:"]
12369#[doc = " - Invalid Connection State"]
12370#[doc = " - Notifications and/or indications not enabled in the CCCD"]
12371#[doc = " - An ATT_MTU exchange is ongoing"]
12372#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied."]
12373#[doc = " @retval ::BLE_ERROR_INVALID_ATTR_HANDLE Invalid attribute handle(s) supplied, handles must be in the range populated by the application."]
12374#[doc = " @retval ::NRF_ERROR_BUSY Procedure already in progress."]
12375#[doc = " @retval ::BLE_ERROR_GATTS_SYS_ATTR_MISSING System attributes missing, use @ref sd_ble_gatts_sys_attr_set to set them to a known value."]
12376#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
12377#[inline(always)]
12378pub unsafe fn sd_ble_gatts_service_changed(conn_handle: u16, start_handle: u16, end_handle: u16) -> u32 {
12379 let ret: u32;
12380 core::arch::asm!("svc 175",
12381 inout("r0") to_asm(conn_handle) => ret,
12382 inout("r1") to_asm(start_handle) => _,
12383 inout("r2") to_asm(end_handle) => _,
12384 lateout("r3") _,
12385 lateout("r12") _,
12386 );
12387 ret
12388}
12389
12390#[doc = "@brief Respond to a Read/Write authorization request."]
12391#[doc = ""]
12392#[doc = " @note This call should only be used as a response to a @ref BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event issued to the application."]
12393#[doc = ""]
12394#[doc = " @mscs"]
12395#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_AUTH_MSC}"]
12396#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_BUF_AUTH_MSC}"]
12397#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_NOAUTH_MSC}"]
12398#[doc = " @mmsc{@ref BLE_GATTS_READ_REQ_AUTH_MSC}"]
12399#[doc = " @mmsc{@ref BLE_GATTS_WRITE_REQ_AUTH_MSC}"]
12400#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_QUEUE_FULL_MSC}"]
12401#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_PEER_CANCEL_MSC}"]
12402#[doc = " @endmscs"]
12403#[doc = ""]
12404#[doc = " @param[in] conn_handle Connection handle."]
12405#[doc = " @param[in] p_rw_authorize_reply_params Pointer to a structure with the attribute provided by the application."]
12406#[doc = ""]
12407#[doc = " @note @ref ble_gatts_authorize_params_t::p_data is ignored when this function is used to respond"]
12408#[doc = " to a @ref BLE_GATTS_AUTHORIZE_TYPE_READ event if @ref ble_gatts_authorize_params_t::update"]
12409#[doc = " is set to 0."]
12410#[doc = ""]
12411#[doc = " @retval ::NRF_SUCCESS Successfully queued a response to the peer, and in the case of a write operation, Attribute Table updated."]
12412#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
12413#[doc = " @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry."]
12414#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
12415#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State or no authorization request pending."]
12416#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Authorization op invalid,"]
12417#[doc = " handle supplied does not match requested handle,"]
12418#[doc = " or invalid data to be written provided by the application."]
12419#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
12420#[inline(always)]
12421pub unsafe fn sd_ble_gatts_rw_authorize_reply(
12422 conn_handle: u16,
12423 p_rw_authorize_reply_params: *const ble_gatts_rw_authorize_reply_params_t,
12424) -> u32 {
12425 let ret: u32;
12426 core::arch::asm!("svc 176",
12427 inout("r0") to_asm(conn_handle) => ret,
12428 inout("r1") to_asm(p_rw_authorize_reply_params) => _,
12429 lateout("r2") _,
12430 lateout("r3") _,
12431 lateout("r12") _,
12432 );
12433 ret
12434}
12435
12436#[doc = "@brief Update persistent system attribute information."]
12437#[doc = ""]
12438#[doc = " @details Supply information about persistent system attributes to the stack,"]
12439#[doc = " previously obtained using @ref sd_ble_gatts_sys_attr_get."]
12440#[doc = " This call is only allowed for active connections, and is usually"]
12441#[doc = " made immediately after a connection is established with an known bonded device,"]
12442#[doc = " often as a response to a @ref BLE_GATTS_EVT_SYS_ATTR_MISSING."]
12443#[doc = ""]
12444#[doc = " p_sysattrs may point directly to the application's stored copy of the system attributes"]
12445#[doc = " obtained using @ref sd_ble_gatts_sys_attr_get."]
12446#[doc = " If the pointer is NULL, the system attribute info is initialized, assuming that"]
12447#[doc = " the application does not have any previously saved system attribute data for this device."]
12448#[doc = ""]
12449#[doc = " @note The state of persistent system attributes is reset upon connection establishment and then remembered for its duration."]
12450#[doc = ""]
12451#[doc = " @note If this call returns with an error code different from @ref NRF_SUCCESS, the storage of persistent system attributes may have been completed only partially."]
12452#[doc = " This means that the state of the attribute table is undefined, and the application should either provide a new set of attributes using this same call or"]
12453#[doc = " reset the SoftDevice to return to a known state."]
12454#[doc = ""]
12455#[doc = " @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS is used with this function, only the system attributes included in system services will be modified."]
12456#[doc = " @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS is used with this function, only the system attributes included in user services will be modified."]
12457#[doc = ""]
12458#[doc = " @mscs"]
12459#[doc = " @mmsc{@ref BLE_GATTS_HVX_SYS_ATTRS_MISSING_MSC}"]
12460#[doc = " @mmsc{@ref BLE_GATTS_SYS_ATTRS_UNK_PEER_MSC}"]
12461#[doc = " @mmsc{@ref BLE_GATTS_SYS_ATTRS_BONDED_PEER_MSC}"]
12462#[doc = " @endmscs"]
12463#[doc = ""]
12464#[doc = " @param[in] conn_handle Connection handle."]
12465#[doc = " @param[in] p_sys_attr_data Pointer to a saved copy of system attributes supplied to the stack, or NULL."]
12466#[doc = " @param[in] len Size of data pointed by p_sys_attr_data, in octets."]
12467#[doc = " @param[in] flags Optional additional flags, see @ref BLE_GATTS_SYS_ATTR_FLAGS"]
12468#[doc = ""]
12469#[doc = " @retval ::NRF_SUCCESS Successfully set the system attribute information."]
12470#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
12471#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
12472#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State."]
12473#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid flags supplied."]
12474#[doc = " @retval ::NRF_ERROR_INVALID_DATA Invalid data supplied, the data should be exactly the same as retrieved with @ref sd_ble_gatts_sys_attr_get."]
12475#[doc = " @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation."]
12476#[inline(always)]
12477pub unsafe fn sd_ble_gatts_sys_attr_set(conn_handle: u16, p_sys_attr_data: *const u8, len: u16, flags: u32) -> u32 {
12478 let ret: u32;
12479 core::arch::asm!("svc 177",
12480 inout("r0") to_asm(conn_handle) => ret,
12481 inout("r1") to_asm(p_sys_attr_data) => _,
12482 inout("r2") to_asm(len) => _,
12483 inout("r3") to_asm(flags) => _,
12484 lateout("r12") _,
12485 );
12486 ret
12487}
12488
12489#[doc = "@brief Retrieve persistent system attribute information from the stack."]
12490#[doc = ""]
12491#[doc = " @details This call is used to retrieve information about values to be stored persistently by the application"]
12492#[doc = " during the lifetime of a connection or after it has been terminated. When a new connection is established with the same bonded device,"]
12493#[doc = " the system attribute information retrieved with this function should be restored using using @ref sd_ble_gatts_sys_attr_set."]
12494#[doc = " If retrieved after disconnection, the data should be read before a new connection established. The connection handle for"]
12495#[doc = " the previous, now disconnected, connection will remain valid until a new one is created to allow this API call to refer to it."]
12496#[doc = " Connection handles belonging to active connections can be used as well, but care should be taken since the system attributes"]
12497#[doc = " may be written to at any time by the peer during a connection's lifetime."]
12498#[doc = ""]
12499#[doc = " @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS is used with this function, only the system attributes included in system services will be returned."]
12500#[doc = " @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS is used with this function, only the system attributes included in user services will be returned."]
12501#[doc = ""]
12502#[doc = " @mscs"]
12503#[doc = " @mmsc{@ref BLE_GATTS_SYS_ATTRS_BONDED_PEER_MSC}"]
12504#[doc = " @endmscs"]
12505#[doc = ""]
12506#[doc = " @param[in] conn_handle Connection handle of the recently terminated connection."]
12507#[doc = " @param[out] p_sys_attr_data Pointer to a buffer where updated information about system attributes will be filled in. The format of the data is described"]
12508#[doc = " in @ref BLE_GATTS_SYS_ATTRS_FORMAT. NULL can be provided to obtain the length of the data."]
12509#[doc = " @param[in,out] p_len Size of application buffer if p_sys_attr_data is not NULL. Unconditionally updated to actual length of system attribute data."]
12510#[doc = " @param[in] flags Optional additional flags, see @ref BLE_GATTS_SYS_ATTR_FLAGS"]
12511#[doc = ""]
12512#[doc = " @retval ::NRF_SUCCESS Successfully retrieved the system attribute information."]
12513#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
12514#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
12515#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid flags supplied."]
12516#[doc = " @retval ::NRF_ERROR_DATA_SIZE The system attribute information did not fit into the provided buffer."]
12517#[doc = " @retval ::NRF_ERROR_NOT_FOUND No system attributes found."]
12518#[inline(always)]
12519pub unsafe fn sd_ble_gatts_sys_attr_get(
12520 conn_handle: u16,
12521 p_sys_attr_data: *mut u8,
12522 p_len: *mut u16,
12523 flags: u32,
12524) -> u32 {
12525 let ret: u32;
12526 core::arch::asm!("svc 178",
12527 inout("r0") to_asm(conn_handle) => ret,
12528 inout("r1") to_asm(p_sys_attr_data) => _,
12529 inout("r2") to_asm(p_len) => _,
12530 inout("r3") to_asm(flags) => _,
12531 lateout("r12") _,
12532 );
12533 ret
12534}
12535
12536#[doc = "@brief Retrieve the first valid user attribute handle."]
12537#[doc = ""]
12538#[doc = " @param[out] p_handle Pointer to an integer where the handle will be stored."]
12539#[doc = ""]
12540#[doc = " @retval ::NRF_SUCCESS Successfully retrieved the handle."]
12541#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
12542#[inline(always)]
12543pub unsafe fn sd_ble_gatts_initial_user_handle_get(p_handle: *mut u16) -> u32 {
12544 let ret: u32;
12545 core::arch::asm!("svc 179",
12546 inout("r0") to_asm(p_handle) => ret,
12547 lateout("r1") _,
12548 lateout("r2") _,
12549 lateout("r3") _,
12550 lateout("r12") _,
12551 );
12552 ret
12553}
12554
12555#[doc = "@brief Retrieve the attribute UUID and/or metadata."]
12556#[doc = ""]
12557#[doc = " @param[in] handle Attribute handle"]
12558#[doc = " @param[out] p_uuid UUID of the attribute. Use NULL to omit this field."]
12559#[doc = " @param[out] p_md Metadata of the attribute. Use NULL to omit this field."]
12560#[doc = ""]
12561#[doc = " @retval ::NRF_SUCCESS Successfully retrieved the attribute metadata,"]
12562#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
12563#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameters supplied. Returned when both @c p_uuid and @c p_md are NULL."]
12564#[doc = " @retval ::NRF_ERROR_NOT_FOUND Attribute was not found."]
12565#[inline(always)]
12566pub unsafe fn sd_ble_gatts_attr_get(handle: u16, p_uuid: *mut ble_uuid_t, p_md: *mut ble_gatts_attr_md_t) -> u32 {
12567 let ret: u32;
12568 core::arch::asm!("svc 180",
12569 inout("r0") to_asm(handle) => ret,
12570 inout("r1") to_asm(p_uuid) => _,
12571 inout("r2") to_asm(p_md) => _,
12572 lateout("r3") _,
12573 lateout("r12") _,
12574 );
12575 ret
12576}
12577
12578#[doc = "@brief Reply to an ATT_MTU exchange request by sending an Exchange MTU Response to the client."]
12579#[doc = ""]
12580#[doc = " @details This function is only used to reply to a @ref BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST event."]
12581#[doc = ""]
12582#[doc = " @details The SoftDevice sets ATT_MTU to the minimum of:"]
12583#[doc = " - The Client RX MTU value from @ref BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST, and"]
12584#[doc = " - The Server RX MTU value."]
12585#[doc = ""]
12586#[doc = " However, the SoftDevice never sets ATT_MTU lower than @ref BLE_GATT_ATT_MTU_DEFAULT."]
12587#[doc = ""]
12588#[doc = " @mscs"]
12589#[doc = " @mmsc{@ref BLE_GATTS_MTU_EXCHANGE}"]
12590#[doc = " @endmscs"]
12591#[doc = ""]
12592#[doc = " @param[in] conn_handle The connection handle identifying the connection to perform this procedure on."]
12593#[doc = " @param[in] server_rx_mtu Server RX MTU size."]
12594#[doc = " - The minimum value is @ref BLE_GATT_ATT_MTU_DEFAULT."]
12595#[doc = " - The maximum value is @ref ble_gatt_conn_cfg_t::att_mtu in the connection configuration"]
12596#[doc = " used for this connection."]
12597#[doc = " - The value must be equal to Client RX MTU size given in @ref sd_ble_gattc_exchange_mtu_request"]
12598#[doc = " if an ATT_MTU exchange has already been performed in the other direction."]
12599#[doc = ""]
12600#[doc = " @retval ::NRF_SUCCESS Successfully sent response to the client."]
12601#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
12602#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State or no ATT_MTU exchange request pending."]
12603#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid Server RX MTU size supplied."]
12604#[doc = " @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection."]
12605#[inline(always)]
12606pub unsafe fn sd_ble_gatts_exchange_mtu_reply(conn_handle: u16, server_rx_mtu: u16) -> u32 {
12607 let ret: u32;
12608 core::arch::asm!("svc 181",
12609 inout("r0") to_asm(conn_handle) => ret,
12610 inout("r1") to_asm(server_rx_mtu) => _,
12611 lateout("r2") _,
12612 lateout("r3") _,
12613 lateout("r12") _,
12614 );
12615 ret
12616}
12617
12618#[doc = "< Enable and initialize the BLE stack"]
12619pub const BLE_COMMON_SVCS_SD_BLE_ENABLE: BLE_COMMON_SVCS = 96;
12620#[doc = "< Get an event from the pending events queue."]
12621pub const BLE_COMMON_SVCS_SD_BLE_EVT_GET: BLE_COMMON_SVCS = 97;
12622#[doc = "< Add a Vendor Specific base UUID."]
12623pub const BLE_COMMON_SVCS_SD_BLE_UUID_VS_ADD: BLE_COMMON_SVCS = 98;
12624#[doc = "< Decode UUID bytes."]
12625pub const BLE_COMMON_SVCS_SD_BLE_UUID_DECODE: BLE_COMMON_SVCS = 99;
12626#[doc = "< Encode UUID bytes."]
12627pub const BLE_COMMON_SVCS_SD_BLE_UUID_ENCODE: BLE_COMMON_SVCS = 100;
12628#[doc = "< Get the local version information (company ID, Link Layer Version, Link Layer Subversion)."]
12629pub const BLE_COMMON_SVCS_SD_BLE_VERSION_GET: BLE_COMMON_SVCS = 101;
12630#[doc = "< User Memory Reply."]
12631pub const BLE_COMMON_SVCS_SD_BLE_USER_MEM_REPLY: BLE_COMMON_SVCS = 102;
12632#[doc = "< Set a BLE option."]
12633pub const BLE_COMMON_SVCS_SD_BLE_OPT_SET: BLE_COMMON_SVCS = 103;
12634#[doc = "< Get a BLE option."]
12635pub const BLE_COMMON_SVCS_SD_BLE_OPT_GET: BLE_COMMON_SVCS = 104;
12636#[doc = "< Add a configuration to the BLE stack."]
12637pub const BLE_COMMON_SVCS_SD_BLE_CFG_SET: BLE_COMMON_SVCS = 105;
12638#[doc = "< Remove a Vendor Specific base UUID."]
12639pub const BLE_COMMON_SVCS_SD_BLE_UUID_VS_REMOVE: BLE_COMMON_SVCS = 106;
12640#[doc = " @brief Common API SVC numbers."]
12641pub type BLE_COMMON_SVCS = self::c_uint;
12642#[doc = "< User Memory request. @ref ble_evt_user_mem_request_t"]
12643pub const BLE_COMMON_EVTS_BLE_EVT_USER_MEM_REQUEST: BLE_COMMON_EVTS = 1;
12644#[doc = "< User Memory release. @ref ble_evt_user_mem_release_t"]
12645pub const BLE_COMMON_EVTS_BLE_EVT_USER_MEM_RELEASE: BLE_COMMON_EVTS = 2;
12646#[doc = " @brief BLE Module Independent Event IDs."]
12647pub type BLE_COMMON_EVTS = self::c_uint;
12648#[doc = "< BLE GAP specific connection configuration."]
12649pub const BLE_CONN_CFGS_BLE_CONN_CFG_GAP: BLE_CONN_CFGS = 32;
12650#[doc = "< BLE GATTC specific connection configuration."]
12651pub const BLE_CONN_CFGS_BLE_CONN_CFG_GATTC: BLE_CONN_CFGS = 33;
12652#[doc = "< BLE GATTS specific connection configuration."]
12653pub const BLE_CONN_CFGS_BLE_CONN_CFG_GATTS: BLE_CONN_CFGS = 34;
12654#[doc = "< BLE GATT specific connection configuration."]
12655pub const BLE_CONN_CFGS_BLE_CONN_CFG_GATT: BLE_CONN_CFGS = 35;
12656#[doc = "< BLE L2CAP specific connection configuration."]
12657pub const BLE_CONN_CFGS_BLE_CONN_CFG_L2CAP: BLE_CONN_CFGS = 36;
12658#[doc = "@brief BLE Connection Configuration IDs."]
12659#[doc = ""]
12660#[doc = " IDs that uniquely identify a connection configuration."]
12661pub type BLE_CONN_CFGS = self::c_uint;
12662#[doc = "< Vendor specific base UUID configuration"]
12663pub const BLE_COMMON_CFGS_BLE_COMMON_CFG_VS_UUID: BLE_COMMON_CFGS = 1;
12664#[doc = "@brief BLE Common Configuration IDs."]
12665#[doc = ""]
12666#[doc = " IDs that uniquely identify a common configuration."]
12667pub type BLE_COMMON_CFGS = self::c_uint;
12668#[doc = "< PA and LNA options"]
12669pub const BLE_COMMON_OPTS_BLE_COMMON_OPT_PA_LNA: BLE_COMMON_OPTS = 1;
12670#[doc = "< Extended connection events option"]
12671pub const BLE_COMMON_OPTS_BLE_COMMON_OPT_CONN_EVT_EXT: BLE_COMMON_OPTS = 2;
12672#[doc = "< Extended RC calibration option"]
12673pub const BLE_COMMON_OPTS_BLE_COMMON_OPT_EXTENDED_RC_CAL: BLE_COMMON_OPTS = 3;
12674#[doc = "@brief Common Option IDs."]
12675#[doc = " IDs that uniquely identify a common option."]
12676pub type BLE_COMMON_OPTS = self::c_uint;
12677#[doc = "@brief User Memory Block."]
12678#[repr(C)]
12679#[derive(Debug, Copy, Clone)]
12680pub struct ble_user_mem_block_t {
12681 #[doc = "< Pointer to the start of the user memory block."]
12682 pub p_mem: *mut u8,
12683 #[doc = "< Length in bytes of the user memory block."]
12684 pub len: u16,
12685}
12686#[test]
12687fn bindgen_test_layout_ble_user_mem_block_t() {
12688 assert_eq!(
12689 ::core::mem::size_of::<ble_user_mem_block_t>(),
12690 8usize,
12691 concat!("Size of: ", stringify!(ble_user_mem_block_t))
12692 );
12693 assert_eq!(
12694 ::core::mem::align_of::<ble_user_mem_block_t>(),
12695 4usize,
12696 concat!("Alignment of ", stringify!(ble_user_mem_block_t))
12697 );
12698 assert_eq!(
12699 unsafe { &(*(::core::ptr::null::<ble_user_mem_block_t>())).p_mem as *const _ as usize },
12700 0usize,
12701 concat!(
12702 "Offset of field: ",
12703 stringify!(ble_user_mem_block_t),
12704 "::",
12705 stringify!(p_mem)
12706 )
12707 );
12708 assert_eq!(
12709 unsafe { &(*(::core::ptr::null::<ble_user_mem_block_t>())).len as *const _ as usize },
12710 4usize,
12711 concat!(
12712 "Offset of field: ",
12713 stringify!(ble_user_mem_block_t),
12714 "::",
12715 stringify!(len)
12716 )
12717 );
12718}
12719#[doc = "@brief Event structure for @ref BLE_EVT_USER_MEM_REQUEST."]
12720#[repr(C)]
12721#[derive(Debug, Copy, Clone)]
12722pub struct ble_evt_user_mem_request_t {
12723 #[doc = "< User memory type, see @ref BLE_USER_MEM_TYPES."]
12724 pub type_: u8,
12725}
12726#[test]
12727fn bindgen_test_layout_ble_evt_user_mem_request_t() {
12728 assert_eq!(
12729 ::core::mem::size_of::<ble_evt_user_mem_request_t>(),
12730 1usize,
12731 concat!("Size of: ", stringify!(ble_evt_user_mem_request_t))
12732 );
12733 assert_eq!(
12734 ::core::mem::align_of::<ble_evt_user_mem_request_t>(),
12735 1usize,
12736 concat!("Alignment of ", stringify!(ble_evt_user_mem_request_t))
12737 );
12738 assert_eq!(
12739 unsafe { &(*(::core::ptr::null::<ble_evt_user_mem_request_t>())).type_ as *const _ as usize },
12740 0usize,
12741 concat!(
12742 "Offset of field: ",
12743 stringify!(ble_evt_user_mem_request_t),
12744 "::",
12745 stringify!(type_)
12746 )
12747 );
12748}
12749#[doc = "@brief Event structure for @ref BLE_EVT_USER_MEM_RELEASE."]
12750#[repr(C)]
12751#[derive(Debug, Copy, Clone)]
12752pub struct ble_evt_user_mem_release_t {
12753 #[doc = "< User memory type, see @ref BLE_USER_MEM_TYPES."]
12754 pub type_: u8,
12755 #[doc = "< User memory block"]
12756 pub mem_block: ble_user_mem_block_t,
12757}
12758#[test]
12759fn bindgen_test_layout_ble_evt_user_mem_release_t() {
12760 assert_eq!(
12761 ::core::mem::size_of::<ble_evt_user_mem_release_t>(),
12762 12usize,
12763 concat!("Size of: ", stringify!(ble_evt_user_mem_release_t))
12764 );
12765 assert_eq!(
12766 ::core::mem::align_of::<ble_evt_user_mem_release_t>(),
12767 4usize,
12768 concat!("Alignment of ", stringify!(ble_evt_user_mem_release_t))
12769 );
12770 assert_eq!(
12771 unsafe { &(*(::core::ptr::null::<ble_evt_user_mem_release_t>())).type_ as *const _ as usize },
12772 0usize,
12773 concat!(
12774 "Offset of field: ",
12775 stringify!(ble_evt_user_mem_release_t),
12776 "::",
12777 stringify!(type_)
12778 )
12779 );
12780 assert_eq!(
12781 unsafe { &(*(::core::ptr::null::<ble_evt_user_mem_release_t>())).mem_block as *const _ as usize },
12782 4usize,
12783 concat!(
12784 "Offset of field: ",
12785 stringify!(ble_evt_user_mem_release_t),
12786 "::",
12787 stringify!(mem_block)
12788 )
12789 );
12790}
12791#[doc = "@brief Event structure for events not associated with a specific function module."]
12792#[repr(C)]
12793#[derive(Copy, Clone)]
12794pub struct ble_common_evt_t {
12795 #[doc = "< Connection Handle on which this event occurred."]
12796 pub conn_handle: u16,
12797 #[doc = "< Event parameter union."]
12798 pub params: ble_common_evt_t__bindgen_ty_1,
12799}
12800#[repr(C)]
12801#[derive(Copy, Clone)]
12802pub union ble_common_evt_t__bindgen_ty_1 {
12803 #[doc = "< User Memory Request Event Parameters."]
12804 pub user_mem_request: ble_evt_user_mem_request_t,
12805 #[doc = "< User Memory Release Event Parameters."]
12806 pub user_mem_release: ble_evt_user_mem_release_t,
12807 _bindgen_union_align: [u32; 3usize],
12808}
12809#[test]
12810fn bindgen_test_layout_ble_common_evt_t__bindgen_ty_1() {
12811 assert_eq!(
12812 ::core::mem::size_of::<ble_common_evt_t__bindgen_ty_1>(),
12813 12usize,
12814 concat!("Size of: ", stringify!(ble_common_evt_t__bindgen_ty_1))
12815 );
12816 assert_eq!(
12817 ::core::mem::align_of::<ble_common_evt_t__bindgen_ty_1>(),
12818 4usize,
12819 concat!("Alignment of ", stringify!(ble_common_evt_t__bindgen_ty_1))
12820 );
12821 assert_eq!(
12822 unsafe { &(*(::core::ptr::null::<ble_common_evt_t__bindgen_ty_1>())).user_mem_request as *const _ as usize },
12823 0usize,
12824 concat!(
12825 "Offset of field: ",
12826 stringify!(ble_common_evt_t__bindgen_ty_1),
12827 "::",
12828 stringify!(user_mem_request)
12829 )
12830 );
12831 assert_eq!(
12832 unsafe { &(*(::core::ptr::null::<ble_common_evt_t__bindgen_ty_1>())).user_mem_release as *const _ as usize },
12833 0usize,
12834 concat!(
12835 "Offset of field: ",
12836 stringify!(ble_common_evt_t__bindgen_ty_1),
12837 "::",
12838 stringify!(user_mem_release)
12839 )
12840 );
12841}
12842#[test]
12843fn bindgen_test_layout_ble_common_evt_t() {
12844 assert_eq!(
12845 ::core::mem::size_of::<ble_common_evt_t>(),
12846 16usize,
12847 concat!("Size of: ", stringify!(ble_common_evt_t))
12848 );
12849 assert_eq!(
12850 ::core::mem::align_of::<ble_common_evt_t>(),
12851 4usize,
12852 concat!("Alignment of ", stringify!(ble_common_evt_t))
12853 );
12854 assert_eq!(
12855 unsafe { &(*(::core::ptr::null::<ble_common_evt_t>())).conn_handle as *const _ as usize },
12856 0usize,
12857 concat!(
12858 "Offset of field: ",
12859 stringify!(ble_common_evt_t),
12860 "::",
12861 stringify!(conn_handle)
12862 )
12863 );
12864 assert_eq!(
12865 unsafe { &(*(::core::ptr::null::<ble_common_evt_t>())).params as *const _ as usize },
12866 4usize,
12867 concat!(
12868 "Offset of field: ",
12869 stringify!(ble_common_evt_t),
12870 "::",
12871 stringify!(params)
12872 )
12873 );
12874}
12875#[doc = "@brief BLE Event header."]
12876#[repr(C)]
12877#[derive(Debug, Copy, Clone)]
12878pub struct ble_evt_hdr_t {
12879 #[doc = "< Value from a BLE_<module>_EVT series."]
12880 pub evt_id: u16,
12881 #[doc = "< Length in octets including this header."]
12882 pub evt_len: u16,
12883}
12884#[test]
12885fn bindgen_test_layout_ble_evt_hdr_t() {
12886 assert_eq!(
12887 ::core::mem::size_of::<ble_evt_hdr_t>(),
12888 4usize,
12889 concat!("Size of: ", stringify!(ble_evt_hdr_t))
12890 );
12891 assert_eq!(
12892 ::core::mem::align_of::<ble_evt_hdr_t>(),
12893 2usize,
12894 concat!("Alignment of ", stringify!(ble_evt_hdr_t))
12895 );
12896 assert_eq!(
12897 unsafe { &(*(::core::ptr::null::<ble_evt_hdr_t>())).evt_id as *const _ as usize },
12898 0usize,
12899 concat!("Offset of field: ", stringify!(ble_evt_hdr_t), "::", stringify!(evt_id))
12900 );
12901 assert_eq!(
12902 unsafe { &(*(::core::ptr::null::<ble_evt_hdr_t>())).evt_len as *const _ as usize },
12903 2usize,
12904 concat!(
12905 "Offset of field: ",
12906 stringify!(ble_evt_hdr_t),
12907 "::",
12908 stringify!(evt_len)
12909 )
12910 );
12911}
12912#[doc = "@brief Common BLE Event type, wrapping the module specific event reports."]
12913#[repr(C)]
12914pub struct ble_evt_t {
12915 #[doc = "< Event header."]
12916 pub header: ble_evt_hdr_t,
12917 #[doc = "< Event union."]
12918 pub evt: ble_evt_t__bindgen_ty_1,
12919}
12920#[repr(C)]
12921pub struct ble_evt_t__bindgen_ty_1 {
12922 #[doc = "< Common Event, evt_id in BLE_EVT_* series."]
12923 pub common_evt: __BindgenUnionField<ble_common_evt_t>,
12924 #[doc = "< GAP originated event, evt_id in BLE_GAP_EVT_* series."]
12925 pub gap_evt: __BindgenUnionField<ble_gap_evt_t>,
12926 #[doc = "< GATT client originated event, evt_id in BLE_GATTC_EVT* series."]
12927 pub gattc_evt: __BindgenUnionField<ble_gattc_evt_t>,
12928 #[doc = "< GATT server originated event, evt_id in BLE_GATTS_EVT* series."]
12929 pub gatts_evt: __BindgenUnionField<ble_gatts_evt_t>,
12930 #[doc = "< L2CAP originated event, evt_id in BLE_L2CAP_EVT* series."]
12931 pub l2cap_evt: __BindgenUnionField<ble_l2cap_evt_t>,
12932 pub bindgen_union_field: [u32; 11usize],
12933}
12934#[test]
12935fn bindgen_test_layout_ble_evt_t__bindgen_ty_1() {
12936 assert_eq!(
12937 ::core::mem::size_of::<ble_evt_t__bindgen_ty_1>(),
12938 44usize,
12939 concat!("Size of: ", stringify!(ble_evt_t__bindgen_ty_1))
12940 );
12941 assert_eq!(
12942 ::core::mem::align_of::<ble_evt_t__bindgen_ty_1>(),
12943 4usize,
12944 concat!("Alignment of ", stringify!(ble_evt_t__bindgen_ty_1))
12945 );
12946 assert_eq!(
12947 unsafe { &(*(::core::ptr::null::<ble_evt_t__bindgen_ty_1>())).common_evt as *const _ as usize },
12948 0usize,
12949 concat!(
12950 "Offset of field: ",
12951 stringify!(ble_evt_t__bindgen_ty_1),
12952 "::",
12953 stringify!(common_evt)
12954 )
12955 );
12956 assert_eq!(
12957 unsafe { &(*(::core::ptr::null::<ble_evt_t__bindgen_ty_1>())).gap_evt as *const _ as usize },
12958 0usize,
12959 concat!(
12960 "Offset of field: ",
12961 stringify!(ble_evt_t__bindgen_ty_1),
12962 "::",
12963 stringify!(gap_evt)
12964 )
12965 );
12966 assert_eq!(
12967 unsafe { &(*(::core::ptr::null::<ble_evt_t__bindgen_ty_1>())).gattc_evt as *const _ as usize },
12968 0usize,
12969 concat!(
12970 "Offset of field: ",
12971 stringify!(ble_evt_t__bindgen_ty_1),
12972 "::",
12973 stringify!(gattc_evt)
12974 )
12975 );
12976 assert_eq!(
12977 unsafe { &(*(::core::ptr::null::<ble_evt_t__bindgen_ty_1>())).gatts_evt as *const _ as usize },
12978 0usize,
12979 concat!(
12980 "Offset of field: ",
12981 stringify!(ble_evt_t__bindgen_ty_1),
12982 "::",
12983 stringify!(gatts_evt)
12984 )
12985 );
12986 assert_eq!(
12987 unsafe { &(*(::core::ptr::null::<ble_evt_t__bindgen_ty_1>())).l2cap_evt as *const _ as usize },
12988 0usize,
12989 concat!(
12990 "Offset of field: ",
12991 stringify!(ble_evt_t__bindgen_ty_1),
12992 "::",
12993 stringify!(l2cap_evt)
12994 )
12995 );
12996}
12997#[test]
12998fn bindgen_test_layout_ble_evt_t() {
12999 assert_eq!(
13000 ::core::mem::size_of::<ble_evt_t>(),
13001 48usize,
13002 concat!("Size of: ", stringify!(ble_evt_t))
13003 );
13004 assert_eq!(
13005 ::core::mem::align_of::<ble_evt_t>(),
13006 4usize,
13007 concat!("Alignment of ", stringify!(ble_evt_t))
13008 );
13009 assert_eq!(
13010 unsafe { &(*(::core::ptr::null::<ble_evt_t>())).header as *const _ as usize },
13011 0usize,
13012 concat!("Offset of field: ", stringify!(ble_evt_t), "::", stringify!(header))
13013 );
13014 assert_eq!(
13015 unsafe { &(*(::core::ptr::null::<ble_evt_t>())).evt as *const _ as usize },
13016 4usize,
13017 concat!("Offset of field: ", stringify!(ble_evt_t), "::", stringify!(evt))
13018 );
13019}
13020#[doc = " @brief Version Information."]
13021#[repr(C)]
13022#[derive(Debug, Copy, Clone)]
13023pub struct ble_version_t {
13024 #[doc = "< Link Layer Version number. See https://www.bluetooth.org/en-us/specification/assigned-numbers/link-layer for assigned values."]
13025 pub version_number: u8,
13026 #[doc = "< Company ID, Nordic Semiconductor's company ID is 89 (0x0059) (https://www.bluetooth.org/apps/content/Default.aspx?doc_id=49708)."]
13027 pub company_id: u16,
13028 #[doc = "< Link Layer Sub Version number, corresponds to the SoftDevice Config ID or Firmware ID (FWID)."]
13029 pub subversion_number: u16,
13030}
13031#[test]
13032fn bindgen_test_layout_ble_version_t() {
13033 assert_eq!(
13034 ::core::mem::size_of::<ble_version_t>(),
13035 6usize,
13036 concat!("Size of: ", stringify!(ble_version_t))
13037 );
13038 assert_eq!(
13039 ::core::mem::align_of::<ble_version_t>(),
13040 2usize,
13041 concat!("Alignment of ", stringify!(ble_version_t))
13042 );
13043 assert_eq!(
13044 unsafe { &(*(::core::ptr::null::<ble_version_t>())).version_number as *const _ as usize },
13045 0usize,
13046 concat!(
13047 "Offset of field: ",
13048 stringify!(ble_version_t),
13049 "::",
13050 stringify!(version_number)
13051 )
13052 );
13053 assert_eq!(
13054 unsafe { &(*(::core::ptr::null::<ble_version_t>())).company_id as *const _ as usize },
13055 2usize,
13056 concat!(
13057 "Offset of field: ",
13058 stringify!(ble_version_t),
13059 "::",
13060 stringify!(company_id)
13061 )
13062 );
13063 assert_eq!(
13064 unsafe { &(*(::core::ptr::null::<ble_version_t>())).subversion_number as *const _ as usize },
13065 4usize,
13066 concat!(
13067 "Offset of field: ",
13068 stringify!(ble_version_t),
13069 "::",
13070 stringify!(subversion_number)
13071 )
13072 );
13073}
13074#[doc = " @brief Configuration parameters for the PA and LNA."]
13075#[repr(C, packed)]
13076#[derive(Debug, Copy, Clone)]
13077pub struct ble_pa_lna_cfg_t {
13078 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
13079}
13080#[test]
13081fn bindgen_test_layout_ble_pa_lna_cfg_t() {
13082 assert_eq!(
13083 ::core::mem::size_of::<ble_pa_lna_cfg_t>(),
13084 1usize,
13085 concat!("Size of: ", stringify!(ble_pa_lna_cfg_t))
13086 );
13087 assert_eq!(
13088 ::core::mem::align_of::<ble_pa_lna_cfg_t>(),
13089 1usize,
13090 concat!("Alignment of ", stringify!(ble_pa_lna_cfg_t))
13091 );
13092}
13093impl ble_pa_lna_cfg_t {
13094 #[inline]
13095 pub fn enable(&self) -> u8 {
13096 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
13097 }
13098 #[inline]
13099 pub fn set_enable(&mut self, val: u8) {
13100 unsafe {
13101 let val: u8 = ::core::mem::transmute(val);
13102 self._bitfield_1.set(0usize, 1u8, val as u64)
13103 }
13104 }
13105 #[inline]
13106 pub fn active_high(&self) -> u8 {
13107 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
13108 }
13109 #[inline]
13110 pub fn set_active_high(&mut self, val: u8) {
13111 unsafe {
13112 let val: u8 = ::core::mem::transmute(val);
13113 self._bitfield_1.set(1usize, 1u8, val as u64)
13114 }
13115 }
13116 #[inline]
13117 pub fn gpio_pin(&self) -> u8 {
13118 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 6u8) as u8) }
13119 }
13120 #[inline]
13121 pub fn set_gpio_pin(&mut self, val: u8) {
13122 unsafe {
13123 let val: u8 = ::core::mem::transmute(val);
13124 self._bitfield_1.set(2usize, 6u8, val as u64)
13125 }
13126 }
13127 #[inline]
13128 pub fn new_bitfield_1(enable: u8, active_high: u8, gpio_pin: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
13129 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
13130 __bindgen_bitfield_unit.set(0usize, 1u8, {
13131 let enable: u8 = unsafe { ::core::mem::transmute(enable) };
13132 enable as u64
13133 });
13134 __bindgen_bitfield_unit.set(1usize, 1u8, {
13135 let active_high: u8 = unsafe { ::core::mem::transmute(active_high) };
13136 active_high as u64
13137 });
13138 __bindgen_bitfield_unit.set(2usize, 6u8, {
13139 let gpio_pin: u8 = unsafe { ::core::mem::transmute(gpio_pin) };
13140 gpio_pin as u64
13141 });
13142 __bindgen_bitfield_unit
13143 }
13144}
13145#[doc = " @brief PA & LNA GPIO toggle configuration"]
13146#[doc = ""]
13147#[doc = " This option configures the SoftDevice to toggle pins when the radio is active for use with a power amplifier and/or"]
13148#[doc = " a low noise amplifier."]
13149#[doc = ""]
13150#[doc = " Toggling the pins is achieved by using two PPI channels and a GPIOTE channel. The hardware channel IDs are provided"]
13151#[doc = " by the application and should be regarded as reserved as long as any PA/LNA toggling is enabled."]
13152#[doc = ""]
13153#[doc = " @note @ref sd_ble_opt_get is not supported for this option."]
13154#[doc = " @note Setting this option while the radio is in use (i.e. any of the roles are active) may have undefined consequences"]
13155#[doc = " and must be avoided by the application."]
13156#[repr(C)]
13157#[derive(Debug, Copy, Clone)]
13158pub struct ble_common_opt_pa_lna_t {
13159 #[doc = "< Power Amplifier configuration"]
13160 pub pa_cfg: ble_pa_lna_cfg_t,
13161 #[doc = "< Low Noise Amplifier configuration"]
13162 pub lna_cfg: ble_pa_lna_cfg_t,
13163 #[doc = "< PPI channel used for radio pin setting"]
13164 pub ppi_ch_id_set: u8,
13165 #[doc = "< PPI channel used for radio pin clearing"]
13166 pub ppi_ch_id_clr: u8,
13167 #[doc = "< GPIOTE channel used for radio pin toggling"]
13168 pub gpiote_ch_id: u8,
13169}
13170#[test]
13171fn bindgen_test_layout_ble_common_opt_pa_lna_t() {
13172 assert_eq!(
13173 ::core::mem::size_of::<ble_common_opt_pa_lna_t>(),
13174 5usize,
13175 concat!("Size of: ", stringify!(ble_common_opt_pa_lna_t))
13176 );
13177 assert_eq!(
13178 ::core::mem::align_of::<ble_common_opt_pa_lna_t>(),
13179 1usize,
13180 concat!("Alignment of ", stringify!(ble_common_opt_pa_lna_t))
13181 );
13182 assert_eq!(
13183 unsafe { &(*(::core::ptr::null::<ble_common_opt_pa_lna_t>())).pa_cfg as *const _ as usize },
13184 0usize,
13185 concat!(
13186 "Offset of field: ",
13187 stringify!(ble_common_opt_pa_lna_t),
13188 "::",
13189 stringify!(pa_cfg)
13190 )
13191 );
13192 assert_eq!(
13193 unsafe { &(*(::core::ptr::null::<ble_common_opt_pa_lna_t>())).lna_cfg as *const _ as usize },
13194 1usize,
13195 concat!(
13196 "Offset of field: ",
13197 stringify!(ble_common_opt_pa_lna_t),
13198 "::",
13199 stringify!(lna_cfg)
13200 )
13201 );
13202 assert_eq!(
13203 unsafe { &(*(::core::ptr::null::<ble_common_opt_pa_lna_t>())).ppi_ch_id_set as *const _ as usize },
13204 2usize,
13205 concat!(
13206 "Offset of field: ",
13207 stringify!(ble_common_opt_pa_lna_t),
13208 "::",
13209 stringify!(ppi_ch_id_set)
13210 )
13211 );
13212 assert_eq!(
13213 unsafe { &(*(::core::ptr::null::<ble_common_opt_pa_lna_t>())).ppi_ch_id_clr as *const _ as usize },
13214 3usize,
13215 concat!(
13216 "Offset of field: ",
13217 stringify!(ble_common_opt_pa_lna_t),
13218 "::",
13219 stringify!(ppi_ch_id_clr)
13220 )
13221 );
13222 assert_eq!(
13223 unsafe { &(*(::core::ptr::null::<ble_common_opt_pa_lna_t>())).gpiote_ch_id as *const _ as usize },
13224 4usize,
13225 concat!(
13226 "Offset of field: ",
13227 stringify!(ble_common_opt_pa_lna_t),
13228 "::",
13229 stringify!(gpiote_ch_id)
13230 )
13231 );
13232}
13233#[doc = " @brief Configuration of extended BLE connection events."]
13234#[doc = ""]
13235#[doc = " When enabled the SoftDevice will dynamically extend the connection event when possible."]
13236#[doc = ""]
13237#[doc = " The connection event length is controlled by the connection configuration as set by @ref ble_gap_conn_cfg_t::event_length."]
13238#[doc = " The connection event can be extended if there is time to send another packet pair before the start of the next connection interval,"]
13239#[doc = " and if there are no conflicts with other BLE roles requesting radio time."]
13240#[doc = ""]
13241#[doc = " @note @ref sd_ble_opt_get is not supported for this option."]
13242#[repr(C, packed)]
13243#[derive(Debug, Copy, Clone)]
13244pub struct ble_common_opt_conn_evt_ext_t {
13245 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
13246}
13247#[test]
13248fn bindgen_test_layout_ble_common_opt_conn_evt_ext_t() {
13249 assert_eq!(
13250 ::core::mem::size_of::<ble_common_opt_conn_evt_ext_t>(),
13251 1usize,
13252 concat!("Size of: ", stringify!(ble_common_opt_conn_evt_ext_t))
13253 );
13254 assert_eq!(
13255 ::core::mem::align_of::<ble_common_opt_conn_evt_ext_t>(),
13256 1usize,
13257 concat!("Alignment of ", stringify!(ble_common_opt_conn_evt_ext_t))
13258 );
13259}
13260impl ble_common_opt_conn_evt_ext_t {
13261 #[inline]
13262 pub fn enable(&self) -> u8 {
13263 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
13264 }
13265 #[inline]
13266 pub fn set_enable(&mut self, val: u8) {
13267 unsafe {
13268 let val: u8 = ::core::mem::transmute(val);
13269 self._bitfield_1.set(0usize, 1u8, val as u64)
13270 }
13271 }
13272 #[inline]
13273 pub fn new_bitfield_1(enable: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
13274 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
13275 __bindgen_bitfield_unit.set(0usize, 1u8, {
13276 let enable: u8 = unsafe { ::core::mem::transmute(enable) };
13277 enable as u64
13278 });
13279 __bindgen_bitfield_unit
13280 }
13281}
13282#[doc = " @brief Enable/disable extended RC calibration."]
13283#[doc = ""]
13284#[doc = " If extended RC calibration is enabled and the internal RC oscillator (@ref NRF_CLOCK_LF_SRC_RC) is used as the SoftDevice"]
13285#[doc = " LFCLK source, the SoftDevice as a peripheral will by default try to increase the receive window if two consecutive packets"]
13286#[doc = " are not received. If it turns out that the packets were not received due to clock drift, the RC calibration is started."]
13287#[doc = " This calibration comes in addition to the periodic calibration that is configured by @ref sd_softdevice_enable(). When"]
13288#[doc = " using only peripheral connections, the periodic calibration can therefore be configured with a much longer interval as the"]
13289#[doc = " peripheral will be able to detect and adjust automatically to clock drift, and calibrate on demand."]
13290#[doc = ""]
13291#[doc = " If extended RC calibration is disabled and the internal RC oscillator is used as the SoftDevice LFCLK source, the"]
13292#[doc = " RC oscillator is calibrated periodically as configured by @ref sd_softdevice_enable()."]
13293#[doc = ""]
13294#[doc = " @note @ref sd_ble_opt_get is not supported for this option."]
13295#[repr(C, packed)]
13296#[derive(Debug, Copy, Clone)]
13297pub struct ble_common_opt_extended_rc_cal_t {
13298 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
13299}
13300#[test]
13301fn bindgen_test_layout_ble_common_opt_extended_rc_cal_t() {
13302 assert_eq!(
13303 ::core::mem::size_of::<ble_common_opt_extended_rc_cal_t>(),
13304 1usize,
13305 concat!("Size of: ", stringify!(ble_common_opt_extended_rc_cal_t))
13306 );
13307 assert_eq!(
13308 ::core::mem::align_of::<ble_common_opt_extended_rc_cal_t>(),
13309 1usize,
13310 concat!("Alignment of ", stringify!(ble_common_opt_extended_rc_cal_t))
13311 );
13312}
13313impl ble_common_opt_extended_rc_cal_t {
13314 #[inline]
13315 pub fn enable(&self) -> u8 {
13316 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
13317 }
13318 #[inline]
13319 pub fn set_enable(&mut self, val: u8) {
13320 unsafe {
13321 let val: u8 = ::core::mem::transmute(val);
13322 self._bitfield_1.set(0usize, 1u8, val as u64)
13323 }
13324 }
13325 #[inline]
13326 pub fn new_bitfield_1(enable: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
13327 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = Default::default();
13328 __bindgen_bitfield_unit.set(0usize, 1u8, {
13329 let enable: u8 = unsafe { ::core::mem::transmute(enable) };
13330 enable as u64
13331 });
13332 __bindgen_bitfield_unit
13333 }
13334}
13335#[doc = "@brief Option structure for common options."]
13336#[repr(C)]
13337#[derive(Copy, Clone)]
13338pub union ble_common_opt_t {
13339 #[doc = "< Parameters for controlling PA and LNA pin toggling."]
13340 pub pa_lna: ble_common_opt_pa_lna_t,
13341 #[doc = "< Parameters for enabling extended connection events."]
13342 pub conn_evt_ext: ble_common_opt_conn_evt_ext_t,
13343 #[doc = "< Parameters for enabling extended RC calibration."]
13344 pub extended_rc_cal: ble_common_opt_extended_rc_cal_t,
13345 _bindgen_union_align: [u8; 5usize],
13346}
13347#[test]
13348fn bindgen_test_layout_ble_common_opt_t() {
13349 assert_eq!(
13350 ::core::mem::size_of::<ble_common_opt_t>(),
13351 5usize,
13352 concat!("Size of: ", stringify!(ble_common_opt_t))
13353 );
13354 assert_eq!(
13355 ::core::mem::align_of::<ble_common_opt_t>(),
13356 1usize,
13357 concat!("Alignment of ", stringify!(ble_common_opt_t))
13358 );
13359 assert_eq!(
13360 unsafe { &(*(::core::ptr::null::<ble_common_opt_t>())).pa_lna as *const _ as usize },
13361 0usize,
13362 concat!(
13363 "Offset of field: ",
13364 stringify!(ble_common_opt_t),
13365 "::",
13366 stringify!(pa_lna)
13367 )
13368 );
13369 assert_eq!(
13370 unsafe { &(*(::core::ptr::null::<ble_common_opt_t>())).conn_evt_ext as *const _ as usize },
13371 0usize,
13372 concat!(
13373 "Offset of field: ",
13374 stringify!(ble_common_opt_t),
13375 "::",
13376 stringify!(conn_evt_ext)
13377 )
13378 );
13379 assert_eq!(
13380 unsafe { &(*(::core::ptr::null::<ble_common_opt_t>())).extended_rc_cal as *const _ as usize },
13381 0usize,
13382 concat!(
13383 "Offset of field: ",
13384 stringify!(ble_common_opt_t),
13385 "::",
13386 stringify!(extended_rc_cal)
13387 )
13388 );
13389}
13390#[doc = "@brief Common BLE Option type, wrapping the module specific options."]
13391#[repr(C)]
13392#[derive(Copy, Clone)]
13393pub union ble_opt_t {
13394 #[doc = "< COMMON options, opt_id in @ref BLE_COMMON_OPTS series."]
13395 pub common_opt: ble_common_opt_t,
13396 #[doc = "< GAP option, opt_id in @ref BLE_GAP_OPTS series."]
13397 pub gap_opt: ble_gap_opt_t,
13398 _bindgen_union_align: [u32; 2usize],
13399}
13400#[test]
13401fn bindgen_test_layout_ble_opt_t() {
13402 assert_eq!(
13403 ::core::mem::size_of::<ble_opt_t>(),
13404 8usize,
13405 concat!("Size of: ", stringify!(ble_opt_t))
13406 );
13407 assert_eq!(
13408 ::core::mem::align_of::<ble_opt_t>(),
13409 4usize,
13410 concat!("Alignment of ", stringify!(ble_opt_t))
13411 );
13412 assert_eq!(
13413 unsafe { &(*(::core::ptr::null::<ble_opt_t>())).common_opt as *const _ as usize },
13414 0usize,
13415 concat!("Offset of field: ", stringify!(ble_opt_t), "::", stringify!(common_opt))
13416 );
13417 assert_eq!(
13418 unsafe { &(*(::core::ptr::null::<ble_opt_t>())).gap_opt as *const _ as usize },
13419 0usize,
13420 concat!("Offset of field: ", stringify!(ble_opt_t), "::", stringify!(gap_opt))
13421 );
13422}
13423#[doc = "@brief BLE connection configuration type, wrapping the module specific configurations, set with"]
13424#[doc = " @ref sd_ble_cfg_set."]
13425#[doc = ""]
13426#[doc = " @note Connection configurations don't have to be set."]
13427#[doc = " In the case that no configurations has been set, or fewer connection configurations has been set than enabled connections,"]
13428#[doc = " the default connection configuration will be automatically added for the remaining connections."]
13429#[doc = " When creating connections with the default configuration, @ref BLE_CONN_CFG_TAG_DEFAULT should be used in"]
13430#[doc = " place of @ref ble_conn_cfg_t::conn_cfg_tag."]
13431#[doc = ""]
13432#[doc = " @sa sd_ble_gap_adv_start()"]
13433#[doc = " @sa sd_ble_gap_connect()"]
13434#[doc = ""]
13435#[doc = " @mscs"]
13436#[doc = " @mmsc{@ref BLE_CONN_CFG}"]
13437#[doc = " @endmscs"]
13438#[doc = ""]
13439#[repr(C)]
13440#[derive(Copy, Clone)]
13441pub struct ble_conn_cfg_t {
13442 #[doc = "< The application chosen tag it can use with the"]
13443 #[doc = "@ref sd_ble_gap_adv_start() and @ref sd_ble_gap_connect() calls"]
13444 #[doc = "to select this configuration when creating a connection."]
13445 #[doc = "Must be different for all connection configurations added and not @ref BLE_CONN_CFG_TAG_DEFAULT."]
13446 pub conn_cfg_tag: u8,
13447 #[doc = "< Connection configuration union."]
13448 pub params: ble_conn_cfg_t__bindgen_ty_1,
13449}
13450#[repr(C)]
13451#[derive(Copy, Clone)]
13452pub union ble_conn_cfg_t__bindgen_ty_1 {
13453 #[doc = "< GAP connection configuration, cfg_id is @ref BLE_CONN_CFG_GAP."]
13454 pub gap_conn_cfg: ble_gap_conn_cfg_t,
13455 #[doc = "< GATTC connection configuration, cfg_id is @ref BLE_CONN_CFG_GATTC."]
13456 pub gattc_conn_cfg: ble_gattc_conn_cfg_t,
13457 #[doc = "< GATTS connection configuration, cfg_id is @ref BLE_CONN_CFG_GATTS."]
13458 pub gatts_conn_cfg: ble_gatts_conn_cfg_t,
13459 #[doc = "< GATT connection configuration, cfg_id is @ref BLE_CONN_CFG_GATT."]
13460 pub gatt_conn_cfg: ble_gatt_conn_cfg_t,
13461 #[doc = "< L2CAP connection configuration, cfg_id is @ref BLE_CONN_CFG_L2CAP."]
13462 pub l2cap_conn_cfg: ble_l2cap_conn_cfg_t,
13463 _bindgen_union_align: [u16; 4usize],
13464}
13465#[test]
13466fn bindgen_test_layout_ble_conn_cfg_t__bindgen_ty_1() {
13467 assert_eq!(
13468 ::core::mem::size_of::<ble_conn_cfg_t__bindgen_ty_1>(),
13469 8usize,
13470 concat!("Size of: ", stringify!(ble_conn_cfg_t__bindgen_ty_1))
13471 );
13472 assert_eq!(
13473 ::core::mem::align_of::<ble_conn_cfg_t__bindgen_ty_1>(),
13474 2usize,
13475 concat!("Alignment of ", stringify!(ble_conn_cfg_t__bindgen_ty_1))
13476 );
13477 assert_eq!(
13478 unsafe { &(*(::core::ptr::null::<ble_conn_cfg_t__bindgen_ty_1>())).gap_conn_cfg as *const _ as usize },
13479 0usize,
13480 concat!(
13481 "Offset of field: ",
13482 stringify!(ble_conn_cfg_t__bindgen_ty_1),
13483 "::",
13484 stringify!(gap_conn_cfg)
13485 )
13486 );
13487 assert_eq!(
13488 unsafe { &(*(::core::ptr::null::<ble_conn_cfg_t__bindgen_ty_1>())).gattc_conn_cfg as *const _ as usize },
13489 0usize,
13490 concat!(
13491 "Offset of field: ",
13492 stringify!(ble_conn_cfg_t__bindgen_ty_1),
13493 "::",
13494 stringify!(gattc_conn_cfg)
13495 )
13496 );
13497 assert_eq!(
13498 unsafe { &(*(::core::ptr::null::<ble_conn_cfg_t__bindgen_ty_1>())).gatts_conn_cfg as *const _ as usize },
13499 0usize,
13500 concat!(
13501 "Offset of field: ",
13502 stringify!(ble_conn_cfg_t__bindgen_ty_1),
13503 "::",
13504 stringify!(gatts_conn_cfg)
13505 )
13506 );
13507 assert_eq!(
13508 unsafe { &(*(::core::ptr::null::<ble_conn_cfg_t__bindgen_ty_1>())).gatt_conn_cfg as *const _ as usize },
13509 0usize,
13510 concat!(
13511 "Offset of field: ",
13512 stringify!(ble_conn_cfg_t__bindgen_ty_1),
13513 "::",
13514 stringify!(gatt_conn_cfg)
13515 )
13516 );
13517 assert_eq!(
13518 unsafe { &(*(::core::ptr::null::<ble_conn_cfg_t__bindgen_ty_1>())).l2cap_conn_cfg as *const _ as usize },
13519 0usize,
13520 concat!(
13521 "Offset of field: ",
13522 stringify!(ble_conn_cfg_t__bindgen_ty_1),
13523 "::",
13524 stringify!(l2cap_conn_cfg)
13525 )
13526 );
13527}
13528#[test]
13529fn bindgen_test_layout_ble_conn_cfg_t() {
13530 assert_eq!(
13531 ::core::mem::size_of::<ble_conn_cfg_t>(),
13532 10usize,
13533 concat!("Size of: ", stringify!(ble_conn_cfg_t))
13534 );
13535 assert_eq!(
13536 ::core::mem::align_of::<ble_conn_cfg_t>(),
13537 2usize,
13538 concat!("Alignment of ", stringify!(ble_conn_cfg_t))
13539 );
13540 assert_eq!(
13541 unsafe { &(*(::core::ptr::null::<ble_conn_cfg_t>())).conn_cfg_tag as *const _ as usize },
13542 0usize,
13543 concat!(
13544 "Offset of field: ",
13545 stringify!(ble_conn_cfg_t),
13546 "::",
13547 stringify!(conn_cfg_tag)
13548 )
13549 );
13550 assert_eq!(
13551 unsafe { &(*(::core::ptr::null::<ble_conn_cfg_t>())).params as *const _ as usize },
13552 2usize,
13553 concat!(
13554 "Offset of field: ",
13555 stringify!(ble_conn_cfg_t),
13556 "::",
13557 stringify!(params)
13558 )
13559 );
13560}
13561#[doc = " @brief Configuration of Vendor Specific base UUIDs, set with @ref sd_ble_cfg_set."]
13562#[doc = ""]
13563#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Too many UUIDs configured."]
13564#[repr(C)]
13565#[derive(Debug, Copy, Clone)]
13566pub struct ble_common_cfg_vs_uuid_t {
13567 #[doc = "< Number of 128-bit Vendor Specific base UUID bases to allocate memory for."]
13568 #[doc = "Default value is @ref BLE_UUID_VS_COUNT_DEFAULT. Maximum value is"]
13569 #[doc = "@ref BLE_UUID_VS_COUNT_MAX."]
13570 pub vs_uuid_count: u8,
13571}
13572#[test]
13573fn bindgen_test_layout_ble_common_cfg_vs_uuid_t() {
13574 assert_eq!(
13575 ::core::mem::size_of::<ble_common_cfg_vs_uuid_t>(),
13576 1usize,
13577 concat!("Size of: ", stringify!(ble_common_cfg_vs_uuid_t))
13578 );
13579 assert_eq!(
13580 ::core::mem::align_of::<ble_common_cfg_vs_uuid_t>(),
13581 1usize,
13582 concat!("Alignment of ", stringify!(ble_common_cfg_vs_uuid_t))
13583 );
13584 assert_eq!(
13585 unsafe { &(*(::core::ptr::null::<ble_common_cfg_vs_uuid_t>())).vs_uuid_count as *const _ as usize },
13586 0usize,
13587 concat!(
13588 "Offset of field: ",
13589 stringify!(ble_common_cfg_vs_uuid_t),
13590 "::",
13591 stringify!(vs_uuid_count)
13592 )
13593 );
13594}
13595#[doc = "@brief Common BLE Configuration type, wrapping the common configurations."]
13596#[repr(C)]
13597#[derive(Copy, Clone)]
13598pub union ble_common_cfg_t {
13599 #[doc = "< Vendor Specific base UUID configuration, cfg_id is @ref BLE_COMMON_CFG_VS_UUID."]
13600 pub vs_uuid_cfg: ble_common_cfg_vs_uuid_t,
13601 _bindgen_union_align: u8,
13602}
13603#[test]
13604fn bindgen_test_layout_ble_common_cfg_t() {
13605 assert_eq!(
13606 ::core::mem::size_of::<ble_common_cfg_t>(),
13607 1usize,
13608 concat!("Size of: ", stringify!(ble_common_cfg_t))
13609 );
13610 assert_eq!(
13611 ::core::mem::align_of::<ble_common_cfg_t>(),
13612 1usize,
13613 concat!("Alignment of ", stringify!(ble_common_cfg_t))
13614 );
13615 assert_eq!(
13616 unsafe { &(*(::core::ptr::null::<ble_common_cfg_t>())).vs_uuid_cfg as *const _ as usize },
13617 0usize,
13618 concat!(
13619 "Offset of field: ",
13620 stringify!(ble_common_cfg_t),
13621 "::",
13622 stringify!(vs_uuid_cfg)
13623 )
13624 );
13625}
13626#[doc = "@brief BLE Configuration type, wrapping the module specific configurations."]
13627#[repr(C)]
13628#[derive(Copy, Clone)]
13629pub union ble_cfg_t {
13630 #[doc = "< Connection specific configurations, cfg_id in @ref BLE_CONN_CFGS series."]
13631 pub conn_cfg: ble_conn_cfg_t,
13632 #[doc = "< Global common configurations, cfg_id in @ref BLE_COMMON_CFGS series."]
13633 pub common_cfg: ble_common_cfg_t,
13634 #[doc = "< Global GAP configurations, cfg_id in @ref BLE_GAP_CFGS series."]
13635 pub gap_cfg: ble_gap_cfg_t,
13636 #[doc = "< Global GATTS configuration, cfg_id in @ref BLE_GATTS_CFGS series."]
13637 pub gatts_cfg: ble_gatts_cfg_t,
13638 _bindgen_union_align: [u32; 3usize],
13639}
13640#[test]
13641fn bindgen_test_layout_ble_cfg_t() {
13642 assert_eq!(
13643 ::core::mem::size_of::<ble_cfg_t>(),
13644 12usize,
13645 concat!("Size of: ", stringify!(ble_cfg_t))
13646 );
13647 assert_eq!(
13648 ::core::mem::align_of::<ble_cfg_t>(),
13649 4usize,
13650 concat!("Alignment of ", stringify!(ble_cfg_t))
13651 );
13652 assert_eq!(
13653 unsafe { &(*(::core::ptr::null::<ble_cfg_t>())).conn_cfg as *const _ as usize },
13654 0usize,
13655 concat!("Offset of field: ", stringify!(ble_cfg_t), "::", stringify!(conn_cfg))
13656 );
13657 assert_eq!(
13658 unsafe { &(*(::core::ptr::null::<ble_cfg_t>())).common_cfg as *const _ as usize },
13659 0usize,
13660 concat!("Offset of field: ", stringify!(ble_cfg_t), "::", stringify!(common_cfg))
13661 );
13662 assert_eq!(
13663 unsafe { &(*(::core::ptr::null::<ble_cfg_t>())).gap_cfg as *const _ as usize },
13664 0usize,
13665 concat!("Offset of field: ", stringify!(ble_cfg_t), "::", stringify!(gap_cfg))
13666 );
13667 assert_eq!(
13668 unsafe { &(*(::core::ptr::null::<ble_cfg_t>())).gatts_cfg as *const _ as usize },
13669 0usize,
13670 concat!("Offset of field: ", stringify!(ble_cfg_t), "::", stringify!(gatts_cfg))
13671 );
13672}
13673
13674#[doc = "@brief Enable the BLE stack"]
13675#[doc = ""]
13676#[doc = " @param[in, out] p_app_ram_base Pointer to a variable containing the start address of the"]
13677#[doc = " application RAM region (APP_RAM_BASE). On return, this will"]
13678#[doc = " contain the minimum start address of the application RAM region"]
13679#[doc = " required by the SoftDevice for this configuration."]
13680#[doc = ""]
13681#[doc = " @note The memory requirement for a specific configuration will not increase between SoftDevices"]
13682#[doc = " with the same major version number."]
13683#[doc = ""]
13684#[doc = " @note At runtime the IC's RAM is split into 2 regions: The SoftDevice RAM region is located"]
13685#[doc = " between 0x20000000 and APP_RAM_BASE-1 and the application's RAM region is located between"]
13686#[doc = " APP_RAM_BASE and the start of the call stack."]
13687#[doc = ""]
13688#[doc = " @details This call initializes the BLE stack, no BLE related function other than @ref"]
13689#[doc = " sd_ble_cfg_set can be called before this one."]
13690#[doc = ""]
13691#[doc = " @mscs"]
13692#[doc = " @mmsc{@ref BLE_COMMON_ENABLE}"]
13693#[doc = " @endmscs"]
13694#[doc = ""]
13695#[doc = " @retval ::NRF_SUCCESS The BLE stack has been initialized successfully."]
13696#[doc = " @retval ::NRF_ERROR_INVALID_STATE The BLE stack had already been initialized and cannot be reinitialized."]
13697#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid or not sufficiently aligned pointer supplied."]
13698#[doc = " @retval ::NRF_ERROR_NO_MEM One or more of the following is true:"]
13699#[doc = " - The amount of memory assigned to the SoftDevice by *p_app_ram_base is not"]
13700#[doc = " large enough to fit this configuration's memory requirement. Check *p_app_ram_base"]
13701#[doc = " and set the start address of the application RAM region accordingly."]
13702#[doc = " - Dynamic part of the SoftDevice RAM region is larger then 64 kB which"]
13703#[doc = " is currently not supported."]
13704#[doc = " @retval ::NRF_ERROR_RESOURCES The total number of L2CAP Channels configured using @ref sd_ble_cfg_set is too large."]
13705#[inline(always)]
13706pub unsafe fn sd_ble_enable(p_app_ram_base: *mut u32) -> u32 {
13707 let ret: u32;
13708 core::arch::asm!("svc 96",
13709 inout("r0") to_asm(p_app_ram_base) => ret,
13710 lateout("r1") _,
13711 lateout("r2") _,
13712 lateout("r3") _,
13713 lateout("r12") _,
13714 );
13715 ret
13716}
13717
13718#[doc = "@brief Add configurations for the BLE stack"]
13719#[doc = ""]
13720#[doc = " @param[in] cfg_id Config ID, see @ref BLE_CONN_CFGS, @ref BLE_COMMON_CFGS, @ref"]
13721#[doc = " BLE_GAP_CFGS or @ref BLE_GATTS_CFGS."]
13722#[doc = " @param[in] p_cfg Pointer to a ble_cfg_t structure containing the configuration value."]
13723#[doc = " @param[in] app_ram_base The start address of the application RAM region (APP_RAM_BASE)."]
13724#[doc = " See @ref sd_ble_enable for details about APP_RAM_BASE."]
13725#[doc = ""]
13726#[doc = " @note The memory requirement for a specific configuration will not increase between SoftDevices"]
13727#[doc = " with the same major version number."]
13728#[doc = ""]
13729#[doc = " @note If a configuration is set more than once, the last one set is the one that takes effect on"]
13730#[doc = " @ref sd_ble_enable."]
13731#[doc = ""]
13732#[doc = " @note Any part of the BLE stack that is NOT configured with @ref sd_ble_cfg_set will have default"]
13733#[doc = " configuration."]
13734#[doc = ""]
13735#[doc = " @note @ref sd_ble_cfg_set may be called at any time when the SoftDevice is enabled (see @ref"]
13736#[doc = " sd_softdevice_enable) while the BLE part of the SoftDevice is not enabled (see @ref"]
13737#[doc = " sd_ble_enable)."]
13738#[doc = ""]
13739#[doc = " @note Error codes for the configurations are described in the configuration structs."]
13740#[doc = ""]
13741#[doc = " @mscs"]
13742#[doc = " @mmsc{@ref BLE_COMMON_ENABLE}"]
13743#[doc = " @endmscs"]
13744#[doc = ""]
13745#[doc = " @retval ::NRF_SUCCESS The configuration has been added successfully."]
13746#[doc = " @retval ::NRF_ERROR_INVALID_STATE The BLE stack had already been initialized."]
13747#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid or not sufficiently aligned pointer supplied."]
13748#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid cfg_id supplied."]
13749#[doc = " @retval ::NRF_ERROR_NO_MEM The amount of memory assigned to the SoftDevice by app_ram_base is not"]
13750#[doc = " large enough to fit this configuration's memory requirement."]
13751#[inline(always)]
13752pub unsafe fn sd_ble_cfg_set(cfg_id: u32, p_cfg: *const ble_cfg_t, app_ram_base: u32) -> u32 {
13753 let ret: u32;
13754 core::arch::asm!("svc 105",
13755 inout("r0") to_asm(cfg_id) => ret,
13756 inout("r1") to_asm(p_cfg) => _,
13757 inout("r2") to_asm(app_ram_base) => _,
13758 lateout("r3") _,
13759 lateout("r12") _,
13760 );
13761 ret
13762}
13763
13764#[doc = "@brief Get an event from the pending events queue."]
13765#[doc = ""]
13766#[doc = " @param[out] p_dest Pointer to buffer to be filled in with an event, or NULL to retrieve the event length."]
13767#[doc = " This buffer <b>must be aligned to the extend defined by @ref BLE_EVT_PTR_ALIGNMENT</b>."]
13768#[doc = " The buffer should be interpreted as a @ref ble_evt_t struct."]
13769#[doc = " @param[in, out] p_len Pointer the length of the buffer, on return it is filled with the event length."]
13770#[doc = ""]
13771#[doc = " @details This call allows the application to pull a BLE event from the BLE stack. The application is signaled that"]
13772#[doc = " an event is available from the BLE stack by the triggering of the SD_EVT_IRQn interrupt."]
13773#[doc = " The application is free to choose whether to call this function from thread mode (main context) or directly from the"]
13774#[doc = " Interrupt Service Routine that maps to SD_EVT_IRQn. In any case however, and because the BLE stack runs at a higher"]
13775#[doc = " priority than the application, this function should be called in a loop (until @ref NRF_ERROR_NOT_FOUND is returned)"]
13776#[doc = " every time SD_EVT_IRQn is raised to ensure that all available events are pulled from the BLE stack. Failure to do so"]
13777#[doc = " could potentially leave events in the internal queue without the application being aware of this fact."]
13778#[doc = ""]
13779#[doc = " Sizing the p_dest buffer is equally important, since the application needs to provide all the memory necessary for the event to"]
13780#[doc = " be copied into application memory. If the buffer provided is not large enough to fit the entire contents of the event,"]
13781#[doc = " @ref NRF_ERROR_DATA_SIZE will be returned and the application can then call again with a larger buffer size."]
13782#[doc = " The maximum possible event length is defined by @ref BLE_EVT_LEN_MAX. The application may also \"peek\" the event length"]
13783#[doc = " by providing p_dest as a NULL pointer and inspecting the value of *p_len upon return:"]
13784#[doc = ""]
13785#[doc = " \\code"]
13786#[doc = " uint16_t len;"]
13787#[doc = " errcode = sd_ble_evt_get(NULL, &len);"]
13788#[doc = " \\endcode"]
13789#[doc = ""]
13790#[doc = " @mscs"]
13791#[doc = " @mmsc{@ref BLE_COMMON_IRQ_EVT_MSC}"]
13792#[doc = " @mmsc{@ref BLE_COMMON_THREAD_EVT_MSC}"]
13793#[doc = " @endmscs"]
13794#[doc = ""]
13795#[doc = " @retval ::NRF_SUCCESS Event pulled and stored into the supplied buffer."]
13796#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid or not sufficiently aligned pointer supplied."]
13797#[doc = " @retval ::NRF_ERROR_NOT_FOUND No events ready to be pulled."]
13798#[doc = " @retval ::NRF_ERROR_DATA_SIZE Event ready but could not fit into the supplied buffer."]
13799#[inline(always)]
13800pub unsafe fn sd_ble_evt_get(p_dest: *mut u8, p_len: *mut u16) -> u32 {
13801 let ret: u32;
13802 core::arch::asm!("svc 97",
13803 inout("r0") to_asm(p_dest) => ret,
13804 inout("r1") to_asm(p_len) => _,
13805 lateout("r2") _,
13806 lateout("r3") _,
13807 lateout("r12") _,
13808 );
13809 ret
13810}
13811
13812#[doc = "@brief Add a Vendor Specific base UUID."]
13813#[doc = ""]
13814#[doc = " @details This call enables the application to add a Vendor Specific base UUID to the BLE stack's table, for later"]
13815#[doc = " use with all other modules and APIs. This then allows the application to use the shorter, 24-bit @ref ble_uuid_t"]
13816#[doc = " format when dealing with both 16-bit and 128-bit UUIDs without having to check for lengths and having split code"]
13817#[doc = " paths. This is accomplished by extending the grouping mechanism that the Bluetooth SIG standard base UUID uses"]
13818#[doc = " for all other 128-bit UUIDs. The type field in the @ref ble_uuid_t structure is an index (relative to"]
13819#[doc = " @ref BLE_UUID_TYPE_VENDOR_BEGIN) to the table populated by multiple calls to this function, and the UUID field"]
13820#[doc = " in the same structure contains the 2 bytes at indexes 12 and 13. The number of possible 128-bit UUIDs available to"]
13821#[doc = " the application is therefore the number of Vendor Specific UUIDs added with the help of this function times 65536,"]
13822#[doc = " although restricted to modifying bytes 12 and 13 for each of the entries in the supplied array."]
13823#[doc = ""]
13824#[doc = " @note Bytes 12 and 13 of the provided UUID will not be used internally, since those are always replaced by"]
13825#[doc = " the 16-bit uuid field in @ref ble_uuid_t."]
13826#[doc = ""]
13827#[doc = " @note If a UUID is already present in the BLE stack's internal table, the corresponding index will be returned in"]
13828#[doc = " p_uuid_type along with an @ref NRF_SUCCESS error code."]
13829#[doc = ""]
13830#[doc = " @param[in] p_vs_uuid Pointer to a 16-octet (128-bit) little endian Vendor Specific base UUID disregarding"]
13831#[doc = " bytes 12 and 13."]
13832#[doc = " @param[out] p_uuid_type Pointer to a uint8_t where the type field in @ref ble_uuid_t corresponding to this UUID will be stored."]
13833#[doc = ""]
13834#[doc = " @retval ::NRF_SUCCESS Successfully added the Vendor Specific base UUID."]
13835#[doc = " @retval ::NRF_ERROR_INVALID_ADDR If p_vs_uuid or p_uuid_type is NULL or invalid."]
13836#[doc = " @retval ::NRF_ERROR_NO_MEM If there are no more free slots for VS UUIDs."]
13837#[inline(always)]
13838pub unsafe fn sd_ble_uuid_vs_add(p_vs_uuid: *const ble_uuid128_t, p_uuid_type: *mut u8) -> u32 {
13839 let ret: u32;
13840 core::arch::asm!("svc 98",
13841 inout("r0") to_asm(p_vs_uuid) => ret,
13842 inout("r1") to_asm(p_uuid_type) => _,
13843 lateout("r2") _,
13844 lateout("r3") _,
13845 lateout("r12") _,
13846 );
13847 ret
13848}
13849
13850#[doc = "@brief Remove a Vendor Specific base UUID."]
13851#[doc = ""]
13852#[doc = " @details This call removes a Vendor Specific base UUID that has been added with @ref sd_ble_uuid_vs_add. This function allows"]
13853#[doc = " the application to reuse memory allocated for Vendor Specific base UUIDs."]
13854#[doc = ""]
13855#[doc = " @note Currently this function can only be called with a p_uuid_type set to @ref BLE_UUID_TYPE_UNKNOWN or the last added UUID type."]
13856#[doc = ""]
13857#[doc = " @param[inout] p_uuid_type Pointer to a uint8_t where its value matches the UUID type in @ref ble_uuid_t::type to be removed."]
13858#[doc = " If the type is set to @ref BLE_UUID_TYPE_UNKNOWN, or the pointer is NULL, the last Vendor Specific"]
13859#[doc = " base UUID will be removed. If the function returns successfully, the UUID type that was removed will"]
13860#[doc = " be written back to @p p_uuid_type. If function returns with a failure, it contains the last type that"]
13861#[doc = " is in use by the ATT Server."]
13862#[doc = ""]
13863#[doc = " @retval ::NRF_SUCCESS Successfully removed the Vendor Specific base UUID."]
13864#[doc = " @retval ::NRF_ERROR_INVALID_ADDR If p_uuid_type is invalid."]
13865#[doc = " @retval ::NRF_ERROR_INVALID_PARAM If p_uuid_type points to a non-valid UUID type."]
13866#[doc = " @retval ::NRF_ERROR_FORBIDDEN If the Vendor Specific base UUID is in use by the ATT Server."]
13867#[inline(always)]
13868pub unsafe fn sd_ble_uuid_vs_remove(p_uuid_type: *mut u8) -> u32 {
13869 let ret: u32;
13870 core::arch::asm!("svc 106",
13871 inout("r0") to_asm(p_uuid_type) => ret,
13872 lateout("r1") _,
13873 lateout("r2") _,
13874 lateout("r3") _,
13875 lateout("r12") _,
13876 );
13877 ret
13878}
13879
13880#[doc = " @brief Decode little endian raw UUID bytes (16-bit or 128-bit) into a 24 bit @ref ble_uuid_t structure."]
13881#[doc = ""]
13882#[doc = " @details The raw UUID bytes excluding bytes 12 and 13 (i.e. bytes 0-11 and 14-15) of p_uuid_le are compared"]
13883#[doc = " to the corresponding ones in each entry of the table of Vendor Specific base UUIDs populated with @ref sd_ble_uuid_vs_add"]
13884#[doc = " to look for a match. If there is such a match, bytes 12 and 13 are returned as p_uuid->uuid and the index"]
13885#[doc = " relative to @ref BLE_UUID_TYPE_VENDOR_BEGIN as p_uuid->type."]
13886#[doc = ""]
13887#[doc = " @note If the UUID length supplied is 2, then the type set by this call will always be @ref BLE_UUID_TYPE_BLE."]
13888#[doc = ""]
13889#[doc = " @param[in] uuid_le_len Length in bytes of the buffer pointed to by p_uuid_le (must be 2 or 16 bytes)."]
13890#[doc = " @param[in] p_uuid_le Pointer pointing to little endian raw UUID bytes."]
13891#[doc = " @param[out] p_uuid Pointer to a @ref ble_uuid_t structure to be filled in."]
13892#[doc = ""]
13893#[doc = " @retval ::NRF_SUCCESS Successfully decoded into the @ref ble_uuid_t structure."]
13894#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
13895#[doc = " @retval ::NRF_ERROR_INVALID_LENGTH Invalid UUID length."]
13896#[doc = " @retval ::NRF_ERROR_NOT_FOUND For a 128-bit UUID, no match in the populated table of UUIDs."]
13897#[inline(always)]
13898pub unsafe fn sd_ble_uuid_decode(uuid_le_len: u8, p_uuid_le: *const u8, p_uuid: *mut ble_uuid_t) -> u32 {
13899 let ret: u32;
13900 core::arch::asm!("svc 99",
13901 inout("r0") to_asm(uuid_le_len) => ret,
13902 inout("r1") to_asm(p_uuid_le) => _,
13903 inout("r2") to_asm(p_uuid) => _,
13904 lateout("r3") _,
13905 lateout("r12") _,
13906 );
13907 ret
13908}
13909
13910#[doc = " @brief Encode a @ref ble_uuid_t structure into little endian raw UUID bytes (16-bit or 128-bit)."]
13911#[doc = ""]
13912#[doc = " @note The pointer to the destination buffer p_uuid_le may be NULL, in which case only the validity and size of p_uuid is computed."]
13913#[doc = ""]
13914#[doc = " @param[in] p_uuid Pointer to a @ref ble_uuid_t structure that will be encoded into bytes."]
13915#[doc = " @param[out] p_uuid_le_len Pointer to a uint8_t that will be filled with the encoded length (2 or 16 bytes)."]
13916#[doc = " @param[out] p_uuid_le Pointer to a buffer where the little endian raw UUID bytes (2 or 16) will be stored."]
13917#[doc = ""]
13918#[doc = " @retval ::NRF_SUCCESS Successfully encoded into the buffer."]
13919#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
13920#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid UUID type."]
13921#[inline(always)]
13922pub unsafe fn sd_ble_uuid_encode(p_uuid: *const ble_uuid_t, p_uuid_le_len: *mut u8, p_uuid_le: *mut u8) -> u32 {
13923 let ret: u32;
13924 core::arch::asm!("svc 100",
13925 inout("r0") to_asm(p_uuid) => ret,
13926 inout("r1") to_asm(p_uuid_le_len) => _,
13927 inout("r2") to_asm(p_uuid_le) => _,
13928 lateout("r3") _,
13929 lateout("r12") _,
13930 );
13931 ret
13932}
13933
13934#[doc = "@brief Get Version Information."]
13935#[doc = ""]
13936#[doc = " @details This call allows the application to get the BLE stack version information."]
13937#[doc = ""]
13938#[doc = " @param[out] p_version Pointer to a ble_version_t structure to be filled in."]
13939#[doc = ""]
13940#[doc = " @retval ::NRF_SUCCESS Version information stored successfully."]
13941#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
13942#[doc = " @retval ::NRF_ERROR_BUSY The BLE stack is busy (typically doing a locally-initiated disconnection procedure)."]
13943#[inline(always)]
13944pub unsafe fn sd_ble_version_get(p_version: *mut ble_version_t) -> u32 {
13945 let ret: u32;
13946 core::arch::asm!("svc 101",
13947 inout("r0") to_asm(p_version) => ret,
13948 lateout("r1") _,
13949 lateout("r2") _,
13950 lateout("r3") _,
13951 lateout("r12") _,
13952 );
13953 ret
13954}
13955
13956#[doc = "@brief Provide a user memory block."]
13957#[doc = ""]
13958#[doc = " @note This call can only be used as a response to a @ref BLE_EVT_USER_MEM_REQUEST event issued to the application."]
13959#[doc = ""]
13960#[doc = " @param[in] conn_handle Connection handle."]
13961#[doc = " @param[in] p_block Pointer to a user memory block structure or NULL if memory is managed by the application."]
13962#[doc = ""]
13963#[doc = " @mscs"]
13964#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_PEER_CANCEL_MSC}"]
13965#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_AUTH_MSC}"]
13966#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_NOAUTH_MSC}"]
13967#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_BUF_AUTH_MSC}"]
13968#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_BUF_NOAUTH_MSC}"]
13969#[doc = " @mmsc{@ref BLE_GATTS_QUEUED_WRITE_QUEUE_FULL_MSC}"]
13970#[doc = " @endmscs"]
13971#[doc = ""]
13972#[doc = " @retval ::NRF_SUCCESS Successfully queued a response to the peer."]
13973#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
13974#[doc = " @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry."]
13975#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
13976#[doc = " @retval ::NRF_ERROR_INVALID_LENGTH Invalid user memory block length supplied."]
13977#[doc = " @retval ::NRF_ERROR_INVALID_STATE Invalid Connection state or no user memory request pending."]
13978#[inline(always)]
13979pub unsafe fn sd_ble_user_mem_reply(conn_handle: u16, p_block: *const ble_user_mem_block_t) -> u32 {
13980 let ret: u32;
13981 core::arch::asm!("svc 102",
13982 inout("r0") to_asm(conn_handle) => ret,
13983 inout("r1") to_asm(p_block) => _,
13984 lateout("r2") _,
13985 lateout("r3") _,
13986 lateout("r12") _,
13987 );
13988 ret
13989}
13990
13991#[doc = "@brief Set a BLE option."]
13992#[doc = ""]
13993#[doc = " @details This call allows the application to set the value of an option."]
13994#[doc = ""]
13995#[doc = " @param[in] opt_id Option ID, see @ref BLE_COMMON_OPTS and @ref BLE_GAP_OPTS."]
13996#[doc = " @param[in] p_opt Pointer to a ble_opt_t structure containing the option value."]
13997#[doc = ""]
13998#[doc = " @retval ::NRF_SUCCESS Option set successfully."]
13999#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
14000#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
14001#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check parameter limits and constraints."]
14002#[doc = " @retval ::NRF_ERROR_INVALID_STATE Unable to set the parameter at this time."]
14003#[doc = " @retval ::NRF_ERROR_BUSY The BLE stack is busy or the previous procedure has not completed."]
14004#[inline(always)]
14005pub unsafe fn sd_ble_opt_set(opt_id: u32, p_opt: *const ble_opt_t) -> u32 {
14006 let ret: u32;
14007 core::arch::asm!("svc 103",
14008 inout("r0") to_asm(opt_id) => ret,
14009 inout("r1") to_asm(p_opt) => _,
14010 lateout("r2") _,
14011 lateout("r3") _,
14012 lateout("r12") _,
14013 );
14014 ret
14015}
14016
14017#[doc = "@brief Get a BLE option."]
14018#[doc = ""]
14019#[doc = " @details This call allows the application to retrieve the value of an option."]
14020#[doc = ""]
14021#[doc = " @param[in] opt_id Option ID, see @ref BLE_COMMON_OPTS and @ref BLE_GAP_OPTS."]
14022#[doc = " @param[out] p_opt Pointer to a ble_opt_t structure to be filled in."]
14023#[doc = ""]
14024#[doc = " @retval ::NRF_SUCCESS Option retrieved successfully."]
14025#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied."]
14026#[doc = " @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle."]
14027#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check parameter limits and constraints."]
14028#[doc = " @retval ::NRF_ERROR_INVALID_STATE Unable to retrieve the parameter at this time."]
14029#[doc = " @retval ::NRF_ERROR_BUSY The BLE stack is busy or the previous procedure has not completed."]
14030#[doc = " @retval ::NRF_ERROR_NOT_SUPPORTED This option is not supported."]
14031#[doc = ""]
14032#[inline(always)]
14033pub unsafe fn sd_ble_opt_get(opt_id: u32, p_opt: *mut ble_opt_t) -> u32 {
14034 let ret: u32;
14035 core::arch::asm!("svc 104",
14036 inout("r0") to_asm(opt_id) => ret,
14037 inout("r1") to_asm(p_opt) => _,
14038 lateout("r2") _,
14039 lateout("r3") _,
14040 lateout("r12") _,
14041 );
14042 ret
14043}
14044
14045pub const NRF_SOC_SVCS_SD_PPI_CHANNEL_ENABLE_GET: NRF_SOC_SVCS = 32;
14046pub const NRF_SOC_SVCS_SD_PPI_CHANNEL_ENABLE_SET: NRF_SOC_SVCS = 33;
14047pub const NRF_SOC_SVCS_SD_PPI_CHANNEL_ENABLE_CLR: NRF_SOC_SVCS = 34;
14048pub const NRF_SOC_SVCS_SD_PPI_CHANNEL_ASSIGN: NRF_SOC_SVCS = 35;
14049pub const NRF_SOC_SVCS_SD_PPI_GROUP_TASK_ENABLE: NRF_SOC_SVCS = 36;
14050pub const NRF_SOC_SVCS_SD_PPI_GROUP_TASK_DISABLE: NRF_SOC_SVCS = 37;
14051pub const NRF_SOC_SVCS_SD_PPI_GROUP_ASSIGN: NRF_SOC_SVCS = 38;
14052pub const NRF_SOC_SVCS_SD_PPI_GROUP_GET: NRF_SOC_SVCS = 39;
14053pub const NRF_SOC_SVCS_SD_FLASH_PAGE_ERASE: NRF_SOC_SVCS = 40;
14054pub const NRF_SOC_SVCS_SD_FLASH_WRITE: NRF_SOC_SVCS = 41;
14055pub const NRF_SOC_SVCS_SD_PROTECTED_REGISTER_WRITE: NRF_SOC_SVCS = 43;
14056pub const NRF_SOC_SVCS_SD_MUTEX_NEW: NRF_SOC_SVCS = 44;
14057pub const NRF_SOC_SVCS_SD_MUTEX_ACQUIRE: NRF_SOC_SVCS = 45;
14058pub const NRF_SOC_SVCS_SD_MUTEX_RELEASE: NRF_SOC_SVCS = 46;
14059pub const NRF_SOC_SVCS_SD_RAND_APPLICATION_POOL_CAPACITY_GET: NRF_SOC_SVCS = 47;
14060pub const NRF_SOC_SVCS_SD_RAND_APPLICATION_BYTES_AVAILABLE_GET: NRF_SOC_SVCS = 48;
14061pub const NRF_SOC_SVCS_SD_RAND_APPLICATION_VECTOR_GET: NRF_SOC_SVCS = 49;
14062pub const NRF_SOC_SVCS_SD_POWER_MODE_SET: NRF_SOC_SVCS = 50;
14063pub const NRF_SOC_SVCS_SD_POWER_SYSTEM_OFF: NRF_SOC_SVCS = 51;
14064pub const NRF_SOC_SVCS_SD_POWER_RESET_REASON_GET: NRF_SOC_SVCS = 52;
14065pub const NRF_SOC_SVCS_SD_POWER_RESET_REASON_CLR: NRF_SOC_SVCS = 53;
14066pub const NRF_SOC_SVCS_SD_POWER_POF_ENABLE: NRF_SOC_SVCS = 54;
14067pub const NRF_SOC_SVCS_SD_POWER_POF_THRESHOLD_SET: NRF_SOC_SVCS = 55;
14068pub const NRF_SOC_SVCS_SD_POWER_POF_THRESHOLDVDDH_SET: NRF_SOC_SVCS = 56;
14069pub const NRF_SOC_SVCS_SD_POWER_RAM_POWER_SET: NRF_SOC_SVCS = 57;
14070pub const NRF_SOC_SVCS_SD_POWER_RAM_POWER_CLR: NRF_SOC_SVCS = 58;
14071pub const NRF_SOC_SVCS_SD_POWER_RAM_POWER_GET: NRF_SOC_SVCS = 59;
14072pub const NRF_SOC_SVCS_SD_POWER_GPREGRET_SET: NRF_SOC_SVCS = 60;
14073pub const NRF_SOC_SVCS_SD_POWER_GPREGRET_CLR: NRF_SOC_SVCS = 61;
14074pub const NRF_SOC_SVCS_SD_POWER_GPREGRET_GET: NRF_SOC_SVCS = 62;
14075pub const NRF_SOC_SVCS_SD_POWER_DCDC_MODE_SET: NRF_SOC_SVCS = 63;
14076pub const NRF_SOC_SVCS_SD_POWER_DCDC0_MODE_SET: NRF_SOC_SVCS = 64;
14077pub const NRF_SOC_SVCS_SD_APP_EVT_WAIT: NRF_SOC_SVCS = 65;
14078pub const NRF_SOC_SVCS_SD_CLOCK_HFCLK_REQUEST: NRF_SOC_SVCS = 66;
14079pub const NRF_SOC_SVCS_SD_CLOCK_HFCLK_RELEASE: NRF_SOC_SVCS = 67;
14080pub const NRF_SOC_SVCS_SD_CLOCK_HFCLK_IS_RUNNING: NRF_SOC_SVCS = 68;
14081pub const NRF_SOC_SVCS_SD_RADIO_NOTIFICATION_CFG_SET: NRF_SOC_SVCS = 69;
14082pub const NRF_SOC_SVCS_SD_ECB_BLOCK_ENCRYPT: NRF_SOC_SVCS = 70;
14083pub const NRF_SOC_SVCS_SD_ECB_BLOCKS_ENCRYPT: NRF_SOC_SVCS = 71;
14084pub const NRF_SOC_SVCS_SD_RADIO_SESSION_OPEN: NRF_SOC_SVCS = 72;
14085pub const NRF_SOC_SVCS_SD_RADIO_SESSION_CLOSE: NRF_SOC_SVCS = 73;
14086pub const NRF_SOC_SVCS_SD_RADIO_REQUEST: NRF_SOC_SVCS = 74;
14087pub const NRF_SOC_SVCS_SD_EVT_GET: NRF_SOC_SVCS = 75;
14088pub const NRF_SOC_SVCS_SD_TEMP_GET: NRF_SOC_SVCS = 76;
14089pub const NRF_SOC_SVCS_SD_POWER_USBPWRRDY_ENABLE: NRF_SOC_SVCS = 77;
14090pub const NRF_SOC_SVCS_SD_POWER_USBDETECTED_ENABLE: NRF_SOC_SVCS = 78;
14091pub const NRF_SOC_SVCS_SD_POWER_USBREMOVED_ENABLE: NRF_SOC_SVCS = 79;
14092pub const NRF_SOC_SVCS_SD_POWER_USBREGSTATUS_GET: NRF_SOC_SVCS = 80;
14093pub const NRF_SOC_SVCS_SVC_SOC_LAST: NRF_SOC_SVCS = 81;
14094#[doc = "@brief The SVC numbers used by the SVC functions in the SoC library."]
14095pub type NRF_SOC_SVCS = self::c_uint;
14096pub const NRF_MUTEX_VALUES_NRF_MUTEX_FREE: NRF_MUTEX_VALUES = 0;
14097pub const NRF_MUTEX_VALUES_NRF_MUTEX_TAKEN: NRF_MUTEX_VALUES = 1;
14098#[doc = "@brief Possible values of a ::nrf_mutex_t."]
14099pub type NRF_MUTEX_VALUES = self::c_uint;
14100#[doc = "< Constant latency mode. See power management in the reference manual."]
14101pub const NRF_POWER_MODES_NRF_POWER_MODE_CONSTLAT: NRF_POWER_MODES = 0;
14102#[doc = "< Low power mode. See power management in the reference manual."]
14103pub const NRF_POWER_MODES_NRF_POWER_MODE_LOWPWR: NRF_POWER_MODES = 1;
14104#[doc = "@brief Power modes."]
14105pub type NRF_POWER_MODES = self::c_uint;
14106#[doc = "< 1.7 Volts power failure threshold."]
14107pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V17: NRF_POWER_THRESHOLDS = 4;
14108#[doc = "< 1.8 Volts power failure threshold."]
14109pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V18: NRF_POWER_THRESHOLDS = 5;
14110#[doc = "< 1.9 Volts power failure threshold."]
14111pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V19: NRF_POWER_THRESHOLDS = 6;
14112#[doc = "< 2.0 Volts power failure threshold."]
14113pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V20: NRF_POWER_THRESHOLDS = 7;
14114#[doc = "< 2.1 Volts power failure threshold."]
14115pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V21: NRF_POWER_THRESHOLDS = 8;
14116#[doc = "< 2.2 Volts power failure threshold."]
14117pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V22: NRF_POWER_THRESHOLDS = 9;
14118#[doc = "< 2.3 Volts power failure threshold."]
14119pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V23: NRF_POWER_THRESHOLDS = 10;
14120#[doc = "< 2.4 Volts power failure threshold."]
14121pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V24: NRF_POWER_THRESHOLDS = 11;
14122#[doc = "< 2.5 Volts power failure threshold."]
14123pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V25: NRF_POWER_THRESHOLDS = 12;
14124#[doc = "< 2.6 Volts power failure threshold."]
14125pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V26: NRF_POWER_THRESHOLDS = 13;
14126#[doc = "< 2.7 Volts power failure threshold."]
14127pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V27: NRF_POWER_THRESHOLDS = 14;
14128#[doc = "< 2.8 Volts power failure threshold."]
14129pub const NRF_POWER_THRESHOLDS_NRF_POWER_THRESHOLD_V28: NRF_POWER_THRESHOLDS = 15;
14130#[doc = "@brief Power failure thresholds"]
14131pub type NRF_POWER_THRESHOLDS = self::c_uint;
14132#[doc = "< 2.7 Volts power failure threshold."]
14133pub const NRF_POWER_THRESHOLDVDDHS_NRF_POWER_THRESHOLDVDDH_V27: NRF_POWER_THRESHOLDVDDHS = 0;
14134#[doc = "< 2.8 Volts power failure threshold."]
14135pub const NRF_POWER_THRESHOLDVDDHS_NRF_POWER_THRESHOLDVDDH_V28: NRF_POWER_THRESHOLDVDDHS = 1;
14136#[doc = "< 2.9 Volts power failure threshold."]
14137pub const NRF_POWER_THRESHOLDVDDHS_NRF_POWER_THRESHOLDVDDH_V29: NRF_POWER_THRESHOLDVDDHS = 2;
14138#[doc = "< 3.0 Volts power failure threshold."]
14139pub const NRF_POWER_THRESHOLDVDDHS_NRF_POWER_THRESHOLDVDDH_V30: NRF_POWER_THRESHOLDVDDHS = 3;
14140#[doc = "< 3.1 Volts power failure threshold."]
14141pub const NRF_POWER_THRESHOLDVDDHS_NRF_POWER_THRESHOLDVDDH_V31: NRF_POWER_THRESHOLDVDDHS = 4;
14142#[doc = "< 3.2 Volts power failure threshold."]
14143pub const NRF_POWER_THRESHOLDVDDHS_NRF_POWER_THRESHOLDVDDH_V32: NRF_POWER_THRESHOLDVDDHS = 5;
14144#[doc = "< 3.3 Volts power failure threshold."]
14145pub const NRF_POWER_THRESHOLDVDDHS_NRF_POWER_THRESHOLDVDDH_V33: NRF_POWER_THRESHOLDVDDHS = 6;
14146#[doc = "< 3.4 Volts power failure threshold."]
14147pub const NRF_POWER_THRESHOLDVDDHS_NRF_POWER_THRESHOLDVDDH_V34: NRF_POWER_THRESHOLDVDDHS = 7;
14148#[doc = "< 3.5 Volts power failure threshold."]
14149pub const NRF_POWER_THRESHOLDVDDHS_NRF_POWER_THRESHOLDVDDH_V35: NRF_POWER_THRESHOLDVDDHS = 8;
14150#[doc = "< 3.6 Volts power failure threshold."]
14151pub const NRF_POWER_THRESHOLDVDDHS_NRF_POWER_THRESHOLDVDDH_V36: NRF_POWER_THRESHOLDVDDHS = 9;
14152#[doc = "< 3.7 Volts power failure threshold."]
14153pub const NRF_POWER_THRESHOLDVDDHS_NRF_POWER_THRESHOLDVDDH_V37: NRF_POWER_THRESHOLDVDDHS = 10;
14154#[doc = "< 3.8 Volts power failure threshold."]
14155pub const NRF_POWER_THRESHOLDVDDHS_NRF_POWER_THRESHOLDVDDH_V38: NRF_POWER_THRESHOLDVDDHS = 11;
14156#[doc = "< 3.9 Volts power failure threshold."]
14157pub const NRF_POWER_THRESHOLDVDDHS_NRF_POWER_THRESHOLDVDDH_V39: NRF_POWER_THRESHOLDVDDHS = 12;
14158#[doc = "< 4.0 Volts power failure threshold."]
14159pub const NRF_POWER_THRESHOLDVDDHS_NRF_POWER_THRESHOLDVDDH_V40: NRF_POWER_THRESHOLDVDDHS = 13;
14160#[doc = "< 4.1 Volts power failure threshold."]
14161pub const NRF_POWER_THRESHOLDVDDHS_NRF_POWER_THRESHOLDVDDH_V41: NRF_POWER_THRESHOLDVDDHS = 14;
14162#[doc = "< 4.2 Volts power failure threshold."]
14163pub const NRF_POWER_THRESHOLDVDDHS_NRF_POWER_THRESHOLDVDDH_V42: NRF_POWER_THRESHOLDVDDHS = 15;
14164#[doc = "@brief Power failure thresholds for high voltage"]
14165pub type NRF_POWER_THRESHOLDVDDHS = self::c_uint;
14166#[doc = "< The DCDC is disabled."]
14167pub const NRF_POWER_DCDC_MODES_NRF_POWER_DCDC_DISABLE: NRF_POWER_DCDC_MODES = 0;
14168#[doc = "< The DCDC is enabled."]
14169pub const NRF_POWER_DCDC_MODES_NRF_POWER_DCDC_ENABLE: NRF_POWER_DCDC_MODES = 1;
14170#[doc = "@brief DC/DC converter modes."]
14171pub type NRF_POWER_DCDC_MODES = self::c_uint;
14172#[doc = "< The event does not have a notification."]
14173pub const NRF_RADIO_NOTIFICATION_DISTANCES_NRF_RADIO_NOTIFICATION_DISTANCE_NONE: NRF_RADIO_NOTIFICATION_DISTANCES = 0;
14174#[doc = "< The distance from the active notification to start of radio activity."]
14175pub const NRF_RADIO_NOTIFICATION_DISTANCES_NRF_RADIO_NOTIFICATION_DISTANCE_800US: NRF_RADIO_NOTIFICATION_DISTANCES = 1;
14176#[doc = "< The distance from the active notification to start of radio activity."]
14177pub const NRF_RADIO_NOTIFICATION_DISTANCES_NRF_RADIO_NOTIFICATION_DISTANCE_1740US: NRF_RADIO_NOTIFICATION_DISTANCES = 2;
14178#[doc = "< The distance from the active notification to start of radio activity."]
14179pub const NRF_RADIO_NOTIFICATION_DISTANCES_NRF_RADIO_NOTIFICATION_DISTANCE_2680US: NRF_RADIO_NOTIFICATION_DISTANCES = 3;
14180#[doc = "< The distance from the active notification to start of radio activity."]
14181pub const NRF_RADIO_NOTIFICATION_DISTANCES_NRF_RADIO_NOTIFICATION_DISTANCE_3620US: NRF_RADIO_NOTIFICATION_DISTANCES = 4;
14182#[doc = "< The distance from the active notification to start of radio activity."]
14183pub const NRF_RADIO_NOTIFICATION_DISTANCES_NRF_RADIO_NOTIFICATION_DISTANCE_4560US: NRF_RADIO_NOTIFICATION_DISTANCES = 5;
14184#[doc = "< The distance from the active notification to start of radio activity."]
14185pub const NRF_RADIO_NOTIFICATION_DISTANCES_NRF_RADIO_NOTIFICATION_DISTANCE_5500US: NRF_RADIO_NOTIFICATION_DISTANCES = 6;
14186#[doc = "@brief Radio notification distances."]
14187pub type NRF_RADIO_NOTIFICATION_DISTANCES = self::c_uint;
14188#[doc = "< The event does not have a radio notification signal."]
14189pub const NRF_RADIO_NOTIFICATION_TYPES_NRF_RADIO_NOTIFICATION_TYPE_NONE: NRF_RADIO_NOTIFICATION_TYPES = 0;
14190#[doc = "< Using interrupt for notification when the radio will be enabled."]
14191pub const NRF_RADIO_NOTIFICATION_TYPES_NRF_RADIO_NOTIFICATION_TYPE_INT_ON_ACTIVE: NRF_RADIO_NOTIFICATION_TYPES = 1;
14192#[doc = "< Using interrupt for notification when the radio has been disabled."]
14193pub const NRF_RADIO_NOTIFICATION_TYPES_NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE: NRF_RADIO_NOTIFICATION_TYPES = 2;
14194#[doc = "< Using interrupt for notification both when the radio will be enabled and disabled."]
14195pub const NRF_RADIO_NOTIFICATION_TYPES_NRF_RADIO_NOTIFICATION_TYPE_INT_ON_BOTH: NRF_RADIO_NOTIFICATION_TYPES = 3;
14196#[doc = "@brief Radio notification types."]
14197pub type NRF_RADIO_NOTIFICATION_TYPES = self::c_uint;
14198#[doc = "< This signal indicates the start of the radio timeslot."]
14199pub const NRF_RADIO_CALLBACK_SIGNAL_TYPE_NRF_RADIO_CALLBACK_SIGNAL_TYPE_START: NRF_RADIO_CALLBACK_SIGNAL_TYPE = 0;
14200#[doc = "< This signal indicates the NRF_TIMER0 interrupt."]
14201pub const NRF_RADIO_CALLBACK_SIGNAL_TYPE_NRF_RADIO_CALLBACK_SIGNAL_TYPE_TIMER0: NRF_RADIO_CALLBACK_SIGNAL_TYPE = 1;
14202#[doc = "< This signal indicates the NRF_RADIO interrupt."]
14203pub const NRF_RADIO_CALLBACK_SIGNAL_TYPE_NRF_RADIO_CALLBACK_SIGNAL_TYPE_RADIO: NRF_RADIO_CALLBACK_SIGNAL_TYPE = 2;
14204#[doc = "< This signal indicates extend action failed."]
14205pub const NRF_RADIO_CALLBACK_SIGNAL_TYPE_NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_FAILED: NRF_RADIO_CALLBACK_SIGNAL_TYPE =
14206 3;
14207#[doc = "< This signal indicates extend action succeeded."]
14208pub const NRF_RADIO_CALLBACK_SIGNAL_TYPE_NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_SUCCEEDED:
14209 NRF_RADIO_CALLBACK_SIGNAL_TYPE = 4;
14210#[doc = "@brief The Radio signal callback types."]
14211pub type NRF_RADIO_CALLBACK_SIGNAL_TYPE = self::c_uint;
14212#[doc = "< Return without action."]
14213pub const NRF_RADIO_SIGNAL_CALLBACK_ACTION_NRF_RADIO_SIGNAL_CALLBACK_ACTION_NONE: NRF_RADIO_SIGNAL_CALLBACK_ACTION = 0;
14214#[doc = "< Request an extension of the current"]
14215#[doc = "timeslot. Maximum execution time for this action:"]
14216#[doc = "@ref NRF_RADIO_MAX_EXTENSION_PROCESSING_TIME_US."]
14217#[doc = "This action must be started at least"]
14218#[doc = "@ref NRF_RADIO_MIN_EXTENSION_MARGIN_US before"]
14219#[doc = "the end of the timeslot."]
14220pub const NRF_RADIO_SIGNAL_CALLBACK_ACTION_NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND: NRF_RADIO_SIGNAL_CALLBACK_ACTION =
14221 1;
14222#[doc = "< End the current radio timeslot."]
14223pub const NRF_RADIO_SIGNAL_CALLBACK_ACTION_NRF_RADIO_SIGNAL_CALLBACK_ACTION_END: NRF_RADIO_SIGNAL_CALLBACK_ACTION = 2;
14224#[doc = "< Request a new radio timeslot and end the current timeslot."]
14225pub const NRF_RADIO_SIGNAL_CALLBACK_ACTION_NRF_RADIO_SIGNAL_CALLBACK_ACTION_REQUEST_AND_END:
14226 NRF_RADIO_SIGNAL_CALLBACK_ACTION = 3;
14227#[doc = "@brief The actions requested by the signal callback."]
14228#[doc = ""]
14229#[doc = " This code gives the SOC instructions about what action to take when the signal callback has"]
14230#[doc = " returned."]
14231pub type NRF_RADIO_SIGNAL_CALLBACK_ACTION = self::c_uint;
14232#[doc = "< The SoftDevice will guarantee that the high frequency clock source is the"]
14233#[doc = "external crystal for the whole duration of the timeslot. This should be the"]
14234#[doc = "preferred option for events that use the radio or require high timing accuracy."]
14235#[doc = "@note The SoftDevice will automatically turn on and off the external crystal,"]
14236#[doc = "at the beginning and end of the timeslot, respectively. The crystal may also"]
14237#[doc = "intentionally be left running after the timeslot, in cases where it is needed"]
14238#[doc = "by the SoftDevice shortly after the end of the timeslot."]
14239pub const NRF_RADIO_HFCLK_CFG_NRF_RADIO_HFCLK_CFG_XTAL_GUARANTEED: NRF_RADIO_HFCLK_CFG = 0;
14240#[doc = "< This configuration allows for earlier and tighter scheduling of timeslots."]
14241#[doc = "The RC oscillator may be the clock source in part or for the whole duration of the timeslot."]
14242#[doc = "The RC oscillator's accuracy must therefore be taken into consideration."]
14243#[doc = "@note If the application will use the radio peripheral in timeslots with this configuration,"]
14244#[doc = "it must make sure that the crystal is running and stable before starting the radio."]
14245pub const NRF_RADIO_HFCLK_CFG_NRF_RADIO_HFCLK_CFG_NO_GUARANTEE: NRF_RADIO_HFCLK_CFG = 1;
14246#[doc = "@brief Radio timeslot high frequency clock source configuration."]
14247pub type NRF_RADIO_HFCLK_CFG = self::c_uint;
14248#[doc = "< High (equal priority as the normal connection priority of the SoftDevice stack(s))."]
14249pub const NRF_RADIO_PRIORITY_NRF_RADIO_PRIORITY_HIGH: NRF_RADIO_PRIORITY = 0;
14250#[doc = "< Normal (equal priority as the priority of secondary activities of the SoftDevice stack(s))."]
14251pub const NRF_RADIO_PRIORITY_NRF_RADIO_PRIORITY_NORMAL: NRF_RADIO_PRIORITY = 1;
14252#[doc = "@brief Radio timeslot priorities."]
14253pub type NRF_RADIO_PRIORITY = self::c_uint;
14254#[doc = "< Request radio timeslot as early as possible. This should always be used for the first request in a session."]
14255pub const NRF_RADIO_REQUEST_TYPE_NRF_RADIO_REQ_TYPE_EARLIEST: NRF_RADIO_REQUEST_TYPE = 0;
14256#[doc = "< Normal radio timeslot request."]
14257pub const NRF_RADIO_REQUEST_TYPE_NRF_RADIO_REQ_TYPE_NORMAL: NRF_RADIO_REQUEST_TYPE = 1;
14258#[doc = "@brief Radio timeslot request type."]
14259pub type NRF_RADIO_REQUEST_TYPE = self::c_uint;
14260#[doc = "< Event indicating that the HFCLK has started."]
14261pub const NRF_SOC_EVTS_NRF_EVT_HFCLKSTARTED: NRF_SOC_EVTS = 0;
14262#[doc = "< Event indicating that a power failure warning has occurred."]
14263pub const NRF_SOC_EVTS_NRF_EVT_POWER_FAILURE_WARNING: NRF_SOC_EVTS = 1;
14264#[doc = "< Event indicating that the ongoing flash operation has completed successfully."]
14265pub const NRF_SOC_EVTS_NRF_EVT_FLASH_OPERATION_SUCCESS: NRF_SOC_EVTS = 2;
14266#[doc = "< Event indicating that the ongoing flash operation has timed out with an error."]
14267pub const NRF_SOC_EVTS_NRF_EVT_FLASH_OPERATION_ERROR: NRF_SOC_EVTS = 3;
14268#[doc = "< Event indicating that a radio timeslot was blocked."]
14269pub const NRF_SOC_EVTS_NRF_EVT_RADIO_BLOCKED: NRF_SOC_EVTS = 4;
14270#[doc = "< Event indicating that a radio timeslot was canceled by SoftDevice."]
14271pub const NRF_SOC_EVTS_NRF_EVT_RADIO_CANCELED: NRF_SOC_EVTS = 5;
14272#[doc = "< Event indicating that a radio timeslot signal callback handler return was invalid."]
14273pub const NRF_SOC_EVTS_NRF_EVT_RADIO_SIGNAL_CALLBACK_INVALID_RETURN: NRF_SOC_EVTS = 6;
14274#[doc = "< Event indicating that a radio timeslot session is idle."]
14275pub const NRF_SOC_EVTS_NRF_EVT_RADIO_SESSION_IDLE: NRF_SOC_EVTS = 7;
14276#[doc = "< Event indicating that a radio timeslot session is closed."]
14277pub const NRF_SOC_EVTS_NRF_EVT_RADIO_SESSION_CLOSED: NRF_SOC_EVTS = 8;
14278#[doc = "< Event indicating that a USB 3.3 V supply is ready."]
14279pub const NRF_SOC_EVTS_NRF_EVT_POWER_USB_POWER_READY: NRF_SOC_EVTS = 9;
14280#[doc = "< Event indicating that voltage supply is detected on VBUS."]
14281pub const NRF_SOC_EVTS_NRF_EVT_POWER_USB_DETECTED: NRF_SOC_EVTS = 10;
14282#[doc = "< Event indicating that voltage supply is removed from VBUS."]
14283pub const NRF_SOC_EVTS_NRF_EVT_POWER_USB_REMOVED: NRF_SOC_EVTS = 11;
14284pub const NRF_SOC_EVTS_NRF_EVT_NUMBER_OF_EVTS: NRF_SOC_EVTS = 12;
14285#[doc = "@brief SoC Events."]
14286pub type NRF_SOC_EVTS = self::c_uint;
14287#[doc = "@brief Represents a mutex for use with the nrf_mutex functions."]
14288#[doc = " @note Accessing the value directly is not safe, use the mutex functions!"]
14289pub type nrf_mutex_t = u8;
14290#[doc = "@brief Parameters for a request for a timeslot as early as possible."]
14291#[repr(C)]
14292#[derive(Debug, Copy, Clone)]
14293pub struct nrf_radio_request_earliest_t {
14294 #[doc = "< High frequency clock source, see @ref NRF_RADIO_HFCLK_CFG."]
14295 pub hfclk: u8,
14296 #[doc = "< The radio timeslot priority, see @ref NRF_RADIO_PRIORITY."]
14297 pub priority: u8,
14298 #[doc = "< The radio timeslot length (in the range 100 to 100,000] microseconds)."]
14299 pub length_us: u32,
14300 #[doc = "< Longest acceptable delay until the start of the requested timeslot (up to @ref NRF_RADIO_EARLIEST_TIMEOUT_MAX_US microseconds)."]
14301 pub timeout_us: u32,
14302}
14303#[test]
14304fn bindgen_test_layout_nrf_radio_request_earliest_t() {
14305 assert_eq!(
14306 ::core::mem::size_of::<nrf_radio_request_earliest_t>(),
14307 12usize,
14308 concat!("Size of: ", stringify!(nrf_radio_request_earliest_t))
14309 );
14310 assert_eq!(
14311 ::core::mem::align_of::<nrf_radio_request_earliest_t>(),
14312 4usize,
14313 concat!("Alignment of ", stringify!(nrf_radio_request_earliest_t))
14314 );
14315 assert_eq!(
14316 unsafe { &(*(::core::ptr::null::<nrf_radio_request_earliest_t>())).hfclk as *const _ as usize },
14317 0usize,
14318 concat!(
14319 "Offset of field: ",
14320 stringify!(nrf_radio_request_earliest_t),
14321 "::",
14322 stringify!(hfclk)
14323 )
14324 );
14325 assert_eq!(
14326 unsafe { &(*(::core::ptr::null::<nrf_radio_request_earliest_t>())).priority as *const _ as usize },
14327 1usize,
14328 concat!(
14329 "Offset of field: ",
14330 stringify!(nrf_radio_request_earliest_t),
14331 "::",
14332 stringify!(priority)
14333 )
14334 );
14335 assert_eq!(
14336 unsafe { &(*(::core::ptr::null::<nrf_radio_request_earliest_t>())).length_us as *const _ as usize },
14337 4usize,
14338 concat!(
14339 "Offset of field: ",
14340 stringify!(nrf_radio_request_earliest_t),
14341 "::",
14342 stringify!(length_us)
14343 )
14344 );
14345 assert_eq!(
14346 unsafe { &(*(::core::ptr::null::<nrf_radio_request_earliest_t>())).timeout_us as *const _ as usize },
14347 8usize,
14348 concat!(
14349 "Offset of field: ",
14350 stringify!(nrf_radio_request_earliest_t),
14351 "::",
14352 stringify!(timeout_us)
14353 )
14354 );
14355}
14356#[doc = "@brief Parameters for a normal radio timeslot request."]
14357#[repr(C)]
14358#[derive(Debug, Copy, Clone)]
14359pub struct nrf_radio_request_normal_t {
14360 #[doc = "< High frequency clock source, see @ref NRF_RADIO_HFCLK_CFG."]
14361 pub hfclk: u8,
14362 #[doc = "< The radio timeslot priority, see @ref NRF_RADIO_PRIORITY."]
14363 pub priority: u8,
14364 #[doc = "< Distance from the start of the previous radio timeslot (up to @ref NRF_RADIO_DISTANCE_MAX_US microseconds)."]
14365 pub distance_us: u32,
14366 #[doc = "< The radio timeslot length (in the range [100..100,000] microseconds)."]
14367 pub length_us: u32,
14368}
14369#[test]
14370fn bindgen_test_layout_nrf_radio_request_normal_t() {
14371 assert_eq!(
14372 ::core::mem::size_of::<nrf_radio_request_normal_t>(),
14373 12usize,
14374 concat!("Size of: ", stringify!(nrf_radio_request_normal_t))
14375 );
14376 assert_eq!(
14377 ::core::mem::align_of::<nrf_radio_request_normal_t>(),
14378 4usize,
14379 concat!("Alignment of ", stringify!(nrf_radio_request_normal_t))
14380 );
14381 assert_eq!(
14382 unsafe { &(*(::core::ptr::null::<nrf_radio_request_normal_t>())).hfclk as *const _ as usize },
14383 0usize,
14384 concat!(
14385 "Offset of field: ",
14386 stringify!(nrf_radio_request_normal_t),
14387 "::",
14388 stringify!(hfclk)
14389 )
14390 );
14391 assert_eq!(
14392 unsafe { &(*(::core::ptr::null::<nrf_radio_request_normal_t>())).priority as *const _ as usize },
14393 1usize,
14394 concat!(
14395 "Offset of field: ",
14396 stringify!(nrf_radio_request_normal_t),
14397 "::",
14398 stringify!(priority)
14399 )
14400 );
14401 assert_eq!(
14402 unsafe { &(*(::core::ptr::null::<nrf_radio_request_normal_t>())).distance_us as *const _ as usize },
14403 4usize,
14404 concat!(
14405 "Offset of field: ",
14406 stringify!(nrf_radio_request_normal_t),
14407 "::",
14408 stringify!(distance_us)
14409 )
14410 );
14411 assert_eq!(
14412 unsafe { &(*(::core::ptr::null::<nrf_radio_request_normal_t>())).length_us as *const _ as usize },
14413 8usize,
14414 concat!(
14415 "Offset of field: ",
14416 stringify!(nrf_radio_request_normal_t),
14417 "::",
14418 stringify!(length_us)
14419 )
14420 );
14421}
14422#[doc = "@brief Radio timeslot request parameters."]
14423#[repr(C)]
14424#[derive(Copy, Clone)]
14425pub struct nrf_radio_request_t {
14426 #[doc = "< Type of request, see @ref NRF_RADIO_REQUEST_TYPE."]
14427 pub request_type: u8,
14428 #[doc = "< Parameter union."]
14429 pub params: nrf_radio_request_t__bindgen_ty_1,
14430}
14431#[repr(C)]
14432#[derive(Copy, Clone)]
14433pub union nrf_radio_request_t__bindgen_ty_1 {
14434 #[doc = "< Parameters for requesting a radio timeslot as early as possible."]
14435 pub earliest: nrf_radio_request_earliest_t,
14436 #[doc = "< Parameters for requesting a normal radio timeslot."]
14437 pub normal: nrf_radio_request_normal_t,
14438 _bindgen_union_align: [u32; 3usize],
14439}
14440#[test]
14441fn bindgen_test_layout_nrf_radio_request_t__bindgen_ty_1() {
14442 assert_eq!(
14443 ::core::mem::size_of::<nrf_radio_request_t__bindgen_ty_1>(),
14444 12usize,
14445 concat!("Size of: ", stringify!(nrf_radio_request_t__bindgen_ty_1))
14446 );
14447 assert_eq!(
14448 ::core::mem::align_of::<nrf_radio_request_t__bindgen_ty_1>(),
14449 4usize,
14450 concat!("Alignment of ", stringify!(nrf_radio_request_t__bindgen_ty_1))
14451 );
14452 assert_eq!(
14453 unsafe { &(*(::core::ptr::null::<nrf_radio_request_t__bindgen_ty_1>())).earliest as *const _ as usize },
14454 0usize,
14455 concat!(
14456 "Offset of field: ",
14457 stringify!(nrf_radio_request_t__bindgen_ty_1),
14458 "::",
14459 stringify!(earliest)
14460 )
14461 );
14462 assert_eq!(
14463 unsafe { &(*(::core::ptr::null::<nrf_radio_request_t__bindgen_ty_1>())).normal as *const _ as usize },
14464 0usize,
14465 concat!(
14466 "Offset of field: ",
14467 stringify!(nrf_radio_request_t__bindgen_ty_1),
14468 "::",
14469 stringify!(normal)
14470 )
14471 );
14472}
14473#[test]
14474fn bindgen_test_layout_nrf_radio_request_t() {
14475 assert_eq!(
14476 ::core::mem::size_of::<nrf_radio_request_t>(),
14477 16usize,
14478 concat!("Size of: ", stringify!(nrf_radio_request_t))
14479 );
14480 assert_eq!(
14481 ::core::mem::align_of::<nrf_radio_request_t>(),
14482 4usize,
14483 concat!("Alignment of ", stringify!(nrf_radio_request_t))
14484 );
14485 assert_eq!(
14486 unsafe { &(*(::core::ptr::null::<nrf_radio_request_t>())).request_type as *const _ as usize },
14487 0usize,
14488 concat!(
14489 "Offset of field: ",
14490 stringify!(nrf_radio_request_t),
14491 "::",
14492 stringify!(request_type)
14493 )
14494 );
14495 assert_eq!(
14496 unsafe { &(*(::core::ptr::null::<nrf_radio_request_t>())).params as *const _ as usize },
14497 4usize,
14498 concat!(
14499 "Offset of field: ",
14500 stringify!(nrf_radio_request_t),
14501 "::",
14502 stringify!(params)
14503 )
14504 );
14505}
14506#[doc = "@brief Return parameters of the radio timeslot signal callback."]
14507#[repr(C)]
14508#[derive(Copy, Clone)]
14509pub struct nrf_radio_signal_callback_return_param_t {
14510 #[doc = "< The action requested by the application when returning from the signal callback, see @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION."]
14511 pub callback_action: u8,
14512 #[doc = "< Parameter union."]
14513 pub params: nrf_radio_signal_callback_return_param_t__bindgen_ty_1,
14514}
14515#[repr(C)]
14516#[derive(Copy, Clone)]
14517pub union nrf_radio_signal_callback_return_param_t__bindgen_ty_1 {
14518 #[doc = "< Additional parameters for return_code @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION_REQUEST_AND_END."]
14519 pub request: nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_1,
14520 #[doc = "< Additional parameters for return_code @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND."]
14521 pub extend: nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_2,
14522 _bindgen_union_align: u32,
14523}
14524#[repr(C)]
14525#[derive(Debug, Copy, Clone)]
14526pub struct nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_1 {
14527 #[doc = "< The request parameters for the next radio timeslot."]
14528 pub p_next: *mut nrf_radio_request_t,
14529}
14530#[test]
14531fn bindgen_test_layout_nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_1() {
14532 assert_eq!(
14533 ::core::mem::size_of::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_1>(),
14534 4usize,
14535 concat!(
14536 "Size of: ",
14537 stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_1)
14538 )
14539 );
14540 assert_eq!(
14541 ::core::mem::align_of::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_1>(),
14542 4usize,
14543 concat!(
14544 "Alignment of ",
14545 stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_1)
14546 )
14547 );
14548 assert_eq!(
14549 unsafe {
14550 &(*(::core::ptr::null::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_1>())).p_next
14551 as *const _ as usize
14552 },
14553 0usize,
14554 concat!(
14555 "Offset of field: ",
14556 stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_1),
14557 "::",
14558 stringify!(p_next)
14559 )
14560 );
14561}
14562#[repr(C)]
14563#[derive(Debug, Copy, Clone)]
14564pub struct nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_2 {
14565 #[doc = "< Requested extension of the radio timeslot duration (microseconds) (for minimum time see @ref NRF_RADIO_MINIMUM_TIMESLOT_LENGTH_EXTENSION_TIME_US)."]
14566 pub length_us: u32,
14567}
14568#[test]
14569fn bindgen_test_layout_nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_2() {
14570 assert_eq!(
14571 ::core::mem::size_of::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_2>(),
14572 4usize,
14573 concat!(
14574 "Size of: ",
14575 stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_2)
14576 )
14577 );
14578 assert_eq!(
14579 ::core::mem::align_of::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_2>(),
14580 4usize,
14581 concat!(
14582 "Alignment of ",
14583 stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_2)
14584 )
14585 );
14586 assert_eq!(
14587 unsafe {
14588 &(*(::core::ptr::null::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_2>())).length_us
14589 as *const _ as usize
14590 },
14591 0usize,
14592 concat!(
14593 "Offset of field: ",
14594 stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1__bindgen_ty_2),
14595 "::",
14596 stringify!(length_us)
14597 )
14598 );
14599}
14600#[test]
14601fn bindgen_test_layout_nrf_radio_signal_callback_return_param_t__bindgen_ty_1() {
14602 assert_eq!(
14603 ::core::mem::size_of::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1>(),
14604 4usize,
14605 concat!(
14606 "Size of: ",
14607 stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1)
14608 )
14609 );
14610 assert_eq!(
14611 ::core::mem::align_of::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1>(),
14612 4usize,
14613 concat!(
14614 "Alignment of ",
14615 stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1)
14616 )
14617 );
14618 assert_eq!(
14619 unsafe {
14620 &(*(::core::ptr::null::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1>())).request as *const _
14621 as usize
14622 },
14623 0usize,
14624 concat!(
14625 "Offset of field: ",
14626 stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1),
14627 "::",
14628 stringify!(request)
14629 )
14630 );
14631 assert_eq!(
14632 unsafe {
14633 &(*(::core::ptr::null::<nrf_radio_signal_callback_return_param_t__bindgen_ty_1>())).extend as *const _
14634 as usize
14635 },
14636 0usize,
14637 concat!(
14638 "Offset of field: ",
14639 stringify!(nrf_radio_signal_callback_return_param_t__bindgen_ty_1),
14640 "::",
14641 stringify!(extend)
14642 )
14643 );
14644}
14645#[test]
14646fn bindgen_test_layout_nrf_radio_signal_callback_return_param_t() {
14647 assert_eq!(
14648 ::core::mem::size_of::<nrf_radio_signal_callback_return_param_t>(),
14649 8usize,
14650 concat!("Size of: ", stringify!(nrf_radio_signal_callback_return_param_t))
14651 );
14652 assert_eq!(
14653 ::core::mem::align_of::<nrf_radio_signal_callback_return_param_t>(),
14654 4usize,
14655 concat!("Alignment of ", stringify!(nrf_radio_signal_callback_return_param_t))
14656 );
14657 assert_eq!(
14658 unsafe {
14659 &(*(::core::ptr::null::<nrf_radio_signal_callback_return_param_t>())).callback_action as *const _ as usize
14660 },
14661 0usize,
14662 concat!(
14663 "Offset of field: ",
14664 stringify!(nrf_radio_signal_callback_return_param_t),
14665 "::",
14666 stringify!(callback_action)
14667 )
14668 );
14669 assert_eq!(
14670 unsafe { &(*(::core::ptr::null::<nrf_radio_signal_callback_return_param_t>())).params as *const _ as usize },
14671 4usize,
14672 concat!(
14673 "Offset of field: ",
14674 stringify!(nrf_radio_signal_callback_return_param_t),
14675 "::",
14676 stringify!(params)
14677 )
14678 );
14679}
14680#[doc = "@brief The radio timeslot signal callback type."]
14681#[doc = ""]
14682#[doc = " @note In case of invalid return parameters, the radio timeslot will automatically end"]
14683#[doc = " immediately after returning from the signal callback and the"]
14684#[doc = " @ref NRF_EVT_RADIO_SIGNAL_CALLBACK_INVALID_RETURN event will be sent."]
14685#[doc = " @note The returned struct pointer must remain valid after the signal callback"]
14686#[doc = " function returns. For instance, this means that it must not point to a stack variable."]
14687#[doc = ""]
14688#[doc = " @param[in] signal_type Type of signal, see @ref NRF_RADIO_CALLBACK_SIGNAL_TYPE."]
14689#[doc = ""]
14690#[doc = " @return Pointer to structure containing action requested by the application."]
14691pub type nrf_radio_signal_callback_t =
14692 ::core::option::Option<unsafe extern "C" fn(signal_type: u8) -> *mut nrf_radio_signal_callback_return_param_t>;
14693#[doc = "@brief AES ECB parameter typedefs"]
14694pub type soc_ecb_key_t = [u8; 16usize];
14695pub type soc_ecb_cleartext_t = [u8; 16usize];
14696pub type soc_ecb_ciphertext_t = [u8; 16usize];
14697#[doc = "@brief AES ECB data structure"]
14698#[repr(C)]
14699#[derive(Debug, Copy, Clone)]
14700pub struct nrf_ecb_hal_data_t {
14701 #[doc = "< Encryption key."]
14702 pub key: soc_ecb_key_t,
14703 #[doc = "< Cleartext data."]
14704 pub cleartext: soc_ecb_cleartext_t,
14705 #[doc = "< Ciphertext data."]
14706 pub ciphertext: soc_ecb_ciphertext_t,
14707}
14708#[test]
14709fn bindgen_test_layout_nrf_ecb_hal_data_t() {
14710 assert_eq!(
14711 ::core::mem::size_of::<nrf_ecb_hal_data_t>(),
14712 48usize,
14713 concat!("Size of: ", stringify!(nrf_ecb_hal_data_t))
14714 );
14715 assert_eq!(
14716 ::core::mem::align_of::<nrf_ecb_hal_data_t>(),
14717 1usize,
14718 concat!("Alignment of ", stringify!(nrf_ecb_hal_data_t))
14719 );
14720 assert_eq!(
14721 unsafe { &(*(::core::ptr::null::<nrf_ecb_hal_data_t>())).key as *const _ as usize },
14722 0usize,
14723 concat!(
14724 "Offset of field: ",
14725 stringify!(nrf_ecb_hal_data_t),
14726 "::",
14727 stringify!(key)
14728 )
14729 );
14730 assert_eq!(
14731 unsafe { &(*(::core::ptr::null::<nrf_ecb_hal_data_t>())).cleartext as *const _ as usize },
14732 16usize,
14733 concat!(
14734 "Offset of field: ",
14735 stringify!(nrf_ecb_hal_data_t),
14736 "::",
14737 stringify!(cleartext)
14738 )
14739 );
14740 assert_eq!(
14741 unsafe { &(*(::core::ptr::null::<nrf_ecb_hal_data_t>())).ciphertext as *const _ as usize },
14742 32usize,
14743 concat!(
14744 "Offset of field: ",
14745 stringify!(nrf_ecb_hal_data_t),
14746 "::",
14747 stringify!(ciphertext)
14748 )
14749 );
14750}
14751#[doc = "@brief AES ECB block. Used to provide multiple blocks in a single call"]
14752#[doc = "to @ref sd_ecb_blocks_encrypt."]
14753#[repr(C)]
14754#[derive(Debug, Copy, Clone)]
14755pub struct nrf_ecb_hal_data_block_t {
14756 #[doc = "< Pointer to the Encryption key."]
14757 pub p_key: *const soc_ecb_key_t,
14758 #[doc = "< Pointer to the Cleartext data."]
14759 pub p_cleartext: *const soc_ecb_cleartext_t,
14760 #[doc = "< Pointer to the Ciphertext data."]
14761 pub p_ciphertext: *mut soc_ecb_ciphertext_t,
14762}
14763#[test]
14764fn bindgen_test_layout_nrf_ecb_hal_data_block_t() {
14765 assert_eq!(
14766 ::core::mem::size_of::<nrf_ecb_hal_data_block_t>(),
14767 12usize,
14768 concat!("Size of: ", stringify!(nrf_ecb_hal_data_block_t))
14769 );
14770 assert_eq!(
14771 ::core::mem::align_of::<nrf_ecb_hal_data_block_t>(),
14772 4usize,
14773 concat!("Alignment of ", stringify!(nrf_ecb_hal_data_block_t))
14774 );
14775 assert_eq!(
14776 unsafe { &(*(::core::ptr::null::<nrf_ecb_hal_data_block_t>())).p_key as *const _ as usize },
14777 0usize,
14778 concat!(
14779 "Offset of field: ",
14780 stringify!(nrf_ecb_hal_data_block_t),
14781 "::",
14782 stringify!(p_key)
14783 )
14784 );
14785 assert_eq!(
14786 unsafe { &(*(::core::ptr::null::<nrf_ecb_hal_data_block_t>())).p_cleartext as *const _ as usize },
14787 4usize,
14788 concat!(
14789 "Offset of field: ",
14790 stringify!(nrf_ecb_hal_data_block_t),
14791 "::",
14792 stringify!(p_cleartext)
14793 )
14794 );
14795 assert_eq!(
14796 unsafe { &(*(::core::ptr::null::<nrf_ecb_hal_data_block_t>())).p_ciphertext as *const _ as usize },
14797 8usize,
14798 concat!(
14799 "Offset of field: ",
14800 stringify!(nrf_ecb_hal_data_block_t),
14801 "::",
14802 stringify!(p_ciphertext)
14803 )
14804 );
14805}
14806
14807#[doc = "@brief Initialize a mutex."]
14808#[doc = ""]
14809#[doc = " @param[in] p_mutex Pointer to the mutex to initialize."]
14810#[doc = ""]
14811#[doc = " @retval ::NRF_SUCCESS"]
14812#[inline(always)]
14813pub unsafe fn sd_mutex_new(p_mutex: *mut nrf_mutex_t) -> u32 {
14814 let ret: u32;
14815 core::arch::asm!("svc 44",
14816 inout("r0") to_asm(p_mutex) => ret,
14817 lateout("r1") _,
14818 lateout("r2") _,
14819 lateout("r3") _,
14820 lateout("r12") _,
14821 );
14822 ret
14823}
14824
14825#[doc = "@brief Attempt to acquire a mutex."]
14826#[doc = ""]
14827#[doc = " @param[in] p_mutex Pointer to the mutex to acquire."]
14828#[doc = ""]
14829#[doc = " @retval ::NRF_SUCCESS The mutex was successfully acquired."]
14830#[doc = " @retval ::NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN The mutex could not be acquired."]
14831#[inline(always)]
14832pub unsafe fn sd_mutex_acquire(p_mutex: *mut nrf_mutex_t) -> u32 {
14833 let ret: u32;
14834 core::arch::asm!("svc 45",
14835 inout("r0") to_asm(p_mutex) => ret,
14836 lateout("r1") _,
14837 lateout("r2") _,
14838 lateout("r3") _,
14839 lateout("r12") _,
14840 );
14841 ret
14842}
14843
14844#[doc = "@brief Release a mutex."]
14845#[doc = ""]
14846#[doc = " @param[in] p_mutex Pointer to the mutex to release."]
14847#[doc = ""]
14848#[doc = " @retval ::NRF_SUCCESS"]
14849#[inline(always)]
14850pub unsafe fn sd_mutex_release(p_mutex: *mut nrf_mutex_t) -> u32 {
14851 let ret: u32;
14852 core::arch::asm!("svc 46",
14853 inout("r0") to_asm(p_mutex) => ret,
14854 lateout("r1") _,
14855 lateout("r2") _,
14856 lateout("r3") _,
14857 lateout("r12") _,
14858 );
14859 ret
14860}
14861
14862#[doc = "@brief Query the capacity of the application random pool."]
14863#[doc = ""]
14864#[doc = " @param[out] p_pool_capacity The capacity of the pool."]
14865#[doc = ""]
14866#[doc = " @retval ::NRF_SUCCESS"]
14867#[inline(always)]
14868pub unsafe fn sd_rand_application_pool_capacity_get(p_pool_capacity: *mut u8) -> u32 {
14869 let ret: u32;
14870 core::arch::asm!("svc 47",
14871 inout("r0") to_asm(p_pool_capacity) => ret,
14872 lateout("r1") _,
14873 lateout("r2") _,
14874 lateout("r3") _,
14875 lateout("r12") _,
14876 );
14877 ret
14878}
14879
14880#[doc = "@brief Get number of random bytes available to the application."]
14881#[doc = ""]
14882#[doc = " @param[out] p_bytes_available The number of bytes currently available in the pool."]
14883#[doc = ""]
14884#[doc = " @retval ::NRF_SUCCESS"]
14885#[inline(always)]
14886pub unsafe fn sd_rand_application_bytes_available_get(p_bytes_available: *mut u8) -> u32 {
14887 let ret: u32;
14888 core::arch::asm!("svc 48",
14889 inout("r0") to_asm(p_bytes_available) => ret,
14890 lateout("r1") _,
14891 lateout("r2") _,
14892 lateout("r3") _,
14893 lateout("r12") _,
14894 );
14895 ret
14896}
14897
14898#[doc = "@brief Get random bytes from the application pool."]
14899#[doc = ""]
14900#[doc = " @param[out] p_buff Pointer to unit8_t buffer for storing the bytes."]
14901#[doc = " @param[in] length Number of bytes to take from pool and place in p_buff."]
14902#[doc = ""]
14903#[doc = " @retval ::NRF_SUCCESS The requested bytes were written to p_buff."]
14904#[doc = " @retval ::NRF_ERROR_SOC_RAND_NOT_ENOUGH_VALUES No bytes were written to the buffer, because there were not enough bytes available."]
14905#[inline(always)]
14906pub unsafe fn sd_rand_application_vector_get(p_buff: *mut u8, length: u8) -> u32 {
14907 let ret: u32;
14908 core::arch::asm!("svc 49",
14909 inout("r0") to_asm(p_buff) => ret,
14910 inout("r1") to_asm(length) => _,
14911 lateout("r2") _,
14912 lateout("r3") _,
14913 lateout("r12") _,
14914 );
14915 ret
14916}
14917
14918#[doc = "@brief Gets the reset reason register."]
14919#[doc = ""]
14920#[doc = " @param[out] p_reset_reason Contents of the NRF_POWER->RESETREAS register."]
14921#[doc = ""]
14922#[doc = " @retval ::NRF_SUCCESS"]
14923#[inline(always)]
14924pub unsafe fn sd_power_reset_reason_get(p_reset_reason: *mut u32) -> u32 {
14925 let ret: u32;
14926 core::arch::asm!("svc 52",
14927 inout("r0") to_asm(p_reset_reason) => ret,
14928 lateout("r1") _,
14929 lateout("r2") _,
14930 lateout("r3") _,
14931 lateout("r12") _,
14932 );
14933 ret
14934}
14935
14936#[doc = "@brief Clears the bits of the reset reason register."]
14937#[doc = ""]
14938#[doc = " @param[in] reset_reason_clr_msk Contains the bits to clear from the reset reason register."]
14939#[doc = ""]
14940#[doc = " @retval ::NRF_SUCCESS"]
14941#[inline(always)]
14942pub unsafe fn sd_power_reset_reason_clr(reset_reason_clr_msk: u32) -> u32 {
14943 let ret: u32;
14944 core::arch::asm!("svc 53",
14945 inout("r0") to_asm(reset_reason_clr_msk) => ret,
14946 lateout("r1") _,
14947 lateout("r2") _,
14948 lateout("r3") _,
14949 lateout("r12") _,
14950 );
14951 ret
14952}
14953
14954#[doc = "@brief Sets the power mode when in CPU sleep."]
14955#[doc = ""]
14956#[doc = " @param[in] power_mode The power mode to use when in CPU sleep, see @ref NRF_POWER_MODES. @sa sd_app_evt_wait"]
14957#[doc = ""]
14958#[doc = " @retval ::NRF_SUCCESS The power mode was set."]
14959#[doc = " @retval ::NRF_ERROR_SOC_POWER_MODE_UNKNOWN The power mode was unknown."]
14960#[inline(always)]
14961pub unsafe fn sd_power_mode_set(power_mode: u8) -> u32 {
14962 let ret: u32;
14963 core::arch::asm!("svc 50",
14964 inout("r0") to_asm(power_mode) => ret,
14965 lateout("r1") _,
14966 lateout("r2") _,
14967 lateout("r3") _,
14968 lateout("r12") _,
14969 );
14970 ret
14971}
14972
14973#[doc = "@brief Puts the chip in System OFF mode."]
14974#[doc = ""]
14975#[doc = " @retval ::NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN"]
14976#[inline(always)]
14977pub unsafe fn sd_power_system_off() -> u32 {
14978 let ret: u32;
14979 core::arch::asm!("svc 51",
14980 lateout("r0") ret,
14981 lateout("r1") _,
14982 lateout("r2") _,
14983 lateout("r3") _,
14984 lateout("r12") _,
14985 );
14986 ret
14987}
14988
14989#[doc = "@brief Enables or disables the power-fail comparator."]
14990#[doc = ""]
14991#[doc = " Enabling this will give a SoftDevice event (NRF_EVT_POWER_FAILURE_WARNING) when the power failure warning occurs."]
14992#[doc = " The event can be retrieved with sd_evt_get();"]
14993#[doc = ""]
14994#[doc = " @param[in] pof_enable True if the power-fail comparator should be enabled, false if it should be disabled."]
14995#[doc = ""]
14996#[doc = " @retval ::NRF_SUCCESS"]
14997#[inline(always)]
14998pub unsafe fn sd_power_pof_enable(pof_enable: u8) -> u32 {
14999 let ret: u32;
15000 core::arch::asm!("svc 54",
15001 inout("r0") to_asm(pof_enable) => ret,
15002 lateout("r1") _,
15003 lateout("r2") _,
15004 lateout("r3") _,
15005 lateout("r12") _,
15006 );
15007 ret
15008}
15009
15010#[doc = "@brief Enables or disables the USB power ready event."]
15011#[doc = ""]
15012#[doc = " Enabling this will give a SoftDevice event (NRF_EVT_POWER_USB_POWER_READY) when a USB 3.3 V supply is ready."]
15013#[doc = " The event can be retrieved with sd_evt_get();"]
15014#[doc = ""]
15015#[doc = " @param[in] usbpwrrdy_enable True if the power ready event should be enabled, false if it should be disabled."]
15016#[doc = ""]
15017#[doc = " @note Calling this function on a chip without USBD peripheral will result in undefined behaviour."]
15018#[doc = ""]
15019#[doc = " @retval ::NRF_SUCCESS"]
15020#[inline(always)]
15021pub unsafe fn sd_power_usbpwrrdy_enable(usbpwrrdy_enable: u8) -> u32 {
15022 let ret: u32;
15023 core::arch::asm!("svc 77",
15024 inout("r0") to_asm(usbpwrrdy_enable) => ret,
15025 lateout("r1") _,
15026 lateout("r2") _,
15027 lateout("r3") _,
15028 lateout("r12") _,
15029 );
15030 ret
15031}
15032
15033#[doc = "@brief Enables or disables the power USB-detected event."]
15034#[doc = ""]
15035#[doc = " Enabling this will give a SoftDevice event (NRF_EVT_POWER_USB_DETECTED) when a voltage supply is detected on VBUS."]
15036#[doc = " The event can be retrieved with sd_evt_get();"]
15037#[doc = ""]
15038#[doc = " @param[in] usbdetected_enable True if the power ready event should be enabled, false if it should be disabled."]
15039#[doc = ""]
15040#[doc = " @note Calling this function on a chip without USBD peripheral will result in undefined behaviour."]
15041#[doc = ""]
15042#[doc = " @retval ::NRF_SUCCESS"]
15043#[inline(always)]
15044pub unsafe fn sd_power_usbdetected_enable(usbdetected_enable: u8) -> u32 {
15045 let ret: u32;
15046 core::arch::asm!("svc 78",
15047 inout("r0") to_asm(usbdetected_enable) => ret,
15048 lateout("r1") _,
15049 lateout("r2") _,
15050 lateout("r3") _,
15051 lateout("r12") _,
15052 );
15053 ret
15054}
15055
15056#[doc = "@brief Enables or disables the power USB-removed event."]
15057#[doc = ""]
15058#[doc = " Enabling this will give a SoftDevice event (NRF_EVT_POWER_USB_REMOVED) when a voltage supply is removed from VBUS."]
15059#[doc = " The event can be retrieved with sd_evt_get();"]
15060#[doc = ""]
15061#[doc = " @param[in] usbremoved_enable True if the power ready event should be enabled, false if it should be disabled."]
15062#[doc = ""]
15063#[doc = " @note Calling this function on a chip without USBD peripheral will result in undefined behaviour."]
15064#[doc = ""]
15065#[doc = " @retval ::NRF_SUCCESS"]
15066#[inline(always)]
15067pub unsafe fn sd_power_usbremoved_enable(usbremoved_enable: u8) -> u32 {
15068 let ret: u32;
15069 core::arch::asm!("svc 79",
15070 inout("r0") to_asm(usbremoved_enable) => ret,
15071 lateout("r1") _,
15072 lateout("r2") _,
15073 lateout("r3") _,
15074 lateout("r12") _,
15075 );
15076 ret
15077}
15078
15079#[doc = "@brief Get USB supply status register content."]
15080#[doc = ""]
15081#[doc = " @param[out] usbregstatus The content of USBREGSTATUS register."]
15082#[doc = ""]
15083#[doc = " @note Calling this function on a chip without USBD peripheral will result in undefined behaviour."]
15084#[doc = ""]
15085#[doc = " @retval ::NRF_SUCCESS"]
15086#[inline(always)]
15087pub unsafe fn sd_power_usbregstatus_get(usbregstatus: *mut u32) -> u32 {
15088 let ret: u32;
15089 core::arch::asm!("svc 80",
15090 inout("r0") to_asm(usbregstatus) => ret,
15091 lateout("r1") _,
15092 lateout("r2") _,
15093 lateout("r3") _,
15094 lateout("r12") _,
15095 );
15096 ret
15097}
15098
15099#[doc = "@brief Sets the power failure comparator threshold value."]
15100#[doc = ""]
15101#[doc = " @note: Power failure comparator threshold setting. This setting applies both for normal voltage"]
15102#[doc = " mode (supply connected to both VDD and VDDH) and high voltage mode (supply connected to"]
15103#[doc = " VDDH only)."]
15104#[doc = ""]
15105#[doc = " @param[in] threshold The power-fail threshold value to use, see @ref NRF_POWER_THRESHOLDS."]
15106#[doc = ""]
15107#[doc = " @retval ::NRF_SUCCESS The power failure threshold was set."]
15108#[doc = " @retval ::NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN The power failure threshold is unknown."]
15109#[inline(always)]
15110pub unsafe fn sd_power_pof_threshold_set(threshold: u8) -> u32 {
15111 let ret: u32;
15112 core::arch::asm!("svc 55",
15113 inout("r0") to_asm(threshold) => ret,
15114 lateout("r1") _,
15115 lateout("r2") _,
15116 lateout("r3") _,
15117 lateout("r12") _,
15118 );
15119 ret
15120}
15121
15122#[doc = "@brief Sets the power failure comparator threshold value for high voltage."]
15123#[doc = ""]
15124#[doc = " @note: Power failure comparator threshold setting for high voltage mode (supply connected to"]
15125#[doc = " VDDH only). This setting does not apply for normal voltage mode (supply connected to both"]
15126#[doc = " VDD and VDDH)."]
15127#[doc = ""]
15128#[doc = " @param[in] threshold The power-fail threshold value to use, see @ref NRF_POWER_THRESHOLDVDDHS."]
15129#[doc = ""]
15130#[doc = " @retval ::NRF_SUCCESS The power failure threshold was set."]
15131#[doc = " @retval ::NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN The power failure threshold is unknown."]
15132#[inline(always)]
15133pub unsafe fn sd_power_pof_thresholdvddh_set(threshold: u8) -> u32 {
15134 let ret: u32;
15135 core::arch::asm!("svc 56",
15136 inout("r0") to_asm(threshold) => ret,
15137 lateout("r1") _,
15138 lateout("r2") _,
15139 lateout("r3") _,
15140 lateout("r12") _,
15141 );
15142 ret
15143}
15144
15145#[doc = "@brief Writes the NRF_POWER->RAM[index].POWERSET register."]
15146#[doc = ""]
15147#[doc = " @param[in] index Contains the index in the NRF_POWER->RAM[index].POWERSET register to write to."]
15148#[doc = " @param[in] ram_powerset Contains the word to write to the NRF_POWER->RAM[index].POWERSET register."]
15149#[doc = ""]
15150#[doc = " @retval ::NRF_SUCCESS"]
15151#[inline(always)]
15152pub unsafe fn sd_power_ram_power_set(index: u8, ram_powerset: u32) -> u32 {
15153 let ret: u32;
15154 core::arch::asm!("svc 57",
15155 inout("r0") to_asm(index) => ret,
15156 inout("r1") to_asm(ram_powerset) => _,
15157 lateout("r2") _,
15158 lateout("r3") _,
15159 lateout("r12") _,
15160 );
15161 ret
15162}
15163
15164#[doc = "@brief Writes the NRF_POWER->RAM[index].POWERCLR register."]
15165#[doc = ""]
15166#[doc = " @param[in] index Contains the index in the NRF_POWER->RAM[index].POWERCLR register to write to."]
15167#[doc = " @param[in] ram_powerclr Contains the word to write to the NRF_POWER->RAM[index].POWERCLR register."]
15168#[doc = ""]
15169#[doc = " @retval ::NRF_SUCCESS"]
15170#[inline(always)]
15171pub unsafe fn sd_power_ram_power_clr(index: u8, ram_powerclr: u32) -> u32 {
15172 let ret: u32;
15173 core::arch::asm!("svc 58",
15174 inout("r0") to_asm(index) => ret,
15175 inout("r1") to_asm(ram_powerclr) => _,
15176 lateout("r2") _,
15177 lateout("r3") _,
15178 lateout("r12") _,
15179 );
15180 ret
15181}
15182
15183#[doc = "@brief Get contents of NRF_POWER->RAM[index].POWER register, indicates power status of RAM[index] blocks."]
15184#[doc = ""]
15185#[doc = " @param[in] index Contains the index in the NRF_POWER->RAM[index].POWER register to read from."]
15186#[doc = " @param[out] p_ram_power Content of NRF_POWER->RAM[index].POWER register."]
15187#[doc = ""]
15188#[doc = " @retval ::NRF_SUCCESS"]
15189#[inline(always)]
15190pub unsafe fn sd_power_ram_power_get(index: u8, p_ram_power: *mut u32) -> u32 {
15191 let ret: u32;
15192 core::arch::asm!("svc 59",
15193 inout("r0") to_asm(index) => ret,
15194 inout("r1") to_asm(p_ram_power) => _,
15195 lateout("r2") _,
15196 lateout("r3") _,
15197 lateout("r12") _,
15198 );
15199 ret
15200}
15201
15202#[doc = "@brief Set bits in the general purpose retention registers (NRF_POWER->GPREGRET*)."]
15203#[doc = ""]
15204#[doc = " @param[in] gpregret_id 0 for GPREGRET, 1 for GPREGRET2."]
15205#[doc = " @param[in] gpregret_msk Bits to be set in the GPREGRET register."]
15206#[doc = ""]
15207#[doc = " @retval ::NRF_SUCCESS"]
15208#[inline(always)]
15209pub unsafe fn sd_power_gpregret_set(gpregret_id: u32, gpregret_msk: u32) -> u32 {
15210 let ret: u32;
15211 core::arch::asm!("svc 60",
15212 inout("r0") to_asm(gpregret_id) => ret,
15213 inout("r1") to_asm(gpregret_msk) => _,
15214 lateout("r2") _,
15215 lateout("r3") _,
15216 lateout("r12") _,
15217 );
15218 ret
15219}
15220
15221#[doc = "@brief Clear bits in the general purpose retention registers (NRF_POWER->GPREGRET*)."]
15222#[doc = ""]
15223#[doc = " @param[in] gpregret_id 0 for GPREGRET, 1 for GPREGRET2."]
15224#[doc = " @param[in] gpregret_msk Bits to be clear in the GPREGRET register."]
15225#[doc = ""]
15226#[doc = " @retval ::NRF_SUCCESS"]
15227#[inline(always)]
15228pub unsafe fn sd_power_gpregret_clr(gpregret_id: u32, gpregret_msk: u32) -> u32 {
15229 let ret: u32;
15230 core::arch::asm!("svc 61",
15231 inout("r0") to_asm(gpregret_id) => ret,
15232 inout("r1") to_asm(gpregret_msk) => _,
15233 lateout("r2") _,
15234 lateout("r3") _,
15235 lateout("r12") _,
15236 );
15237 ret
15238}
15239
15240#[doc = "@brief Get contents of the general purpose retention registers (NRF_POWER->GPREGRET*)."]
15241#[doc = ""]
15242#[doc = " @param[in] gpregret_id 0 for GPREGRET, 1 for GPREGRET2."]
15243#[doc = " @param[out] p_gpregret Contents of the GPREGRET register."]
15244#[doc = ""]
15245#[doc = " @retval ::NRF_SUCCESS"]
15246#[inline(always)]
15247pub unsafe fn sd_power_gpregret_get(gpregret_id: u32, p_gpregret: *mut u32) -> u32 {
15248 let ret: u32;
15249 core::arch::asm!("svc 62",
15250 inout("r0") to_asm(gpregret_id) => ret,
15251 inout("r1") to_asm(p_gpregret) => _,
15252 lateout("r2") _,
15253 lateout("r3") _,
15254 lateout("r12") _,
15255 );
15256 ret
15257}
15258
15259#[doc = "@brief Enable or disable the DC/DC regulator for the regulator stage 1 (REG1)."]
15260#[doc = ""]
15261#[doc = " @param[in] dcdc_mode The mode of the DCDC, see @ref NRF_POWER_DCDC_MODES."]
15262#[doc = ""]
15263#[doc = " @retval ::NRF_SUCCESS"]
15264#[doc = " @retval ::NRF_ERROR_INVALID_PARAM The DCDC mode is invalid."]
15265#[inline(always)]
15266pub unsafe fn sd_power_dcdc_mode_set(dcdc_mode: u8) -> u32 {
15267 let ret: u32;
15268 core::arch::asm!("svc 63",
15269 inout("r0") to_asm(dcdc_mode) => ret,
15270 lateout("r1") _,
15271 lateout("r2") _,
15272 lateout("r3") _,
15273 lateout("r12") _,
15274 );
15275 ret
15276}
15277
15278#[doc = "@brief Enable or disable the DC/DC regulator for the regulator stage 0 (REG0)."]
15279#[doc = ""]
15280#[doc = " For more details on the REG0 stage, please see product specification."]
15281#[doc = ""]
15282#[doc = " @param[in] dcdc_mode The mode of the DCDC0, see @ref NRF_POWER_DCDC_MODES."]
15283#[doc = ""]
15284#[doc = " @retval ::NRF_SUCCESS"]
15285#[doc = " @retval ::NRF_ERROR_INVALID_PARAM The dcdc_mode is invalid."]
15286#[inline(always)]
15287pub unsafe fn sd_power_dcdc0_mode_set(dcdc_mode: u8) -> u32 {
15288 let ret: u32;
15289 core::arch::asm!("svc 64",
15290 inout("r0") to_asm(dcdc_mode) => ret,
15291 lateout("r1") _,
15292 lateout("r2") _,
15293 lateout("r3") _,
15294 lateout("r12") _,
15295 );
15296 ret
15297}
15298
15299#[doc = "@brief Request the high frequency crystal oscillator."]
15300#[doc = ""]
15301#[doc = " Will start the high frequency crystal oscillator, the startup time of the crystal varies"]
15302#[doc = " and the ::sd_clock_hfclk_is_running function can be polled to check if it has started."]
15303#[doc = ""]
15304#[doc = " @see sd_clock_hfclk_is_running"]
15305#[doc = " @see sd_clock_hfclk_release"]
15306#[doc = ""]
15307#[doc = " @retval ::NRF_SUCCESS"]
15308#[inline(always)]
15309pub unsafe fn sd_clock_hfclk_request() -> u32 {
15310 let ret: u32;
15311 core::arch::asm!("svc 66",
15312 lateout("r0") ret,
15313 lateout("r1") _,
15314 lateout("r2") _,
15315 lateout("r3") _,
15316 lateout("r12") _,
15317 );
15318 ret
15319}
15320
15321#[doc = "@brief Releases the high frequency crystal oscillator."]
15322#[doc = ""]
15323#[doc = " Will stop the high frequency crystal oscillator, this happens immediately."]
15324#[doc = ""]
15325#[doc = " @see sd_clock_hfclk_is_running"]
15326#[doc = " @see sd_clock_hfclk_request"]
15327#[doc = ""]
15328#[doc = " @retval ::NRF_SUCCESS"]
15329#[inline(always)]
15330pub unsafe fn sd_clock_hfclk_release() -> u32 {
15331 let ret: u32;
15332 core::arch::asm!("svc 67",
15333 lateout("r0") ret,
15334 lateout("r1") _,
15335 lateout("r2") _,
15336 lateout("r3") _,
15337 lateout("r12") _,
15338 );
15339 ret
15340}
15341
15342#[doc = "@brief Checks if the high frequency crystal oscillator is running."]
15343#[doc = ""]
15344#[doc = " @see sd_clock_hfclk_request"]
15345#[doc = " @see sd_clock_hfclk_release"]
15346#[doc = ""]
15347#[doc = " @param[out] p_is_running 1 if the external crystal oscillator is running, 0 if not."]
15348#[doc = ""]
15349#[doc = " @retval ::NRF_SUCCESS"]
15350#[inline(always)]
15351pub unsafe fn sd_clock_hfclk_is_running(p_is_running: *mut u32) -> u32 {
15352 let ret: u32;
15353 core::arch::asm!("svc 68",
15354 inout("r0") to_asm(p_is_running) => ret,
15355 lateout("r1") _,
15356 lateout("r2") _,
15357 lateout("r3") _,
15358 lateout("r12") _,
15359 );
15360 ret
15361}
15362
15363#[doc = "@brief Waits for an application event."]
15364#[doc = ""]
15365#[doc = " An application event is either an application interrupt or a pended interrupt when the interrupt"]
15366#[doc = " is disabled."]
15367#[doc = ""]
15368#[doc = " When the application waits for an application event by calling this function, an interrupt that"]
15369#[doc = " is enabled will be taken immediately on pending since this function will wait in thread mode,"]
15370#[doc = " then the execution will return in the application's main thread."]
15371#[doc = ""]
15372#[doc = " In order to wake up from disabled interrupts, the SEVONPEND flag has to be set in the Cortex-M"]
15373#[doc = " MCU's System Control Register (SCR), CMSIS_SCB. In that case, when a disabled interrupt gets"]
15374#[doc = " pended, this function will return to the application's main thread."]
15375#[doc = ""]
15376#[doc = " @note The application must ensure that the pended flag is cleared using ::sd_nvic_ClearPendingIRQ"]
15377#[doc = " in order to sleep using this function. This is only necessary for disabled interrupts, as"]
15378#[doc = " the interrupt handler will clear the pending flag automatically for enabled interrupts."]
15379#[doc = ""]
15380#[doc = " @note If an application interrupt has happened since the last time sd_app_evt_wait was"]
15381#[doc = " called this function will return immediately and not go to sleep. This is to avoid race"]
15382#[doc = " conditions that can occur when a flag is updated in the interrupt handler and processed"]
15383#[doc = " in the main loop."]
15384#[doc = ""]
15385#[doc = " @post An application interrupt has happened or a interrupt pending flag is set."]
15386#[doc = ""]
15387#[doc = " @retval ::NRF_SUCCESS"]
15388#[inline(always)]
15389pub unsafe fn sd_app_evt_wait() -> u32 {
15390 let ret: u32;
15391 core::arch::asm!("svc 65",
15392 lateout("r0") ret,
15393 lateout("r1") _,
15394 lateout("r2") _,
15395 lateout("r3") _,
15396 lateout("r12") _,
15397 );
15398 ret
15399}
15400
15401#[doc = "@brief Get PPI channel enable register contents."]
15402#[doc = ""]
15403#[doc = " @param[out] p_channel_enable The contents of the PPI CHEN register."]
15404#[doc = ""]
15405#[doc = " @retval ::NRF_SUCCESS"]
15406#[inline(always)]
15407pub unsafe fn sd_ppi_channel_enable_get(p_channel_enable: *mut u32) -> u32 {
15408 let ret: u32;
15409 core::arch::asm!("svc 32",
15410 inout("r0") to_asm(p_channel_enable) => ret,
15411 lateout("r1") _,
15412 lateout("r2") _,
15413 lateout("r3") _,
15414 lateout("r12") _,
15415 );
15416 ret
15417}
15418
15419#[doc = "@brief Set PPI channel enable register."]
15420#[doc = ""]
15421#[doc = " @param[in] channel_enable_set_msk Mask containing the bits to set in the PPI CHEN register."]
15422#[doc = ""]
15423#[doc = " @retval ::NRF_SUCCESS"]
15424#[inline(always)]
15425pub unsafe fn sd_ppi_channel_enable_set(channel_enable_set_msk: u32) -> u32 {
15426 let ret: u32;
15427 core::arch::asm!("svc 33",
15428 inout("r0") to_asm(channel_enable_set_msk) => ret,
15429 lateout("r1") _,
15430 lateout("r2") _,
15431 lateout("r3") _,
15432 lateout("r12") _,
15433 );
15434 ret
15435}
15436
15437#[doc = "@brief Clear PPI channel enable register."]
15438#[doc = ""]
15439#[doc = " @param[in] channel_enable_clr_msk Mask containing the bits to clear in the PPI CHEN register."]
15440#[doc = ""]
15441#[doc = " @retval ::NRF_SUCCESS"]
15442#[inline(always)]
15443pub unsafe fn sd_ppi_channel_enable_clr(channel_enable_clr_msk: u32) -> u32 {
15444 let ret: u32;
15445 core::arch::asm!("svc 34",
15446 inout("r0") to_asm(channel_enable_clr_msk) => ret,
15447 lateout("r1") _,
15448 lateout("r2") _,
15449 lateout("r3") _,
15450 lateout("r12") _,
15451 );
15452 ret
15453}
15454
15455#[doc = "@brief Assign endpoints to a PPI channel."]
15456#[doc = ""]
15457#[doc = " @param[in] channel_num Number of the PPI channel to assign."]
15458#[doc = " @param[in] evt_endpoint Event endpoint of the PPI channel."]
15459#[doc = " @param[in] task_endpoint Task endpoint of the PPI channel."]
15460#[doc = ""]
15461#[doc = " @retval ::NRF_ERROR_SOC_PPI_INVALID_CHANNEL The channel number is invalid."]
15462#[doc = " @retval ::NRF_SUCCESS"]
15463#[inline(always)]
15464pub unsafe fn sd_ppi_channel_assign(
15465 channel_num: u8,
15466 evt_endpoint: *const self::c_void,
15467 task_endpoint: *const self::c_void,
15468) -> u32 {
15469 let ret: u32;
15470 core::arch::asm!("svc 35",
15471 inout("r0") to_asm(channel_num) => ret,
15472 inout("r1") to_asm(evt_endpoint) => _,
15473 inout("r2") to_asm(task_endpoint) => _,
15474 lateout("r3") _,
15475 lateout("r12") _,
15476 );
15477 ret
15478}
15479
15480#[doc = "@brief Task to enable a channel group."]
15481#[doc = ""]
15482#[doc = " @param[in] group_num Number of the channel group."]
15483#[doc = ""]
15484#[doc = " @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid"]
15485#[doc = " @retval ::NRF_SUCCESS"]
15486#[inline(always)]
15487pub unsafe fn sd_ppi_group_task_enable(group_num: u8) -> u32 {
15488 let ret: u32;
15489 core::arch::asm!("svc 36",
15490 inout("r0") to_asm(group_num) => ret,
15491 lateout("r1") _,
15492 lateout("r2") _,
15493 lateout("r3") _,
15494 lateout("r12") _,
15495 );
15496 ret
15497}
15498
15499#[doc = "@brief Task to disable a channel group."]
15500#[doc = ""]
15501#[doc = " @param[in] group_num Number of the PPI group."]
15502#[doc = ""]
15503#[doc = " @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid."]
15504#[doc = " @retval ::NRF_SUCCESS"]
15505#[inline(always)]
15506pub unsafe fn sd_ppi_group_task_disable(group_num: u8) -> u32 {
15507 let ret: u32;
15508 core::arch::asm!("svc 37",
15509 inout("r0") to_asm(group_num) => ret,
15510 lateout("r1") _,
15511 lateout("r2") _,
15512 lateout("r3") _,
15513 lateout("r12") _,
15514 );
15515 ret
15516}
15517
15518#[doc = "@brief Assign PPI channels to a channel group."]
15519#[doc = ""]
15520#[doc = " @param[in] group_num Number of the channel group."]
15521#[doc = " @param[in] channel_msk Mask of the channels to assign to the group."]
15522#[doc = ""]
15523#[doc = " @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid."]
15524#[doc = " @retval ::NRF_SUCCESS"]
15525#[inline(always)]
15526pub unsafe fn sd_ppi_group_assign(group_num: u8, channel_msk: u32) -> u32 {
15527 let ret: u32;
15528 core::arch::asm!("svc 38",
15529 inout("r0") to_asm(group_num) => ret,
15530 inout("r1") to_asm(channel_msk) => _,
15531 lateout("r2") _,
15532 lateout("r3") _,
15533 lateout("r12") _,
15534 );
15535 ret
15536}
15537
15538#[doc = "@brief Gets the PPI channels of a channel group."]
15539#[doc = ""]
15540#[doc = " @param[in] group_num Number of the channel group."]
15541#[doc = " @param[out] p_channel_msk Mask of the channels assigned to the group."]
15542#[doc = ""]
15543#[doc = " @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid."]
15544#[doc = " @retval ::NRF_SUCCESS"]
15545#[inline(always)]
15546pub unsafe fn sd_ppi_group_get(group_num: u8, p_channel_msk: *mut u32) -> u32 {
15547 let ret: u32;
15548 core::arch::asm!("svc 39",
15549 inout("r0") to_asm(group_num) => ret,
15550 inout("r1") to_asm(p_channel_msk) => _,
15551 lateout("r2") _,
15552 lateout("r3") _,
15553 lateout("r12") _,
15554 );
15555 ret
15556}
15557
15558#[doc = "@brief Configures the Radio Notification signal."]
15559#[doc = ""]
15560#[doc = " @note"]
15561#[doc = " - The notification signal latency depends on the interrupt priority settings of SWI used"]
15562#[doc = " for notification signal."]
15563#[doc = " - To ensure that the radio notification signal behaves in a consistent way, the radio"]
15564#[doc = " notifications must be configured when there is no protocol stack or other SoftDevice"]
15565#[doc = " activity in progress. It is recommended that the radio notification signal is"]
15566#[doc = " configured directly after the SoftDevice has been enabled."]
15567#[doc = " - In the period between the ACTIVE signal and the start of the Radio Event, the SoftDevice"]
15568#[doc = " will interrupt the application to do Radio Event preparation."]
15569#[doc = " - Using the Radio Notification feature may limit the bandwidth, as the SoftDevice may have"]
15570#[doc = " to shorten the connection events to have time for the Radio Notification signals."]
15571#[doc = ""]
15572#[doc = " @param[in] type Type of notification signal, see @ref NRF_RADIO_NOTIFICATION_TYPES."]
15573#[doc = " @ref NRF_RADIO_NOTIFICATION_TYPE_NONE shall be used to turn off radio"]
15574#[doc = " notification. Using @ref NRF_RADIO_NOTIFICATION_DISTANCE_NONE is"]
15575#[doc = " recommended (but not required) to be used with"]
15576#[doc = " @ref NRF_RADIO_NOTIFICATION_TYPE_NONE."]
15577#[doc = ""]
15578#[doc = " @param[in] distance Distance between the notification signal and start of radio activity, see @ref NRF_RADIO_NOTIFICATION_DISTANCES."]
15579#[doc = " This parameter is ignored when @ref NRF_RADIO_NOTIFICATION_TYPE_NONE or"]
15580#[doc = " @ref NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE is used."]
15581#[doc = ""]
15582#[doc = " @retval ::NRF_ERROR_INVALID_PARAM The group number is invalid."]
15583#[doc = " @retval ::NRF_ERROR_INVALID_STATE A protocol stack or other SoftDevice is running. Stop all"]
15584#[doc = " running activities and retry."]
15585#[doc = " @retval ::NRF_SUCCESS"]
15586#[inline(always)]
15587pub unsafe fn sd_radio_notification_cfg_set(type_: u8, distance: u8) -> u32 {
15588 let ret: u32;
15589 core::arch::asm!("svc 69",
15590 inout("r0") to_asm(type_) => ret,
15591 inout("r1") to_asm(distance) => _,
15592 lateout("r2") _,
15593 lateout("r3") _,
15594 lateout("r12") _,
15595 );
15596 ret
15597}
15598
15599#[doc = "@brief Encrypts a block according to the specified parameters."]
15600#[doc = ""]
15601#[doc = " 128-bit AES encryption."]
15602#[doc = ""]
15603#[doc = " @note:"]
15604#[doc = " - The application may set the SEVONPEND bit in the SCR to 1 to make the SoftDevice sleep while"]
15605#[doc = " the ECB is running. The SEVONPEND bit should only be cleared (set to 0) from application"]
15606#[doc = " main or low interrupt level."]
15607#[doc = ""]
15608#[doc = " @param[in, out] p_ecb_data Pointer to the ECB parameters' struct (two input"]
15609#[doc = " parameters and one output parameter)."]
15610#[doc = ""]
15611#[doc = " @retval ::NRF_SUCCESS"]
15612#[inline(always)]
15613pub unsafe fn sd_ecb_block_encrypt(p_ecb_data: *mut nrf_ecb_hal_data_t) -> u32 {
15614 let ret: u32;
15615 core::arch::asm!("svc 70",
15616 inout("r0") to_asm(p_ecb_data) => ret,
15617 lateout("r1") _,
15618 lateout("r2") _,
15619 lateout("r3") _,
15620 lateout("r12") _,
15621 );
15622 ret
15623}
15624
15625#[doc = "@brief Encrypts multiple data blocks provided as an array of data block structures."]
15626#[doc = ""]
15627#[doc = " @details: Performs 128-bit AES encryption on multiple data blocks"]
15628#[doc = ""]
15629#[doc = " @note:"]
15630#[doc = " - The application may set the SEVONPEND bit in the SCR to 1 to make the SoftDevice sleep while"]
15631#[doc = " the ECB is running. The SEVONPEND bit should only be cleared (set to 0) from application"]
15632#[doc = " main or low interrupt level."]
15633#[doc = ""]
15634#[doc = " @param[in] block_count Count of blocks in the p_data_blocks array."]
15635#[doc = " @param[in,out] p_data_blocks Pointer to the first entry in a contiguous array of"]
15636#[doc = " @ref nrf_ecb_hal_data_block_t structures."]
15637#[doc = ""]
15638#[doc = " @retval ::NRF_SUCCESS"]
15639#[inline(always)]
15640pub unsafe fn sd_ecb_blocks_encrypt(block_count: u8, p_data_blocks: *mut nrf_ecb_hal_data_block_t) -> u32 {
15641 let ret: u32;
15642 core::arch::asm!("svc 71",
15643 inout("r0") to_asm(block_count) => ret,
15644 inout("r1") to_asm(p_data_blocks) => _,
15645 lateout("r2") _,
15646 lateout("r3") _,
15647 lateout("r12") _,
15648 );
15649 ret
15650}
15651
15652#[doc = "@brief Gets any pending events generated by the SoC API."]
15653#[doc = ""]
15654#[doc = " The application should keep calling this function to get events, until ::NRF_ERROR_NOT_FOUND is returned."]
15655#[doc = ""]
15656#[doc = " @param[out] p_evt_id Set to one of the values in @ref NRF_SOC_EVTS, if any events are pending."]
15657#[doc = ""]
15658#[doc = " @retval ::NRF_SUCCESS An event was pending. The event id is written in the p_evt_id parameter."]
15659#[doc = " @retval ::NRF_ERROR_NOT_FOUND No pending events."]
15660#[inline(always)]
15661pub unsafe fn sd_evt_get(p_evt_id: *mut u32) -> u32 {
15662 let ret: u32;
15663 core::arch::asm!("svc 75",
15664 inout("r0") to_asm(p_evt_id) => ret,
15665 lateout("r1") _,
15666 lateout("r2") _,
15667 lateout("r3") _,
15668 lateout("r12") _,
15669 );
15670 ret
15671}
15672
15673#[doc = "@brief Get the temperature measured on the chip"]
15674#[doc = ""]
15675#[doc = " This function will block until the temperature measurement is done."]
15676#[doc = " It takes around 50 us from call to return."]
15677#[doc = ""]
15678#[doc = " @param[out] p_temp Result of temperature measurement. Die temperature in 0.25 degrees Celsius."]
15679#[doc = ""]
15680#[doc = " @retval ::NRF_SUCCESS A temperature measurement was done, and the temperature was written to temp"]
15681#[inline(always)]
15682pub unsafe fn sd_temp_get(p_temp: *mut i32) -> u32 {
15683 let ret: u32;
15684 core::arch::asm!("svc 76",
15685 inout("r0") to_asm(p_temp) => ret,
15686 lateout("r1") _,
15687 lateout("r2") _,
15688 lateout("r3") _,
15689 lateout("r12") _,
15690 );
15691 ret
15692}
15693
15694#[doc = "@brief Flash Write"]
15695#[doc = ""]
15696#[doc = " Commands to write a buffer to flash"]
15697#[doc = ""]
15698#[doc = " If the SoftDevice is enabled:"]
15699#[doc = " This call initiates the flash access command, and its completion will be communicated to the"]
15700#[doc = " application with exactly one of the following events:"]
15701#[doc = " - @ref NRF_EVT_FLASH_OPERATION_SUCCESS - The command was successfully completed."]
15702#[doc = " - @ref NRF_EVT_FLASH_OPERATION_ERROR - The command could not be started."]
15703#[doc = ""]
15704#[doc = " If the SoftDevice is not enabled no event will be generated, and this call will return @ref NRF_SUCCESS when the"]
15705#[doc = " write has been completed"]
15706#[doc = ""]
15707#[doc = " @note"]
15708#[doc = " - This call takes control over the radio and the CPU during flash erase and write to make sure that"]
15709#[doc = " they will not interfere with the flash access. This means that all interrupts will be blocked"]
15710#[doc = " for a predictable time (depending on the NVMC specification in the device's Product Specification"]
15711#[doc = " and the command parameters)."]
15712#[doc = " - The data in the p_src buffer should not be modified before the @ref NRF_EVT_FLASH_OPERATION_SUCCESS"]
15713#[doc = " or the @ref NRF_EVT_FLASH_OPERATION_ERROR have been received if the SoftDevice is enabled."]
15714#[doc = " - This call will make the SoftDevice trigger a hardfault when the page is written, if it is"]
15715#[doc = " protected."]
15716#[doc = ""]
15717#[doc = ""]
15718#[doc = " @param[in] p_dst Pointer to start of flash location to be written."]
15719#[doc = " @param[in] p_src Pointer to buffer with data to be written."]
15720#[doc = " @param[in] size Number of 32-bit words to write. Maximum size is the number of words in one"]
15721#[doc = " flash page. See the device's Product Specification for details."]
15722#[doc = ""]
15723#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Tried to write to a non existing flash address, or p_dst or p_src was unaligned."]
15724#[doc = " @retval ::NRF_ERROR_BUSY The previous command has not yet completed."]
15725#[doc = " @retval ::NRF_ERROR_INVALID_LENGTH Size was 0, or higher than the maximum allowed size."]
15726#[doc = " @retval ::NRF_ERROR_FORBIDDEN Tried to write to an address outside the application flash area."]
15727#[doc = " @retval ::NRF_SUCCESS The command was accepted."]
15728#[inline(always)]
15729pub unsafe fn sd_flash_write(p_dst: *mut u32, p_src: *const u32, size: u32) -> u32 {
15730 let ret: u32;
15731 core::arch::asm!("svc 41",
15732 inout("r0") to_asm(p_dst) => ret,
15733 inout("r1") to_asm(p_src) => _,
15734 inout("r2") to_asm(size) => _,
15735 lateout("r3") _,
15736 lateout("r12") _,
15737 );
15738 ret
15739}
15740
15741#[doc = "@brief Flash Erase page"]
15742#[doc = ""]
15743#[doc = " Commands to erase a flash page"]
15744#[doc = " If the SoftDevice is enabled:"]
15745#[doc = " This call initiates the flash access command, and its completion will be communicated to the"]
15746#[doc = " application with exactly one of the following events:"]
15747#[doc = " - @ref NRF_EVT_FLASH_OPERATION_SUCCESS - The command was successfully completed."]
15748#[doc = " - @ref NRF_EVT_FLASH_OPERATION_ERROR - The command could not be started."]
15749#[doc = ""]
15750#[doc = " If the SoftDevice is not enabled no event will be generated, and this call will return @ref NRF_SUCCESS when the"]
15751#[doc = " erase has been completed"]
15752#[doc = ""]
15753#[doc = " @note"]
15754#[doc = " - This call takes control over the radio and the CPU during flash erase and write to make sure that"]
15755#[doc = " they will not interfere with the flash access. This means that all interrupts will be blocked"]
15756#[doc = " for a predictable time (depending on the NVMC specification in the device's Product Specification"]
15757#[doc = " and the command parameters)."]
15758#[doc = " - This call will make the SoftDevice trigger a hardfault when the page is erased, if it is"]
15759#[doc = " protected."]
15760#[doc = ""]
15761#[doc = ""]
15762#[doc = " @param[in] page_number Page number of the page to erase"]
15763#[doc = ""]
15764#[doc = " @retval ::NRF_ERROR_INTERNAL If a new session could not be opened due to an internal error."]
15765#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Tried to erase to a non existing flash page."]
15766#[doc = " @retval ::NRF_ERROR_BUSY The previous command has not yet completed."]
15767#[doc = " @retval ::NRF_ERROR_FORBIDDEN Tried to erase a page outside the application flash area."]
15768#[doc = " @retval ::NRF_SUCCESS The command was accepted."]
15769#[inline(always)]
15770pub unsafe fn sd_flash_page_erase(page_number: u32) -> u32 {
15771 let ret: u32;
15772 core::arch::asm!("svc 40",
15773 inout("r0") to_asm(page_number) => ret,
15774 lateout("r1") _,
15775 lateout("r2") _,
15776 lateout("r3") _,
15777 lateout("r12") _,
15778 );
15779 ret
15780}
15781
15782#[doc = "@brief Opens a session for radio timeslot requests."]
15783#[doc = ""]
15784#[doc = " @note Only one session can be open at a time."]
15785#[doc = " @note p_radio_signal_callback(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START) will be called when the radio timeslot"]
15786#[doc = " starts. From this point the NRF_RADIO and NRF_TIMER0 peripherals can be freely accessed"]
15787#[doc = " by the application."]
15788#[doc = " @note p_radio_signal_callback(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_TIMER0) is called whenever the NRF_TIMER0"]
15789#[doc = " interrupt occurs."]
15790#[doc = " @note p_radio_signal_callback(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_RADIO) is called whenever the NRF_RADIO"]
15791#[doc = " interrupt occurs."]
15792#[doc = " @note p_radio_signal_callback() will be called at ARM interrupt priority level 0. This"]
15793#[doc = " implies that none of the sd_* API calls can be used from p_radio_signal_callback()."]
15794#[doc = ""]
15795#[doc = " @param[in] p_radio_signal_callback The signal callback."]
15796#[doc = ""]
15797#[doc = " @retval ::NRF_ERROR_INVALID_ADDR p_radio_signal_callback is an invalid function pointer."]
15798#[doc = " @retval ::NRF_ERROR_BUSY If session cannot be opened."]
15799#[doc = " @retval ::NRF_ERROR_INTERNAL If a new session could not be opened due to an internal error."]
15800#[doc = " @retval ::NRF_SUCCESS Otherwise."]
15801#[inline(always)]
15802pub unsafe fn sd_radio_session_open(p_radio_signal_callback: nrf_radio_signal_callback_t) -> u32 {
15803 let ret: u32;
15804 core::arch::asm!("svc 72",
15805 inout("r0") to_asm(p_radio_signal_callback) => ret,
15806 lateout("r1") _,
15807 lateout("r2") _,
15808 lateout("r3") _,
15809 lateout("r12") _,
15810 );
15811 ret
15812}
15813
15814#[doc = "@brief Closes a session for radio timeslot requests."]
15815#[doc = ""]
15816#[doc = " @note Any current radio timeslot will be finished before the session is closed."]
15817#[doc = " @note If a radio timeslot is scheduled when the session is closed, it will be canceled."]
15818#[doc = " @note The application cannot consider the session closed until the @ref NRF_EVT_RADIO_SESSION_CLOSED"]
15819#[doc = " event is received."]
15820#[doc = ""]
15821#[doc = " @retval ::NRF_ERROR_FORBIDDEN If session not opened."]
15822#[doc = " @retval ::NRF_ERROR_BUSY If session is currently being closed."]
15823#[doc = " @retval ::NRF_SUCCESS Otherwise."]
15824#[inline(always)]
15825pub unsafe fn sd_radio_session_close() -> u32 {
15826 let ret: u32;
15827 core::arch::asm!("svc 73",
15828 lateout("r0") ret,
15829 lateout("r1") _,
15830 lateout("r2") _,
15831 lateout("r3") _,
15832 lateout("r12") _,
15833 );
15834 ret
15835}
15836
15837#[doc = "@brief Requests a radio timeslot."]
15838#[doc = ""]
15839#[doc = " @note The request type is determined by p_request->request_type, and can be one of @ref NRF_RADIO_REQ_TYPE_EARLIEST"]
15840#[doc = " and @ref NRF_RADIO_REQ_TYPE_NORMAL. The first request in a session must always be of type @ref NRF_RADIO_REQ_TYPE_EARLIEST."]
15841#[doc = " @note For a normal request (@ref NRF_RADIO_REQ_TYPE_NORMAL), the start time of a radio timeslot is specified by"]
15842#[doc = " p_request->distance_us and is given relative to the start of the previous timeslot."]
15843#[doc = " @note A too small p_request->distance_us will lead to a @ref NRF_EVT_RADIO_BLOCKED event."]
15844#[doc = " @note Timeslots scheduled too close will lead to a @ref NRF_EVT_RADIO_BLOCKED event."]
15845#[doc = " @note See the SoftDevice Specification for more on radio timeslot scheduling, distances and lengths."]
15846#[doc = " @note If an opportunity for the first radio timeslot is not found before 100 ms after the call to this"]
15847#[doc = " function, it is not scheduled, and instead a @ref NRF_EVT_RADIO_BLOCKED event is sent."]
15848#[doc = " The application may then try to schedule the first radio timeslot again."]
15849#[doc = " @note Successful requests will result in nrf_radio_signal_callback_t(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START)."]
15850#[doc = " Unsuccessful requests will result in a @ref NRF_EVT_RADIO_BLOCKED event, see @ref NRF_SOC_EVTS."]
15851#[doc = " @note The jitter in the start time of the radio timeslots is +/- @ref NRF_RADIO_START_JITTER_US us."]
15852#[doc = " @note The nrf_radio_signal_callback_t(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START) call has a latency relative to the"]
15853#[doc = " specified radio timeslot start, but this does not affect the actual start time of the timeslot."]
15854#[doc = " @note NRF_TIMER0 is reset at the start of the radio timeslot, and is clocked at 1MHz from the high frequency"]
15855#[doc = " (16 MHz) clock source. If p_request->hfclk_force_xtal is true, the high frequency clock is"]
15856#[doc = " guaranteed to be clocked from the external crystal."]
15857#[doc = " @note The SoftDevice will neither access the NRF_RADIO peripheral nor the NRF_TIMER0 peripheral"]
15858#[doc = " during the radio timeslot."]
15859#[doc = ""]
15860#[doc = " @param[in] p_request Pointer to the request parameters."]
15861#[doc = ""]
15862#[doc = " @retval ::NRF_ERROR_FORBIDDEN Either:"]
15863#[doc = " - The session is not open."]
15864#[doc = " - The session is not IDLE."]
15865#[doc = " - This is the first request and its type is not @ref NRF_RADIO_REQ_TYPE_EARLIEST."]
15866#[doc = " - The request type was set to @ref NRF_RADIO_REQ_TYPE_NORMAL after a"]
15867#[doc = " @ref NRF_RADIO_REQ_TYPE_EARLIEST request was blocked."]
15868#[doc = " @retval ::NRF_ERROR_INVALID_ADDR If the p_request pointer is invalid."]
15869#[doc = " @retval ::NRF_ERROR_INVALID_PARAM If the parameters of p_request are not valid."]
15870#[doc = " @retval ::NRF_SUCCESS Otherwise."]
15871#[inline(always)]
15872pub unsafe fn sd_radio_request(p_request: *const nrf_radio_request_t) -> u32 {
15873 let ret: u32;
15874 core::arch::asm!("svc 74",
15875 inout("r0") to_asm(p_request) => ret,
15876 lateout("r1") _,
15877 lateout("r2") _,
15878 lateout("r3") _,
15879 lateout("r12") _,
15880 );
15881 ret
15882}
15883
15884#[doc = "@brief Write register protected by the SoftDevice"]
15885#[doc = ""]
15886#[doc = " This function writes to a register that is write-protected by the SoftDevice. Please refer to your"]
15887#[doc = " SoftDevice Specification for more details about which registers that are protected by SoftDevice."]
15888#[doc = " This function can write to the following protected peripheral:"]
15889#[doc = " - ACL"]
15890#[doc = ""]
15891#[doc = " @note Protected registers may be read directly."]
15892#[doc = " @note Register that are write-once will return @ref NRF_SUCCESS on second set, even the value in"]
15893#[doc = " the register has not changed. See the Product Specification for more details about register"]
15894#[doc = " properties."]
15895#[doc = ""]
15896#[doc = " @param[in] p_register Pointer to register to be written."]
15897#[doc = " @param[in] value Value to be written to the register."]
15898#[doc = ""]
15899#[doc = " @retval ::NRF_ERROR_INVALID_ADDR This function can not write to the reguested register."]
15900#[doc = " @retval ::NRF_SUCCESS Value successfully written to register."]
15901#[doc = ""]
15902#[inline(always)]
15903pub unsafe fn sd_protected_register_write(p_register: *mut u32, value: u32) -> u32 {
15904 let ret: u32;
15905 core::arch::asm!("svc 43",
15906 inout("r0") to_asm(p_register) => ret,
15907 inout("r1") to_asm(value) => _,
15908 lateout("r2") _,
15909 lateout("r3") _,
15910 lateout("r12") _,
15911 );
15912 ret
15913}
15914
15915#[doc = "< ::sd_mbr_command"]
15916pub const NRF_MBR_SVCS_SD_MBR_COMMAND: NRF_MBR_SVCS = 24;
15917#[doc = "@brief nRF Master Boot Record API SVC numbers."]
15918pub type NRF_MBR_SVCS = self::c_uint;
15919#[doc = "< Copy a new BootLoader. @see ::sd_mbr_command_copy_bl_t"]
15920pub const NRF_MBR_COMMANDS_SD_MBR_COMMAND_COPY_BL: NRF_MBR_COMMANDS = 0;
15921#[doc = "< Copy a new SoftDevice. @see ::sd_mbr_command_copy_sd_t"]
15922pub const NRF_MBR_COMMANDS_SD_MBR_COMMAND_COPY_SD: NRF_MBR_COMMANDS = 1;
15923#[doc = "< Initialize forwarding interrupts to SD, and run reset function in SD. Does not require any parameters in ::sd_mbr_command_t params."]
15924pub const NRF_MBR_COMMANDS_SD_MBR_COMMAND_INIT_SD: NRF_MBR_COMMANDS = 2;
15925#[doc = "< This command works like memcmp. @see ::sd_mbr_command_compare_t"]
15926pub const NRF_MBR_COMMANDS_SD_MBR_COMMAND_COMPARE: NRF_MBR_COMMANDS = 3;
15927#[doc = "< Change the address the MBR starts after a reset. @see ::sd_mbr_command_vector_table_base_set_t"]
15928pub const NRF_MBR_COMMANDS_SD_MBR_COMMAND_VECTOR_TABLE_BASE_SET: NRF_MBR_COMMANDS = 4;
15929pub const NRF_MBR_COMMANDS_SD_MBR_COMMAND_RESERVED: NRF_MBR_COMMANDS = 5;
15930#[doc = "< Start forwarding all interrupts to this address. @see ::sd_mbr_command_irq_forward_address_set_t"]
15931pub const NRF_MBR_COMMANDS_SD_MBR_COMMAND_IRQ_FORWARD_ADDRESS_SET: NRF_MBR_COMMANDS = 6;
15932#[doc = "@brief Possible values for ::sd_mbr_command_t.command"]
15933pub type NRF_MBR_COMMANDS = self::c_uint;
15934#[doc = "@brief This command copies part of a new SoftDevice"]
15935#[doc = ""]
15936#[doc = " The destination area is erased before copying."]
15937#[doc = " If dst is in the middle of a flash page, that whole flash page will be erased."]
15938#[doc = " If (dst+len) is in the middle of a flash page, that whole flash page will be erased."]
15939#[doc = ""]
15940#[doc = " The user of this function is responsible for setting the BPROT registers."]
15941#[doc = ""]
15942#[doc = " @retval ::NRF_SUCCESS indicates that the contents of the memory blocks where copied correctly."]
15943#[doc = " @retval ::NRF_ERROR_INTERNAL indicates that the contents of the memory blocks where not verified correctly after copying."]
15944#[repr(C)]
15945#[derive(Debug, Copy, Clone)]
15946pub struct sd_mbr_command_copy_sd_t {
15947 #[doc = "< Pointer to the source of data to be copied."]
15948 pub src: *mut u32,
15949 #[doc = "< Pointer to the destination where the content is to be copied."]
15950 pub dst: *mut u32,
15951 #[doc = "< Number of 32 bit words to copy. Must be a multiple of @ref MBR_PAGE_SIZE_IN_WORDS words."]
15952 pub len: u32,
15953}
15954#[test]
15955fn bindgen_test_layout_sd_mbr_command_copy_sd_t() {
15956 assert_eq!(
15957 ::core::mem::size_of::<sd_mbr_command_copy_sd_t>(),
15958 12usize,
15959 concat!("Size of: ", stringify!(sd_mbr_command_copy_sd_t))
15960 );
15961 assert_eq!(
15962 ::core::mem::align_of::<sd_mbr_command_copy_sd_t>(),
15963 4usize,
15964 concat!("Alignment of ", stringify!(sd_mbr_command_copy_sd_t))
15965 );
15966 assert_eq!(
15967 unsafe { &(*(::core::ptr::null::<sd_mbr_command_copy_sd_t>())).src as *const _ as usize },
15968 0usize,
15969 concat!(
15970 "Offset of field: ",
15971 stringify!(sd_mbr_command_copy_sd_t),
15972 "::",
15973 stringify!(src)
15974 )
15975 );
15976 assert_eq!(
15977 unsafe { &(*(::core::ptr::null::<sd_mbr_command_copy_sd_t>())).dst as *const _ as usize },
15978 4usize,
15979 concat!(
15980 "Offset of field: ",
15981 stringify!(sd_mbr_command_copy_sd_t),
15982 "::",
15983 stringify!(dst)
15984 )
15985 );
15986 assert_eq!(
15987 unsafe { &(*(::core::ptr::null::<sd_mbr_command_copy_sd_t>())).len as *const _ as usize },
15988 8usize,
15989 concat!(
15990 "Offset of field: ",
15991 stringify!(sd_mbr_command_copy_sd_t),
15992 "::",
15993 stringify!(len)
15994 )
15995 );
15996}
15997#[doc = "@brief This command works like memcmp, but takes the length in words."]
15998#[doc = ""]
15999#[doc = " @retval ::NRF_SUCCESS indicates that the contents of both memory blocks are equal."]
16000#[doc = " @retval ::NRF_ERROR_NULL indicates that the contents of the memory blocks are not equal."]
16001#[repr(C)]
16002#[derive(Debug, Copy, Clone)]
16003pub struct sd_mbr_command_compare_t {
16004 #[doc = "< Pointer to block of memory."]
16005 pub ptr1: *mut u32,
16006 #[doc = "< Pointer to block of memory."]
16007 pub ptr2: *mut u32,
16008 #[doc = "< Number of 32 bit words to compare."]
16009 pub len: u32,
16010}
16011#[test]
16012fn bindgen_test_layout_sd_mbr_command_compare_t() {
16013 assert_eq!(
16014 ::core::mem::size_of::<sd_mbr_command_compare_t>(),
16015 12usize,
16016 concat!("Size of: ", stringify!(sd_mbr_command_compare_t))
16017 );
16018 assert_eq!(
16019 ::core::mem::align_of::<sd_mbr_command_compare_t>(),
16020 4usize,
16021 concat!("Alignment of ", stringify!(sd_mbr_command_compare_t))
16022 );
16023 assert_eq!(
16024 unsafe { &(*(::core::ptr::null::<sd_mbr_command_compare_t>())).ptr1 as *const _ as usize },
16025 0usize,
16026 concat!(
16027 "Offset of field: ",
16028 stringify!(sd_mbr_command_compare_t),
16029 "::",
16030 stringify!(ptr1)
16031 )
16032 );
16033 assert_eq!(
16034 unsafe { &(*(::core::ptr::null::<sd_mbr_command_compare_t>())).ptr2 as *const _ as usize },
16035 4usize,
16036 concat!(
16037 "Offset of field: ",
16038 stringify!(sd_mbr_command_compare_t),
16039 "::",
16040 stringify!(ptr2)
16041 )
16042 );
16043 assert_eq!(
16044 unsafe { &(*(::core::ptr::null::<sd_mbr_command_compare_t>())).len as *const _ as usize },
16045 8usize,
16046 concat!(
16047 "Offset of field: ",
16048 stringify!(sd_mbr_command_compare_t),
16049 "::",
16050 stringify!(len)
16051 )
16052 );
16053}
16054#[doc = "@brief This command copies a new BootLoader."]
16055#[doc = ""]
16056#[doc = " The MBR assumes that either @ref MBR_BOOTLOADER_ADDR or @ref MBR_UICR_BOOTLOADER_ADDR is set to"]
16057#[doc = " the address where the bootloader will be copied. If both addresses are set, the MBR will prioritize"]
16058#[doc = " @ref MBR_BOOTLOADER_ADDR."]
16059#[doc = ""]
16060#[doc = " The bootloader destination is erased by this function."]
16061#[doc = " If (destination+bl_len) is in the middle of a flash page, that whole flash page will be erased."]
16062#[doc = ""]
16063#[doc = " This command requires that @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR is set,"]
16064#[doc = " see @ref sd_mbr_command."]
16065#[doc = ""]
16066#[doc = " This command will use the flash protect peripheral (BPROT or ACL) to protect the flash that is"]
16067#[doc = " not intended to be written."]
16068#[doc = ""]
16069#[doc = " On success, this function will not return. It will start the new bootloader from reset-vector as normal."]
16070#[doc = ""]
16071#[doc = " @retval ::NRF_ERROR_INTERNAL indicates an internal error that should not happen."]
16072#[doc = " @retval ::NRF_ERROR_FORBIDDEN if the bootloader address is not set."]
16073#[doc = " @retval ::NRF_ERROR_INVALID_LENGTH if parameters attempts to read or write outside flash area."]
16074#[doc = " @retval ::NRF_ERROR_NO_MEM No MBR parameter page is provided. See @ref sd_mbr_command."]
16075#[repr(C)]
16076#[derive(Debug, Copy, Clone)]
16077pub struct sd_mbr_command_copy_bl_t {
16078 #[doc = "< Pointer to the source of the bootloader to be be copied."]
16079 pub bl_src: *mut u32,
16080 #[doc = "< Number of 32 bit words to copy for BootLoader."]
16081 pub bl_len: u32,
16082}
16083#[test]
16084fn bindgen_test_layout_sd_mbr_command_copy_bl_t() {
16085 assert_eq!(
16086 ::core::mem::size_of::<sd_mbr_command_copy_bl_t>(),
16087 8usize,
16088 concat!("Size of: ", stringify!(sd_mbr_command_copy_bl_t))
16089 );
16090 assert_eq!(
16091 ::core::mem::align_of::<sd_mbr_command_copy_bl_t>(),
16092 4usize,
16093 concat!("Alignment of ", stringify!(sd_mbr_command_copy_bl_t))
16094 );
16095 assert_eq!(
16096 unsafe { &(*(::core::ptr::null::<sd_mbr_command_copy_bl_t>())).bl_src as *const _ as usize },
16097 0usize,
16098 concat!(
16099 "Offset of field: ",
16100 stringify!(sd_mbr_command_copy_bl_t),
16101 "::",
16102 stringify!(bl_src)
16103 )
16104 );
16105 assert_eq!(
16106 unsafe { &(*(::core::ptr::null::<sd_mbr_command_copy_bl_t>())).bl_len as *const _ as usize },
16107 4usize,
16108 concat!(
16109 "Offset of field: ",
16110 stringify!(sd_mbr_command_copy_bl_t),
16111 "::",
16112 stringify!(bl_len)
16113 )
16114 );
16115}
16116#[doc = "@brief Change the address the MBR starts after a reset"]
16117#[doc = ""]
16118#[doc = " Once this function has been called, this address is where the MBR will start to forward"]
16119#[doc = " interrupts to after a reset."]
16120#[doc = ""]
16121#[doc = " To restore default forwarding, this function should be called with @ref address set to 0. If a"]
16122#[doc = " bootloader is present, interrupts will be forwarded to the bootloader. If not, interrupts will"]
16123#[doc = " be forwarded to the SoftDevice."]
16124#[doc = ""]
16125#[doc = " The location of a bootloader can be specified in @ref MBR_BOOTLOADER_ADDR or"]
16126#[doc = " @ref MBR_UICR_BOOTLOADER_ADDR. If both addresses are set, the MBR will prioritize"]
16127#[doc = " @ref MBR_BOOTLOADER_ADDR."]
16128#[doc = ""]
16129#[doc = " This command requires that @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR is set,"]
16130#[doc = " see @ref sd_mbr_command."]
16131#[doc = ""]
16132#[doc = " On success, this function will not return. It will reset the device."]
16133#[doc = ""]
16134#[doc = " @retval ::NRF_ERROR_INTERNAL indicates an internal error that should not happen."]
16135#[doc = " @retval ::NRF_ERROR_INVALID_ADDR if parameter address is outside of the flash size."]
16136#[doc = " @retval ::NRF_ERROR_NO_MEM No MBR parameter page is provided. See @ref sd_mbr_command."]
16137#[repr(C)]
16138#[derive(Debug, Copy, Clone)]
16139pub struct sd_mbr_command_vector_table_base_set_t {
16140 #[doc = "< The base address of the interrupt vector table for forwarded interrupts."]
16141 pub address: u32,
16142}
16143#[test]
16144fn bindgen_test_layout_sd_mbr_command_vector_table_base_set_t() {
16145 assert_eq!(
16146 ::core::mem::size_of::<sd_mbr_command_vector_table_base_set_t>(),
16147 4usize,
16148 concat!("Size of: ", stringify!(sd_mbr_command_vector_table_base_set_t))
16149 );
16150 assert_eq!(
16151 ::core::mem::align_of::<sd_mbr_command_vector_table_base_set_t>(),
16152 4usize,
16153 concat!("Alignment of ", stringify!(sd_mbr_command_vector_table_base_set_t))
16154 );
16155 assert_eq!(
16156 unsafe { &(*(::core::ptr::null::<sd_mbr_command_vector_table_base_set_t>())).address as *const _ as usize },
16157 0usize,
16158 concat!(
16159 "Offset of field: ",
16160 stringify!(sd_mbr_command_vector_table_base_set_t),
16161 "::",
16162 stringify!(address)
16163 )
16164 );
16165}
16166#[doc = "@brief Sets the base address of the interrupt vector table for interrupts forwarded from the MBR"]
16167#[doc = ""]
16168#[doc = " Unlike sd_mbr_command_vector_table_base_set_t, this function does not reset, and it does not"]
16169#[doc = " change where the MBR starts after reset."]
16170#[doc = ""]
16171#[doc = " @retval ::NRF_SUCCESS"]
16172#[repr(C)]
16173#[derive(Debug, Copy, Clone)]
16174pub struct sd_mbr_command_irq_forward_address_set_t {
16175 #[doc = "< The base address of the interrupt vector table for forwarded interrupts."]
16176 pub address: u32,
16177}
16178#[test]
16179fn bindgen_test_layout_sd_mbr_command_irq_forward_address_set_t() {
16180 assert_eq!(
16181 ::core::mem::size_of::<sd_mbr_command_irq_forward_address_set_t>(),
16182 4usize,
16183 concat!("Size of: ", stringify!(sd_mbr_command_irq_forward_address_set_t))
16184 );
16185 assert_eq!(
16186 ::core::mem::align_of::<sd_mbr_command_irq_forward_address_set_t>(),
16187 4usize,
16188 concat!("Alignment of ", stringify!(sd_mbr_command_irq_forward_address_set_t))
16189 );
16190 assert_eq!(
16191 unsafe { &(*(::core::ptr::null::<sd_mbr_command_irq_forward_address_set_t>())).address as *const _ as usize },
16192 0usize,
16193 concat!(
16194 "Offset of field: ",
16195 stringify!(sd_mbr_command_irq_forward_address_set_t),
16196 "::",
16197 stringify!(address)
16198 )
16199 );
16200}
16201#[doc = "@brief Input structure containing data used when calling ::sd_mbr_command"]
16202#[doc = ""]
16203#[doc = " Depending on what command value that is set, the corresponding params value type must also be"]
16204#[doc = " set. See @ref NRF_MBR_COMMANDS for command types and corresponding params value type. If command"]
16205#[doc = " @ref SD_MBR_COMMAND_INIT_SD is set, it is not necessary to set any values under params."]
16206#[repr(C)]
16207#[derive(Copy, Clone)]
16208pub struct sd_mbr_command_t {
16209 #[doc = "< Type of command to be issued. See @ref NRF_MBR_COMMANDS."]
16210 pub command: u32,
16211 #[doc = "< Command parameters."]
16212 pub params: sd_mbr_command_t__bindgen_ty_1,
16213}
16214#[repr(C)]
16215#[derive(Copy, Clone)]
16216pub union sd_mbr_command_t__bindgen_ty_1 {
16217 #[doc = "< Parameters for copy SoftDevice."]
16218 pub copy_sd: sd_mbr_command_copy_sd_t,
16219 #[doc = "< Parameters for verify."]
16220 pub compare: sd_mbr_command_compare_t,
16221 #[doc = "< Parameters for copy BootLoader. Requires parameter page."]
16222 pub copy_bl: sd_mbr_command_copy_bl_t,
16223 #[doc = "< Parameters for vector table base set. Requires parameter page."]
16224 pub base_set: sd_mbr_command_vector_table_base_set_t,
16225 #[doc = "< Parameters for irq forward address set"]
16226 pub irq_forward_address_set: sd_mbr_command_irq_forward_address_set_t,
16227 _bindgen_union_align: [u32; 3usize],
16228}
16229#[test]
16230fn bindgen_test_layout_sd_mbr_command_t__bindgen_ty_1() {
16231 assert_eq!(
16232 ::core::mem::size_of::<sd_mbr_command_t__bindgen_ty_1>(),
16233 12usize,
16234 concat!("Size of: ", stringify!(sd_mbr_command_t__bindgen_ty_1))
16235 );
16236 assert_eq!(
16237 ::core::mem::align_of::<sd_mbr_command_t__bindgen_ty_1>(),
16238 4usize,
16239 concat!("Alignment of ", stringify!(sd_mbr_command_t__bindgen_ty_1))
16240 );
16241 assert_eq!(
16242 unsafe { &(*(::core::ptr::null::<sd_mbr_command_t__bindgen_ty_1>())).copy_sd as *const _ as usize },
16243 0usize,
16244 concat!(
16245 "Offset of field: ",
16246 stringify!(sd_mbr_command_t__bindgen_ty_1),
16247 "::",
16248 stringify!(copy_sd)
16249 )
16250 );
16251 assert_eq!(
16252 unsafe { &(*(::core::ptr::null::<sd_mbr_command_t__bindgen_ty_1>())).compare as *const _ as usize },
16253 0usize,
16254 concat!(
16255 "Offset of field: ",
16256 stringify!(sd_mbr_command_t__bindgen_ty_1),
16257 "::",
16258 stringify!(compare)
16259 )
16260 );
16261 assert_eq!(
16262 unsafe { &(*(::core::ptr::null::<sd_mbr_command_t__bindgen_ty_1>())).copy_bl as *const _ as usize },
16263 0usize,
16264 concat!(
16265 "Offset of field: ",
16266 stringify!(sd_mbr_command_t__bindgen_ty_1),
16267 "::",
16268 stringify!(copy_bl)
16269 )
16270 );
16271 assert_eq!(
16272 unsafe { &(*(::core::ptr::null::<sd_mbr_command_t__bindgen_ty_1>())).base_set as *const _ as usize },
16273 0usize,
16274 concat!(
16275 "Offset of field: ",
16276 stringify!(sd_mbr_command_t__bindgen_ty_1),
16277 "::",
16278 stringify!(base_set)
16279 )
16280 );
16281 assert_eq!(
16282 unsafe {
16283 &(*(::core::ptr::null::<sd_mbr_command_t__bindgen_ty_1>())).irq_forward_address_set as *const _ as usize
16284 },
16285 0usize,
16286 concat!(
16287 "Offset of field: ",
16288 stringify!(sd_mbr_command_t__bindgen_ty_1),
16289 "::",
16290 stringify!(irq_forward_address_set)
16291 )
16292 );
16293}
16294#[test]
16295fn bindgen_test_layout_sd_mbr_command_t() {
16296 assert_eq!(
16297 ::core::mem::size_of::<sd_mbr_command_t>(),
16298 16usize,
16299 concat!("Size of: ", stringify!(sd_mbr_command_t))
16300 );
16301 assert_eq!(
16302 ::core::mem::align_of::<sd_mbr_command_t>(),
16303 4usize,
16304 concat!("Alignment of ", stringify!(sd_mbr_command_t))
16305 );
16306 assert_eq!(
16307 unsafe { &(*(::core::ptr::null::<sd_mbr_command_t>())).command as *const _ as usize },
16308 0usize,
16309 concat!(
16310 "Offset of field: ",
16311 stringify!(sd_mbr_command_t),
16312 "::",
16313 stringify!(command)
16314 )
16315 );
16316 assert_eq!(
16317 unsafe { &(*(::core::ptr::null::<sd_mbr_command_t>())).params as *const _ as usize },
16318 4usize,
16319 concat!(
16320 "Offset of field: ",
16321 stringify!(sd_mbr_command_t),
16322 "::",
16323 stringify!(params)
16324 )
16325 );
16326}
16327
16328#[doc = "@brief Issue Master Boot Record commands"]
16329#[doc = ""]
16330#[doc = " Commands used when updating a SoftDevice and bootloader."]
16331#[doc = ""]
16332#[doc = " The @ref SD_MBR_COMMAND_COPY_BL and @ref SD_MBR_COMMAND_VECTOR_TABLE_BASE_SET requires"]
16333#[doc = " parameters to be retained by the MBR when resetting the IC. This is done in a separate flash"]
16334#[doc = " page. The location of the flash page should be provided by the application in either"]
16335#[doc = " @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR. If both addresses are set, the MBR"]
16336#[doc = " will prioritize @ref MBR_PARAM_PAGE_ADDR. This page will be cleared by the MBR and is used to"]
16337#[doc = " store the command before reset. When an address is specified, the page it refers to must not be"]
16338#[doc = " used by the application. If no address is provided by the application, i.e. both"]
16339#[doc = " @ref MBR_PARAM_PAGE_ADDR and @ref MBR_UICR_PARAM_PAGE_ADDR is 0xFFFFFFFF, MBR commands which use"]
16340#[doc = " flash will be unavailable and return @ref NRF_ERROR_NO_MEM."]
16341#[doc = ""]
16342#[doc = " @param[in] param Pointer to a struct describing the command."]
16343#[doc = ""]
16344#[doc = " @note For a complete set of return values, see ::sd_mbr_command_copy_sd_t,"]
16345#[doc = " ::sd_mbr_command_copy_bl_t, ::sd_mbr_command_compare_t,"]
16346#[doc = " ::sd_mbr_command_vector_table_base_set_t, ::sd_mbr_command_irq_forward_address_set_t"]
16347#[doc = ""]
16348#[doc = " @retval ::NRF_ERROR_NO_MEM No MBR parameter page provided"]
16349#[doc = " @retval ::NRF_ERROR_INVALID_PARAM if an invalid command is given."]
16350#[inline(always)]
16351pub unsafe fn sd_mbr_command(param: *mut sd_mbr_command_t) -> u32 {
16352 let ret: u32;
16353 core::arch::asm!("svc 24",
16354 inout("r0") to_asm(param) => ret,
16355 lateout("r1") _,
16356 lateout("r2") _,
16357 lateout("r3") _,
16358 lateout("r12") _,
16359 );
16360 ret
16361}
16362
16363#[doc = "< ::sd_softdevice_enable"]
16364pub const NRF_SD_SVCS_SD_SOFTDEVICE_ENABLE: NRF_SD_SVCS = 16;
16365#[doc = "< ::sd_softdevice_disable"]
16366pub const NRF_SD_SVCS_SD_SOFTDEVICE_DISABLE: NRF_SD_SVCS = 17;
16367#[doc = "< ::sd_softdevice_is_enabled"]
16368pub const NRF_SD_SVCS_SD_SOFTDEVICE_IS_ENABLED: NRF_SD_SVCS = 18;
16369#[doc = "< ::sd_softdevice_vector_table_base_set"]
16370pub const NRF_SD_SVCS_SD_SOFTDEVICE_VECTOR_TABLE_BASE_SET: NRF_SD_SVCS = 19;
16371#[doc = "< Placeholder for last SDM SVC"]
16372pub const NRF_SD_SVCS_SVC_SDM_LAST: NRF_SD_SVCS = 20;
16373#[doc = "@brief nRF SoftDevice Manager API SVC numbers."]
16374pub type NRF_SD_SVCS = self::c_uint;
16375#[doc = "@brief Type representing LFCLK oscillator source."]
16376#[repr(C)]
16377#[derive(Debug, Copy, Clone)]
16378pub struct nrf_clock_lf_cfg_t {
16379 #[doc = "< LF oscillator clock source, see @ref NRF_CLOCK_LF_SRC."]
16380 pub source: u8,
16381 #[doc = "< Only for ::NRF_CLOCK_LF_SRC_RC: Calibration timer interval in 1/4 second"]
16382 #[doc = "units (nRF52: 1-32)."]
16383 #[doc = "@note To avoid excessive clock drift, 0.5 degrees Celsius is the"]
16384 #[doc = "maximum temperature change allowed in one calibration timer"]
16385 #[doc = "interval. The interval should be selected to ensure this."]
16386 #[doc = ""]
16387 #[doc = "@note Must be 0 if source is not ::NRF_CLOCK_LF_SRC_RC."]
16388 pub rc_ctiv: u8,
16389 #[doc = "< Only for ::NRF_CLOCK_LF_SRC_RC: How often (in number of calibration"]
16390 #[doc = "intervals) the RC oscillator shall be calibrated if the temperature"]
16391 #[doc = "hasn't changed."]
16392 #[doc = "0: Always calibrate even if the temperature hasn't changed."]
16393 #[doc = "1: Only calibrate if the temperature has changed (legacy - nRF51 only)."]
16394 #[doc = "2-33: Check the temperature and only calibrate if it has changed,"]
16395 #[doc = "however calibration will take place every rc_temp_ctiv"]
16396 #[doc = "intervals in any case."]
16397 #[doc = ""]
16398 #[doc = "@note Must be 0 if source is not ::NRF_CLOCK_LF_SRC_RC."]
16399 #[doc = ""]
16400 #[doc = "@note For nRF52, the application must ensure calibration at least once"]
16401 #[doc = "every 8 seconds to ensure +/-500 ppm clock stability. The"]
16402 #[doc = "recommended configuration for ::NRF_CLOCK_LF_SRC_RC on nRF52 is"]
16403 #[doc = "rc_ctiv=16 and rc_temp_ctiv=2. This will ensure calibration at"]
16404 #[doc = "least once every 8 seconds and for temperature changes of 0.5"]
16405 #[doc = "degrees Celsius every 4 seconds. See the Product Specification"]
16406 #[doc = "for the nRF52 device being used for more information."]
16407 pub rc_temp_ctiv: u8,
16408 #[doc = "< External clock accuracy used in the LL to compute timing"]
16409 #[doc = "windows, see @ref NRF_CLOCK_LF_ACCURACY."]
16410 pub accuracy: u8,
16411}
16412#[test]
16413fn bindgen_test_layout_nrf_clock_lf_cfg_t() {
16414 assert_eq!(
16415 ::core::mem::size_of::<nrf_clock_lf_cfg_t>(),
16416 4usize,
16417 concat!("Size of: ", stringify!(nrf_clock_lf_cfg_t))
16418 );
16419 assert_eq!(
16420 ::core::mem::align_of::<nrf_clock_lf_cfg_t>(),
16421 1usize,
16422 concat!("Alignment of ", stringify!(nrf_clock_lf_cfg_t))
16423 );
16424 assert_eq!(
16425 unsafe { &(*(::core::ptr::null::<nrf_clock_lf_cfg_t>())).source as *const _ as usize },
16426 0usize,
16427 concat!(
16428 "Offset of field: ",
16429 stringify!(nrf_clock_lf_cfg_t),
16430 "::",
16431 stringify!(source)
16432 )
16433 );
16434 assert_eq!(
16435 unsafe { &(*(::core::ptr::null::<nrf_clock_lf_cfg_t>())).rc_ctiv as *const _ as usize },
16436 1usize,
16437 concat!(
16438 "Offset of field: ",
16439 stringify!(nrf_clock_lf_cfg_t),
16440 "::",
16441 stringify!(rc_ctiv)
16442 )
16443 );
16444 assert_eq!(
16445 unsafe { &(*(::core::ptr::null::<nrf_clock_lf_cfg_t>())).rc_temp_ctiv as *const _ as usize },
16446 2usize,
16447 concat!(
16448 "Offset of field: ",
16449 stringify!(nrf_clock_lf_cfg_t),
16450 "::",
16451 stringify!(rc_temp_ctiv)
16452 )
16453 );
16454 assert_eq!(
16455 unsafe { &(*(::core::ptr::null::<nrf_clock_lf_cfg_t>())).accuracy as *const _ as usize },
16456 3usize,
16457 concat!(
16458 "Offset of field: ",
16459 stringify!(nrf_clock_lf_cfg_t),
16460 "::",
16461 stringify!(accuracy)
16462 )
16463 );
16464}
16465#[doc = "@brief Fault Handler type."]
16466#[doc = ""]
16467#[doc = " When certain unrecoverable errors occur within the application or SoftDevice the fault handler will be called back."]
16468#[doc = " The protocol stack will be in an undefined state when this happens and the only way to recover will be to"]
16469#[doc = " perform a reset, using e.g. CMSIS NVIC_SystemReset()."]
16470#[doc = " If the application returns from the fault handler the SoftDevice will call NVIC_SystemReset()."]
16471#[doc = ""]
16472#[doc = " @note It is recommended to either perform a reset in the fault handler or to let the SoftDevice reset the device."]
16473#[doc = " Otherwise SoC peripherals may behave in an undefined way. For example, the RADIO peripherial may"]
16474#[doc = " continously transmit packets."]
16475#[doc = ""]
16476#[doc = " @note This callback is executed in HardFault context, thus SVC functions cannot be called from the fault callback."]
16477#[doc = ""]
16478#[doc = " @param[in] id Fault identifier. See @ref NRF_FAULT_IDS."]
16479#[doc = " @param[in] pc The program counter of the instruction that triggered the fault."]
16480#[doc = " @param[in] info Optional additional information regarding the fault. Refer to each Fault identifier for details."]
16481#[doc = ""]
16482#[doc = " @note When id is set to @ref NRF_FAULT_ID_APP_MEMACC, pc will contain the address of the instruction being executed at the time when"]
16483#[doc = " the fault is detected by the CPU. The CPU program counter may have advanced up to 2 instructions (no branching) after the one that triggered the fault."]
16484pub type nrf_fault_handler_t = ::core::option::Option<unsafe extern "C" fn(id: u32, pc: u32, info: u32)>;
16485
16486#[doc = "@brief Enables the SoftDevice and by extension the protocol stack."]
16487#[doc = ""]
16488#[doc = " @note Some care must be taken if a low frequency clock source is already running when calling this function:"]
16489#[doc = " If the LF clock has a different source then the one currently running, it will be stopped. Then, the new"]
16490#[doc = " clock source will be started."]
16491#[doc = ""]
16492#[doc = " @note This function has no effect when returning with an error."]
16493#[doc = ""]
16494#[doc = " @post If return code is ::NRF_SUCCESS"]
16495#[doc = " - SoC library and protocol stack APIs are made available."]
16496#[doc = " - A portion of RAM will be unavailable (see relevant SDS documentation)."]
16497#[doc = " - Some peripherals will be unavailable or available only through the SoC API (see relevant SDS documentation)."]
16498#[doc = " - Interrupts will not arrive from protected peripherals or interrupts."]
16499#[doc = " - nrf_nvic_ functions must be used instead of CMSIS NVIC_ functions for reliable usage of the SoftDevice."]
16500#[doc = " - Interrupt latency may be affected by the SoftDevice (see relevant SDS documentation)."]
16501#[doc = " - Chosen low frequency clock source will be running."]
16502#[doc = ""]
16503#[doc = " @param p_clock_lf_cfg Low frequency clock source and accuracy."]
16504#[doc = "If NULL the clock will be configured as an RC source with rc_ctiv = 16 and .rc_temp_ctiv = 2"]
16505#[doc = "In the case of XTAL source, the PPM accuracy of the chosen clock source must be greater than or equal to the actual characteristics of your XTAL clock."]
16506#[doc = " @param fault_handler Callback to be invoked in case of fault, cannot be NULL."]
16507#[doc = ""]
16508#[doc = " @retval ::NRF_SUCCESS"]
16509#[doc = " @retval ::NRF_ERROR_INVALID_ADDR Invalid or NULL pointer supplied."]
16510#[doc = " @retval ::NRF_ERROR_INVALID_STATE SoftDevice is already enabled, and the clock source and fault handler cannot be updated."]
16511#[doc = " @retval ::NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION SoftDevice interrupt is already enabled, or an enabled interrupt has an illegal priority level."]
16512#[doc = " @retval ::NRF_ERROR_SDM_LFCLK_SOURCE_UNKNOWN Unknown low frequency clock source selected."]
16513#[doc = " @retval ::NRF_ERROR_INVALID_PARAM Invalid clock source configuration supplied in p_clock_lf_cfg."]
16514#[inline(always)]
16515pub unsafe fn sd_softdevice_enable(
16516 p_clock_lf_cfg: *const nrf_clock_lf_cfg_t,
16517 fault_handler: nrf_fault_handler_t,
16518) -> u32 {
16519 let ret: u32;
16520 core::arch::asm!("svc 16",
16521 inout("r0") to_asm(p_clock_lf_cfg) => ret,
16522 inout("r1") to_asm(fault_handler) => _,
16523 lateout("r2") _,
16524 lateout("r3") _,
16525 lateout("r12") _,
16526 );
16527 ret
16528}
16529
16530#[doc = "@brief Disables the SoftDevice and by extension the protocol stack."]
16531#[doc = ""]
16532#[doc = " Idempotent function to disable the SoftDevice."]
16533#[doc = ""]
16534#[doc = " @post SoC library and protocol stack APIs are made unavailable."]
16535#[doc = " @post All interrupts that was protected by the SoftDevice will be disabled and initialized to priority 0 (highest)."]
16536#[doc = " @post All peripherals used by the SoftDevice will be reset to default values."]
16537#[doc = " @post All of RAM become available."]
16538#[doc = " @post All interrupts are forwarded to the application."]
16539#[doc = " @post LFCLK source chosen in ::sd_softdevice_enable will be left running."]
16540#[doc = ""]
16541#[doc = " @retval ::NRF_SUCCESS"]
16542#[inline(always)]
16543pub unsafe fn sd_softdevice_disable() -> u32 {
16544 let ret: u32;
16545 core::arch::asm!("svc 17",
16546 lateout("r0") ret,
16547 lateout("r1") _,
16548 lateout("r2") _,
16549 lateout("r3") _,
16550 lateout("r12") _,
16551 );
16552 ret
16553}
16554
16555#[doc = "@brief Check if the SoftDevice is enabled."]
16556#[doc = ""]
16557#[doc = " @param[out] p_softdevice_enabled If the SoftDevice is enabled: 1 else 0."]
16558#[doc = ""]
16559#[doc = " @retval ::NRF_SUCCESS"]
16560#[inline(always)]
16561pub unsafe fn sd_softdevice_is_enabled(p_softdevice_enabled: *mut u8) -> u32 {
16562 let ret: u32;
16563 core::arch::asm!("svc 18",
16564 inout("r0") to_asm(p_softdevice_enabled) => ret,
16565 lateout("r1") _,
16566 lateout("r2") _,
16567 lateout("r3") _,
16568 lateout("r12") _,
16569 );
16570 ret
16571}
16572
16573#[doc = "@brief Sets the base address of the interrupt vector table for interrupts forwarded from the SoftDevice"]
16574#[doc = ""]
16575#[doc = " This function is only intended to be called when a bootloader is enabled."]
16576#[doc = ""]
16577#[doc = " @param[in] address The base address of the interrupt vector table for forwarded interrupts."]
16578#[doc = ""]
16579#[doc = " @retval ::NRF_SUCCESS"]
16580#[inline(always)]
16581pub unsafe fn sd_softdevice_vector_table_base_set(address: u32) -> u32 {
16582 let ret: u32;
16583 core::arch::asm!("svc 19",
16584 inout("r0") to_asm(address) => ret,
16585 lateout("r1") _,
16586 lateout("r2") _,
16587 lateout("r3") _,
16588 lateout("r12") _,
16589 );
16590 ret
16591}