#[repr(C)]
#[derive(Default)]
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
impl<T> __IncompleteArrayField<T> {
#[inline]
pub const fn new() -> Self {
__IncompleteArrayField(::core::marker::PhantomData, [])
}
#[inline]
pub fn as_ptr(&self) -> *const T {
self as *const _ as *const T
}
#[inline]
pub fn as_mut_ptr(&mut self) -> *mut T {
self as *mut _ as *mut T
}
#[inline]
pub unsafe fn as_slice(&self, len: usize) -> &[T] {
::core::slice::from_raw_parts(self.as_ptr(), len)
}
#[inline]
pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
}
}
impl<T> ::core::fmt::Debug for __IncompleteArrayField<T> {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.write_str("__IncompleteArrayField")
}
}
pub const BSD_MAX_SOCKET_COUNT: u32 = 8;
pub const BSD_AT_MAX_CMD_SIZE: u32 = 4096;
pub const BSD_IP_MAX_MESSAGE_SIZE: u32 = 4096;
pub const BSD_TLS_MAX_MESSAGE_SIZE: u32 = 2048;
pub const BSD_MAX_PDN_COUNT: u32 = 10;
pub const BSD_OS_NO_WAIT: u32 = 0;
pub const BSD_OS_FOREVER: i32 = -1;
pub const BSD_VERSION_MAJOR_NUMBER: u32 = 1;
pub const BSD_VERSION_MINOR_NUMBER: u32 = 0;
pub const BSD_RESERVED_MEMORY_ADDRESS: u32 = 536936448;
pub const BSD_RESERVED_MEMORY_SIZE: u32 = 49184;
pub const BSD_RESERVED_MEMORY_SIZE_TRACE_DISABLED: u32 = 32800;
pub const BSD_NETWORK_IRQ_PRIORITY: u32 = 0;
pub const BSD_APPLICATION_IRQ_PRIORITY: u32 = 6;
pub const NRF_EPERM: u32 = 1;
pub const NRF_ENOENT: u32 = 2;
pub const NRF_EIO: u32 = 5;
pub const NRF_ENOEXEC: u32 = 8;
pub const NRF_EBADF: u32 = 9;
pub const NRF_ENOMEM: u32 = 12;
pub const NRF_EACCES: u32 = 13;
pub const NRF_EFAULT: u32 = 14;
pub const NRF_EINVAL: u32 = 22;
pub const NRF_EMFILE: u32 = 24;
pub const NRF_ENOSPC: u32 = 28;
pub const NRF_EAGAIN: u32 = 35;
pub const NRF_EDOM: u32 = 37;
pub const NRF_EMSGSIZE: u32 = 40;
pub const NRF_EPROTOTYPE: u32 = 41;
pub const NRF_ENOPROTOOPT: u32 = 42;
pub const NRF_EPROTONOSUPPORT: u32 = 43;
pub const NRF_ESOCKTNOSUPPORT: u32 = 44;
pub const NRF_EOPNOTSUPP: u32 = 45;
pub const NRF_EAFNOSUPPORT: u32 = 47;
pub const NRF_EADDRINUSE: u32 = 48;
pub const NRF_ENETDOWN: u32 = 50;
pub const NRF_ENETUNREACH: u32 = 51;
pub const NRF_ENETRESET: u32 = 52;
pub const NRF_ECONNABORTED: u32 = 53;
pub const NRF_ECONNRESET: u32 = 54;
pub const NRF_EISCONN: u32 = 56;
pub const NRF_ENOTCONN: u32 = 57;
pub const NRF_ETIMEDOUT: u32 = 60;
pub const NRF_ENOBUFS: u32 = 105;
pub const NRF_EHOSTDOWN: u32 = 112;
pub const NRF_EALREADY: u32 = 114;
pub const NRF_EINPROGRESS: u32 = 115;
pub const NRF_ECANCELED: u32 = 125;
pub const NRF_ENOKEY: u32 = 126;
pub const NRF_EKEYEXPIRED: u32 = 127;
pub const NRF_EKEYREVOKED: u32 = 128;
pub const NRF_EKEYREJECTED: u32 = 129;
pub const NRF_INET_ADDRSTRLEN: u32 = 16;
pub const NRF_INET6_ADDRSTRLEN: u32 = 46;
pub const NRF_PDN_MAX_USERNAME_LEN: u32 = 100;
pub const NRF_PDN_MAX_PASSWORD_LEN: u32 = 100;
pub const NRF_AF_LOCAL: u32 = 1;
pub const NRF_AF_INET: u32 = 2;
pub const NRF_AF_PACKET: u32 = 5;
pub const NRF_AF_INET6: u32 = 10;
pub const NRF_AF_LTE: u32 = 102;
pub const NRF_SOCK_STREAM: u32 = 1;
pub const NRF_SOCK_DGRAM: u32 = 2;
pub const NRF_SOCK_RAW: u32 = 3;
pub const NRF_SOCK_MGMT: u32 = 512;
pub const NRF_IPPROTO_TCP: u32 = 1;
pub const NRF_IPPROTO_UDP: u32 = 2;
pub const NRF_SPROTO_TLS1v2: u32 = 260;
pub const NRF_SPROTO_TLS1v3: u32 = 261;
pub const NRF_SPROTO_DTLS1v2: u32 = 270;
pub const NRF_PROTO_AT: u32 = 513;
pub const NRF_PROTO_PDN: u32 = 514;
pub const NRF_PROTO_DFU: u32 = 515;
pub const NRF_PROTO_GNSS: u32 = 516;
pub const NRF_SO_SEC_ROLE: u32 = 1;
pub const NRF_SO_SEC_TAG_LIST: u32 = 2;
pub const NRF_SO_SEC_SESSION_CACHE: u32 = 3;
pub const NRF_SO_SEC_PEER_VERIFY: u32 = 4;
pub const NRF_SO_HOSTNAME: u32 = 5;
pub const NRF_SO_CIPHERSUITE_LIST: u32 = 6;
pub const NRF_SO_CIPHER_IN_USE: u32 = 7;
pub const NRF_SO_PDN_AF: u32 = 1;
pub const NRF_SO_PDN_CONTEXT_ID: u32 = 2;
pub const NRF_SO_PDN_STATE: u32 = 3;
pub const NRF_SO_PDN_AUTH: u32 = 4;
pub const NRF_SO_DFU_FW_VERSION: u32 = 1;
pub const NRF_SO_DFU_RESOURCES: u32 = 2;
pub const NRF_SO_DFU_TIMEO: u32 = 3;
pub const NRF_SO_DFU_APPLY: u32 = 4;
pub const NRF_SO_DFU_REVERT: u32 = 5;
pub const NRF_SO_DFU_BACKUP_DELETE: u32 = 6;
pub const NRF_SO_DFU_OFFSET: u32 = 7;
pub const NRF_SO_DFU_ERROR: u32 = 20;
pub const NRF_SO_GNSS_FIX_INTERVAL: u32 = 1;
pub const NRF_SO_GNSS_FIX_RETRY: u32 = 2;
pub const NRF_SO_GNSS_SYSTEM: u32 = 3;
pub const NRF_SO_GNSS_NMEA_MASK: u32 = 4;
pub const NRF_SO_GNSS_ELEVATION_MASK: u32 = 5;
pub const NRF_SO_GNSS_USE_CASE: u32 = 6;
pub const NRF_SO_GNSS_START: u32 = 7;
pub const NRF_SO_GNSS_STOP: u32 = 8;
pub const NRF_SO_GNSS_POWER_SAVE_MODE: u32 = 9;
pub const NRF_SO_GNSS_ENABLE_PRIORITY: u32 = 10;
pub const NRF_SO_GNSS_DISABLE_PRIORITY: u32 = 11;
pub const NRF_GNSS_NMEA_GGA_MASK: u32 = 1;
pub const NRF_GNSS_NMEA_GLL_MASK: u32 = 2;
pub const NRF_GNSS_NMEA_GSA_MASK: u32 = 4;
pub const NRF_GNSS_NMEA_GSV_MASK: u32 = 8;
pub const NRF_GNSS_NMEA_RMC_MASK: u32 = 16;
pub const NRF_GNSS_PSM_DISABLED: u32 = 0;
pub const NRF_GNSS_PSM_DUTY_CYCLING_PERFORMANCE: u32 = 1;
pub const NRF_GNSS_PSM_DUTY_CYCLING_POWER: u32 = 2;
pub const NRF_GNSS_USE_CASE_SINGLE_COLD_START: u32 = 0;
pub const NRF_GNSS_USE_CASE_MULTIPLE_HOT_START: u32 = 1;
pub const NRF_GNSS_USE_CASE_NORMAL_ACCURACY: u32 = 0;
pub const NRF_GNSS_USE_CASE_LOW_ACCURACY: u32 = 2;
pub const NRF_GNSS_PVT_FLAG_FIX_VALID_BIT: u32 = 1;
pub const NRF_GNSS_PVT_FLAG_LEAP_SECOND_VALID: u32 = 2;
pub const NRF_GNSS_PVT_FLAG_SLEEP_BETWEEN_PVT: u32 = 4;
pub const NRF_GNSS_PVT_FLAG_DEADLINE_MISSED: u32 = 8;
pub const NRF_GNSS_PVT_FLAG_NOT_ENOUGH_WINDOW_TIME: u32 = 16;
pub const NRF_GNSS_SV_FLAG_USED_IN_FIX: u32 = 2;
pub const NRF_GNSS_SV_FLAG_UNHEALTHY: u32 = 8;
pub const NRF_GNSS_AGPS_UTC_PARAMETERS: u32 = 1;
pub const NRF_GNSS_AGPS_EPHEMERIDES: u32 = 2;
pub const NRF_GNSS_AGPS_ALMANAC: u32 = 3;
pub const NRF_GNSS_AGPS_KLOBUCHAR_IONOSPHERIC_CORRECTION: u32 = 4;
pub const NRF_GNSS_AGPS_NEQUICK_IONOSPHERIC_CORRECTION: u32 = 5;
pub const NRF_GNSS_AGPS_GPS_SYSTEM_CLOCK_AND_TOWS: u32 = 6;
pub const NRF_GNSS_AGPS_LOCATION: u32 = 7;
pub const NRF_GNSS_AGPS_INTEGRITY: u32 = 8;
pub const NRF_SO_ERROR: u32 = 4;
pub const NRF_SO_RCVTIMEO: u32 = 20;
pub const NRF_SO_SNDTIMEO: u32 = 21;
pub const NRF_SO_BINDTODEVICE: u32 = 25;
pub const NRF_SO_SILENCE_ALL: u32 = 30;
pub const NRF_SO_SILENCE_IP_ECHO_REPLY: u32 = 31;
pub const NRF_SO_SILENCE_IPV6_ECHO_REPLY: u32 = 32;
pub const NRF_SO_REUSEADDR: u32 = 40;
pub const NRF_SOL_SOCKET: u32 = 1;
pub const NRF_SOL_SECURE: u32 = 282;
pub const NRF_SOL_PDN: u32 = 514;
pub const NRF_SOL_DFU: u32 = 515;
pub const NRF_SOL_GNSS: u32 = 516;
pub const NRF_MSG_DONTROUTE: u32 = 1;
pub const NRF_MSG_DONTWAIT: u32 = 2;
pub const NRF_MSG_OOB: u32 = 4;
pub const NRF_MSG_PEEK: u32 = 8;
pub const NRF_MSG_WAITALL: u32 = 16;
pub const NRF_MSG_TRUNC: u32 = 32;
pub const NRF_F_SETFL: u32 = 1;
pub const NRF_F_GETFL: u32 = 2;
pub const NRF_O_NONBLOCK: u32 = 1;
pub const NRF_IFNAMSIZ: u32 = 64;
pub const NRF_GNSS_MAX_SATELLITES: u32 = 12;
pub const NRF_GNSS_NMEA_MAX_LEN: u32 = 83;
pub const NRF_GNSS_AGPS_GPS_UTC_REQUEST: u32 = 0;
pub const NRF_GNSS_AGPS_KLOBUCHAR_REQUEST: u32 = 1;
pub const NRF_GNSS_AGPS_NEQUICK_REQUEST: u32 = 2;
pub const NRF_GNSS_AGPS_SYS_TIME_AND_SV_TOW_REQUEST: u32 = 3;
pub const NRF_GNSS_AGPS_POSITION_REQUEST: u32 = 4;
pub const NRF_GNSS_AGPS_INTEGRITY_REQUEST: u32 = 5;
pub const NRF_GNSS_PVT_DATA_ID: u32 = 1;
pub const NRF_GNSS_NMEA_DATA_ID: u32 = 2;
pub const NRF_GNSS_AGPS_DATA_ID: u32 = 3;
pub const NRF_GNSS_AGPS_MAX_SV_TOW: u32 = 32;
pub const NRF_POLLIN: u32 = 1;
pub const NRF_POLLOUT: u32 = 2;
pub const NRF_POLLERR: u32 = 4;
pub const NRF_POLLHUP: u32 = 8;
pub const NRF_POLLNVAL: u32 = 16;
pub const NRF_CC3XX_PLATFORM_ENTROPY_MAX_GATHER: u32 = 144;
pub const NRF_CC3XX_PLATFORM_USE_COUNT_MAX: u32 = 10;
pub const NRF_CC3XX_PLATFORM_SUCCESS: u32 = 0;
pub const NRF_CC3XX_PLATFORM_ERROR_PARAM_NULL: i32 = -28673;
pub const NRF_CC3XX_PLATFORM_ERROR_INTERNAL: i32 = -28674;
pub const NRF_CC3XX_PLATFORM_ERROR_RNG_TEST_FAILED: i32 = -28675;
pub const NRF_CC3XX_PLATFORM_ERROR_HW_VERSION_FAILED: i32 = -28676;
pub const NRF_CC3XX_PLATFORM_ERROR_PARAM_WRITE_FAILED: i32 = -28677;
pub const NRF_CC3XX_PLATFORM_ERROR_MUTEX_NOT_INITIALIZED: i32 = -28694;
pub const NRF_CC3XX_PLATFORM_ERROR_MUTEX_FAILED: i32 = -28695;
pub const NRF_CC3XX_PLATFORM_ERROR_ENTROPY_NOT_INITIALIZED: i32 = -28696;
pub const NRF_CC3XX_PLATFORM_ERROR_ENTROPY_TRNG_TOO_LONG: i32 = -28697;
pub const NRF_CC3XX_PLATFORM_ERROR_KMU_INVALID_SLOT: i32 = -28698;
pub const NRF_CC3XX_PLATFORM_ERROR_KMU_ALREADY_FILLED: i32 = -28699;
pub const NRF_CC3XX_PLATFORM_ERROR_KMU_WRONG_ADDRESS: i32 = -28700;
pub const NRF_CC3XX_PLATFORM_ERROR_KMU_WRITE_KEY_FAILED: i32 = -28701;
pub const NRF_CC3XX_PLATFORM_ERROR_KMU_WRITE_INVALID_PERM: i32 = -28702;
pub const NRF_CC3XX_PLATFORM_ERROR_KDR_INVALID_WRITE: i32 = -28703;
pub const NRF_CC3XX_PLATFORM_ERROR_KDR_INVALID_PUSH: i32 = -28704;
pub const NRF_CC3XX_PLATFORM_MUTEX_MASK_INVALID: u32 = 0;
pub const NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID: u32 = 1;
pub const NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_ALLOCATED: u32 = 2;
pub const NRF_CC310_PLATFORM_ENTROPY_MAX_GATHER: u32 = 144;
pub const NRF_CC310_PLATFORM_USE_COUNT_MAX: u32 = 10;
pub const NRF_CC310_PLATFORM_SUCCESS: u32 = 0;
pub const NRF_CC310_PLATFORM_ERROR_PARAM_NULL: i32 = -28673;
pub const NRF_CC310_PLATFORM_ERROR_INTERNAL: i32 = -28674;
pub const NRF_CC310_PLATFORM_ERROR_RNG_TEST_FAILED: i32 = -28675;
pub const NRF_CC310_PLATFORM_ERROR_HW_VERSION_FAILED: i32 = -28676;
pub const NRF_CC310_PLATFORM_ERROR_PARAM_WRITE_FAILED: i32 = -28677;
pub const NRF_CC310_PLATFORM_ERROR_MUTEX_NOT_INITIALIZED: i32 = -28694;
pub const NRF_CC310_PLATFORM_ERROR_MUTEX_FAILED: i32 = -28695;
pub const NRF_CC310_PLATFORM_ERROR_ENTROPY_NOT_INITIALIZED: i32 = -28696;
pub const NRF_CC310_PLATFORM_ERROR_ENTROPY_TRNG_TOO_LONG: i32 = -28697;
pub const NRF_CC310_PLATFORM_MUTEX_MASK_INVALID: u32 = 0;
pub const NRF_CC310_PLATFORM_MUTEX_MASK_IS_VALID: u32 = 1;
pub const NRF_CC310_PLATFORM_MUTEX_MASK_IS_ALLOCATED: u32 = 2;
pub type bool_ = bool;
#[doc = " Structure for bsd library initialization parameters."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct bsd_init_params_t {
#[doc = "< Indicates the traces are in use."]
pub trace_on: bool_,
#[doc = "< Defines the bsd library memory address."]
pub bsd_memory_address: u32,
#[doc = "< Defines the bsd library memory size."]
pub bsd_memory_size: u32,
}
#[test]
fn bindgen_test_layout_bsd_init_params_t() {
assert_eq!(
::core::mem::size_of::<bsd_init_params_t>(),
12usize,
concat!("Size of: ", stringify!(bsd_init_params_t))
);
assert_eq!(
::core::mem::align_of::<bsd_init_params_t>(),
4usize,
concat!("Alignment of ", stringify!(bsd_init_params_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<bsd_init_params_t>())).trace_on as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(bsd_init_params_t),
"::",
stringify!(trace_on)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<bsd_init_params_t>())).bsd_memory_address as *const _ as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(bsd_init_params_t),
"::",
stringify!(bsd_memory_address)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<bsd_init_params_t>())).bsd_memory_size as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(bsd_init_params_t),
"::",
stringify!(bsd_memory_size)
)
);
}
extern "C" {
#[doc = " Initialize the library."]
#[doc = ""]
#[doc = " Once initialized, the library uses the resources defined in bsd_platform.h."]
#[doc = ""]
#[doc = " * `p_init_params` - Parameters to initialize bsd library."]
#[doc = " Cannot be NULL."]
#[doc = ""]
#[doc = " Returns Zero on success."]
#[doc = " Returns A positive value from @ref bsd_modem_dfu when executing"]
#[doc = " Modem firmware updates."]
#[doc = ""]
#[doc = " Returns -1 on error."]
pub fn bsd_init(p_init_params: *const bsd_init_params_t) -> ctypes::c_int;
}
extern "C" {
#[doc = " Shutdown the library."]
#[doc = ""]
#[doc = " Resources reserved by the library in bsd_platform.h are freed when"]
#[doc = " the library is shutdown."]
#[doc = ""]
#[doc = " Returns Zero on success."]
#[doc = " Returns -1 on error."]
pub fn bsd_shutdown() -> ctypes::c_int;
}
extern "C" {
#[doc = " Handler for BSD library errors."]
#[doc = ""]
#[doc = " * `error` - The error reason."]
pub fn bsd_recoverable_error_handler(error: u32);
}
extern "C" {
pub fn bsd_os_init();
}
extern "C" {
pub fn bsd_os_timedwait(context: u32, p_timeout: *mut i32) -> i32;
}
extern "C" {
pub fn bsd_os_errno_set(errno_val: ctypes::c_int);
}
extern "C" {
pub fn bsd_os_application_irq_clear();
}
extern "C" {
pub fn bsd_os_application_irq_set();
}
extern "C" {
pub fn bsd_os_trace_irq_set();
}
extern "C" {
pub fn bsd_os_trace_irq_clear();
}
extern "C" {
pub fn bsd_os_trace_put(p_buffer: *const u8, buf_len: u32) -> i32;
}
extern "C" {
pub fn bsd_os_application_irq_handler();
}
extern "C" {
pub fn bsd_os_trace_irq_handler();
}
pub type size_t = u32;
pub type ssize_t = i32;
#[doc = " @defgroup nrf_fd_set_api Descriptor sets API"]
#[doc = " Types and macros used to manipulate the input data argument to the nrf_select() function."]
#[doc = " s File descriptor sets are used as input to the nrf_select() function for doing I/O"]
#[doc = " multiplexing. The maximum number of descriptors contained in a set is defined by"]
#[doc = " NRF_FD_SETSIZE."]
#[doc = ""]
#[doc = " @{"]
pub type nrf_fd_set = u32;
#[doc = " Socket port type."]
pub type nrf_in_port_t = u16;
#[doc = " Structure specifying time interval."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_timeval {
#[doc = "< Time interval seconds."]
pub tv_sec: u32,
#[doc = "< Time interval microseconds."]
pub tv_usec: u32,
}
#[test]
fn bindgen_test_layout_nrf_timeval() {
assert_eq!(
::core::mem::size_of::<nrf_timeval>(),
8usize,
concat!("Size of: ", stringify!(nrf_timeval))
);
assert_eq!(
::core::mem::align_of::<nrf_timeval>(),
4usize,
concat!("Alignment of ", stringify!(nrf_timeval))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_timeval>())).tv_sec as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_timeval),
"::",
stringify!(tv_sec)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_timeval>())).tv_usec as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_timeval),
"::",
stringify!(tv_usec)
)
);
}
#[doc = " Socket families."]
#[doc = ""]
#[doc = " s For a list of valid values, refer to nrf_socket_families."]
pub type nrf_socket_family_t = ctypes::c_int;
pub type nrf_sa_family_t = nrf_socket_family_t;
#[doc = " IPv6 address."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_in6_addr {
pub s6_addr: [u8; 16usize],
}
#[test]
fn bindgen_test_layout_nrf_in6_addr() {
assert_eq!(
::core::mem::size_of::<nrf_in6_addr>(),
16usize,
concat!("Size of: ", stringify!(nrf_in6_addr))
);
assert_eq!(
::core::mem::align_of::<nrf_in6_addr>(),
1usize,
concat!("Alignment of ", stringify!(nrf_in6_addr))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_in6_addr>())).s6_addr as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_in6_addr),
"::",
stringify!(s6_addr)
)
);
}
#[doc = " IPv4 address."]
pub type nrf_in_addr_t = u32;
#[doc = " IPv4 address structure."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_in_addr {
pub s_addr: nrf_in_addr_t,
}
#[test]
fn bindgen_test_layout_nrf_in_addr() {
assert_eq!(
::core::mem::size_of::<nrf_in_addr>(),
4usize,
concat!("Size of: ", stringify!(nrf_in_addr))
);
assert_eq!(
::core::mem::align_of::<nrf_in_addr>(),
4usize,
concat!("Alignment of ", stringify!(nrf_in_addr))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_in_addr>())).s_addr as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_in_addr),
"::",
stringify!(s_addr)
)
);
}
#[doc = " Address record for IPv6 addresses."]
#[doc = ""]
#[doc = " s Contains the address and port of the host, as well as other socket options. All fields"]
#[doc = " in this structure are compatible with the POSIX variant for API compatibility."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_sockaddr_in6 {
#[doc = "< Length of this data structure."]
pub sin6_len: u8,
#[doc = "< Socket family."]
pub sin6_family: nrf_sa_family_t,
#[doc = "< Port, in network byte order."]
pub sin6_port: nrf_in_port_t,
#[doc = "< IPv6 flow info parameters. Not used."]
pub sin6_flowinfo: u32,
#[doc = "< IPv6 address."]
pub sin6_addr: nrf_in6_addr,
#[doc = "< IPv6 scope ID. Not used."]
pub sin6_scope_id: u32,
}
#[test]
fn bindgen_test_layout_nrf_sockaddr_in6() {
assert_eq!(
::core::mem::size_of::<nrf_sockaddr_in6>(),
36usize,
concat!("Size of: ", stringify!(nrf_sockaddr_in6))
);
assert_eq!(
::core::mem::align_of::<nrf_sockaddr_in6>(),
4usize,
concat!("Alignment of ", stringify!(nrf_sockaddr_in6))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_sockaddr_in6>())).sin6_len as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_sockaddr_in6),
"::",
stringify!(sin6_len)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_sockaddr_in6>())).sin6_family as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_sockaddr_in6),
"::",
stringify!(sin6_family)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_sockaddr_in6>())).sin6_port as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(nrf_sockaddr_in6),
"::",
stringify!(sin6_port)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_sockaddr_in6>())).sin6_flowinfo as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(nrf_sockaddr_in6),
"::",
stringify!(sin6_flowinfo)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_sockaddr_in6>())).sin6_addr as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(nrf_sockaddr_in6),
"::",
stringify!(sin6_addr)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_sockaddr_in6>())).sin6_scope_id as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(nrf_sockaddr_in6),
"::",
stringify!(sin6_scope_id)
)
);
}
#[doc = " Address record for IPv4 addresses."]
#[doc = ""]
#[doc = " s Contains the address and port of the host. All fields"]
#[doc = " in this structure are compatible with the POSIX variant for API compatibility."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_sockaddr_in {
#[doc = "< Length of this data structure."]
pub sin_len: u8,
#[doc = "< Socket family."]
pub sin_family: nrf_sa_family_t,
#[doc = "< Port, in network byte order."]
pub sin_port: nrf_in_port_t,
#[doc = "< IPv4 address."]
pub sin_addr: nrf_in_addr,
}
#[test]
fn bindgen_test_layout_nrf_sockaddr_in() {
assert_eq!(
::core::mem::size_of::<nrf_sockaddr_in>(),
16usize,
concat!("Size of: ", stringify!(nrf_sockaddr_in))
);
assert_eq!(
::core::mem::align_of::<nrf_sockaddr_in>(),
4usize,
concat!("Alignment of ", stringify!(nrf_sockaddr_in))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_sockaddr_in>())).sin_len as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_sockaddr_in),
"::",
stringify!(sin_len)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_sockaddr_in>())).sin_family as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_sockaddr_in),
"::",
stringify!(sin_family)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_sockaddr_in>())).sin_port as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(nrf_sockaddr_in),
"::",
stringify!(sin_port)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_sockaddr_in>())).sin_addr as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(nrf_sockaddr_in),
"::",
stringify!(sin_addr)
)
);
}
pub type nrf_sockaddr_t = nrf_sockaddr;
pub type nrf_sockaddr_in6_t = nrf_sockaddr_in6;
pub type nrf_in6_addr_t = nrf_in6_addr;
pub type nrf_sockaddr_in_t = nrf_sockaddr_in;
#[doc = " Socket module size type."]
pub type nrf_socklen_t = u32;
#[doc = " Generic socket address."]
#[doc = ""]
#[doc = " s Only provided for API compatibility."]
#[repr(C)]
#[derive(Debug)]
pub struct nrf_sockaddr {
#[doc = "< Socket address length"]
pub sa_len: u8,
#[doc = "< Socket address family"]
pub sa_family: ctypes::c_int,
#[doc = "< Socket address"]
pub sa_data: __IncompleteArrayField<ctypes::c_char>,
}
#[test]
fn bindgen_test_layout_nrf_sockaddr() {
assert_eq!(
::core::mem::size_of::<nrf_sockaddr>(),
8usize,
concat!("Size of: ", stringify!(nrf_sockaddr))
);
assert_eq!(
::core::mem::align_of::<nrf_sockaddr>(),
4usize,
concat!("Alignment of ", stringify!(nrf_sockaddr))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_sockaddr>())).sa_len as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_sockaddr),
"::",
stringify!(sa_len)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_sockaddr>())).sa_family as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_sockaddr),
"::",
stringify!(sa_family)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_sockaddr>())).sa_data as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(nrf_sockaddr),
"::",
stringify!(sa_data)
)
);
}
#[doc = " Address information."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_addrinfo {
#[doc = "< Input flags."]
pub ai_flags: ctypes::c_int,
#[doc = "< Address family of the socket."]
pub ai_family: ctypes::c_int,
#[doc = "< Socket type."]
pub ai_socktype: ctypes::c_int,
#[doc = "< Protocol of the socket."]
pub ai_protocol: ctypes::c_int,
#[doc = "< Length of the socket address."]
pub ai_addrlen: nrf_socklen_t,
#[doc = "< Address of the socket."]
pub ai_addr: *mut nrf_sockaddr,
#[doc = "< Canonical name of service location."]
pub ai_canonname: *mut ctypes::c_char,
#[doc = "< Pointer to next in list."]
pub ai_next: *mut nrf_addrinfo,
}
#[test]
fn bindgen_test_layout_nrf_addrinfo() {
assert_eq!(
::core::mem::size_of::<nrf_addrinfo>(),
32usize,
concat!("Size of: ", stringify!(nrf_addrinfo))
);
assert_eq!(
::core::mem::align_of::<nrf_addrinfo>(),
4usize,
concat!("Alignment of ", stringify!(nrf_addrinfo))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_addrinfo>())).ai_flags as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_addrinfo),
"::",
stringify!(ai_flags)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_addrinfo>())).ai_family as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_addrinfo),
"::",
stringify!(ai_family)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_addrinfo>())).ai_socktype as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(nrf_addrinfo),
"::",
stringify!(ai_socktype)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_addrinfo>())).ai_protocol as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(nrf_addrinfo),
"::",
stringify!(ai_protocol)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_addrinfo>())).ai_addrlen as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(nrf_addrinfo),
"::",
stringify!(ai_addrlen)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_addrinfo>())).ai_addr as *const _ as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(nrf_addrinfo),
"::",
stringify!(ai_addr)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_addrinfo>())).ai_canonname as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(nrf_addrinfo),
"::",
stringify!(ai_canonname)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_addrinfo>())).ai_next as *const _ as usize },
28usize,
concat!(
"Offset of field: ",
stringify!(nrf_addrinfo),
"::",
stringify!(ai_next)
)
);
}
#[doc = ""]
#[doc = " TLS role for the connection."]
#[doc = " - 0 - TLS client role."]
#[doc = " - 1 - TLS server role."]
pub type nrf_sec_role_t = u32;
#[doc = ""]
#[doc = " Security tags used on the TLS socket."]
#[doc = ""]
#[doc = " More than one security tags may be used on a socket."]
#[doc = " If more than one tag is used on the socket, pass an array of security tags."]
#[doc = ""]
#[doc = " A maximum of 8 tags can be set per socket."]
pub type nrf_sec_tag_t = u32;
#[doc = ""]
#[doc = " Session cache configuration for the TLS connection."]
#[doc = " - 0 - Disabled."]
#[doc = " - 1 - Enabled."]
#[doc = ""]
#[doc = " By default, the session cache is enabled."]
#[doc = " @note Session cache, may not be used if the peer does not support it."]
pub type nrf_sec_session_cache_t = u8;
#[doc = ""]
#[doc = " Peer verification level for the TLS connection."]
#[doc = " - 0 - None."]
#[doc = " - 1 - Optional."]
#[doc = " - 2 - Required."]
#[doc = ""]
#[doc = " By default, peer verification is optional."]
pub type nrf_sec_peer_verify_t = u32;
#[doc = ""]
#[doc = " A IANA cipher suite identifier."]
pub type nrf_sec_cipher_t = u32;
#[doc = " Data type to combine all security configuration parameters."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_sec_config_t {
#[doc = "< Local role to be played. See nrf_sec_role_t for details."]
pub role: nrf_sec_role_t,
#[doc = "< Indicates the preference for peer verification. See nrf_sec_peer_verify_t for details."]
pub peer_verify: nrf_sec_peer_verify_t,
#[doc = "< Indicates the preference for session caching. See nrf_sec_session_cache_t for details."]
pub session_cache: nrf_sec_session_cache_t,
#[doc = "< Indicates the number of entries in the cipher list."]
pub cipher_count: u32,
#[doc = "< Indicates the list of ciphers to be used for the session. See nrf_sec_cipher_t for details."]
pub p_cipher_list: *mut nrf_sec_cipher_t,
#[doc = "< Indicates the number of entries in the sec tag list."]
pub sec_tag_count: u32,
#[doc = "< Indicates the list of security tags to be used for the session. See nrf_sec_tag_t for details."]
pub p_sec_tag_list: *mut nrf_sec_tag_t,
}
#[test]
fn bindgen_test_layout_nrf_sec_config_t() {
assert_eq!(
::core::mem::size_of::<nrf_sec_config_t>(),
28usize,
concat!("Size of: ", stringify!(nrf_sec_config_t))
);
assert_eq!(
::core::mem::align_of::<nrf_sec_config_t>(),
4usize,
concat!("Alignment of ", stringify!(nrf_sec_config_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_sec_config_t>())).role as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_sec_config_t),
"::",
stringify!(role)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_sec_config_t>())).peer_verify as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_sec_config_t),
"::",
stringify!(peer_verify)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_sec_config_t>())).session_cache as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(nrf_sec_config_t),
"::",
stringify!(session_cache)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_sec_config_t>())).cipher_count as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(nrf_sec_config_t),
"::",
stringify!(cipher_count)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_sec_config_t>())).p_cipher_list as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(nrf_sec_config_t),
"::",
stringify!(p_cipher_list)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_sec_config_t>())).sec_tag_count as *const _ as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(nrf_sec_config_t),
"::",
stringify!(sec_tag_count)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_sec_config_t>())).p_sec_tag_list as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(nrf_sec_config_t),
"::",
stringify!(p_sec_tag_list)
)
);
}
#[doc = " Data type for network interface."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct nrf_ifreq {
pub ifr_name: [ctypes::c_char; 64usize],
}
#[test]
fn bindgen_test_layout_nrf_ifreq() {
assert_eq!(
::core::mem::size_of::<nrf_ifreq>(),
64usize,
concat!("Size of: ", stringify!(nrf_ifreq))
);
assert_eq!(
::core::mem::align_of::<nrf_ifreq>(),
1usize,
concat!("Alignment of ", stringify!(nrf_ifreq))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_ifreq>())).ifr_name as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_ifreq),
"::",
stringify!(ifr_name)
)
);
}
#[doc = "@addtogroup nrf_socket_pdn"]
#[doc = " Data types defined to set and get socket options on a PDN socket."]
#[doc = " @{"]
#[doc = " List of address family(ies) for the PDN."]
pub type nrf_pdn_af_list_t = *mut nrf_sa_family_t;
#[doc = ""]
#[doc = " Context ID for the PDN."]
pub type nrf_pdn_context_id_t = u8;
#[doc = ""]
#[doc = " PDN state."]
#[doc = " 1 - PDN is active."]
#[doc = " 0 - PDN is inactive."]
pub type nrf_pdn_state_t = u8;
pub const nrf_pdn_auth_type_t_NRF_PDN_AUTH_TYPE_NONE: nrf_pdn_auth_type_t = 0;
pub const nrf_pdn_auth_type_t_NRF_PDN_AUTH_TYPE_PAP: nrf_pdn_auth_type_t = 1;
pub const nrf_pdn_auth_type_t_NRF_PDN_AUTH_TYPE_CHAP: nrf_pdn_auth_type_t = 2;
#[doc = ""]
#[doc = " PDN authentication type."]
pub type nrf_pdn_auth_type_t = ctypes::c_uint;
#[doc = ""]
#[doc = " Structure for PDN authentication socket option."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct nrf_pdn_auth_t {
pub username: [ctypes::c_char; 100usize],
pub password: [ctypes::c_char; 100usize],
pub authentication_type: nrf_pdn_auth_type_t,
}
#[test]
fn bindgen_test_layout_nrf_pdn_auth_t() {
assert_eq!(
::core::mem::size_of::<nrf_pdn_auth_t>(),
204usize,
concat!("Size of: ", stringify!(nrf_pdn_auth_t))
);
assert_eq!(
::core::mem::align_of::<nrf_pdn_auth_t>(),
4usize,
concat!("Alignment of ", stringify!(nrf_pdn_auth_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_pdn_auth_t>())).username as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_pdn_auth_t),
"::",
stringify!(username)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_pdn_auth_t>())).password as *const _ as usize },
100usize,
concat!(
"Offset of field: ",
stringify!(nrf_pdn_auth_t),
"::",
stringify!(password)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_pdn_auth_t>())).authentication_type as *const _ as usize
},
200usize,
concat!(
"Offset of field: ",
stringify!(nrf_pdn_auth_t),
"::",
stringify!(authentication_type)
)
);
}
#[doc = ""]
#[doc = " Universally unique identifier of the modem firmware version."]
#[doc = " The UUID format is defined by RFC 4122."]
pub type nrf_dfu_fw_version_t = [u8; 36usize];
#[doc = ""]
#[doc = " Maximum size for a firmware image, in bytes."]
pub type nrf_dfu_resources_t = u32;
#[doc = ""]
#[doc = " Size of the firmware image stored in flash, in bytes."]
pub type nrf_dfu_fw_offset_t = u32;
#[doc = " DFU socket error."]
pub type nrf_dfu_err_t = i32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_gnss_datetime_t {
#[doc = "< 4-digit representation (Gregorian calendar)."]
pub year: u16,
#[doc = "< 1...12"]
pub month: u8,
#[doc = "< 1...31"]
pub day: u8,
#[doc = "< 0...23"]
pub hour: u8,
#[doc = "< 0...59"]
pub minute: u8,
#[doc = "< 0...59"]
pub seconds: u8,
#[doc = "< 0...999"]
pub ms: u16,
}
#[test]
fn bindgen_test_layout_nrf_gnss_datetime_t() {
assert_eq!(
::core::mem::size_of::<nrf_gnss_datetime_t>(),
10usize,
concat!("Size of: ", stringify!(nrf_gnss_datetime_t))
);
assert_eq!(
::core::mem::align_of::<nrf_gnss_datetime_t>(),
2usize,
concat!("Alignment of ", stringify!(nrf_gnss_datetime_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_datetime_t>())).year as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_datetime_t),
"::",
stringify!(year)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_datetime_t>())).month as *const _ as usize },
2usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_datetime_t),
"::",
stringify!(month)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_datetime_t>())).day as *const _ as usize },
3usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_datetime_t),
"::",
stringify!(day)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_datetime_t>())).hour as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_datetime_t),
"::",
stringify!(hour)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_datetime_t>())).minute as *const _ as usize },
5usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_datetime_t),
"::",
stringify!(minute)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_datetime_t>())).seconds as *const _ as usize },
6usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_datetime_t),
"::",
stringify!(seconds)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_datetime_t>())).ms as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_datetime_t),
"::",
stringify!(ms)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_gnss_sv_t {
#[doc = "< SV number 1...32 for GPS."]
pub sv: u16,
#[doc = "< Signal type. 0: invalid, 1: GPS L1C/A, other values are reserved for other GNSSes or signals."]
pub signal: u8,
#[doc = "< 0.1 dB/Hz."]
pub cn0: u16,
#[doc = "< SV elevation angle in degrees."]
pub elevation: i16,
#[doc = "< SV azimuth angle in degrees."]
pub azimuth: i16,
#[doc = "< Bit mask of measurement and position computation flags."]
pub flags: u8,
}
#[test]
fn bindgen_test_layout_nrf_gnss_sv_t() {
assert_eq!(
::core::mem::size_of::<nrf_gnss_sv_t>(),
12usize,
concat!("Size of: ", stringify!(nrf_gnss_sv_t))
);
assert_eq!(
::core::mem::align_of::<nrf_gnss_sv_t>(),
2usize,
concat!("Alignment of ", stringify!(nrf_gnss_sv_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_sv_t>())).sv as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_sv_t),
"::",
stringify!(sv)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_sv_t>())).signal as *const _ as usize },
2usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_sv_t),
"::",
stringify!(signal)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_sv_t>())).cn0 as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_sv_t),
"::",
stringify!(cn0)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_sv_t>())).elevation as *const _ as usize },
6usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_sv_t),
"::",
stringify!(elevation)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_sv_t>())).azimuth as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_sv_t),
"::",
stringify!(azimuth)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_sv_t>())).flags as *const _ as usize },
10usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_sv_t),
"::",
stringify!(flags)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_gnss_pvt_data_frame_t {
#[doc = "< Latitude in degrees."]
pub latitude: f64,
#[doc = "< Longitude in degrees."]
pub longitude: f64,
#[doc = "< Altitude above WGS-84 ellipsoid in meters."]
pub altitude: f32,
#[doc = "< Accuracy (2D 1-sigma) in meters."]
pub accuracy: f32,
#[doc = "< Horizontal speed in meters."]
pub speed: f32,
#[doc = "< Heading of user movement in degrees."]
pub heading: f32,
pub datetime: nrf_gnss_datetime_t,
#[doc = "< Position dilution of precision."]
pub pdop: f32,
#[doc = "< Horizontal dilution of precision."]
pub hdop: f32,
#[doc = "< Vertical dilution of precision."]
pub vdop: f32,
#[doc = "< Time dilution of precision."]
pub tdop: f32,
#[doc = "< Bit 0 (LSB): fix validity. Bit 1: Leap second validity. Bit 2: If set, the GNSS operation is blocked, for example, by LTE."]
pub flags: u8,
#[doc = "< Describes up to 12 of the space vehicles used for the measurement."]
pub sv: [nrf_gnss_sv_t; 12usize],
}
#[test]
fn bindgen_test_layout_nrf_gnss_pvt_data_frame_t() {
assert_eq!(
::core::mem::size_of::<nrf_gnss_pvt_data_frame_t>(),
208usize,
concat!("Size of: ", stringify!(nrf_gnss_pvt_data_frame_t))
);
assert_eq!(
::core::mem::align_of::<nrf_gnss_pvt_data_frame_t>(),
8usize,
concat!("Alignment of ", stringify!(nrf_gnss_pvt_data_frame_t))
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_pvt_data_frame_t>())).latitude as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_pvt_data_frame_t),
"::",
stringify!(latitude)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_pvt_data_frame_t>())).longitude as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_pvt_data_frame_t),
"::",
stringify!(longitude)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_pvt_data_frame_t>())).altitude as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_pvt_data_frame_t),
"::",
stringify!(altitude)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_pvt_data_frame_t>())).accuracy as *const _ as usize
},
20usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_pvt_data_frame_t),
"::",
stringify!(accuracy)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_pvt_data_frame_t>())).speed as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_pvt_data_frame_t),
"::",
stringify!(speed)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_pvt_data_frame_t>())).heading as *const _ as usize
},
28usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_pvt_data_frame_t),
"::",
stringify!(heading)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_pvt_data_frame_t>())).datetime as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_pvt_data_frame_t),
"::",
stringify!(datetime)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_pvt_data_frame_t>())).pdop as *const _ as usize },
44usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_pvt_data_frame_t),
"::",
stringify!(pdop)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_pvt_data_frame_t>())).hdop as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_pvt_data_frame_t),
"::",
stringify!(hdop)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_pvt_data_frame_t>())).vdop as *const _ as usize },
52usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_pvt_data_frame_t),
"::",
stringify!(vdop)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_pvt_data_frame_t>())).tdop as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_pvt_data_frame_t),
"::",
stringify!(tdop)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_pvt_data_frame_t>())).flags as *const _ as usize
},
60usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_pvt_data_frame_t),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_pvt_data_frame_t>())).sv as *const _ as usize },
62usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_pvt_data_frame_t),
"::",
stringify!(sv)
)
);
}
#[doc = " Single null-terminated NMEA sentence"]
pub type nrf_gnss_nmea_data_frame_t = [ctypes::c_char; 83usize];
#[doc = " AGPS notification data frame used by the GPS module to let the application know it needs new APGS data."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_gnss_agps_data_frame_t {
#[doc = "< Bit mask indicating the satellite PRNs for which the assistance GPS ephemeris data is needed."]
pub sv_mask_ephe: u32,
#[doc = "< Bit mask indicating the satellite PRNs for which the assistance GPS almanac data is needed."]
pub sv_mask_alm: u32,
#[doc = "< Indicating other AGPS data models is needed by the GNSS module"]
pub data_flags: u32,
}
#[test]
fn bindgen_test_layout_nrf_gnss_agps_data_frame_t() {
assert_eq!(
::core::mem::size_of::<nrf_gnss_agps_data_frame_t>(),
12usize,
concat!("Size of: ", stringify!(nrf_gnss_agps_data_frame_t))
);
assert_eq!(
::core::mem::align_of::<nrf_gnss_agps_data_frame_t>(),
4usize,
concat!("Alignment of ", stringify!(nrf_gnss_agps_data_frame_t))
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_frame_t>())).sv_mask_ephe as *const _
as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_frame_t),
"::",
stringify!(sv_mask_ephe)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_frame_t>())).sv_mask_alm as *const _ as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_frame_t),
"::",
stringify!(sv_mask_alm)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_frame_t>())).data_flags as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_frame_t),
"::",
stringify!(data_flags)
)
);
}
#[doc = " Wrapper struct that used for all data frames read from the GNSS module"]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct nrf_gnss_data_frame_t {
pub data_id: u8,
pub __bindgen_anon_1: nrf_gnss_data_frame_t__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union nrf_gnss_data_frame_t__bindgen_ty_1 {
#[doc = "< PVT (Position, Velocity, and Time) data notification frame"]
pub pvt: nrf_gnss_pvt_data_frame_t,
#[doc = "< NMEA data notification frame"]
pub nmea: nrf_gnss_nmea_data_frame_t,
#[doc = "< AGPS data request notification"]
pub agps: nrf_gnss_agps_data_frame_t,
_bindgen_union_align: [u64; 26usize],
}
#[test]
fn bindgen_test_layout_nrf_gnss_data_frame_t__bindgen_ty_1() {
assert_eq!(
::core::mem::size_of::<nrf_gnss_data_frame_t__bindgen_ty_1>(),
208usize,
concat!("Size of: ", stringify!(nrf_gnss_data_frame_t__bindgen_ty_1))
);
assert_eq!(
::core::mem::align_of::<nrf_gnss_data_frame_t__bindgen_ty_1>(),
8usize,
concat!(
"Alignment of ",
stringify!(nrf_gnss_data_frame_t__bindgen_ty_1)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_data_frame_t__bindgen_ty_1>())).pvt as *const _
as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_data_frame_t__bindgen_ty_1),
"::",
stringify!(pvt)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_data_frame_t__bindgen_ty_1>())).nmea as *const _
as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_data_frame_t__bindgen_ty_1),
"::",
stringify!(nmea)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_data_frame_t__bindgen_ty_1>())).agps as *const _
as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_data_frame_t__bindgen_ty_1),
"::",
stringify!(agps)
)
);
}
#[test]
fn bindgen_test_layout_nrf_gnss_data_frame_t() {
assert_eq!(
::core::mem::size_of::<nrf_gnss_data_frame_t>(),
216usize,
concat!("Size of: ", stringify!(nrf_gnss_data_frame_t))
);
assert_eq!(
::core::mem::align_of::<nrf_gnss_data_frame_t>(),
8usize,
concat!("Alignment of ", stringify!(nrf_gnss_data_frame_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_data_frame_t>())).data_id as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_data_frame_t),
"::",
stringify!(data_id)
)
);
}
#[doc = " Type used to select which AGPS data is written to the GPS module."]
#[doc = " s Goes into the * `p_servaddr` - parameter in the * `nrf_sendto` - function prototype. Possible values:"]
#[doc = " * * `NRF_GNSS_AGPS_UTC_PARAMETERS` - "]
#[doc = " * * `NRF_GNSS_AGPS_EPHEMERIDE` - "]
#[doc = " * * `NRF_GNSS_AGPS_ALMANAC` - "]
#[doc = " * * `NRF_GNSS_AGPS_KLOBUCHAR_IONOSPHERIC_CORRECTION` - "]
#[doc = " * * `NRF_GNSS_AGPS_NEQUICK_IONOSPHERIC_CORRECTION` - "]
#[doc = " * * `NRF_GNSS_AGPS_GPS_SYSTEM_CLOCK_AND_TOWS` - "]
#[doc = " * * `NRF_GNSS_AGPS_LOCATION` - "]
#[doc = " * * `NRF_GNSS_AGPS_INTEGRITY` - "]
pub type nrf_gnss_agps_data_type_t = u16;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_gnss_agps_data_utc_t {
#[doc = "< First order term of polynomial (sec/sec). Scale factor 2^-50. Range -8388608...8388607 (25 bits)."]
pub a1: i32,
#[doc = "< Constant term of polynomial (sec). Scale factor 2^-30."]
pub a0: i32,
#[doc = "< UTC reference GPS time-of-week (sec). Scale factor 2^12. Range 0..147."]
pub tot: u8,
#[doc = "< UTC reference GPS week number modulo 256."]
pub wn_t: u8,
#[doc = "< Current or past leap second count (sec)."]
pub delta_tls: i8,
#[doc = "< Leap second reference GPS week number modulo 256."]
pub wn_lsf: u8,
#[doc = "< Leap second reference GPS day-of-week (day). Range 1...7."]
pub dn: i8,
#[doc = "< Current or future leap second count (sec) (total size of the type-specific assistance data)."]
pub delta_tlsf: i8,
}
#[test]
fn bindgen_test_layout_nrf_gnss_agps_data_utc_t() {
assert_eq!(
::core::mem::size_of::<nrf_gnss_agps_data_utc_t>(),
16usize,
concat!("Size of: ", stringify!(nrf_gnss_agps_data_utc_t))
);
assert_eq!(
::core::mem::align_of::<nrf_gnss_agps_data_utc_t>(),
4usize,
concat!("Alignment of ", stringify!(nrf_gnss_agps_data_utc_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_agps_data_utc_t>())).a1 as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_utc_t),
"::",
stringify!(a1)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_agps_data_utc_t>())).a0 as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_utc_t),
"::",
stringify!(a0)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_agps_data_utc_t>())).tot as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_utc_t),
"::",
stringify!(tot)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_agps_data_utc_t>())).wn_t as *const _ as usize },
9usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_utc_t),
"::",
stringify!(wn_t)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_utc_t>())).delta_tls as *const _ as usize
},
10usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_utc_t),
"::",
stringify!(delta_tls)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_utc_t>())).wn_lsf as *const _ as usize
},
11usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_utc_t),
"::",
stringify!(wn_lsf)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_agps_data_utc_t>())).dn as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_utc_t),
"::",
stringify!(dn)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_utc_t>())).delta_tlsf as *const _ as usize
},
13usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_utc_t),
"::",
stringify!(delta_tlsf)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_gnss_agps_data_ephemeris_t {
#[doc = "< Satellite ID (dimensionless). Range 1...32."]
pub sv_id: u8,
#[doc = "< Satellite health (dimensionless)."]
pub health: u8,
#[doc = "< Issue of data, clock parameters (dimensionless). Range 0...2047 (11 bits)."]
pub iodc: u16,
#[doc = "< Clock parameters reference GPS time-of-week (sec). Scale factor 2^4. Range 0...37799."]
pub toc: u16,
#[doc = "< Clock drift rate (sec/sec2). Scale factor 2^-55."]
pub af2: i8,
#[doc = "< Clock drift (sec/sec). Scale factor 2^-43."]
pub af1: i16,
#[doc = "< Clock bias (sec). Scale factor 2^-31. Range -2097152...2097151 (22 bit)"]
pub af0: i32,
#[doc = "< Group delay (sec). Scale factor 2^-31."]
pub tgd: i8,
#[doc = "< URA index (dimensionless). Range 0...15."]
pub ura: u8,
#[doc = "< Curve fit interval indication. Range 0...1."]
pub fit_int: u8,
#[doc = "< Ephemeris parameters reference GPS time-of-week (sec). Scale factor 2^4. Range 0...37799."]
pub toe: u16,
#[doc = "< Argument of perigee (semi-circle). Scale factor 2^-31."]
pub w: i32,
#[doc = "< Mean motion difference (semi-circle/sec). Scale factor 2^-43."]
pub delta_n: i16,
#[doc = "< Mean anomaly at reference time (semi-circle). Scale factor 2^-31."]
pub m0: i32,
#[doc = "< Rate of right ascension (semi-circle/sec). Scale factor 2^-43. Range -8388608...8388607 (24 bits)."]
pub omega_dot: i32,
#[doc = "< Eccentricity (dimensionless). Scale factor 2^-33."]
pub e: u32,
#[doc = "< Rate of inclination angle (semi-circle/sec). Scale factor 2-43. Range -8192...8191 (14 bits)."]
pub idot: i16,
#[doc = "< Square root of semi-major axis (m). Scale factor 2^-19."]
pub sqrt_a: u32,
#[doc = "< Inclination angle at reference time (semi-circle). Scale factor 2^-31."]
pub i0: i32,
#[doc = "< Longitude of ascending node at weekly epoch (semi-circle). Scale factor 2^-31."]
pub omega0: i32,
#[doc = "< Orbit radius, sine harmonic amplitude (m). Scale factor 2^-5."]
pub crs: i16,
#[doc = "< Inclination angle, sine harmonic amplitude (rad). Scale factor 2^-29."]
pub cis: i16,
#[doc = "< Argument of latitude, sine harmonic amplitude (rad). Scale factor 2^-29."]
pub cus: i16,
#[doc = "< Orbit radius, cosine harmonic amplitude (m). Scale factor 2^-5."]
pub crc: i16,
#[doc = "< Inclination angle, cosine harmonic amplitude (rad). Scale factor 2^-29."]
pub cic: i16,
#[doc = "< Argument of latitude, cosine harmonic amplitude (rad). Scale factor 2^-29."]
pub cuc: i16,
}
#[test]
fn bindgen_test_layout_nrf_gnss_agps_data_ephemeris_t() {
assert_eq!(
::core::mem::size_of::<nrf_gnss_agps_data_ephemeris_t>(),
72usize,
concat!("Size of: ", stringify!(nrf_gnss_agps_data_ephemeris_t))
);
assert_eq!(
::core::mem::align_of::<nrf_gnss_agps_data_ephemeris_t>(),
4usize,
concat!("Alignment of ", stringify!(nrf_gnss_agps_data_ephemeris_t))
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).sv_id as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(sv_id)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).health as *const _ as usize
},
1usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(health)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).iodc as *const _ as usize
},
2usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(iodc)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).toc as *const _ as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(toc)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).af2 as *const _ as usize
},
6usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(af2)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).af1 as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(af1)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).af0 as *const _ as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(af0)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).tgd as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(tgd)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).ura as *const _ as usize
},
17usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(ura)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).fit_int as *const _ as usize
},
18usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(fit_int)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).toe as *const _ as usize
},
20usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(toe)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).w as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(w)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).delta_n as *const _ as usize
},
28usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(delta_n)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).m0 as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(m0)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).omega_dot as *const _
as usize
},
36usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(omega_dot)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).e as *const _ as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(e)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).idot as *const _ as usize
},
44usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(idot)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).sqrt_a as *const _ as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(sqrt_a)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).i0 as *const _ as usize
},
52usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(i0)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).omega0 as *const _ as usize
},
56usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(omega0)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).crs as *const _ as usize
},
60usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(crs)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).cis as *const _ as usize
},
62usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(cis)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).cus as *const _ as usize
},
64usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(cus)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).crc as *const _ as usize
},
66usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(crc)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).cic as *const _ as usize
},
68usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(cic)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_ephemeris_t>())).cuc as *const _ as usize
},
70usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_ephemeris_t),
"::",
stringify!(cuc)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_gnss_agps_data_almanac_t {
#[doc = "< Satellite ID (dimensionless). Range 1...32."]
pub sv_id: u8,
#[doc = "< Almanac reference GPS week number modulo 256."]
pub wn: u8,
#[doc = "< Almanac reference GPS time-of-week (sec). Scale factor 2^12. Range 0...147."]
pub toa: u8,
#[doc = "< Issue of data, almanac (dimensionless). Range 0...3 (2 bits)."]
pub ioda: u8,
#[doc = "< Eccentricity (dimensionless). Scale factor 2^-21."]
pub e: u16,
#[doc = "< Correction to inclination (semi-circle). Scale factor 2^-19."]
pub delta_i: i16,
#[doc = "< Rate of right ascension (semi-circle/sec). Scale factor 2^-38."]
pub omega_dot: i16,
#[doc = "< Satellite health (dimensionless)"]
pub sv_health: u8,
#[doc = "< Square root of semi-major axis (m^(1/2)). Scale factor 2^-11. Range 0...16777215 (24 bit)."]
pub sqrt_a: u32,
#[doc = "< Longitude of ascending node at weekly epoch (semi-circle). Scale factor 2^-23. Range -8388608...8388607 (24 bits)."]
pub omega0: i32,
#[doc = "< Argument of perigee (semi-circle). Scale factor 2^-23."]
pub w: i32,
#[doc = "< Mean anomaly at reference time (semi-circle). Scale factor 2^-23. Range -8388608...8388608 (24 bits)."]
pub m0: i32,
#[doc = "< Clock bias (sec). Scale factor 2^-20. Range -1024...1023 (11 bits)."]
pub af0: i16,
#[doc = "< Clock drift (sec/sec). Scale factor 2^-38. Range -1024...1023 (11 bits)."]
pub af1: i16,
}
#[test]
fn bindgen_test_layout_nrf_gnss_agps_data_almanac_t() {
assert_eq!(
::core::mem::size_of::<nrf_gnss_agps_data_almanac_t>(),
32usize,
concat!("Size of: ", stringify!(nrf_gnss_agps_data_almanac_t))
);
assert_eq!(
::core::mem::align_of::<nrf_gnss_agps_data_almanac_t>(),
4usize,
concat!("Alignment of ", stringify!(nrf_gnss_agps_data_almanac_t))
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_almanac_t>())).sv_id as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_almanac_t),
"::",
stringify!(sv_id)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_almanac_t>())).wn as *const _ as usize
},
1usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_almanac_t),
"::",
stringify!(wn)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_almanac_t>())).toa as *const _ as usize
},
2usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_almanac_t),
"::",
stringify!(toa)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_almanac_t>())).ioda as *const _ as usize
},
3usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_almanac_t),
"::",
stringify!(ioda)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_agps_data_almanac_t>())).e as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_almanac_t),
"::",
stringify!(e)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_almanac_t>())).delta_i as *const _ as usize
},
6usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_almanac_t),
"::",
stringify!(delta_i)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_almanac_t>())).omega_dot as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_almanac_t),
"::",
stringify!(omega_dot)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_almanac_t>())).sv_health as *const _ as usize
},
10usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_almanac_t),
"::",
stringify!(sv_health)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_almanac_t>())).sqrt_a as *const _ as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_almanac_t),
"::",
stringify!(sqrt_a)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_almanac_t>())).omega0 as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_almanac_t),
"::",
stringify!(omega0)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_gnss_agps_data_almanac_t>())).w as *const _ as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_almanac_t),
"::",
stringify!(w)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_almanac_t>())).m0 as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_almanac_t),
"::",
stringify!(m0)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_almanac_t>())).af0 as *const _ as usize
},
28usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_almanac_t),
"::",
stringify!(af0)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_almanac_t>())).af1 as *const _ as usize
},
30usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_almanac_t),
"::",
stringify!(af1)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_gnss_agps_data_klobuchar_t {
#[doc = "< Constant term (sec). Scale factor 2^-30."]
pub alpha0: i8,
#[doc = "< First-order coefficient (sec/semi-circle). Scale factor 2^-27."]
pub alpha1: i8,
#[doc = "< Second-order coefficient (sec/semi-circle^2). Scale factor 2^-24."]
pub alpha2: i8,
#[doc = "< Third-order coefficient (sec/semi-circle^3). Scale factor 2^-24."]
pub alpha3: i8,
#[doc = "< Constant term (sec). Scale factor 2^11."]
pub beta0: i8,
#[doc = "< First-order coefficient (sec/semi-circle). Scale factor 2^14."]
pub beta1: i8,
#[doc = "< Second-order coefficient (sec/semi-circle^2). Scale factor 2^16."]
pub beta2: i8,
#[doc = "< Third-order coefficient (sec/semi-circle^3). Scale factor 2^16."]
pub beta3: i8,
}
#[test]
fn bindgen_test_layout_nrf_gnss_agps_data_klobuchar_t() {
assert_eq!(
::core::mem::size_of::<nrf_gnss_agps_data_klobuchar_t>(),
8usize,
concat!("Size of: ", stringify!(nrf_gnss_agps_data_klobuchar_t))
);
assert_eq!(
::core::mem::align_of::<nrf_gnss_agps_data_klobuchar_t>(),
1usize,
concat!("Alignment of ", stringify!(nrf_gnss_agps_data_klobuchar_t))
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_klobuchar_t>())).alpha0 as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_klobuchar_t),
"::",
stringify!(alpha0)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_klobuchar_t>())).alpha1 as *const _ as usize
},
1usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_klobuchar_t),
"::",
stringify!(alpha1)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_klobuchar_t>())).alpha2 as *const _ as usize
},
2usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_klobuchar_t),
"::",
stringify!(alpha2)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_klobuchar_t>())).alpha3 as *const _ as usize
},
3usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_klobuchar_t),
"::",
stringify!(alpha3)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_klobuchar_t>())).beta0 as *const _ as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_klobuchar_t),
"::",
stringify!(beta0)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_klobuchar_t>())).beta1 as *const _ as usize
},
5usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_klobuchar_t),
"::",
stringify!(beta1)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_klobuchar_t>())).beta2 as *const _ as usize
},
6usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_klobuchar_t),
"::",
stringify!(beta2)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_klobuchar_t>())).beta3 as *const _ as usize
},
7usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_klobuchar_t),
"::",
stringify!(beta3)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_gnss_agps_data_nequick_t {
#[doc = "< Effective ionisation level 1st order parameter (SFU). Scale factor 2^-2. Range 0...2047 (11 bits)."]
pub ai0: i16,
#[doc = "< Effective ionisation level 2nd order parameter (SFU/deg). Scale factor 2^-8. Range -1024...1023 (11 bits)."]
pub ai1: i16,
#[doc = "< Effective ionisation level 3rd order parameter (SFU/deg^2). Scale factor 2^-15. Range -8192...8191 (14 bits)."]
pub ai2: i16,
#[doc = "< Storm condition bit mask indicating the ionospheric storm condition for different regions."]
pub storm_cond: u8,
#[doc = "< Storm validity bit mask indicating for which regions the ionospheric storm condition bit is valid."]
pub storm_valid: u8,
}
#[test]
fn bindgen_test_layout_nrf_gnss_agps_data_nequick_t() {
assert_eq!(
::core::mem::size_of::<nrf_gnss_agps_data_nequick_t>(),
8usize,
concat!("Size of: ", stringify!(nrf_gnss_agps_data_nequick_t))
);
assert_eq!(
::core::mem::align_of::<nrf_gnss_agps_data_nequick_t>(),
2usize,
concat!("Alignment of ", stringify!(nrf_gnss_agps_data_nequick_t))
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_nequick_t>())).ai0 as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_nequick_t),
"::",
stringify!(ai0)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_nequick_t>())).ai1 as *const _ as usize
},
2usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_nequick_t),
"::",
stringify!(ai1)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_nequick_t>())).ai2 as *const _ as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_nequick_t),
"::",
stringify!(ai2)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_nequick_t>())).storm_cond as *const _
as usize
},
6usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_nequick_t),
"::",
stringify!(storm_cond)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_nequick_t>())).storm_valid as *const _
as usize
},
7usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_nequick_t),
"::",
stringify!(storm_valid)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_gnss_agps_data_tow_element_t {
#[doc = "< First two bits (MSB) represent the reserved bit and integrity status flag in the telemetry message (TLM) word."]
#[doc = "The following 14 bits represent the TLM being broadcast by the satellite."]
pub tlm: u16,
#[doc = "< Bit 0 (LSB): anti-spoof flag. Bit 1: alert flag."]
pub flags: u8,
}
#[test]
fn bindgen_test_layout_nrf_gnss_agps_data_tow_element_t() {
assert_eq!(
::core::mem::size_of::<nrf_gnss_agps_data_tow_element_t>(),
4usize,
concat!("Size of: ", stringify!(nrf_gnss_agps_data_tow_element_t))
);
assert_eq!(
::core::mem::align_of::<nrf_gnss_agps_data_tow_element_t>(),
2usize,
concat!(
"Alignment of ",
stringify!(nrf_gnss_agps_data_tow_element_t)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_tow_element_t>())).tlm as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_tow_element_t),
"::",
stringify!(tlm)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_tow_element_t>())).flags as *const _ as usize
},
2usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_tow_element_t),
"::",
stringify!(flags)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_gnss_agps_data_system_time_and_sv_tow_t {
#[doc = "< Day number since Jan 6th, 1980 00:00:00 UTC (USNO)"]
pub date_day: u16,
#[doc = "< Full seconds part of time-of-day (s). Range 0...86399."]
pub time_full_s: u32,
#[doc = "< Fraction of a second part of time-of-day (ms). Range 0...999."]
pub time_frac_ms: u16,
#[doc = "< Bit mask indicating the satellite PRNs for which the satellite-specific TOW assistance data is valid."]
pub sv_mask: u32,
#[doc = "< TOW assistance data for PRN n"]
pub sv_tow: [nrf_gnss_agps_data_tow_element_t; 32usize],
}
#[test]
fn bindgen_test_layout_nrf_gnss_agps_data_system_time_and_sv_tow_t() {
assert_eq!(
::core::mem::size_of::<nrf_gnss_agps_data_system_time_and_sv_tow_t>(),
144usize,
concat!(
"Size of: ",
stringify!(nrf_gnss_agps_data_system_time_and_sv_tow_t)
)
);
assert_eq!(
::core::mem::align_of::<nrf_gnss_agps_data_system_time_and_sv_tow_t>(),
4usize,
concat!(
"Alignment of ",
stringify!(nrf_gnss_agps_data_system_time_and_sv_tow_t)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_system_time_and_sv_tow_t>())).date_day
as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_system_time_and_sv_tow_t),
"::",
stringify!(date_day)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_system_time_and_sv_tow_t>())).time_full_s
as *const _ as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_system_time_and_sv_tow_t),
"::",
stringify!(time_full_s)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_system_time_and_sv_tow_t>())).time_frac_ms
as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_system_time_and_sv_tow_t),
"::",
stringify!(time_frac_ms)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_system_time_and_sv_tow_t>())).sv_mask
as *const _ as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_system_time_and_sv_tow_t),
"::",
stringify!(sv_mask)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_system_time_and_sv_tow_t>())).sv_tow
as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_system_time_and_sv_tow_t),
"::",
stringify!(sv_tow)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_gnss_agps_data_location_t {
#[doc = "< Geodetic latitude in WGS-84. Range -8388607...8388607."]
#[doc = " The relation between the coded number N and the latitude"]
#[doc = " range X (in degrees) is as follows: N <= (2^23/90) * X < N + 1."]
#[doc = " For N = 2^23 - 1, the range is extended to include N+1."]
#[doc = " Range of X (in degrees) -90...90."]
pub latitude: i32,
#[doc = "< Geodetic longitude in WGS-84. Range -8388607..8388607."]
#[doc = " The relation between the coded number N and the longitude range"]
#[doc = " X (in degrees) is as follows: N <= (2^24/360) * X < N + 1."]
#[doc = " Range of X (in degrees) -180...180."]
pub longitude: i32,
#[doc = "< Altitude. Above (positive value) or below (negative value) WGS-84"]
#[doc = " ellipsoid surface. Range -32767...32767."]
#[doc = " The relation between the coded number N and the altitude range a"]
#[doc = " (in meters) is as follows: N <= a < N + 1."]
#[doc = " For N = 2^15 - 1 the range is extended to include all greater values of a."]
pub altitude: i16,
#[doc = "< Uncertainty, semi-major. Range 0...127. The uncertainty (in meters) is"]
#[doc = " mapped from the coded number K with following formula: r = C * ((1 + x)^K - 1),"]
#[doc = " where C = 10 and x = 0,1. Range of r (in kilometers) 0...1800."]
pub unc_semimajor: u8,
#[doc = "< Uncertainty, semi-minor. Range 0...127. The uncertainty (in meters) is"]
#[doc = " mapped from the coded number K with following formula: r = C * ((1 + x)^K - 1),"]
#[doc = " where C = 10 and x = 0,1. Range of r (in kilometers) 0...1800)"]
pub unc_semiminor: u8,
#[doc = "< Orientation angle between the major axis and north. Range in degrees 0...179."]
pub orientation_major: u8,
#[doc = "< Uncertainty, altitude. Range 0...127. The uncertainty in altitude h (in meters)"]
#[doc = " is mapped from the coded number K with following formula: h = C * ((1 + x)^K - 1)."]
#[doc = " where C = 45 and x = 0,025. Range of h (in meters) 0...990,5."]
pub unc_altitude: u8,
#[doc = "< The confidence level (expressed as a percentage) with which"]
#[doc = " the position of a target entity is included within the uncertainty ellipsoid."]
#[doc = " Range 0...128. '0' indicates 'no information'. Values 101..128 should be treated as '0'."]
pub confidence: u8,
}
#[test]
fn bindgen_test_layout_nrf_gnss_agps_data_location_t() {
assert_eq!(
::core::mem::size_of::<nrf_gnss_agps_data_location_t>(),
16usize,
concat!("Size of: ", stringify!(nrf_gnss_agps_data_location_t))
);
assert_eq!(
::core::mem::align_of::<nrf_gnss_agps_data_location_t>(),
4usize,
concat!("Alignment of ", stringify!(nrf_gnss_agps_data_location_t))
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_location_t>())).latitude as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_location_t),
"::",
stringify!(latitude)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_location_t>())).longitude as *const _
as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_location_t),
"::",
stringify!(longitude)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_location_t>())).altitude as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_location_t),
"::",
stringify!(altitude)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_location_t>())).unc_semimajor as *const _
as usize
},
10usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_location_t),
"::",
stringify!(unc_semimajor)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_location_t>())).unc_semiminor as *const _
as usize
},
11usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_location_t),
"::",
stringify!(unc_semiminor)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_location_t>())).orientation_major as *const _
as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_location_t),
"::",
stringify!(orientation_major)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_location_t>())).unc_altitude as *const _
as usize
},
13usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_location_t),
"::",
stringify!(unc_altitude)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_location_t>())).confidence as *const _
as usize
},
14usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_location_t),
"::",
stringify!(confidence)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_gnss_agps_data_integrity_t {
#[doc = "< Bit mask indicating the unhealthy GPS satellite PRNs. When a mask bit is set,"]
#[doc = " the corresponding GPS satellite PRN is unhealthy."]
pub integrity_mask: u32,
}
#[test]
fn bindgen_test_layout_nrf_gnss_agps_data_integrity_t() {
assert_eq!(
::core::mem::size_of::<nrf_gnss_agps_data_integrity_t>(),
4usize,
concat!("Size of: ", stringify!(nrf_gnss_agps_data_integrity_t))
);
assert_eq!(
::core::mem::align_of::<nrf_gnss_agps_data_integrity_t>(),
4usize,
concat!("Alignment of ", stringify!(nrf_gnss_agps_data_integrity_t))
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_gnss_agps_data_integrity_t>())).integrity_mask as *const _
as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_gnss_agps_data_integrity_t),
"::",
stringify!(integrity_mask)
)
);
}
#[doc = " Defines the interval between each fix in seconds."]
#[doc = " s Allowed values are 0, 1, 10..1800, value 0 denotes single fix."]
#[doc = " Default interval is 1 second (continous mode), 0 denotes a single fix."]
pub type nrf_gnss_fix_interval_t = u16;
#[doc = " Defines how long (in seconds) the receiver should try to get a fix."]
#[doc = " s The default retry wait time is 60 seconds before it gives up."]
#[doc = "0 denotes an infinite limit."]
pub type nrf_gnss_fix_retry_t = u16;
#[doc = " Defines which GNSS system to use."]
#[doc = " s 0 denotes GPS. Currently, only GPS is supported and any other value"]
#[doc = " returns an error."]
pub type nrf_gnss_system_t = u8;
#[doc = " Defines at which elevation the GPS should track a satellite."]
#[doc = " s This option is used to make the GPS stop tracking GPSes on a"]
#[doc = " certain elevation, because the information sent from the GPS gets more"]
#[doc = " inaccurate as it gets closer to the horizon. Acceptable values"]
#[doc = " are between 0 and 30 degrees."]
pub type nrf_gnss_elevation_mask_t = u8;
#[doc = " Defines the targeted start performance."]
#[doc = " s 0 denotes single cold start performance."]
#[doc = " 1 denotes multiple hot start performance."]
pub type nrf_gnss_use_case_t = u8;
#[doc = " Defines if NMEA frames should be added."]
pub type nrf_gnss_nmea_mask_t = u16;
#[doc = " Defines which power mode policy to use for the GNSS module."]
#[doc = " s"]
#[doc = " * * `NRF_GNSS_PSM_DISABLED` - for no power mode policy."]
#[doc = " * * `NRF_GNSS_PSM_DUTY_CYCLING_PERFORMANCE` - for low power mode with better performance."]
#[doc = " * * `NRF_GNSS_PSM_DUTY_CYCLING_POWER` - for low power mode with lower power consumption."]
#[doc = ""]
#[doc = " The available power modes determine whether duty-cycled tracking is allowed, and,"]
#[doc = " if allowed what is the target performance."]
#[doc = ""]
#[doc = " Performance duty-cycled power mode:"]
#[doc = " Duty-cycled tracking is engaged and run when conditions allow it without"]
#[doc = " significant performance degradation."]
#[doc = ""]
#[doc = " Power duty-cycled power mode::"]
#[doc = " Duty-cycled tracking is engaged and run whenever it is possible with acceptable"]
#[doc = " performance degradation."]
#[doc = ""]
#[doc = " The GNSS receiver keeps producing PVT estimates at the configured rate"]
#[doc = " regardless of whether it is tracking continuously or in duty cycles. However,"]
#[doc = " a failure to produce a valid PVT estimate during duty-cycled tracking may"]
#[doc = " cause the GNSS receiver to resume continuous tracking."]
#[doc = ""]
pub type nrf_gnss_power_save_mode_t = u8;
#[doc = " Defines a mask of non-volatile data types to delete."]
#[doc = " s"]
#[doc = " * Bit 0 denotes ephemerides data."]
#[doc = " * Bit 1 denotes almanac data (excluding leap second and ionospheric correction parameters)."]
#[doc = " * Bit 2 denotes ionospheric correction parameters data."]
#[doc = " * Bit 3 denotes last good fix (the last position) data."]
#[doc = " * Bit 4 denotes GPS time-of-week (TOW) data."]
#[doc = " * Bit 5 denotes GPS week number data."]
#[doc = " * Bit 6 denotes leap second (UTC parameters) data."]
#[doc = " * Bit 7 denotes local clock (TCXO) frequency offset data."]
pub type nrf_gnss_delete_mask_t = u32;
extern "C" {
#[doc = " Function for creating a socket."]
#[doc = ""]
#[doc = " s API to create a socket that can be used for network communication independently"]
#[doc = " of lower protocol layers."]
#[doc = ""]
#[doc = " * `family` - The protocol family of the network protocol to use."]
#[doc = " * `type` - The protocol type to use for this socket."]
#[doc = " * `protocol` - The transport protocol to use for this socket."]
#[doc = ""]
#[doc = " Returns A non-negative socket descriptor on success, or -1 on error."]
pub fn nrf_socket(
family: ctypes::c_int,
type_: ctypes::c_int,
protocol: ctypes::c_int,
) -> ctypes::c_int;
}
extern "C" {
#[doc = " Function for closing a socket and freeing any resources held by it."]
#[doc = ""]
#[doc = " s If the socket is already closed, this function does nothing."]
#[doc = ""]
#[doc = " * `sock` - The socket to close."]
#[doc = ""]
#[doc = " Returns 0 on success, or -1 on error."]
pub fn nrf_close(sock: ctypes::c_int) -> ctypes::c_int;
}
extern "C" {
#[doc = " Function for controlling file descriptor options."]
#[doc = ""]
#[doc = " s Set or get file descriptor options or flags. For a list of supported commands, refer"]
#[doc = " to @ref nrf_fcnt_commands."]
#[doc = " For a list of supported flags, refer to nrf_fcnt_flags."]
#[doc = ""]
#[doc = " * `fd` - The descriptor to set options on."]
#[doc = " * `cmd` - The command class for options."]
#[doc = " * `flags` - The flags to set."]
pub fn nrf_fcntl(fd: ctypes::c_int, cmd: ctypes::c_int, flags: ctypes::c_int) -> ctypes::c_int;
}
extern "C" {
#[doc = " Function for connecting to an endpoint with a given address."]
#[doc = ""]
#[doc = " s The socket handle must be a valid handle that has not yet been connected. Running"]
#[doc = " connect on a connected handle will return an error."]
#[doc = ""]
#[doc = " * `sock` - The socket to use for connection."]
#[doc = " * `p_servaddr` - The address of the server to connect to."]
#[doc = " * `addrlen` - The size of the p_servaddr argument."]
#[doc = ""]
#[doc = " Returns 0 on success, or -1 on error."]
pub fn nrf_connect(
sock: ctypes::c_int,
p_servaddr: *const ctypes::c_void,
addrlen: nrf_socklen_t,
) -> ctypes::c_int;
}
extern "C" {
#[doc = " Function for sending data through a socket."]
#[doc = ""]
#[doc = " s By default, this function will block unless the NRF_O_NONBLOCK"]
#[doc = " socket option has been set, OR NRF_MSG_DONTWAIT is passed as a flag. In that case, the"]
#[doc = " method will return immediately."]
#[doc = ""]
#[doc = " * `sock` - The socket to write data to."]
#[doc = " * `p_buff` - Buffer containing the data to send."]
#[doc = " * `nbytes` - Size of data contained on p_buff."]
#[doc = " * `flags` - Flags to control send behavior."]
#[doc = ""]
#[doc = " Returns The number of bytes that were sent on success, or -1 on error."]
pub fn nrf_send(
sock: ctypes::c_int,
p_buff: *const ctypes::c_void,
nbytes: size_t,
flags: ctypes::c_int,
) -> ssize_t;
}
extern "C" {
#[doc = " Function for sending datagram through a socket."]
#[doc = ""]
#[doc = " s By default, this function will block if the lower layers are not able to process the"]
#[doc = " packet, unless the NRF_O_NONBLOCK socket option has been set, OR NRF_MSG_DONTWAIT is passed as a flag."]
#[doc = " In that case, the method will return immediately."]
#[doc = ""]
#[doc = " * `sock` - The socket to write data to."]
#[doc = " * `p_buff` - Buffer containing the data to send."]
#[doc = " * `nbytes` - Size of data contained in p_buff."]
#[doc = " * `flags` - Flags to control send behavior."]
#[doc = " * `p_servaddr` - The address of the server to send to."]
#[doc = " * `addrlen` - The size of the p_servaddr argument."]
#[doc = ""]
#[doc = " Returns The number of bytes that were sent on success, or -1 on error."]
pub fn nrf_sendto(
sock: ctypes::c_int,
p_buff: *const ctypes::c_void,
nbytes: size_t,
flags: ctypes::c_int,
p_servaddr: *const ctypes::c_void,
addrlen: nrf_socklen_t,
) -> ssize_t;
}
extern "C" {
#[doc = " Function for writing data to a socket. See `nrf_send()` for details."]
#[doc = ""]
#[doc = " * `sock` - The socket to write data to."]
#[doc = " * `p_buff` - Buffer containing the data to send."]
#[doc = " * `nbytes` - Size of data contained in p_buff."]
#[doc = ""]
#[doc = " Returns The number of bytes that were sent on success, or -1 on error."]
pub fn nrf_write(sock: ctypes::c_int, p_buff: *const ctypes::c_void, nbytes: size_t)
-> ssize_t;
}
extern "C" {
#[doc = " Function for receiving data on a socket."]
#[doc = ""]
#[doc = " s API for receiving data from a socket. By default, this function will block, unless the"]
#[doc = " NRF_O_NONBLOCK socket option has been set, or NRF_MSG_DONTWAIT is passed as a flag."]
#[doc = ""]
#[doc = " * `sock` - The socket to receive data from."]
#[doc = " * `p_buff` - Buffer to hold the data to be read."]
#[doc = " * `nbytes` - Number of bytes to read. Should not be larger than the size of p_buff."]
#[doc = " * `flags` - Flags to control receive behavior."]
#[doc = ""]
#[doc = " Returns The number of bytes that were read, or -1 on error."]
pub fn nrf_recv(
sock: ctypes::c_int,
p_buff: *mut ctypes::c_void,
nbytes: size_t,
flags: ctypes::c_int,
) -> ssize_t;
}
extern "C" {
#[doc = " Function for receiving datagram on a socket."]
#[doc = ""]
#[doc = " s API for receiving data from a socket. By default, this function will block, unless the"]
#[doc = " NRF_O_NONBLOCK socket option has been set, or NRF_MSG_DONTWAIT is passed as a flag."]
#[doc = ""]
#[doc = " * `sock` - The socket to receive data from."]
#[doc = " * `p_buff` - Buffer to hold the data to be read."]
#[doc = " * `nbytes` - Number of bytes to read. Should not be larger than the size of p_buff."]
#[doc = " * `flags` - Flags to control receive behavior."]
#[doc = " * `p_cliaddr` - Socket address that will be set to the client's address."]
#[doc = " * `p_addrlen` - The size of the p_cliaddr passed. Might be modified by the function."]
#[doc = ""]
#[doc = " Returns The number of bytes that were read, or -1 on error."]
pub fn nrf_recvfrom(
sock: ctypes::c_int,
p_buff: *mut ctypes::c_void,
nbytes: size_t,
flags: ctypes::c_int,
p_cliaddr: *mut ctypes::c_void,
p_addrlen: *mut nrf_socklen_t,
) -> ssize_t;
}
extern "C" {
#[doc = " Function for reading data from a socket. See `nrf_recv()` for details."]
#[doc = ""]
#[doc = " * `sock` - The socket to receive data from."]
#[doc = " * `p_buff` - Buffer to hold the data to be read."]
#[doc = " * `nbytes` - Number of bytes to read. Should not be larger than the size of p_buff."]
#[doc = ""]
#[doc = " Returns The number of bytes that were read, or -1 on error."]
pub fn nrf_read(sock: ctypes::c_int, p_buff: *mut ctypes::c_void, nbytes: size_t) -> ssize_t;
}
extern "C" {
#[doc = " Function for waiting for read, write, or exception events on a socket."]
#[doc = ""]
#[doc = " s Wait for a set of socket descriptors to be ready for reading, writing, or having"]
#[doc = " exceptions. The set of socket descriptors is configured before calling this function."]
#[doc = " This function will block until any of the descriptors in the set has any of the required"]
#[doc = " events. This function is mostly useful when using NRF_O_NONBLOCK or NRF_MSG_DONTWAIT"]
#[doc = " options to enable asynchronous operation."]
#[doc = ""]
#[doc = " * `nfds` - The highest socket descriptor value contained in the sets."]
#[doc = " * `p_readset` - The set of descriptors for which to wait for read events. Set to NULL"]
#[doc = " if not used."]
#[doc = " * `p_writeset` - The set of descriptors for which to wait for write events. Set to NULL"]
#[doc = " if not used."]
#[doc = " * `p_exceptset` - The set of descriptors for which to wait for exception events. Set to"]
#[doc = " NULL if not used."]
#[doc = " * `p_timeout` - The timeout to use for select call. Set to NULL if waiting forever."]
#[doc = ""]
#[doc = " Returns The number of ready descriptors contained in the descriptor sets on success, or -1 on error."]
pub fn nrf_select(
nfds: ctypes::c_int,
p_readset: *mut nrf_fd_set,
p_writeset: *mut nrf_fd_set,
p_exceptset: *mut nrf_fd_set,
p_timeout: *const nrf_timeval,
) -> ctypes::c_int;
}
#[doc = " @details This structure is used to describe which events to poll for a given socket. Which is then given as argument"]
#[doc = " to nrf_poll()."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_pollfd {
#[doc = "< Socket handle."]
pub fd: ctypes::c_int,
#[doc = "< Requested events, is a mask of events."]
pub events: ctypes::c_short,
#[doc = "< Returned events, is a mask of events."]
pub revents: ctypes::c_short,
}
#[test]
fn bindgen_test_layout_nrf_pollfd() {
assert_eq!(
::core::mem::size_of::<nrf_pollfd>(),
8usize,
concat!("Size of: ", stringify!(nrf_pollfd))
);
assert_eq!(
::core::mem::align_of::<nrf_pollfd>(),
4usize,
concat!("Alignment of ", stringify!(nrf_pollfd))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_pollfd>())).fd as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_pollfd),
"::",
stringify!(fd)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_pollfd>())).events as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_pollfd),
"::",
stringify!(events)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_pollfd>())).revents as *const _ as usize },
6usize,
concat!(
"Offset of field: ",
stringify!(nrf_pollfd),
"::",
stringify!(revents)
)
);
}
extern "C" {
#[doc = " Method to poll for events on one or more sockets."]
#[doc = ""]
#[doc = " * `p_fds` - An array of sockets, and respective for each socket that the caller polls for."]
#[doc = " The occurred events per socket is returned in the revents field of nrf_pollfd structure."]
#[doc = " Shall not be NULL."]
#[doc = " * `nfds` - Positive number of sockets being polled for events."]
#[doc = " Shall not be more than BSD_MAX_SOCKET_COUNT."]
#[doc = ""]
#[doc = " * `timeout` - Timeout in milliseconds."]
#[doc = " The methods waits for this time period for the events to occur on the sockets."]
#[doc = ""]
#[doc = " Returns A positive number less than or equal to nfds indicating sockets on which events occurred."]
#[doc = " 0 indicates the timed out occurred and no file descriptors were ready."]
#[doc = " -1 on error, and errno indicates the reason for failure."]
pub fn nrf_poll(p_fds: *mut nrf_pollfd, nfds: u32, timeout: ctypes::c_int) -> ctypes::c_int;
}
extern "C" {
#[doc = " Function for setting socket options for a given socket."]
#[doc = ""]
#[doc = " s The options are grouped by level, and the option value should be the expected for the"]
#[doc = " given option, and the lifetime must be longer than that of the socket."]
#[doc = ""]
#[doc = " * `sock` - The socket for which to set the option."]
#[doc = " * `level` - The level or group to which the option belongs."]
#[doc = " * `optname` - The name of the socket option."]
#[doc = " * `p_optval` - The value to be stored for this option."]
#[doc = " * `optlen` - The size of p_optval."]
#[doc = ""]
#[doc = " Returns 0 on success, or -1 on error."]
pub fn nrf_setsockopt(
sock: ctypes::c_int,
level: ctypes::c_int,
optname: ctypes::c_int,
p_optval: *const ctypes::c_void,
optlen: nrf_socklen_t,
) -> ctypes::c_int;
}
extern "C" {
#[doc = " Function for getting socket options for a given socket."]
#[doc = ""]
#[doc = " s The options are grouped by level, and the option value is the value described by the"]
#[doc = " option name."]
#[doc = ""]
#[doc = " * `sock` - The socket for which to set the option."]
#[doc = " * `level` - The level or group to which the option belongs."]
#[doc = " * `optname` - The name of the socket option."]
#[doc = " * `p_optval` - Pointer to the storage for the option value."]
#[doc = " * `p_optlen` - The size of p_optval. Can be modified to the actual size of p_optval."]
#[doc = ""]
#[doc = " Returns 0 on success, or -1 on error."]
pub fn nrf_getsockopt(
sock: ctypes::c_int,
level: ctypes::c_int,
optname: ctypes::c_int,
p_optval: *mut ctypes::c_void,
p_optlen: *mut nrf_socklen_t,
) -> ctypes::c_int;
}
extern "C" {
#[doc = " Function for binding a socket to an address and port."]
#[doc = ""]
#[doc = " s The provided address must be supported by the socket protocol family."]
#[doc = ""]
#[doc = " * `sock` - The socket descriptor to bind."]
#[doc = " * `p_myaddr` - The address to bind this socket to."]
#[doc = " * `addrlen` - The size of p_myaddr."]
#[doc = ""]
#[doc = " Returns 0 on success, or -1 on error."]
pub fn nrf_bind(
sock: ctypes::c_int,
p_myaddr: *const ctypes::c_void,
addrlen: nrf_socklen_t,
) -> ctypes::c_int;
}
extern "C" {
#[doc = " Function to put the socket in listening mode for incoming connections."]
#[doc = ""]
#[doc = " s Once a socket is marked to be in the listening state, it remains a listening socket until closed."]
#[doc = " It is important to consider the backlog parameter, as it will affect how much memory your application will"]
#[doc = " use in the worst case."]
#[doc = ""]
#[doc = " * `sock` - The socket descriptor on which to set the listening options."]
#[doc = " * `backlog` - The max length of the queue of pending connections. A value of 0 means"]
#[doc = " infinite."]
#[doc = ""]
#[doc = " Returns 0 on success, or -1 on error."]
pub fn nrf_listen(sock: ctypes::c_int, backlog: ctypes::c_int) -> ctypes::c_int;
}
extern "C" {
#[doc = " Function for waiting for the next client to connect."]
#[doc = ""]
#[doc = " s This function will block if there are no clients attempting to connect."]
#[doc = ""]
#[doc = " * `sock` - The socket descriptor to use for waiting on client connections."]
#[doc = " * `p_cliaddr` - Socket address that will be set to the client's address."]
#[doc = " * `p_addrlen` - The size of the p_cliaddr passed. Might be modified by the function."]
#[doc = ""]
#[doc = " Returns A non-negative client descriptor on success, or -1 on error."]
pub fn nrf_accept(
sock: ctypes::c_int,
p_cliaddr: *mut ctypes::c_void,
p_addrlen: *mut nrf_socklen_t,
) -> ctypes::c_int;
}
extern "C" {
#[doc = " Function for converting a human-readable IP address to a form usable by the socket API."]
#[doc = ""]
#[doc = " s This function will convert a string form of addresses and encode it into a byte"]
#[doc = " array in network byte order."]
#[doc = ""]
#[doc = " @note Currently not supporting mixed IPv4 and IPv6 format strings."]
#[doc = ""]
#[doc = " * `family` - Address family. NRF_AF_INET or NRF_AF_INET6."]
#[doc = " * `p_src` - Null-terminated string containing the address to convert."]
#[doc = " * `p_dst` - Pointer to a struct nrf_in_addr or nrf_in6_addr where the address will"]
#[doc = " be stored."]
#[doc = ""]
#[doc = " Returns 1 on success, 0 if p_src does not contain a valid address,"]
#[doc = " -1 and errno set in case of error."]
pub fn nrf_inet_pton(
family: ctypes::c_int,
p_src: *const ctypes::c_char,
p_dst: *mut ctypes::c_void,
) -> ctypes::c_int;
}
extern "C" {
#[doc = " Function for converting an IP address to a human-readable string form."]
#[doc = ""]
#[doc = " s This function will decode the IP bytes from network byte order and convert"]
#[doc = " it to a string form of the address."]
#[doc = ""]
#[doc = " @note Currently not supporting mixed IPv4 and IPv6 format strings."]
#[doc = ""]
#[doc = " * `family` - Address family. NRF_AF_INET or NRF_AF_INET6."]
#[doc = " * `p_src` - Pointer to a struct nrf_in_addr or nrf_in6_addr containing the address to convert."]
#[doc = " * `p_dst` - Pointer to a buffer where the string representation of the address will be stored."]
#[doc = " * `size` - Size of the provided buffer in p_dst."]
#[doc = ""]
#[doc = " Returns Pointer to p_dst on success, NULL and errno set in case of error."]
pub fn nrf_inet_ntop(
family: ctypes::c_int,
p_src: *const ctypes::c_void,
p_dst: *mut ctypes::c_char,
size: nrf_socklen_t,
) -> *const ctypes::c_char;
}
extern "C" {
#[doc = " Function to resolve the host name into IPv4 and/or IPv6 addresses."]
#[doc = ""]
#[doc = " @note The memory pointed to by * `pp_res` - must be freed using"]
#[doc = " nrf_freeaddrinfo when the address is no longer needed"]
#[doc = " or before calling nrf_getaddrinfo again."]
#[doc = ""]
#[doc = " * `p_node` - Host name to resolve."]
#[doc = " * `p_service` - Service to resolve."]
#[doc = " * `p_hints` - Any hints to be used for the resolution."]
#[doc = " * `pp_res` - Pointer to the linked list of resolved addresses if the procedure"]
#[doc = " was successful."]
#[doc = ""]
#[doc = " Returns 0 if the procedure succeeds, else, an errno indicating the reason for failure."]
pub fn nrf_getaddrinfo(
p_node: *const ctypes::c_char,
p_service: *const ctypes::c_char,
p_hints: *const nrf_addrinfo,
pp_res: *mut *mut nrf_addrinfo,
) -> ctypes::c_int;
}
extern "C" {
#[doc = " Function for freeing the memory allocated for the result of nrf_getaddrinfo."]
#[doc = ""]
#[doc = " s When the linked list of resolved addresses created by nrf_getaddrinfo"]
#[doc = " is no longer needed, call this function to free the allocated memory."]
#[doc = ""]
#[doc = " * `p_res` - Pointer to the memory to be freed."]
pub fn nrf_freeaddrinfo(p_res: *mut nrf_addrinfo);
}
extern "C" {
#[doc = " Set a secondary DNS address."]
#[doc = ""]
#[doc = " s The secondary DNS address is used automatically in case the primary DNS"]
#[doc = " address is unreachable, or if no DNS address is provided by the operator."]
#[doc = " The secondary DNS address does not override the primary DNS address."]
#[doc = ""]
#[doc = " * `family` - Address family."]
#[doc = " * `in_addr` - An IPv4 or IPv6 address encoded in a nrf_in_addr or"]
#[doc = " nrf_in6_addr structure, respectively."]
#[doc = " Pass * `NULL` - to unset the secondary DNS address."]
#[doc = ""]
#[doc = " Returns int Zero on success, or an error from @file bsdlib/include/nrf_errno.h"]
#[doc = " otherwise."]
pub fn nrf_setdnsaddr(family: ctypes::c_int, in_addr: *const ctypes::c_void) -> ctypes::c_int;
}
#[doc = " Type definition of handle used for abort"]
#[doc = ""]
#[doc = " This handle could point to the thread or task to abort or any other"]
#[doc = " static memory required for aborting the on-going cryptographic routine(s)."]
pub type nrf_cc3xx_platform_abort_handle_t = *mut ctypes::c_void;
#[doc = " Type definition of platform abort function"]
#[doc = ""]
#[doc = " @note This function pointer will be used when the nrf_cc3xx_platform"]
#[doc = " and/or dependent libraries raises an error that can't be recovered."]
pub type nrf_cc3xx_platform_abort_fn_t =
::core::option::Option<unsafe extern "C" fn(reason: *const ctypes::c_char)>;
#[doc = " Type definition of structure holding platform abort APIs"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_cc3xx_platform_abort_apis_t {
#[doc = "!< Handle to use when crypto operations are aborted."]
pub abort_handle: nrf_cc3xx_platform_abort_handle_t,
#[doc = "!< Function to use when crypto operations are aborted."]
pub abort_fn: nrf_cc3xx_platform_abort_fn_t,
}
#[test]
fn bindgen_test_layout_nrf_cc3xx_platform_abort_apis_t() {
assert_eq!(
::core::mem::size_of::<nrf_cc3xx_platform_abort_apis_t>(),
8usize,
concat!("Size of: ", stringify!(nrf_cc3xx_platform_abort_apis_t))
);
assert_eq!(
::core::mem::align_of::<nrf_cc3xx_platform_abort_apis_t>(),
4usize,
concat!("Alignment of ", stringify!(nrf_cc3xx_platform_abort_apis_t))
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_cc3xx_platform_abort_apis_t>())).abort_handle as *const _
as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_cc3xx_platform_abort_apis_t),
"::",
stringify!(abort_handle)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_cc3xx_platform_abort_apis_t>())).abort_fn as *const _
as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_cc3xx_platform_abort_apis_t),
"::",
stringify!(abort_fn)
)
);
}
extern "C" {
#[doc = " Function to set platform abort APIs"]
#[doc = ""]
#[doc = " * `apis` - Pointer to platform APIs."]
pub fn nrf_cc3xx_platform_set_abort(apis: *const nrf_cc3xx_platform_abort_apis_t);
}
extern "C" {
#[doc = " Function to initialize platform abort APIs"]
#[doc = ""]
#[doc = " @note This function must be called once before calling"]
#[doc = " @ref nrf_cc3xx_platform_init or @ref nrf_cc3xx_platform_init_no_rng."]
#[doc = ""]
#[doc = " @note This function is not expected to be thread-safe."]
pub fn nrf_cc3xx_platform_abort_init();
}
#[doc = " Type definition of architecture neutral mutex type"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_cc3xx_platform_mutex {
pub mutex: *mut ctypes::c_void,
pub flags: u32,
}
#[test]
fn bindgen_test_layout_nrf_cc3xx_platform_mutex() {
assert_eq!(
::core::mem::size_of::<nrf_cc3xx_platform_mutex>(),
8usize,
concat!("Size of: ", stringify!(nrf_cc3xx_platform_mutex))
);
assert_eq!(
::core::mem::align_of::<nrf_cc3xx_platform_mutex>(),
4usize,
concat!("Alignment of ", stringify!(nrf_cc3xx_platform_mutex))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_cc3xx_platform_mutex>())).mutex as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_cc3xx_platform_mutex),
"::",
stringify!(mutex)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nrf_cc3xx_platform_mutex>())).flags as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_cc3xx_platform_mutex),
"::",
stringify!(flags)
)
);
}
#[doc = " Type definition of architecture neutral mutex type"]
pub type nrf_cc3xx_platform_mutex_t = nrf_cc3xx_platform_mutex;
#[doc = " Type definition of function pointer to initialize a mutex"]
#[doc = ""]
#[doc = " Calling this function pointer should initialize a previously uninitialized"]
#[doc = " mutex or do nothing if the mutex is already initialized."]
#[doc = ""]
#[doc = " @note Initialization may not imply memory allocation, as this can be done"]
#[doc = " using static allocation through other APIs in the RTOS."]
#[doc = ""]
#[doc = " * `mutex` - Pointer to a mutex to initialize."]
pub type nrf_cc3xx_platform_mutex_init_fn_t =
::core::option::Option<unsafe extern "C" fn(mutex: *mut nrf_cc3xx_platform_mutex_t)>;
#[doc = " Type definition of function pointer to free a mutex"]
#[doc = ""]
#[doc = " Calling this function pointer should free a mutex."]
#[doc = ""]
#[doc = " @note If the RTOS does not provide an API to free the mutex it is advised"]
#[doc = " to reset the mutex to an initialized state with no owner."]
#[doc = ""]
#[doc = " * `mutex` - Pointer to a mutex to free."]
pub type nrf_cc3xx_platform_mutex_free_fn_t =
::core::option::Option<unsafe extern "C" fn(mutex: *mut nrf_cc3xx_platform_mutex_t)>;
#[doc = " Type definition of function pointer to lock a mutex"]
#[doc = ""]
#[doc = " Calling this function pointer should lock a mutex."]
#[doc = ""]
#[doc = " * `mutex` - Pointer to a mutex to lock."]
pub type nrf_cc3xx_platform_mutex_lock_fn_t = ::core::option::Option<
unsafe extern "C" fn(mutex: *mut nrf_cc3xx_platform_mutex_t) -> ctypes::c_int,
>;
#[doc = " Type definition of function pointer to unlock a mutex"]
#[doc = ""]
#[doc = " Calling this function pointer should unlock a mutex."]
#[doc = ""]
#[doc = " * `mutex` - Pointer to a mutex to unlock."]
pub type nrf_cc3xx_platform_mutex_unlock_fn_t = ::core::option::Option<
unsafe extern "C" fn(mutex: *mut nrf_cc3xx_platform_mutex_t) -> ctypes::c_int,
>;
#[doc = " Type definition of structure holding platform mutex APIs"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_cc3xx_platform_mutex_apis_t {
pub mutex_init_fn: nrf_cc3xx_platform_mutex_init_fn_t,
pub mutex_free_fn: nrf_cc3xx_platform_mutex_free_fn_t,
pub mutex_lock_fn: nrf_cc3xx_platform_mutex_lock_fn_t,
pub mutex_unlock_fn: nrf_cc3xx_platform_mutex_unlock_fn_t,
}
#[test]
fn bindgen_test_layout_nrf_cc3xx_platform_mutex_apis_t() {
assert_eq!(
::core::mem::size_of::<nrf_cc3xx_platform_mutex_apis_t>(),
16usize,
concat!("Size of: ", stringify!(nrf_cc3xx_platform_mutex_apis_t))
);
assert_eq!(
::core::mem::align_of::<nrf_cc3xx_platform_mutex_apis_t>(),
4usize,
concat!("Alignment of ", stringify!(nrf_cc3xx_platform_mutex_apis_t))
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_cc3xx_platform_mutex_apis_t>())).mutex_init_fn as *const _
as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_cc3xx_platform_mutex_apis_t),
"::",
stringify!(mutex_init_fn)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_cc3xx_platform_mutex_apis_t>())).mutex_free_fn as *const _
as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_cc3xx_platform_mutex_apis_t),
"::",
stringify!(mutex_free_fn)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_cc3xx_platform_mutex_apis_t>())).mutex_lock_fn as *const _
as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(nrf_cc3xx_platform_mutex_apis_t),
"::",
stringify!(mutex_lock_fn)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_cc3xx_platform_mutex_apis_t>())).mutex_unlock_fn as *const _
as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(nrf_cc3xx_platform_mutex_apis_t),
"::",
stringify!(mutex_unlock_fn)
)
);
}
#[doc = " Type definition of structure to platform hw mutexes"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nrf_cc3xx_platform_mutexes_t {
pub sym_mutex: *mut ctypes::c_void,
pub asym_mutex: *mut ctypes::c_void,
pub rng_mutex: *mut ctypes::c_void,
pub reserved: *mut ctypes::c_void,
pub power_mutex: *mut ctypes::c_void,
}
#[test]
fn bindgen_test_layout_nrf_cc3xx_platform_mutexes_t() {
assert_eq!(
::core::mem::size_of::<nrf_cc3xx_platform_mutexes_t>(),
20usize,
concat!("Size of: ", stringify!(nrf_cc3xx_platform_mutexes_t))
);
assert_eq!(
::core::mem::align_of::<nrf_cc3xx_platform_mutexes_t>(),
4usize,
concat!("Alignment of ", stringify!(nrf_cc3xx_platform_mutexes_t))
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_cc3xx_platform_mutexes_t>())).sym_mutex as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(nrf_cc3xx_platform_mutexes_t),
"::",
stringify!(sym_mutex)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_cc3xx_platform_mutexes_t>())).asym_mutex as *const _
as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(nrf_cc3xx_platform_mutexes_t),
"::",
stringify!(asym_mutex)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_cc3xx_platform_mutexes_t>())).rng_mutex as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(nrf_cc3xx_platform_mutexes_t),
"::",
stringify!(rng_mutex)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_cc3xx_platform_mutexes_t>())).reserved as *const _ as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(nrf_cc3xx_platform_mutexes_t),
"::",
stringify!(reserved)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<nrf_cc3xx_platform_mutexes_t>())).power_mutex as *const _
as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(nrf_cc3xx_platform_mutexes_t),
"::",
stringify!(power_mutex)
)
);
}
extern "C" {
#[doc = " Function to set platform mutex APIs and mutexes"]
#[doc = ""]
#[doc = " * `apis` - Structure holding the mutex APIs."]
#[doc = " * `mutexes` - Structure holding the mutexes."]
pub fn nrf_cc3xx_platform_set_mutexes(
apis: *const nrf_cc3xx_platform_mutex_apis_t,
mutexes: *const nrf_cc3xx_platform_mutexes_t,
);
}
extern "C" {
#[doc = " Function to initialize RTOS thread-safe mutexes"]
#[doc = ""]
#[doc = " This function must be implemented to set the platform mutex APIS,"]
#[doc = " and platform mutexes."]
#[doc = ""]
#[doc = " @note This function must be called once before calling"]
#[doc = " @ref nrf_cc3xx_platform_init or @ref nrf_cc3xx_platform_init_no_rng."]
#[doc = ""]
#[doc = " @note This function is not expected to be thread-safe."]
pub fn nrf_cc3xx_platform_mutex_init();
}
extern "C" {
#[doc = " Function to generate entropy using Arm CryptoCell cc3xx"]
#[doc = ""]
#[doc = " This API corresponds to mbedtls_hardware_poll. It provides TRNG using"]
#[doc = " the Arm CryptoCell cc3xx hardware accelerator."]
#[doc = ""]
#[doc = " @note This API is only usable if @ref nrf_cc3xx_platform_init was run"]
#[doc = " prior to calling it."]
#[doc = ""]
#[doc = " * `buffer` - Pointer to buffer to hold the entropy data."]
#[doc = " * `length` - Length of the buffer to fill with entropy data."]
#[doc = " * `olen` - Pointer to variable that will hold the length of"]
#[doc = " generated entropy."]
#[doc = ""]
#[doc = " Returns 0 on success"]
#[doc = " Returns Any other error code returned from mbedtls_hardware_poll"]
pub fn nrf_cc3xx_platform_entropy_get(
buffer: *mut u8,
length: size_t,
olen: *mut size_t,
) -> ctypes::c_int;
}