1
2
3
/* automatically generated by rust-bindgen */

# [ repr ( C ) ] # [ derive ( Copy , Clone , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ] pub struct __BindgenBitfieldUnit < Storage , Align > { storage : Storage , align : [ Align ; 0 ] , } impl < Storage , Align > __BindgenBitfieldUnit < Storage , Align > { # [ inline ] pub const fn new ( storage : Storage ) -> Self { Self { storage , align : [ ] } } } impl < Storage , Align > __BindgenBitfieldUnit < Storage , Align > where Storage : AsRef < [ u8 ] > + AsMut < [ u8 ] >, { # [ inline ] pub fn get_bit ( & self , index : usize ) -> bool { debug_assert ! ( index / 8 < self . storage . as_ref ( ) . len ( ) ) ; let byte_index = index / 8 ; let byte = self . storage . as_ref ( ) [ byte_index ] ; let bit_index = if cfg ! ( target_endian = "big" ) { 7 - ( index % 8 ) } else { index % 8 } ; let mask = 1 << bit_index ; byte & mask == mask } # [ inline ] pub fn set_bit ( & mut self , index : usize , val : bool ) { debug_assert ! ( index / 8 < self . storage . as_ref ( ) . len ( ) ) ; let byte_index = index / 8 ; let byte = & mut self . storage . as_mut ( ) [ byte_index ] ; let bit_index = if cfg ! ( target_endian = "big" ) { 7 - ( index % 8 ) } else { index % 8 } ; let mask = 1 << bit_index ; if val { * byte |= mask ; } else { * byte &= ! mask ; } } # [ inline ] pub fn get ( & self , bit_offset : usize , bit_width : u8 ) -> u64 { debug_assert ! ( bit_width <= 64 ) ; debug_assert ! ( bit_offset / 8 < self . storage . as_ref ( ) . len ( ) ) ; debug_assert ! ( ( bit_offset + ( bit_width as usize ) ) / 8 <= self . storage . as_ref ( ) . len ( ) ) ; let mut val = 0 ; for i in 0 .. ( bit_width as usize ) { if self . get_bit ( i + bit_offset ) { let index = if cfg ! ( target_endian = "big" ) { bit_width as usize - 1 - i } else { i } ; val |= 1 << index ; } } val } # [ inline ] pub fn set ( & mut self , bit_offset : usize , bit_width : u8 , val : u64 ) { debug_assert ! ( bit_width <= 64 ) ; debug_assert ! ( bit_offset / 8 < self . storage . as_ref ( ) . len ( ) ) ; debug_assert ! ( ( bit_offset + ( bit_width as usize ) ) / 8 <= self . storage . as_ref ( ) . len ( ) ) ; for i in 0 .. ( bit_width as usize ) { let mask = 1 << i ; let val_bit_is_set = val & mask == mask ; let index = if cfg ! ( target_endian = "big" ) { bit_width as usize - 1 - i } else { i } ; self . set_bit ( index + bit_offset , val_bit_is_set ) ; } } } pub const OT_LOG_LEVEL_NONE : u32 = 0 ; pub const OT_LOG_LEVEL_CRIT : u32 = 1 ; pub const OT_LOG_LEVEL_WARN : u32 = 2 ; pub const OT_LOG_LEVEL_NOTE : u32 = 3 ; pub const OT_LOG_LEVEL_INFO : u32 = 4 ; pub const OT_LOG_LEVEL_DEBG : u32 = 5 ; pub const OT_PANID_BROADCAST : u32 = 65535 ; pub const OT_EXT_ADDRESS_SIZE : u32 = 8 ; pub const OT_MAC_KEY_SIZE : u32 = 16 ; pub const OT_IP6_PREFIX_SIZE : u32 = 8 ; pub const OT_IP6_PREFIX_BITSIZE : u32 = 64 ; pub const OT_IP6_IID_SIZE : u32 = 8 ; pub const OT_IP6_ADDRESS_SIZE : u32 = 16 ; pub const OT_MASTER_KEY_SIZE : u32 = 16 ; pub const OT_NETWORK_NAME_MAX_SIZE : u32 = 16 ; pub const OT_EXT_PAN_ID_SIZE : u32 = 8 ; pub const OT_MESH_LOCAL_PREFIX_SIZE : u32 = 8 ; pub const OT_PSKC_MAX_SIZE : u32 = 16 ; pub const OT_CHANNEL_1_MASK : u32 = 2 ; pub const OT_CHANNEL_2_MASK : u32 = 4 ; pub const OT_CHANNEL_3_MASK : u32 = 8 ; pub const OT_CHANNEL_4_MASK : u32 = 16 ; pub const OT_CHANNEL_5_MASK : u32 = 32 ; pub const OT_CHANNEL_6_MASK : u32 = 64 ; pub const OT_CHANNEL_7_MASK : u32 = 128 ; pub const OT_CHANNEL_8_MASK : u32 = 256 ; pub const OT_CHANNEL_9_MASK : u32 = 512 ; pub const OT_CHANNEL_10_MASK : u32 = 1024 ; pub const OT_CHANNEL_11_MASK : u32 = 2048 ; pub const OT_CHANNEL_12_MASK : u32 = 4096 ; pub const OT_CHANNEL_13_MASK : u32 = 8192 ; pub const OT_CHANNEL_14_MASK : u32 = 16384 ; pub const OT_CHANNEL_15_MASK : u32 = 32768 ; pub const OT_CHANNEL_16_MASK : u32 = 65536 ; pub const OT_CHANNEL_17_MASK : u32 = 131072 ; pub const OT_CHANNEL_18_MASK : u32 = 262144 ; pub const OT_CHANNEL_19_MASK : u32 = 524288 ; pub const OT_CHANNEL_20_MASK : u32 = 1048576 ; pub const OT_CHANNEL_21_MASK : u32 = 2097152 ; pub const OT_CHANNEL_22_MASK : u32 = 4194304 ; pub const OT_CHANNEL_23_MASK : u32 = 8388608 ; pub const OT_CHANNEL_24_MASK : u32 = 16777216 ; pub const OT_CHANNEL_25_MASK : u32 = 33554432 ; pub const OT_CHANNEL_26_MASK : u32 = 67108864 ; pub const OT_COMMISSIONING_PASSPHRASE_MIN_SIZE : u32 = 6 ; pub const OT_COMMISSIONING_PASSPHRASE_MAX_SIZE : u32 = 255 ; pub const OT_PROVISIONING_URL_MAX_SIZE : u32 = 64 ; pub const OT_STEERING_DATA_MAX_LENGTH : u32 = 16 ; pub const OT_PSKD_MAX_SIZE : u32 = 32 ; pub const OT_NETWORK_DATA_ITERATOR_INIT : u32 = 0 ; pub const OT_SERVICE_DATA_MAX_SIZE : u32 = 252 ; pub const OT_SERVER_DATA_MAX_SIZE : u32 = 248 ; pub const OT_DEFAULT_COAP_PORT : u32 = 5683 ; pub const OT_COAP_MAX_TOKEN_LENGTH : u32 = 8 ; pub const OT_COAP_MAX_RETRANSMIT : u32 = 30 ; pub const OT_COAP_MIN_ACK_TIMEOUT : u32 = 1000 ; pub const OT_DEFAULT_COAP_SECURE_PORT : u32 = 5684 ; pub const OT_CRYPTO_HMAC_SHA_HASH_SIZE : u32 = 32 ; pub const OT_DNS_MAX_HOSTNAME_LENGTH : u32 = 62 ; pub const OT_DNS_DEFAULT_SERVER_IP : & 'static [ u8 ; 21usize ] = b"2001:4860:4860::8888\0" ; pub const OT_DNS_DEFAULT_SERVER_PORT : u32 = 53 ; pub const OT_ICMP6_HEADER_DATA_SIZE : u32 = 4 ; pub const OT_MAC_FILTER_FIXED_RSS_DISABLED : u32 = 127 ; pub const OT_MAC_FILTER_ITERATOR_INIT : u32 = 0 ; pub const OT_NCP_LEGACY_ULA_PREFIX_LENGTH : u32 = 8 ; pub const OT_NETWORK_BASE_TLV_MAX_LENGTH : u32 = 254 ; pub const OT_NETWORK_MAX_ROUTER_ID : u32 = 62 ; pub const OT_NEIGHBOR_INFO_ITERATOR_INIT : u32 = 0 ; pub const OT_NETWORK_DIAGNOSTIC_TYPELIST_MAX_ENTRIES : u32 = 19 ; pub const OT_NETWORK_DIAGNOSTIC_CHILD_TABLE_ENTRY_SIZE : u32 = 3 ; pub const OT_NETWORK_DIAGNOSTIC_ITERATOR_INIT : u32 = 0 ; pub const OT_TIME_SYNC_INVALID_SEQ : u32 = 0 ; pub const OT_SNTP_DEFAULT_SERVER_IP : & 'static [ u8 ; 19usize ] = b"2001:4860:4806:8::\0" ; pub const OT_SNTP_DEFAULT_SERVER_PORT : u32 = 123 ; pub const OT_CHILD_IP6_ADDRESS_ITERATOR_INIT : u32 = 0 ; pub type size_t = :: std :: os :: raw :: c_ulong ; pub type __int8_t = :: std :: os :: raw :: c_schar ; pub type __uint8_t = :: std :: os :: raw :: c_uchar ; pub type __int16_t = :: std :: os :: raw :: c_short ; pub type __uint16_t = :: std :: os :: raw :: c_ushort ; pub type __uint32_t = :: std :: os :: raw :: c_uint ; pub type __int64_t = :: std :: os :: raw :: c_long ; pub type __uint64_t = :: std :: os :: raw :: c_ulong ; # [ doc = " No error." ] pub const otError_OT_ERROR_NONE : otError = 0 ; # [ doc = " Operational failed." ] pub const otError_OT_ERROR_FAILED : otError = 1 ; # [ doc = " Message was dropped." ] pub const otError_OT_ERROR_DROP : otError = 2 ; # [ doc = " Insufficient buffers." ] pub const otError_OT_ERROR_NO_BUFS : otError = 3 ; # [ doc = " No route available." ] pub const otError_OT_ERROR_NO_ROUTE : otError = 4 ; # [ doc = " Service is busy and could not service the operation." ] pub const otError_OT_ERROR_BUSY : otError = 5 ; # [ doc = " Failed to parse message." ] pub const otError_OT_ERROR_PARSE : otError = 6 ; # [ doc = " Input arguments are invalid." ] pub const otError_OT_ERROR_INVALID_ARGS : otError = 7 ; # [ doc = " Security checks failed." ] pub const otError_OT_ERROR_SECURITY : otError = 8 ; # [ doc = " Address resolution requires an address query operation." ] pub const otError_OT_ERROR_ADDRESS_QUERY : otError = 9 ; # [ doc = " Address is not in the source match table." ] pub const otError_OT_ERROR_NO_ADDRESS : otError = 10 ; # [ doc = " Operation was aborted." ] pub const otError_OT_ERROR_ABORT : otError = 11 ; # [ doc = " Function or method is not implemented." ] pub const otError_OT_ERROR_NOT_IMPLEMENTED : otError = 12 ; # [ doc = " Cannot complete due to invalid state." ] pub const otError_OT_ERROR_INVALID_STATE : otError = 13 ; # [ doc = " No acknowledgment was received after macMaxFrameRetries (IEEE 802.15.4-2006)." ] pub const otError_OT_ERROR_NO_ACK : otError = 14 ; # [ doc = " A transmission could not take place due to activity on the channel, i.e., the CSMA-CA mechanism has failed" ] # [ doc = " (IEEE 802.15.4-2006)." ] pub const otError_OT_ERROR_CHANNEL_ACCESS_FAILURE : otError = 15 ; # [ doc = " Not currently attached to a Thread Partition." ] pub const otError_OT_ERROR_DETACHED : otError = 16 ; # [ doc = " FCS check failure while receiving." ] pub const otError_OT_ERROR_FCS : otError = 17 ; # [ doc = " No frame received." ] pub const otError_OT_ERROR_NO_FRAME_RECEIVED : otError = 18 ; # [ doc = " Received a frame from an unknown neighbor." ] pub const otError_OT_ERROR_UNKNOWN_NEIGHBOR : otError = 19 ; # [ doc = " Received a frame from an invalid source address." ] pub const otError_OT_ERROR_INVALID_SOURCE_ADDRESS : otError = 20 ; # [ doc = " Received a frame filtered by the address filter (whitelisted or blacklisted)." ] pub const otError_OT_ERROR_ADDRESS_FILTERED : otError = 21 ; # [ doc = " Received a frame filtered by the destination address check." ] pub const otError_OT_ERROR_DESTINATION_ADDRESS_FILTERED : otError = 22 ; # [ doc = " The requested item could not be found." ] pub const otError_OT_ERROR_NOT_FOUND : otError = 23 ; # [ doc = " The operation is already in progress." ] pub const otError_OT_ERROR_ALREADY : otError = 24 ; # [ doc = " The creation of IPv6 address failed." ] pub const otError_OT_ERROR_IP6_ADDRESS_CREATION_FAILURE : otError = 26 ; # [ doc = " Operation prevented by mode flags" ] pub const otError_OT_ERROR_NOT_CAPABLE : otError = 27 ; # [ doc = " Coap response or acknowledgment or DNS, SNTP response not received." ] pub const otError_OT_ERROR_RESPONSE_TIMEOUT : otError = 28 ; # [ doc = " Received a duplicated frame." ] pub const otError_OT_ERROR_DUPLICATED : otError = 29 ; # [ doc = " Message is being dropped from reassembly list due to timeout." ] pub const otError_OT_ERROR_REASSEMBLY_TIMEOUT : otError = 30 ; # [ doc = " Message is not a TMF Message." ] pub const otError_OT_ERROR_NOT_TMF : otError = 31 ; # [ doc = " Received a non-lowpan data frame." ] pub const otError_OT_ERROR_NOT_LOWPAN_DATA_FRAME : otError = 32 ; # [ doc = " The link margin was too low." ] pub const otError_OT_ERROR_LINK_MARGIN_LOW : otError = 34 ; # [ doc = " Input (CLI) command is invalid." ] pub const otError_OT_ERROR_INVALID_COMMAND : otError = 35 ; # [ doc = " The number of defined errors." ] pub const otError_OT_NUM_ERRORS : otError = 36 ; # [ doc = " Generic error (should not use)." ] pub const otError_OT_ERROR_GENERIC : otError = 255 ; # [ doc = " This enumeration represents error codes used throughout OpenThread." ] # [ doc = "" ] pub type otError = u32 ; extern "C" { # [ doc = " This function converts an otError enum into a string." ] # [ doc = "" ] # [ doc = " @param[in]  aError     An otError enum." ] # [ doc = "" ] # [ doc = " @returns  A string representation of an otError." ] # [ doc = "" ] pub fn otThreadErrorToString ( aError : otError ) -> * const :: std :: os :: raw :: c_char ; } pub type va_list = __builtin_va_list ; # [ doc = " This type represents the log level." ] # [ doc = "" ] pub type otLogLevel = :: std :: os :: raw :: c_int ; # [ doc = "< OpenThread API" ] pub const otLogRegion_OT_LOG_REGION_API : otLogRegion = 1 ; # [ doc = "< MLE" ] pub const otLogRegion_OT_LOG_REGION_MLE : otLogRegion = 2 ; # [ doc = "< EID-to-RLOC mapping." ] pub const otLogRegion_OT_LOG_REGION_ARP : otLogRegion = 3 ; # [ doc = "< Network Data" ] pub const otLogRegion_OT_LOG_REGION_NET_DATA : otLogRegion = 4 ; # [ doc = "< ICMPv6" ] pub const otLogRegion_OT_LOG_REGION_ICMP : otLogRegion = 5 ; # [ doc = "< IPv6" ] pub const otLogRegion_OT_LOG_REGION_IP6 : otLogRegion = 6 ; # [ doc = "< IEEE 802.15.4 MAC" ] pub const otLogRegion_OT_LOG_REGION_MAC : otLogRegion = 7 ; # [ doc = "< Memory" ] pub const otLogRegion_OT_LOG_REGION_MEM : otLogRegion = 8 ; # [ doc = "< NCP" ] pub const otLogRegion_OT_LOG_REGION_NCP : otLogRegion = 9 ; # [ doc = "< Mesh Commissioning Protocol" ] pub const otLogRegion_OT_LOG_REGION_MESH_COP : otLogRegion = 10 ; # [ doc = "< Network Diagnostic" ] pub const otLogRegion_OT_LOG_REGION_NET_DIAG : otLogRegion = 11 ; # [ doc = "< Platform" ] pub const otLogRegion_OT_LOG_REGION_PLATFORM : otLogRegion = 12 ; # [ doc = "< CoAP" ] pub const otLogRegion_OT_LOG_REGION_COAP : otLogRegion = 13 ; # [ doc = "< CLI" ] pub const otLogRegion_OT_LOG_REGION_CLI : otLogRegion = 14 ; # [ doc = "< OpenThread Core" ] pub const otLogRegion_OT_LOG_REGION_CORE : otLogRegion = 15 ; # [ doc = "< Utility module" ] pub const otLogRegion_OT_LOG_REGION_UTIL : otLogRegion = 16 ; # [ doc = "< Backbone Router (available since Thread 1.2)" ] pub const otLogRegion_OT_LOG_REGION_BBR : otLogRegion = 17 ; # [ doc = " This enumeration represents log regions." ] # [ doc = "" ] pub type otLogRegion = u32 ; extern "C" { # [ doc = " This function outputs logs." ] # [ doc = "" ] # [ doc = " @param[in]  aLogLevel   The log level." ] # [ doc = " @param[in]  aLogRegion  The log region." ] # [ doc = " @param[in]  aFormat     A pointer to the format string." ] # [ doc = " @param[in]  ...         Arguments for the format specification." ] # [ doc = "" ] pub fn otPlatLog ( aLogLevel : otLogLevel , aLogRegion : otLogRegion , aFormat : * const :: std :: os :: raw :: c_char , ... ) ; } # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otInstance { _unused : [ u8 ; 0 ] , } extern "C" { # [ doc = " This function initializes the OpenThread library." ] # [ doc = "" ] # [ doc = " This function initializes OpenThread and prepares it for subsequent OpenThread API calls. This function must be" ] # [ doc = " called before any other calls to OpenThread." ] # [ doc = "" ] # [ doc = " This function is available and can only be used when support for multiple OpenThread instances is enabled." ] # [ doc = "" ] # [ doc = " @param[in]    aInstanceBuffer      The buffer for OpenThread to use for allocating the otInstance structure." ] # [ doc = " @param[inout] aInstanceBufferSize  On input, the size of aInstanceBuffer. On output, if not enough space for" ] # [ doc = "                                    otInstance, the number of bytes required for otInstance." ] # [ doc = "" ] # [ doc = " @returns  A pointer to the new OpenThread instance." ] # [ doc = "" ] # [ doc = " @sa otInstanceFinalize" ] # [ doc = "" ] pub fn otInstanceInit ( aInstanceBuffer : * mut :: std :: os :: raw :: c_void , aInstanceBufferSize : * mut size_t ) -> * mut otInstance ; } extern "C" { # [ doc = " This function initializes the static single instance of the OpenThread library." ] # [ doc = "" ] # [ doc = " This function initializes OpenThread and prepares it for subsequent OpenThread API calls. This function must be" ] # [ doc = " called before any other calls to OpenThread." ] # [ doc = "" ] # [ doc = " This function is available and can only be used when support for multiple OpenThread instances is disabled." ] # [ doc = "" ] # [ doc = " @returns A pointer to the single OpenThread instance." ] # [ doc = "" ] pub fn otInstanceInitSingle ( ) -> * mut otInstance ; } extern "C" { # [ doc = " This function indicates whether or not the instance is valid/initialized." ] # [ doc = "" ] # [ doc = " The instance is considered valid if it is acquired and initialized using either `otInstanceInitSingle()` (in single" ] # [ doc = " instance case) or `otInstanceInit()` (in multi instance case). A subsequent call to `otInstanceFinalize()` causes" ] # [ doc = " the instance to be considered as uninitialized." ] # [ doc = "" ] # [ doc = " @param[in] aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns TRUE if the given instance is valid/initialized, FALSE otherwise." ] # [ doc = "" ] pub fn otInstanceIsInitialized ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " This function disables the OpenThread library." ] # [ doc = "" ] # [ doc = " Call this function when OpenThread is no longer in use." ] # [ doc = "" ] # [ doc = " @param[in] aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] pub fn otInstanceFinalize ( aInstance : * mut otInstance ) ; } # [ doc = "< IPv6 address was added" ] pub const OT_CHANGED_IP6_ADDRESS_ADDED : _bindgen_ty_1 = 1 ; # [ doc = "< IPv6 address was removed" ] pub const OT_CHANGED_IP6_ADDRESS_REMOVED : _bindgen_ty_1 = 2 ; # [ doc = "< Role (disabled, detached, child, router, leader) changed" ] pub const OT_CHANGED_THREAD_ROLE : _bindgen_ty_1 = 4 ; # [ doc = "< The link-local address changed" ] pub const OT_CHANGED_THREAD_LL_ADDR : _bindgen_ty_1 = 8 ; # [ doc = "< The mesh-local address changed" ] pub const OT_CHANGED_THREAD_ML_ADDR : _bindgen_ty_1 = 16 ; # [ doc = "< RLOC was added" ] pub const OT_CHANGED_THREAD_RLOC_ADDED : _bindgen_ty_1 = 32 ; # [ doc = "< RLOC was removed" ] pub const OT_CHANGED_THREAD_RLOC_REMOVED : _bindgen_ty_1 = 64 ; # [ doc = "< Partition ID changed" ] pub const OT_CHANGED_THREAD_PARTITION_ID : _bindgen_ty_1 = 128 ; # [ doc = "< Thread Key Sequence changed" ] pub const OT_CHANGED_THREAD_KEY_SEQUENCE_COUNTER : _bindgen_ty_1 = 256 ; # [ doc = "< Thread Network Data changed" ] pub const OT_CHANGED_THREAD_NETDATA : _bindgen_ty_1 = 512 ; # [ doc = "< Child was added" ] pub const OT_CHANGED_THREAD_CHILD_ADDED : _bindgen_ty_1 = 1024 ; # [ doc = "< Child was removed" ] pub const OT_CHANGED_THREAD_CHILD_REMOVED : _bindgen_ty_1 = 2048 ; # [ doc = "< Subscribed to a IPv6 multicast address" ] pub const OT_CHANGED_IP6_MULTICAST_SUBSCRIBED : _bindgen_ty_1 = 4096 ; # [ doc = "< Unsubscribed from a IPv6 multicast address" ] pub const OT_CHANGED_IP6_MULTICAST_UNSUBSCRIBED : _bindgen_ty_1 = 8192 ; # [ doc = "< Thread network channel changed" ] pub const OT_CHANGED_THREAD_CHANNEL : _bindgen_ty_1 = 16384 ; # [ doc = "< Thread network PAN Id changed" ] pub const OT_CHANGED_THREAD_PANID : _bindgen_ty_1 = 32768 ; # [ doc = "< Thread network name changed" ] pub const OT_CHANGED_THREAD_NETWORK_NAME : _bindgen_ty_1 = 65536 ; # [ doc = "< Thread network extended PAN ID changed" ] pub const OT_CHANGED_THREAD_EXT_PANID : _bindgen_ty_1 = 131072 ; # [ doc = "< Master key changed" ] pub const OT_CHANGED_MASTER_KEY : _bindgen_ty_1 = 262144 ; # [ doc = "< PSKc changed" ] pub const OT_CHANGED_PSKC : _bindgen_ty_1 = 524288 ; # [ doc = "< Security Policy changed" ] pub const OT_CHANGED_SECURITY_POLICY : _bindgen_ty_1 = 1048576 ; # [ doc = "< Channel Manager new pending Thread channel changed" ] pub const OT_CHANGED_CHANNEL_MANAGER_NEW_CHANNEL : _bindgen_ty_1 = 2097152 ; # [ doc = "< Supported channel mask changed" ] pub const OT_CHANGED_SUPPORTED_CHANNEL_MASK : _bindgen_ty_1 = 4194304 ; # [ doc = "< Commissioner state changed" ] pub const OT_CHANGED_COMMISSIONER_STATE : _bindgen_ty_1 = 8388608 ; # [ doc = "< Thread network interface state changed" ] pub const OT_CHANGED_THREAD_NETIF_STATE : _bindgen_ty_1 = 16777216 ; # [ doc = "< Backbone Router state changed" ] pub const OT_CHANGED_THREAD_BACKBONE_ROUTER_STATE : _bindgen_ty_1 = 33554432 ; # [ doc = "< Local Backbone Router configuration changed" ] pub const OT_CHANGED_THREAD_BACKBONE_ROUTER_LOCAL : _bindgen_ty_1 = 67108864 ; # [ doc = "< Joiner state changed" ] pub const OT_CHANGED_JOINER_STATE : _bindgen_ty_1 = 134217728 ; # [ doc = " This enumeration defines flags that are passed as part of `otStateChangedCallback`." ] # [ doc = "" ] pub type _bindgen_ty_1 = u32 ; # [ doc = " This type represents a bit-field indicating specific state/configuration that has changed. See `OT_CHANGED_*`" ] # [ doc = " definitions." ] # [ doc = "" ] pub type otChangedFlags = u32 ; # [ doc = " This function pointer is called to notify certain configuration or state changes within OpenThread." ] # [ doc = "" ] # [ doc = " @param[in]  aFlags    A bit-field indicating specific state that has changed.  See `OT_CHANGED_*` definitions." ] # [ doc = " @param[in]  aContext  A pointer to application-specific context." ] # [ doc = "" ] pub type otStateChangedCallback = :: std :: option :: Option < unsafe extern "C" fn ( aFlags : otChangedFlags , aContext : * mut :: std :: os :: raw :: c_void ) > ; extern "C" { # [ doc = " This function registers a callback to indicate when certain configuration or state changes within OpenThread." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aCallback  A pointer to a function that is called with certain configuration or state changes." ] # [ doc = " @param[in]  aContext   A pointer to application-specific context." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE     Added the callback to the list of callbacks." ] # [ doc = " @retval OT_ERROR_ALREADY  The callback was already registered." ] # [ doc = " @retval OT_ERROR_NO_BUFS  Could not add the callback due to resource constraints." ] # [ doc = "" ] pub fn otSetStateChangedCallback ( aInstance : * mut otInstance , aCallback : otStateChangedCallback , aContext : * mut :: std :: os :: raw :: c_void ) -> otError ; } extern "C" { # [ doc = " This function removes a callback to indicate when certain configuration or state changes within OpenThread." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aCallback   A pointer to a function that is called with certain configuration or state changes." ] # [ doc = " @param[in]  aContext    A pointer to application-specific context." ] # [ doc = "" ] pub fn otRemoveStateChangeCallback ( aInstance : * mut otInstance , aCallback : otStateChangedCallback , aContext : * mut :: std :: os :: raw :: c_void ) ; } extern "C" { # [ doc = " This method triggers a platform reset." ] # [ doc = "" ] # [ doc = " The reset process ensures that all the OpenThread state/info (stored in volatile memory) is erased. Note that the" ] # [ doc = " `otPlatformReset` does not erase any persistent state/info saved in non-volatile memory." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] pub fn otInstanceReset ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " This method deletes all the settings stored on non-volatile memory, and then triggers platform reset." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] pub fn otInstanceFactoryReset ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " This function erases all the OpenThread persistent info (network settings) stored on non-volatile memory." ] # [ doc = " Erase is successful only if the device is in `disabled` state/role." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           All persistent info/state was erased successfully." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  Device is not in `disabled` state/role." ] # [ doc = "" ] pub fn otInstanceErasePersistentInfo ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " This function gets the OpenThread version string." ] # [ doc = "" ] # [ doc = " @returns A pointer to the OpenThread version." ] # [ doc = "" ] pub fn otGetVersionString ( ) -> * const :: std :: os :: raw :: c_char ; } extern "C" { # [ doc = " This function gets the OpenThread radio version string." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to the OpenThread radio version." ] # [ doc = "" ] pub fn otGetRadioVersionString ( aInstance : * mut otInstance ) -> * const :: std :: os :: raw :: c_char ; } # [ doc = " This structure points to an OpenThread message buffer." ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otMessage { # [ doc = "< A pointer to the next Message buffer." ] pub mNext : * mut otMessage , } # [ test ] fn bindgen_test_layout_otMessage ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otMessage > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( otMessage ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otMessage > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otMessage ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMessage > ( ) ) ) . mNext as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otMessage ) , "::" , stringify ! ( mNext ) ) ) ; } # [ doc = " This structure represents the message buffer information." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otBufferInfo { # [ doc = "< The number of buffers in the pool." ] pub mTotalBuffers : u16 , # [ doc = "< The number of free message buffers." ] pub mFreeBuffers : u16 , # [ doc = "< The number of messages in the 6lo send queue." ] pub m6loSendMessages : u16 , # [ doc = "< The number of buffers in the 6lo send queue." ] pub m6loSendBuffers : u16 , # [ doc = "< The number of messages in the 6LoWPAN reassembly queue." ] pub m6loReassemblyMessages : u16 , # [ doc = "< The number of buffers in the 6LoWPAN reassembly queue." ] pub m6loReassemblyBuffers : u16 , # [ doc = "< The number of messages in the IPv6 send queue." ] pub mIp6Messages : u16 , # [ doc = "< The number of buffers in the IPv6 send queue." ] pub mIp6Buffers : u16 , # [ doc = "< The number of messages in the MPL send queue." ] pub mMplMessages : u16 , # [ doc = "< The number of buffers in the MPL send queue." ] pub mMplBuffers : u16 , # [ doc = "< The number of messages in the MLE send queue." ] pub mMleMessages : u16 , # [ doc = "< The number of buffers in the MLE send queue." ] pub mMleBuffers : u16 , # [ doc = "< The number of messages in the ARP send queue." ] pub mArpMessages : u16 , # [ doc = "< The number of buffers in the ARP send queue." ] pub mArpBuffers : u16 , # [ doc = "< The number of messages in the CoAP send queue." ] pub mCoapMessages : u16 , # [ doc = "< The number of buffers in the CoAP send queue." ] pub mCoapBuffers : u16 , # [ doc = "< The number of messages in the CoAP secure send queue." ] pub mCoapSecureMessages : u16 , # [ doc = "< The number of buffers in the CoAP secure send queue." ] pub mCoapSecureBuffers : u16 , # [ doc = "< The number of messages in the application CoAP send queue." ] pub mApplicationCoapMessages : u16 , # [ doc = "< The number of buffers in the application CoAP send queue." ] pub mApplicationCoapBuffers : u16 , } # [ test ] fn bindgen_test_layout_otBufferInfo ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otBufferInfo > ( ) , 40usize , concat ! ( "Size of: " , stringify ! ( otBufferInfo ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otBufferInfo > ( ) , 2usize , concat ! ( "Alignment of " , stringify ! ( otBufferInfo ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . mTotalBuffers as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( mTotalBuffers ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . mFreeBuffers as * const _ as usize } , 2usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( mFreeBuffers ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . m6loSendMessages as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( m6loSendMessages ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . m6loSendBuffers as * const _ as usize } , 6usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( m6loSendBuffers ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . m6loReassemblyMessages as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( m6loReassemblyMessages ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . m6loReassemblyBuffers as * const _ as usize } , 10usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( m6loReassemblyBuffers ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . mIp6Messages as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( mIp6Messages ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . mIp6Buffers as * const _ as usize } , 14usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( mIp6Buffers ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . mMplMessages as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( mMplMessages ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . mMplBuffers as * const _ as usize } , 18usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( mMplBuffers ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . mMleMessages as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( mMleMessages ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . mMleBuffers as * const _ as usize } , 22usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( mMleBuffers ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . mArpMessages as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( mArpMessages ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . mArpBuffers as * const _ as usize } , 26usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( mArpBuffers ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . mCoapMessages as * const _ as usize } , 28usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( mCoapMessages ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . mCoapBuffers as * const _ as usize } , 30usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( mCoapBuffers ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . mCoapSecureMessages as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( mCoapSecureMessages ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . mCoapSecureBuffers as * const _ as usize } , 34usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( mCoapSecureBuffers ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . mApplicationCoapMessages as * const _ as usize } , 36usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( mApplicationCoapMessages ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBufferInfo > ( ) ) ) . mApplicationCoapBuffers as * const _ as usize } , 38usize , concat ! ( "Offset of field: " , stringify ! ( otBufferInfo ) , "::" , stringify ! ( mApplicationCoapBuffers ) ) ) ; } # [ doc = "< Low priority level." ] pub const otMessagePriority_OT_MESSAGE_PRIORITY_LOW : otMessagePriority = 0 ; # [ doc = "< Normal priority level." ] pub const otMessagePriority_OT_MESSAGE_PRIORITY_NORMAL : otMessagePriority = 1 ; # [ doc = "< High priority level." ] pub const otMessagePriority_OT_MESSAGE_PRIORITY_HIGH : otMessagePriority = 2 ; # [ doc = " This enumeration defines the OpenThread message priority levels." ] # [ doc = "" ] pub type otMessagePriority = u32 ; # [ doc = " This structure represents a message settings." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otMessageSettings { # [ doc = "< TRUE if the message should be secured at Layer 2." ] pub mLinkSecurityEnabled : bool , # [ doc = "< The message priority level." ] pub mPriority : otMessagePriority , } # [ test ] fn bindgen_test_layout_otMessageSettings ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otMessageSettings > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( otMessageSettings ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otMessageSettings > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( otMessageSettings ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMessageSettings > ( ) ) ) . mLinkSecurityEnabled as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otMessageSettings ) , "::" , stringify ! ( mLinkSecurityEnabled ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMessageSettings > ( ) ) ) . mPriority as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( otMessageSettings ) , "::" , stringify ! ( mPriority ) ) ) ; } extern "C" { # [ doc = " Free an allocated message buffer." ] # [ doc = "" ] # [ doc = " @param[in]  aMessage  A pointer to a message buffer." ] # [ doc = "" ] # [ doc = " @sa otMessageAppend" ] # [ doc = " @sa otMessageGetLength" ] # [ doc = " @sa otMessageSetLength" ] # [ doc = " @sa otMessageGetOffset" ] # [ doc = " @sa otMessageSetOffset" ] # [ doc = " @sa otMessageRead" ] # [ doc = " @sa otMessageWrite" ] # [ doc = "" ] pub fn otMessageFree ( aMessage : * mut otMessage ) ; } extern "C" { # [ doc = " Get the message length in bytes." ] # [ doc = "" ] # [ doc = " @param[in]  aMessage  A pointer to a message buffer." ] # [ doc = "" ] # [ doc = " @returns The message length in bytes." ] # [ doc = "" ] # [ doc = " @sa otMessageFree" ] # [ doc = " @sa otMessageAppend" ] # [ doc = " @sa otMessageSetLength" ] # [ doc = " @sa otMessageGetOffset" ] # [ doc = " @sa otMessageSetOffset" ] # [ doc = " @sa otMessageRead" ] # [ doc = " @sa otMessageWrite" ] # [ doc = " @sa otMessageSetLength" ] # [ doc = "" ] pub fn otMessageGetLength ( aMessage : * const otMessage ) -> u16 ; } extern "C" { # [ doc = " Set the message length in bytes." ] # [ doc = "" ] # [ doc = " @param[in]  aMessage  A pointer to a message buffer." ] # [ doc = " @param[in]  aLength   A length in bytes." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE     Successfully set the message length." ] # [ doc = " @retval OT_ERROR_NO_BUFS  No available buffers to grow the message." ] # [ doc = "" ] # [ doc = " @sa otMessageFree" ] # [ doc = " @sa otMessageAppend" ] # [ doc = " @sa otMessageGetLength" ] # [ doc = " @sa otMessageGetOffset" ] # [ doc = " @sa otMessageSetOffset" ] # [ doc = " @sa otMessageRead" ] # [ doc = " @sa otMessageWrite" ] # [ doc = "" ] pub fn otMessageSetLength ( aMessage : * mut otMessage , aLength : u16 ) -> otError ; } extern "C" { # [ doc = " Get the message offset in bytes." ] # [ doc = "" ] # [ doc = " @param[in]  aMessage  A pointer to a message buffer." ] # [ doc = "" ] # [ doc = " @returns The message offset value." ] # [ doc = "" ] # [ doc = " @sa otMessageFree" ] # [ doc = " @sa otMessageAppend" ] # [ doc = " @sa otMessageGetLength" ] # [ doc = " @sa otMessageSetLength" ] # [ doc = " @sa otMessageSetOffset" ] # [ doc = " @sa otMessageRead" ] # [ doc = " @sa otMessageWrite" ] # [ doc = "" ] pub fn otMessageGetOffset ( aMessage : * const otMessage ) -> u16 ; } extern "C" { # [ doc = " Set the message offset in bytes." ] # [ doc = "" ] # [ doc = " @param[in]  aMessage  A pointer to a message buffer." ] # [ doc = " @param[in]  aOffset   An offset in bytes." ] # [ doc = "" ] # [ doc = " @sa otMessageFree" ] # [ doc = " @sa otMessageAppend" ] # [ doc = " @sa otMessageGetLength" ] # [ doc = " @sa otMessageSetLength" ] # [ doc = " @sa otMessageGetOffset" ] # [ doc = " @sa otMessageRead" ] # [ doc = " @sa otMessageWrite" ] # [ doc = "" ] pub fn otMessageSetOffset ( aMessage : * mut otMessage , aOffset : u16 ) ; } extern "C" { # [ doc = " This function indicates whether or not link security is enabled for the message." ] # [ doc = "" ] # [ doc = " @param[in]  aMessage  A pointer to a message buffer." ] # [ doc = "" ] # [ doc = " @retval TRUE   If link security is enabled." ] # [ doc = " @retval FALSE  If link security is not enabled." ] # [ doc = "" ] pub fn otMessageIsLinkSecurityEnabled ( aMessage : * const otMessage ) -> bool ; } extern "C" { # [ doc = " This function sets/forces the message to be forwarded using direct transmission." ] # [ doc = " Default setting for a new message is `false`." ] # [ doc = "" ] # [ doc = " @param[in]  aMessage  A pointer to a message buffer." ] # [ doc = " @param[in]  aEnabled  If `true`, the message is forced to use direct transmission. If `false`, the message follows" ] # [ doc = "                       the normal procedure." ] # [ doc = "" ] pub fn otMessageSetDirectTransmission ( aMessage : * mut otMessage , aEnabled : bool ) ; } extern "C" { # [ doc = " This function returns the average RSS (received signal strength) associated with the message." ] # [ doc = "" ] # [ doc = " @returns The average RSS value (in dBm) or OT_RADIO_RSSI_INVALID if no average RSS is available." ] # [ doc = "" ] pub fn otMessageGetRss ( aMessage : * const otMessage ) -> i8 ; } extern "C" { # [ doc = " Append bytes to a message." ] # [ doc = "" ] # [ doc = " @param[in]  aMessage  A pointer to a message buffer." ] # [ doc = " @param[in]  aBuf      A pointer to the data to append." ] # [ doc = " @param[in]  aLength   Number of bytes to append." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE     Successfully appended to the message" ] # [ doc = " @retval OT_ERROR_NO_BUFS  No available buffers to grow the message." ] # [ doc = "" ] # [ doc = " @sa otMessageFree" ] # [ doc = " @sa otMessageGetLength" ] # [ doc = " @sa otMessageSetLength" ] # [ doc = " @sa otMessageGetOffset" ] # [ doc = " @sa otMessageSetOffset" ] # [ doc = " @sa otMessageRead" ] # [ doc = " @sa otMessageWrite" ] # [ doc = "" ] pub fn otMessageAppend ( aMessage : * mut otMessage , aBuf : * const :: std :: os :: raw :: c_void , aLength : u16 ) -> otError ; } extern "C" { # [ doc = " Read bytes from a message." ] # [ doc = "" ] # [ doc = " @param[in]  aMessage  A pointer to a message buffer." ] # [ doc = " @param[in]  aOffset   An offset in bytes." ] # [ doc = " @param[in]  aBuf      A pointer to a buffer that message bytes are read to." ] # [ doc = " @param[in]  aLength   Number of bytes to read." ] # [ doc = "" ] # [ doc = " @returns The number of bytes read." ] # [ doc = "" ] # [ doc = " @sa otMessageFree" ] # [ doc = " @sa otMessageAppend" ] # [ doc = " @sa otMessageGetLength" ] # [ doc = " @sa otMessageSetLength" ] # [ doc = " @sa otMessageGetOffset" ] # [ doc = " @sa otMessageSetOffset" ] # [ doc = " @sa otMessageWrite" ] # [ doc = "" ] pub fn otMessageRead ( aMessage : * const otMessage , aOffset : u16 , aBuf : * mut :: std :: os :: raw :: c_void , aLength : u16 ) -> u16 ; } extern "C" { # [ doc = " Write bytes to a message." ] # [ doc = "" ] # [ doc = " @param[in]  aMessage  A pointer to a message buffer." ] # [ doc = " @param[in]  aOffset   An offset in bytes." ] # [ doc = " @param[in]  aBuf      A pointer to a buffer that message bytes are written from." ] # [ doc = " @param[in]  aLength   Number of bytes to write." ] # [ doc = "" ] # [ doc = " @returns The number of bytes written." ] # [ doc = "" ] # [ doc = " @sa otMessageFree" ] # [ doc = " @sa otMessageAppend" ] # [ doc = " @sa otMessageGetLength" ] # [ doc = " @sa otMessageSetLength" ] # [ doc = " @sa otMessageGetOffset" ] # [ doc = " @sa otMessageSetOffset" ] # [ doc = " @sa otMessageRead" ] # [ doc = "" ] pub fn otMessageWrite ( aMessage : * mut otMessage , aOffset : u16 , aBuf : * const :: std :: os :: raw :: c_void , aLength : u16 ) -> :: std :: os :: raw :: c_int ; } # [ doc = " This structure represents an OpenThread message queue." ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otMessageQueue { # [ doc = "< Opaque data used by the implementation." ] pub mData : * mut :: std :: os :: raw :: c_void , } # [ test ] fn bindgen_test_layout_otMessageQueue ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otMessageQueue > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( otMessageQueue ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otMessageQueue > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otMessageQueue ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMessageQueue > ( ) ) ) . mData as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otMessageQueue ) , "::" , stringify ! ( mData ) ) ) ; } extern "C" { # [ doc = " Initialize the message queue." ] # [ doc = "" ] # [ doc = " This function MUST be called once and only once for a `otMessageQueue` instance before any other `otMessageQueue`" ] # [ doc = " functions. The behavior is undefined if other queue APIs are used with an `otMessageQueue` before it being" ] # [ doc = " initialized or if it is initialized more than once." ] # [ doc = "" ] # [ doc = " @param[in]  aQueue     A pointer to a message queue." ] # [ doc = "" ] pub fn otMessageQueueInit ( aQueue : * mut otMessageQueue ) ; } extern "C" { # [ doc = " This function adds a message to the end of the given message queue." ] # [ doc = "" ] # [ doc = " @param[in]  aQueue    A pointer to the message queue." ] # [ doc = " @param[in]  aMessage  The message to add." ] # [ doc = "" ] pub fn otMessageQueueEnqueue ( aQueue : * mut otMessageQueue , aMessage : * mut otMessage ) ; } extern "C" { # [ doc = " This function adds a message at the head/front of the given message queue." ] # [ doc = "" ] # [ doc = " @param[in]  aQueue    A pointer to the message queue." ] # [ doc = " @param[in]  aMessage  The message to add." ] # [ doc = "" ] pub fn otMessageQueueEnqueueAtHead ( aQueue : * mut otMessageQueue , aMessage : * mut otMessage ) ; } extern "C" { # [ doc = " This function removes a message from the given message queue." ] # [ doc = "" ] # [ doc = " @param[in]  aQueue    A pointer to the message queue." ] # [ doc = " @param[in]  aMessage  The message to remove." ] # [ doc = "" ] pub fn otMessageQueueDequeue ( aQueue : * mut otMessageQueue , aMessage : * mut otMessage ) ; } extern "C" { # [ doc = " This function returns a pointer to the message at the head of the queue." ] # [ doc = "" ] # [ doc = " @param[in]  aQueue    A pointer to a message queue." ] # [ doc = "" ] # [ doc = " @returns  A pointer to the message at the head of queue or NULL if queue is empty." ] # [ doc = "" ] pub fn otMessageQueueGetHead ( aQueue : * mut otMessageQueue ) -> * mut otMessage ; } extern "C" { # [ doc = " This function returns a pointer to the next message in the queue by iterating forward (from head to tail)." ] # [ doc = "" ] # [ doc = " @param[in]  aQueue    A pointer to a message queue." ] # [ doc = " @param[in]  aMessage  A pointer to current message buffer." ] # [ doc = "" ] # [ doc = " @returns  A pointer to the next message in the queue after `aMessage` or NULL if `aMessage is the tail of queue." ] # [ doc = "           NULL is returned if `aMessage` is not in the queue `aQueue`." ] # [ doc = "" ] pub fn otMessageQueueGetNext ( aQueue : * mut otMessageQueue , aMessage : * const otMessage ) -> * mut otMessage ; } extern "C" { # [ doc = " Get the Message Buffer information." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance    A pointer to the OpenThread instance." ] # [ doc = " @param[out]  aBufferInfo  A pointer where the message buffer information is written." ] # [ doc = "" ] pub fn otMessageGetBufferInfo ( aInstance : * mut otInstance , aBufferInfo : * mut otBufferInfo ) ; } # [ doc = "< aMaxPHYPacketSize (IEEE 802.15.4-2006)" ] pub const OT_RADIO_FRAME_MAX_SIZE : _bindgen_ty_2 = 127 ; # [ doc = "< 2.4 GHz IEEE 802.15.4-2006" ] pub const OT_RADIO_SYMBOLS_PER_OCTET : _bindgen_ty_2 = 2 ; # [ doc = "< 2.4 GHz IEEE 802.15.4 (bits per second)" ] pub const OT_RADIO_BIT_RATE : _bindgen_ty_2 = 250000 ; # [ doc = "< Number of bits per octet" ] pub const OT_RADIO_BITS_PER_OCTET : _bindgen_ty_2 = 8 ; pub const OT_RADIO_SYMBOL_TIME : _bindgen_ty_2 = 16 ; # [ doc = "< LQI measurement not supported" ] pub const OT_RADIO_LQI_NONE : _bindgen_ty_2 = 0 ; # [ doc = "< Invalid or unknown RSSI value" ] pub const OT_RADIO_RSSI_INVALID : _bindgen_ty_2 = 127 ; # [ doc = " @defgroup radio-types Types" ] # [ doc = "" ] # [ doc = " @brief" ] # [ doc = "   This module includes the platform abstraction for a radio frame." ] # [ doc = "" ] # [ doc = " @{" ] # [ doc = "" ] pub type _bindgen_ty_2 = u32 ; # [ doc = "< 2.4 GHz IEEE 802.15.4-2006" ] pub const OT_RADIO_CHANNEL_PAGE_0 : _bindgen_ty_3 = 0 ; # [ doc = "< 2.4 GHz IEEE 802.15.4-2006" ] pub const OT_RADIO_CHANNEL_PAGE_0_MASK : _bindgen_ty_3 = 1 ; # [ doc = "< 915 MHz IEEE 802.15.4-2006" ] pub const OT_RADIO_CHANNEL_PAGE_2 : _bindgen_ty_3 = 2 ; # [ doc = "< 915 MHz IEEE 802.15.4-2006" ] pub const OT_RADIO_CHANNEL_PAGE_2_MASK : _bindgen_ty_3 = 4 ; # [ doc = "< Maximum supported channel page value" ] pub const OT_RADIO_CHANNEL_PAGE_MAX : _bindgen_ty_3 = 2 ; # [ doc = " This enumeration defines the channel page." ] # [ doc = "" ] pub type _bindgen_ty_3 = u32 ; # [ doc = "< 915 MHz IEEE 802.15.4-2006" ] pub const OT_RADIO_915MHZ_OQPSK_CHANNEL_MIN : _bindgen_ty_4 = 1 ; # [ doc = "< 915 MHz IEEE 802.15.4-2006" ] pub const OT_RADIO_915MHZ_OQPSK_CHANNEL_MAX : _bindgen_ty_4 = 10 ; # [ doc = "< 915 MHz IEEE 802.15.4-2006" ] pub const OT_RADIO_915MHZ_OQPSK_CHANNEL_MASK : _bindgen_ty_4 = 2046 ; # [ doc = "< 2.4 GHz IEEE 802.15.4-2006" ] pub const OT_RADIO_2P4GHZ_OQPSK_CHANNEL_MIN : _bindgen_ty_4 = 11 ; # [ doc = "< 2.4 GHz IEEE 802.15.4-2006" ] pub const OT_RADIO_2P4GHZ_OQPSK_CHANNEL_MAX : _bindgen_ty_4 = 26 ; # [ doc = "< 2.4 GHz IEEE 802.15.4-2006" ] pub const OT_RADIO_2P4GHZ_OQPSK_CHANNEL_MASK : _bindgen_ty_4 = 134215680 ; # [ doc = " This enumeration defines the frequency band channel range." ] # [ doc = "" ] pub type _bindgen_ty_4 = u32 ; # [ doc = " This type represents radio capabilities." ] # [ doc = "" ] # [ doc = " The value is a bit-field indicating the capabilities supported by the radio. See `OT_RADIO_CAPS_*` definitions." ] # [ doc = "" ] pub type otRadioCaps = u8 ; # [ doc = "< Radio supports no capability." ] pub const OT_RADIO_CAPS_NONE : _bindgen_ty_5 = 0 ; # [ doc = "< Radio supports AckTime event." ] pub const OT_RADIO_CAPS_ACK_TIMEOUT : _bindgen_ty_5 = 1 ; # [ doc = "< Radio supports Energy Scans." ] pub const OT_RADIO_CAPS_ENERGY_SCAN : _bindgen_ty_5 = 2 ; # [ doc = "< Radio supports tx retry logic with collision avoidance (CSMA)." ] pub const OT_RADIO_CAPS_TRANSMIT_RETRIES : _bindgen_ty_5 = 4 ; # [ doc = "< Radio supports CSMA backoff for frame transmission (but no retry)." ] pub const OT_RADIO_CAPS_CSMA_BACKOFF : _bindgen_ty_5 = 8 ; # [ doc = "< Radio supports direct transition from sleep to TX with CSMA." ] pub const OT_RADIO_CAPS_SLEEP_TO_TX : _bindgen_ty_5 = 16 ; # [ doc = "< Radio supports tx security." ] pub const OT_RADIO_CAPS_TRANSMIT_SEC : _bindgen_ty_5 = 32 ; # [ doc = " This enumeration defines constants that are used to indicate different radio capabilities. See `otRadioCaps`." ] # [ doc = "" ] pub type _bindgen_ty_5 = u32 ; # [ doc = " This type represents the IEEE 802.15.4 PAN ID." ] # [ doc = "" ] pub type otPanId = u16 ; # [ doc = " This type represents the IEEE 802.15.4 Short Address." ] # [ doc = "" ] pub type otShortAddress = u16 ; # [ doc = " @struct otExtAddress" ] # [ doc = "" ] # [ doc = " This structure represents the IEEE 802.15.4 Extended Address." ] # [ doc = "" ] # [ repr ( C , packed ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otExtAddress { # [ doc = "< IEEE 802.15.4 Extended Address bytes" ] pub m8 : [ u8 ; 8usize ] , } # [ test ] fn bindgen_test_layout_otExtAddress ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otExtAddress > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( otExtAddress ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otExtAddress > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otExtAddress ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otExtAddress > ( ) ) ) . m8 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otExtAddress ) , "::" , stringify ! ( m8 ) ) ) ; } # [ doc = " @struct otMacKey" ] # [ doc = "" ] # [ doc = " This structure represents a MAC Key." ] # [ doc = "" ] # [ repr ( C , packed ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otMacKey { # [ doc = "< MAC Key bytes." ] pub m8 : [ u8 ; 16usize ] , } # [ test ] fn bindgen_test_layout_otMacKey ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otMacKey > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( otMacKey ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otMacKey > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otMacKey ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacKey > ( ) ) ) . m8 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otMacKey ) , "::" , stringify ! ( m8 ) ) ) ; } # [ doc = " This structure represents the IEEE 802.15.4 Header IE (Information Element) related information of a radio frame." ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otRadioIeInfo { # [ doc = "< The time offset to the Thread network time." ] pub mNetworkTimeOffset : i64 , # [ doc = "< The Time IE offset from the start of PSDU." ] pub mTimeIeOffset : u8 , # [ doc = "< The Time sync sequence." ] pub mTimeSyncSeq : u8 , } # [ test ] fn bindgen_test_layout_otRadioIeInfo ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otRadioIeInfo > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( otRadioIeInfo ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otRadioIeInfo > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otRadioIeInfo ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioIeInfo > ( ) ) ) . mNetworkTimeOffset as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otRadioIeInfo ) , "::" , stringify ! ( mNetworkTimeOffset ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioIeInfo > ( ) ) ) . mTimeIeOffset as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otRadioIeInfo ) , "::" , stringify ! ( mTimeIeOffset ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioIeInfo > ( ) ) ) . mTimeSyncSeq as * const _ as usize } , 9usize , concat ! ( "Offset of field: " , stringify ! ( otRadioIeInfo ) , "::" , stringify ! ( mTimeSyncSeq ) ) ) ; } # [ doc = " This structure represents an IEEE 802.15.4 radio frame." ] # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otRadioFrame { # [ doc = "< The PSDU." ] pub mPsdu : * mut u8 , # [ doc = "< Length of the PSDU." ] pub mLength : u16 , # [ doc = "< Channel used to transmit/receive the frame." ] pub mChannel : u8 , pub mInfo : otRadioFrame__bindgen_ty_1 , } # [ doc = " The union of transmit and receive information for a radio frame." ] # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub union otRadioFrame__bindgen_ty_1 { pub mTxInfo : otRadioFrame__bindgen_ty_1__bindgen_ty_1 , pub mRxInfo : otRadioFrame__bindgen_ty_1__bindgen_ty_2 , _bindgen_union_align : [ u64 ; 3usize ] , } # [ doc = " Structure representing radio frame transmit information." ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otRadioFrame__bindgen_ty_1__bindgen_ty_1 { # [ doc = "< The key used for AES-CCM frame security." ] pub mAesKey : * const otMacKey , # [ doc = "< The pointer to the Header IE(s) related information." ] pub mIeInfo : * mut otRadioIeInfo , # [ doc = "< Maximum number of backoffs attempts before declaring CCA failure." ] pub mMaxCsmaBackoffs : u8 , # [ doc = "< Maximum number of retries allowed after a transmission failure." ] pub mMaxFrameRetries : u8 , pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > , pub __bindgen_padding_0 : [ u8 ; 5usize ] , } # [ test ] fn bindgen_test_layout_otRadioFrame__bindgen_ty_1__bindgen_ty_1 ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otRadioFrame__bindgen_ty_1__bindgen_ty_1 > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( otRadioFrame__bindgen_ty_1__bindgen_ty_1 ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otRadioFrame__bindgen_ty_1__bindgen_ty_1 > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otRadioFrame__bindgen_ty_1__bindgen_ty_1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioFrame__bindgen_ty_1__bindgen_ty_1 > ( ) ) ) . mAesKey as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otRadioFrame__bindgen_ty_1__bindgen_ty_1 ) , "::" , stringify ! ( mAesKey ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioFrame__bindgen_ty_1__bindgen_ty_1 > ( ) ) ) . mIeInfo as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otRadioFrame__bindgen_ty_1__bindgen_ty_1 ) , "::" , stringify ! ( mIeInfo ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioFrame__bindgen_ty_1__bindgen_ty_1 > ( ) ) ) . mMaxCsmaBackoffs as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otRadioFrame__bindgen_ty_1__bindgen_ty_1 ) , "::" , stringify ! ( mMaxCsmaBackoffs ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioFrame__bindgen_ty_1__bindgen_ty_1 > ( ) ) ) . mMaxFrameRetries as * const _ as usize } , 17usize , concat ! ( "Offset of field: " , stringify ! ( otRadioFrame__bindgen_ty_1__bindgen_ty_1 ) , "::" , stringify ! ( mMaxFrameRetries ) ) ) ; } impl otRadioFrame__bindgen_ty_1__bindgen_ty_1 { # [ inline ] pub fn mIsARetx ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsARetx ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mCsmaCaEnabled ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 1usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mCsmaCaEnabled ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 1usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mIsSecurityProcessed ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 2usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsSecurityProcessed ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 2usize , 1u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( mIsARetx : bool , mCsmaCaEnabled : bool , mIsSecurityProcessed : bool ) -> __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 1u8 , { let mIsARetx : u8 = unsafe { :: std :: mem :: transmute ( mIsARetx ) } ; mIsARetx as u64 } ) ; __bindgen_bitfield_unit . set ( 1usize , 1u8 , { let mCsmaCaEnabled : u8 = unsafe { :: std :: mem :: transmute ( mCsmaCaEnabled ) } ; mCsmaCaEnabled as u64 } ) ; __bindgen_bitfield_unit . set ( 2usize , 1u8 , { let mIsSecurityProcessed : u8 = unsafe { :: std :: mem :: transmute ( mIsSecurityProcessed ) } ; mIsSecurityProcessed as u64 } ) ; __bindgen_bitfield_unit } } # [ doc = " Structure representing radio frame receive information." ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otRadioFrame__bindgen_ty_1__bindgen_ty_2 { # [ doc = " The timestamp when the frame was received in microseconds." ] # [ doc = "" ] # [ doc = " The value SHALL be the time when the SFD was received when TIME_SYNC or CSL is enabled." ] # [ doc = " Otherwise, the time when the MAC frame was fully received is also acceptable." ] # [ doc = "" ] pub mTimestamp : u64 , # [ doc = "< Received signal strength indicator in dBm for received frames." ] pub mRssi : i8 , # [ doc = "< Link Quality Indicator for received frames." ] pub mLqi : u8 , pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > , pub __bindgen_padding_0 : [ u8 ; 5usize ] , } # [ test ] fn bindgen_test_layout_otRadioFrame__bindgen_ty_1__bindgen_ty_2 ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otRadioFrame__bindgen_ty_1__bindgen_ty_2 > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( otRadioFrame__bindgen_ty_1__bindgen_ty_2 ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otRadioFrame__bindgen_ty_1__bindgen_ty_2 > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otRadioFrame__bindgen_ty_1__bindgen_ty_2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioFrame__bindgen_ty_1__bindgen_ty_2 > ( ) ) ) . mTimestamp as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otRadioFrame__bindgen_ty_1__bindgen_ty_2 ) , "::" , stringify ! ( mTimestamp ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioFrame__bindgen_ty_1__bindgen_ty_2 > ( ) ) ) . mRssi as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otRadioFrame__bindgen_ty_1__bindgen_ty_2 ) , "::" , stringify ! ( mRssi ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioFrame__bindgen_ty_1__bindgen_ty_2 > ( ) ) ) . mLqi as * const _ as usize } , 9usize , concat ! ( "Offset of field: " , stringify ! ( otRadioFrame__bindgen_ty_1__bindgen_ty_2 ) , "::" , stringify ! ( mLqi ) ) ) ; } impl otRadioFrame__bindgen_ty_1__bindgen_ty_2 { # [ inline ] pub fn mAckedWithFramePending ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mAckedWithFramePending ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 1u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( mAckedWithFramePending : bool ) -> __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 1u8 , { let mAckedWithFramePending : u8 = unsafe { :: std :: mem :: transmute ( mAckedWithFramePending ) } ; mAckedWithFramePending as u64 } ) ; __bindgen_bitfield_unit } } # [ test ] fn bindgen_test_layout_otRadioFrame__bindgen_ty_1 ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otRadioFrame__bindgen_ty_1 > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( otRadioFrame__bindgen_ty_1 ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otRadioFrame__bindgen_ty_1 > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otRadioFrame__bindgen_ty_1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioFrame__bindgen_ty_1 > ( ) ) ) . mTxInfo as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otRadioFrame__bindgen_ty_1 ) , "::" , stringify ! ( mTxInfo ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioFrame__bindgen_ty_1 > ( ) ) ) . mRxInfo as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otRadioFrame__bindgen_ty_1 ) , "::" , stringify ! ( mRxInfo ) ) ) ; } # [ test ] fn bindgen_test_layout_otRadioFrame ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otRadioFrame > ( ) , 40usize , concat ! ( "Size of: " , stringify ! ( otRadioFrame ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otRadioFrame > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otRadioFrame ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioFrame > ( ) ) ) . mPsdu as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otRadioFrame ) , "::" , stringify ! ( mPsdu ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioFrame > ( ) ) ) . mLength as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otRadioFrame ) , "::" , stringify ! ( mLength ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioFrame > ( ) ) ) . mChannel as * const _ as usize } , 10usize , concat ! ( "Offset of field: " , stringify ! ( otRadioFrame ) , "::" , stringify ! ( mChannel ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioFrame > ( ) ) ) . mInfo as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otRadioFrame ) , "::" , stringify ! ( mInfo ) ) ) ; } pub const otRadioState_OT_RADIO_STATE_DISABLED : otRadioState = 0 ; pub const otRadioState_OT_RADIO_STATE_SLEEP : otRadioState = 1 ; pub const otRadioState_OT_RADIO_STATE_RECEIVE : otRadioState = 2 ; pub const otRadioState_OT_RADIO_STATE_TRANSMIT : otRadioState = 3 ; pub const otRadioState_OT_RADIO_STATE_INVALID : otRadioState = 255 ; # [ doc = " This structure represents the state of a radio." ] # [ doc = " Initially, a radio is in the Disabled state." ] pub type otRadioState = u32 ; # [ doc = " This structure represents radio coexistence metrics." ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otRadioCoexMetrics { # [ doc = "< Number of grant glitches." ] pub mNumGrantGlitch : u32 , # [ doc = "< Number of tx requests." ] pub mNumTxRequest : u32 , # [ doc = "< Number of tx requests while grant was active." ] pub mNumTxGrantImmediate : u32 , # [ doc = "< Number of tx requests while grant was inactive." ] pub mNumTxGrantWait : u32 , # [ doc = "< Number of tx requests while grant was inactive that were ultimately granted." ] pub mNumTxGrantWaitActivated : u32 , # [ doc = "< Number of tx requests while grant was inactive that timed out." ] pub mNumTxGrantWaitTimeout : u32 , # [ doc = "< Number of tx that were in progress when grant was deactivated." ] pub mNumTxGrantDeactivatedDuringRequest : u32 , # [ doc = "< Number of tx requests that were not granted within 50us." ] pub mNumTxDelayedGrant : u32 , # [ doc = "< Average time in usec from tx request to grant." ] pub mAvgTxRequestToGrantTime : u32 , # [ doc = "< Number of rx requests." ] pub mNumRxRequest : u32 , # [ doc = "< Number of rx requests while grant was active." ] pub mNumRxGrantImmediate : u32 , # [ doc = "< Number of rx requests while grant was inactive." ] pub mNumRxGrantWait : u32 , # [ doc = "< Number of rx requests while grant was inactive that were ultimately granted." ] pub mNumRxGrantWaitActivated : u32 , # [ doc = "< Number of rx requests while grant was inactive that timed out." ] pub mNumRxGrantWaitTimeout : u32 , # [ doc = "< Number of rx that were in progress when grant was deactivated." ] pub mNumRxGrantDeactivatedDuringRequest : u32 , # [ doc = "< Number of rx requests that were not granted within 50us." ] pub mNumRxDelayedGrant : u32 , # [ doc = "< Average time in usec from rx request to grant." ] pub mAvgRxRequestToGrantTime : u32 , # [ doc = "< Number of rx requests that completed without receiving grant." ] pub mNumRxGrantNone : u32 , # [ doc = "< Stats collection stopped due to saturation." ] pub mStopped : bool , } # [ test ] fn bindgen_test_layout_otRadioCoexMetrics ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otRadioCoexMetrics > ( ) , 76usize , concat ! ( "Size of: " , stringify ! ( otRadioCoexMetrics ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otRadioCoexMetrics > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( otRadioCoexMetrics ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioCoexMetrics > ( ) ) ) . mNumGrantGlitch as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otRadioCoexMetrics ) , "::" , stringify ! ( mNumGrantGlitch ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioCoexMetrics > ( ) ) ) . mNumTxRequest as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( otRadioCoexMetrics ) , "::" , stringify ! ( mNumTxRequest ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioCoexMetrics > ( ) ) ) . mNumTxGrantImmediate as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otRadioCoexMetrics ) , "::" , stringify ! ( mNumTxGrantImmediate ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioCoexMetrics > ( ) ) ) . mNumTxGrantWait as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( otRadioCoexMetrics ) , "::" , stringify ! ( mNumTxGrantWait ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioCoexMetrics > ( ) ) ) . mNumTxGrantWaitActivated as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otRadioCoexMetrics ) , "::" , stringify ! ( mNumTxGrantWaitActivated ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioCoexMetrics > ( ) ) ) . mNumTxGrantWaitTimeout as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( otRadioCoexMetrics ) , "::" , stringify ! ( mNumTxGrantWaitTimeout ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioCoexMetrics > ( ) ) ) . mNumTxGrantDeactivatedDuringRequest as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( otRadioCoexMetrics ) , "::" , stringify ! ( mNumTxGrantDeactivatedDuringRequest ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioCoexMetrics > ( ) ) ) . mNumTxDelayedGrant as * const _ as usize } , 28usize , concat ! ( "Offset of field: " , stringify ! ( otRadioCoexMetrics ) , "::" , stringify ! ( mNumTxDelayedGrant ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioCoexMetrics > ( ) ) ) . mAvgTxRequestToGrantTime as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( otRadioCoexMetrics ) , "::" , stringify ! ( mAvgTxRequestToGrantTime ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioCoexMetrics > ( ) ) ) . mNumRxRequest as * const _ as usize } , 36usize , concat ! ( "Offset of field: " , stringify ! ( otRadioCoexMetrics ) , "::" , stringify ! ( mNumRxRequest ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioCoexMetrics > ( ) ) ) . mNumRxGrantImmediate as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( otRadioCoexMetrics ) , "::" , stringify ! ( mNumRxGrantImmediate ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioCoexMetrics > ( ) ) ) . mNumRxGrantWait as * const _ as usize } , 44usize , concat ! ( "Offset of field: " , stringify ! ( otRadioCoexMetrics ) , "::" , stringify ! ( mNumRxGrantWait ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioCoexMetrics > ( ) ) ) . mNumRxGrantWaitActivated as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( otRadioCoexMetrics ) , "::" , stringify ! ( mNumRxGrantWaitActivated ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioCoexMetrics > ( ) ) ) . mNumRxGrantWaitTimeout as * const _ as usize } , 52usize , concat ! ( "Offset of field: " , stringify ! ( otRadioCoexMetrics ) , "::" , stringify ! ( mNumRxGrantWaitTimeout ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioCoexMetrics > ( ) ) ) . mNumRxGrantDeactivatedDuringRequest as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( otRadioCoexMetrics ) , "::" , stringify ! ( mNumRxGrantDeactivatedDuringRequest ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioCoexMetrics > ( ) ) ) . mNumRxDelayedGrant as * const _ as usize } , 60usize , concat ! ( "Offset of field: " , stringify ! ( otRadioCoexMetrics ) , "::" , stringify ! ( mNumRxDelayedGrant ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioCoexMetrics > ( ) ) ) . mAvgRxRequestToGrantTime as * const _ as usize } , 64usize , concat ! ( "Offset of field: " , stringify ! ( otRadioCoexMetrics ) , "::" , stringify ! ( mAvgRxRequestToGrantTime ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioCoexMetrics > ( ) ) ) . mNumRxGrantNone as * const _ as usize } , 68usize , concat ! ( "Offset of field: " , stringify ! ( otRadioCoexMetrics ) , "::" , stringify ! ( mNumRxGrantNone ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRadioCoexMetrics > ( ) ) ) . mStopped as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( otRadioCoexMetrics ) , "::" , stringify ! ( mStopped ) ) ) ; } extern "C" { # [ doc = " Get the radio capabilities." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @returns The radio capability bit vector (see `OT_RADIO_CAP_*` definitions)." ] # [ doc = "" ] pub fn otPlatRadioGetCaps ( aInstance : * mut otInstance ) -> otRadioCaps ; } extern "C" { # [ doc = " Get the radio version string." ] # [ doc = "" ] # [ doc = " This is an optional radio driver platform function. If not provided by platform radio driver, OpenThread uses" ] # [ doc = " the OpenThread version instead (@sa otGetVersionString())." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @returns A pointer to the OpenThread radio version." ] # [ doc = "" ] pub fn otPlatRadioGetVersionString ( aInstance : * mut otInstance ) -> * const :: std :: os :: raw :: c_char ; } extern "C" { # [ doc = " Get the radio receive sensitivity value." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @returns The radio receive sensitivity value in dBm." ] # [ doc = "" ] pub fn otPlatRadioGetReceiveSensitivity ( aInstance : * mut otInstance ) -> i8 ; } extern "C" { # [ doc = " Get the factory-assigned IEEE EUI-64 for this interface." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   The OpenThread instance structure." ] # [ doc = " @param[out] aIeeeEui64  A pointer to the factory-assigned IEEE EUI-64." ] # [ doc = "" ] pub fn otPlatRadioGetIeeeEui64 ( aInstance : * mut otInstance , aIeeeEui64 : * mut u8 ) ; } extern "C" { # [ doc = " Set the PAN ID for address filtering." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aPanId     The IEEE 802.15.4 PAN ID." ] # [ doc = "" ] pub fn otPlatRadioSetPanId ( aInstance : * mut otInstance , aPanId : otPanId ) ; } extern "C" { # [ doc = " Set the Extended Address for address filtering." ] # [ doc = "" ] # [ doc = " @param[in] aInstance    The OpenThread instance structure." ] # [ doc = " @param[in] aExtAddress  A pointer to the IEEE 802.15.4 Extended Address stored in little-endian byte order." ] # [ doc = "" ] # [ doc = "" ] pub fn otPlatRadioSetExtendedAddress ( aInstance : * mut otInstance , aExtAddress : * const otExtAddress ) ; } extern "C" { # [ doc = " Set the Short Address for address filtering." ] # [ doc = "" ] # [ doc = " @param[in] aInstance      The OpenThread instance structure." ] # [ doc = " @param[in] aShortAddress  The IEEE 802.15.4 Short Address." ] # [ doc = "" ] pub fn otPlatRadioSetShortAddress ( aInstance : * mut otInstance , aShortAddress : otShortAddress ) ; } extern "C" { # [ doc = " Get the radio's transmit power in dBm." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[out] aPower    The transmit power in dBm." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE             Successfully retrieved the transmit power." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS     @p aPower was NULL." ] # [ doc = " @retval OT_ERROR_NOT_IMPLEMENTED  Transmit power configuration via dBm is not implemented." ] # [ doc = "" ] pub fn otPlatRadioGetTransmitPower ( aInstance : * mut otInstance , aPower : * mut i8 ) -> otError ; } extern "C" { # [ doc = " Set the radio's transmit power in dBm." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aPower     The transmit power in dBm." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE             Successfully set the transmit power." ] # [ doc = " @retval OT_ERROR_NOT_IMPLEMENTED  Transmit power configuration via dBm is not implemented." ] # [ doc = "" ] pub fn otPlatRadioSetTransmitPower ( aInstance : * mut otInstance , aPower : i8 ) -> otError ; } extern "C" { # [ doc = " Get the radio's CCA ED threshold in dBm." ] # [ doc = "" ] # [ doc = " @param[in] aInstance    The OpenThread instance structure." ] # [ doc = " @param[out] aThreshold  The CCA ED threshold in dBm." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE             Successfully retrieved the CCA ED threshold." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS     @p aThreshold was NULL." ] # [ doc = " @retval OT_ERROR_NOT_IMPLEMENTED  CCA ED threshold configuration via dBm is not implemented." ] # [ doc = "" ] pub fn otPlatRadioGetCcaEnergyDetectThreshold ( aInstance : * mut otInstance , aThreshold : * mut i8 ) -> otError ; } extern "C" { # [ doc = " Set the radio's CCA ED threshold in dBm." ] # [ doc = "" ] # [ doc = " @param[in] aInstance   The OpenThread instance structure." ] # [ doc = " @param[in] aThreshold  The CCA ED threshold in dBm." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE             Successfully set the transmit power." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS     Given threshold is out of range." ] # [ doc = " @retval OT_ERROR_NOT_IMPLEMENTED  CCA ED threshold configuration via dBm is not implemented." ] # [ doc = "" ] pub fn otPlatRadioSetCcaEnergyDetectThreshold ( aInstance : * mut otInstance , aThreshold : i8 ) -> otError ; } extern "C" { # [ doc = " Get the status of promiscuous mode." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @retval TRUE   Promiscuous mode is enabled." ] # [ doc = " @retval FALSE  Promiscuous mode is disabled." ] # [ doc = "" ] pub fn otPlatRadioGetPromiscuous ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " Enable or disable promiscuous mode." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance The OpenThread instance structure." ] # [ doc = " @param[in]  aEnable   TRUE to enable or FALSE to disable promiscuous mode." ] # [ doc = "" ] pub fn otPlatRadioSetPromiscuous ( aInstance : * mut otInstance , aEnable : bool ) ; } extern "C" { # [ doc = " Update MAC keys and key index" ] # [ doc = "" ] # [ doc = " This function is used when radio provides OT_RADIO_CAPS_TRANSMIT_SEC capability." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]   aKeyIdMode   The key ID mode." ] # [ doc = " @param[in]   aKeyId       Current MAC key index." ] # [ doc = " @param[in]   aPrevKey     A pointer to the previous MAC key." ] # [ doc = " @param[in]   aCurrKey     A pointer to the current MAC key." ] # [ doc = " @param[in]   aNextKey     A pointer to the next MAC key." ] # [ doc = "" ] pub fn otPlatRadioSetMacKey ( aInstance : * mut otInstance , aKeyIdMode : u8 , aKeyId : u8 , aPrevKey : * const otMacKey , aCurrKey : * const otMacKey , aNextKey : * const otMacKey ) ; } extern "C" { # [ doc = " Get current state of the radio." ] # [ doc = "" ] # [ doc = " This function is not required by OpenThread. It may be used for debugging and/or application-specific purposes." ] # [ doc = "" ] # [ doc = " @note This function may be not implemented. It does not affect OpenThread." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @return  Current state of the radio." ] # [ doc = "" ] pub fn otPlatRadioGetState ( aInstance : * mut otInstance ) -> otRadioState ; } extern "C" { # [ doc = " Enable the radio." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE     Successfully enabled." ] # [ doc = " @retval OT_ERROR_FAILED   The radio could not be enabled." ] # [ doc = "" ] pub fn otPlatRadioEnable ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " Disable the radio." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE            Successfully transitioned to Disabled." ] # [ doc = " @retval OT_ERROR_INVALID_STATE   The radio was not in sleep state." ] # [ doc = "" ] pub fn otPlatRadioDisable ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " Check whether radio is enabled or not." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @returns TRUE if the radio is enabled, FALSE otherwise." ] # [ doc = "" ] pub fn otPlatRadioIsEnabled ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " Transition the radio from Receive to Sleep (turn off the radio)." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully transitioned to Sleep." ] # [ doc = " @retval OT_ERROR_BUSY          The radio was transmitting." ] # [ doc = " @retval OT_ERROR_INVALID_STATE The radio was disabled." ] # [ doc = "" ] pub fn otPlatRadioSleep ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " Transition the radio from Sleep to Receive (turn on the radio)." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  The OpenThread instance structure." ] # [ doc = " @param[in]  aChannel   The channel to use for receiving." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully transitioned to Receive." ] # [ doc = " @retval OT_ERROR_INVALID_STATE The radio was disabled or transmitting." ] # [ doc = "" ] pub fn otPlatRadioReceive ( aInstance : * mut otInstance , aChannel : u8 ) -> otError ; } extern "C" { # [ doc = " The radio driver calls this method to notify OpenThread of a received frame." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance The OpenThread instance structure." ] # [ doc = " @param[in]  aFrame    A pointer to the received frame or NULL if the receive operation failed." ] # [ doc = " @param[in]  aError    OT_ERROR_NONE when successfully received a frame," ] # [ doc = "                       OT_ERROR_ABORT when reception was aborted and a frame was not received," ] # [ doc = "                       OT_ERROR_NO_BUFS when a frame could not be received due to lack of rx buffer space." ] # [ doc = "" ] pub fn otPlatRadioReceiveDone ( aInstance : * mut otInstance , aFrame : * mut otRadioFrame , aError : otError ) ; } extern "C" { # [ doc = " The radio driver calls this method to notify OpenThread diagnostics module of a received frame." ] # [ doc = "" ] # [ doc = " This function is used when diagnostics is enabled." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance The OpenThread instance structure." ] # [ doc = " @param[in]  aFrame    A pointer to the received frame or NULL if the receive operation failed." ] # [ doc = " @param[in]  aError    OT_ERROR_NONE when successfully received a frame," ] # [ doc = "                       OT_ERROR_ABORT when reception was aborted and a frame was not received," ] # [ doc = "                       OT_ERROR_NO_BUFS when a frame could not be received due to lack of rx buffer space." ] # [ doc = "" ] pub fn otPlatDiagRadioReceiveDone ( aInstance : * mut otInstance , aFrame : * mut otRadioFrame , aError : otError ) ; } extern "C" { # [ doc = " Get the radio transmit frame buffer." ] # [ doc = "" ] # [ doc = " OpenThread forms the IEEE 802.15.4 frame in this buffer then calls `otPlatRadioTransmit()` to request transmission." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @returns A pointer to the transmit frame buffer." ] # [ doc = "" ] pub fn otPlatRadioGetTransmitBuffer ( aInstance : * mut otInstance ) -> * mut otRadioFrame ; } extern "C" { # [ doc = " Begin the transmit sequence on the radio." ] # [ doc = "" ] # [ doc = " The caller must form the IEEE 802.15.4 frame in the buffer provided by `otPlatRadioGetTransmitBuffer()` before" ] # [ doc = " requesting transmission.  The channel and transmit power are also included in the otRadioFrame structure." ] # [ doc = "" ] # [ doc = " The transmit sequence consists of:" ] # [ doc = " 1. Transitioning the radio to Transmit from one of the following states:" ] # [ doc = "    - Receive if RX is on when the device is idle or OT_RADIO_CAPS_SLEEP_TO_TX is not supported" ] # [ doc = "    - Sleep if RX is off when the device is idle and OT_RADIO_CAPS_SLEEP_TO_TX is supported." ] # [ doc = " 2. Transmits the psdu on the given channel and at the given transmit power." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aFrame     A pointer to the frame to be transmitted." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully transitioned to Transmit." ] # [ doc = " @retval OT_ERROR_INVALID_STATE The radio was not in the Receive state." ] # [ doc = "" ] pub fn otPlatRadioTransmit ( aInstance : * mut otInstance , aFrame : * mut otRadioFrame ) -> otError ; } extern "C" { # [ doc = " The radio driver calls this method to notify OpenThread that the transmission has started." ] # [ doc = "" ] # [ doc = " @note  This function should be called by the same thread that executes all of the other OpenThread code. It should" ] # [ doc = "        not be called by ISR or any other task." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to the OpenThread instance structure." ] # [ doc = " @param[in]  aFrame     A pointer to the frame that is being transmitted." ] # [ doc = "" ] pub fn otPlatRadioTxStarted ( aInstance : * mut otInstance , aFrame : * mut otRadioFrame ) ; } extern "C" { # [ doc = " The radio driver calls this function to notify OpenThread that the transmit operation has completed," ] # [ doc = " providing both the transmitted frame and, if applicable, the received ack frame." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  The OpenThread instance structure." ] # [ doc = " @param[in]  aFrame     A pointer to the frame that was transmitted." ] # [ doc = " @param[in]  aAckFrame  A pointer to the ACK frame, NULL if no ACK was received." ] # [ doc = " @param[in]  aError     OT_ERROR_NONE when the frame was transmitted," ] # [ doc = "                        OT_ERROR_NO_ACK when the frame was transmitted but no ACK was received," ] # [ doc = "                        OT_ERROR_CHANNEL_ACCESS_FAILURE tx could not take place due to activity on the channel," ] # [ doc = "                        OT_ERROR_ABORT when transmission was aborted for other reasons." ] # [ doc = "" ] pub fn otPlatRadioTxDone ( aInstance : * mut otInstance , aFrame : * mut otRadioFrame , aAckFrame : * mut otRadioFrame , aError : otError ) ; } extern "C" { # [ doc = " The radio driver calls this method to notify OpenThread diagnostics module that the transmission has completed." ] # [ doc = "" ] # [ doc = " This function is used when diagnostics is enabled." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance      The OpenThread instance structure." ] # [ doc = " @param[in]  aFrame         A pointer to the frame that was transmitted." ] # [ doc = " @param[in]  aError         OT_ERROR_NONE when the frame was transmitted," ] # [ doc = "                            OT_ERROR_CHANNEL_ACCESS_FAILURE tx could not take place due to activity on the channel," ] # [ doc = "                            OT_ERROR_ABORT when transmission was aborted for other reasons." ] # [ doc = "" ] pub fn otPlatDiagRadioTransmitDone ( aInstance : * mut otInstance , aFrame : * mut otRadioFrame , aError : otError ) ; } extern "C" { # [ doc = " Get the most recent RSSI measurement." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @returns The RSSI in dBm when it is valid.  127 when RSSI is invalid." ] # [ doc = "" ] pub fn otPlatRadioGetRssi ( aInstance : * mut otInstance ) -> i8 ; } extern "C" { # [ doc = " Begin the energy scan sequence on the radio." ] # [ doc = "" ] # [ doc = " This function is used when radio provides OT_RADIO_CAPS_ENERGY_SCAN capability." ] # [ doc = "" ] # [ doc = " @param[in] aInstance      The OpenThread instance structure." ] # [ doc = " @param[in] aScanChannel   The channel to perform the energy scan on." ] # [ doc = " @param[in] aScanDuration  The duration, in milliseconds, for the channel to be scanned." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE             Successfully started scanning the channel." ] # [ doc = " @retval OT_ERROR_NOT_IMPLEMENTED  The radio doesn't support energy scanning." ] # [ doc = "" ] pub fn otPlatRadioEnergyScan ( aInstance : * mut otInstance , aScanChannel : u8 , aScanDuration : u16 ) -> otError ; } extern "C" { # [ doc = " The radio driver calls this method to notify OpenThread that the energy scan is complete." ] # [ doc = "" ] # [ doc = " This function is used when radio provides OT_RADIO_CAPS_ENERGY_SCAN capability." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance           The OpenThread instance structure." ] # [ doc = " @param[in]  aEnergyScanMaxRssi  The maximum RSSI encountered on the scanned channel." ] # [ doc = "" ] pub fn otPlatRadioEnergyScanDone ( aInstance : * mut otInstance , aEnergyScanMaxRssi : i8 ) ; } extern "C" { # [ doc = " Enable/Disable source address match feature." ] # [ doc = "" ] # [ doc = " The source address match feature controls how the radio layer decides the \"frame pending\" bit for acks sent in" ] # [ doc = " response to data request commands from children." ] # [ doc = "" ] # [ doc = " If disabled, the radio layer must set the \"frame pending\" on all acks to data request commands." ] # [ doc = "" ] # [ doc = " If enabled, the radio layer uses the source address match table to determine whether to set or clear the \"frame" ] # [ doc = " pending\" bit in an ack to a data request command." ] # [ doc = "" ] # [ doc = " The source address match table provides the list of children for which there is a pending frame. Either a short" ] # [ doc = " address or an extended/long address can be added to the source address match table." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   The OpenThread instance structure." ] # [ doc = " @param[in]  aEnable     Enable/disable source address match feature." ] # [ doc = "" ] pub fn otPlatRadioEnableSrcMatch ( aInstance : * mut otInstance , aEnable : bool ) ; } extern "C" { # [ doc = " Add a short address to the source address match table." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance      The OpenThread instance structure." ] # [ doc = " @param[in]  aShortAddress  The short address to be added." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE      Successfully added short address to the source match table." ] # [ doc = " @retval OT_ERROR_NO_BUFS   No available entry in the source match table." ] # [ doc = "" ] pub fn otPlatRadioAddSrcMatchShortEntry ( aInstance : * mut otInstance , aShortAddress : otShortAddress ) -> otError ; } extern "C" { # [ doc = " Add an extended address to the source address match table." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    The OpenThread instance structure." ] # [ doc = " @param[in]  aExtAddress  The extended address to be added stored in little-endian byte order." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE      Successfully added extended address to the source match table." ] # [ doc = " @retval OT_ERROR_NO_BUFS   No available entry in the source match table." ] # [ doc = "" ] pub fn otPlatRadioAddSrcMatchExtEntry ( aInstance : * mut otInstance , aExtAddress : * const otExtAddress ) -> otError ; } extern "C" { # [ doc = " Remove a short address from the source address match table." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance      The OpenThread instance structure." ] # [ doc = " @param[in]  aShortAddress  The short address to be removed." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE        Successfully removed short address from the source match table." ] # [ doc = " @retval OT_ERROR_NO_ADDRESS  The short address is not in source address match table." ] # [ doc = "" ] pub fn otPlatRadioClearSrcMatchShortEntry ( aInstance : * mut otInstance , aShortAddress : otShortAddress ) -> otError ; } extern "C" { # [ doc = " Remove an extended address from the source address match table." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    The OpenThread instance structure." ] # [ doc = " @param[in]  aExtAddress  The extended address to be removed stored in little-endian byte order." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE        Successfully removed the extended address from the source match table." ] # [ doc = " @retval OT_ERROR_NO_ADDRESS  The extended address is not in source address match table." ] # [ doc = "" ] pub fn otPlatRadioClearSrcMatchExtEntry ( aInstance : * mut otInstance , aExtAddress : * const otExtAddress ) -> otError ; } extern "C" { # [ doc = " Clear all short addresses from the source address match table." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   The OpenThread instance structure." ] # [ doc = "" ] pub fn otPlatRadioClearSrcMatchShortEntries ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " Clear all the extended/long addresses from source address match table." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   The OpenThread instance structure." ] # [ doc = "" ] pub fn otPlatRadioClearSrcMatchExtEntries ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " Get the radio supported channel mask that the device is allowed to be on." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @returns The radio supported channel mask." ] # [ doc = "" ] pub fn otPlatRadioGetSupportedChannelMask ( aInstance : * mut otInstance ) -> u32 ; } extern "C" { # [ doc = " Get the radio preferred channel mask that the device prefers to form on." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @returns The radio preferred channel mask." ] # [ doc = "" ] pub fn otPlatRadioGetPreferredChannelMask ( aInstance : * mut otInstance ) -> u32 ; } extern "C" { # [ doc = " Enable the radio coex." ] # [ doc = "" ] # [ doc = " This function is used when feature OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE is enabled." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aEnabled   TRUE to enable the radio coex, FALSE otherwise." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE     Successfully enabled." ] # [ doc = " @retval OT_ERROR_FAILED   The radio coex could not be enabled." ] # [ doc = "" ] pub fn otPlatRadioSetCoexEnabled ( aInstance : * mut otInstance , aEnabled : bool ) -> otError ; } extern "C" { # [ doc = " Check whether radio coex is enabled or not." ] # [ doc = "" ] # [ doc = " This function is used when feature OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE is enabled." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @returns TRUE if the radio coex is enabled, FALSE otherwise." ] # [ doc = "" ] pub fn otPlatRadioIsCoexEnabled ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " Get the radio coexistence metrics." ] # [ doc = "" ] # [ doc = " This function is used when feature OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE is enabled." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance     The OpenThread instance structure." ] # [ doc = " @param[out] aCoexMetrics  A pointer to the coexistence metrics structure." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully retrieved the coex metrics." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  @p aCoexMetrics was NULL." ] pub fn otPlatRadioGetCoexMetrics ( aInstance : * mut otInstance , aCoexMetrics : * mut otRadioCoexMetrics ) -> otError ; } # [ doc = " @struct otIp6Address" ] # [ doc = "" ] # [ doc = " This structure represents an IPv6 address." ] # [ doc = "" ] # [ repr ( C , packed ) ] # [ derive ( Copy , Clone ) ] pub struct otIp6Address { # [ doc = "< IPv6 accessor fields" ] pub mFields : otIp6Address__bindgen_ty_1 , } # [ repr ( C , packed ) ] # [ derive ( Copy , Clone ) ] pub union otIp6Address__bindgen_ty_1 { # [ doc = "< 8-bit fields" ] pub m8 : [ u8 ; 16usize ] , # [ doc = "< 16-bit fields" ] pub m16 : [ u16 ; 8usize ] , # [ doc = "< 32-bit fields" ] pub m32 : [ u32 ; 4usize ] , _bindgen_union_align : [ u8 ; 16usize ] , } # [ test ] fn bindgen_test_layout_otIp6Address__bindgen_ty_1 ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otIp6Address__bindgen_ty_1 > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( otIp6Address__bindgen_ty_1 ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otIp6Address__bindgen_ty_1 > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otIp6Address__bindgen_ty_1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIp6Address__bindgen_ty_1 > ( ) ) ) . m8 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otIp6Address__bindgen_ty_1 ) , "::" , stringify ! ( m8 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIp6Address__bindgen_ty_1 > ( ) ) ) . m16 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otIp6Address__bindgen_ty_1 ) , "::" , stringify ! ( m16 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIp6Address__bindgen_ty_1 > ( ) ) ) . m32 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otIp6Address__bindgen_ty_1 ) , "::" , stringify ! ( m32 ) ) ) ; } # [ test ] fn bindgen_test_layout_otIp6Address ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otIp6Address > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( otIp6Address ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otIp6Address > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otIp6Address ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIp6Address > ( ) ) ) . mFields as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otIp6Address ) , "::" , stringify ! ( mFields ) ) ) ; } # [ doc = " This structure represents an IPv6 prefix." ] # [ doc = "" ] # [ repr ( C , packed ) ] # [ derive ( Copy , Clone ) ] pub struct otIp6Prefix { # [ doc = "< The IPv6 prefix." ] pub mPrefix : otIp6Address , # [ doc = "< The IPv6 prefix length (in bits)." ] pub mLength : u8 , } # [ test ] fn bindgen_test_layout_otIp6Prefix ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otIp6Prefix > ( ) , 17usize , concat ! ( "Size of: " , stringify ! ( otIp6Prefix ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otIp6Prefix > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otIp6Prefix ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIp6Prefix > ( ) ) ) . mPrefix as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otIp6Prefix ) , "::" , stringify ! ( mPrefix ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIp6Prefix > ( ) ) ) . mLength as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otIp6Prefix ) , "::" , stringify ! ( mLength ) ) ) ; } # [ doc = " This structure represents an IPv6 network interface unicast address." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otNetifAddress { # [ doc = "< The IPv6 unicast address." ] pub mAddress : otIp6Address , # [ doc = "< The Prefix length (in bits)." ] pub mPrefixLength : u8 , pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > , # [ doc = "< A pointer to the next network interface address." ] pub mNext : * mut otNetifAddress , } # [ test ] fn bindgen_test_layout_otNetifAddress ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otNetifAddress > ( ) , 32usize , concat ! ( "Size of: " , stringify ! ( otNetifAddress ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otNetifAddress > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otNetifAddress ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetifAddress > ( ) ) ) . mAddress as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetifAddress ) , "::" , stringify ! ( mAddress ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetifAddress > ( ) ) ) . mPrefixLength as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otNetifAddress ) , "::" , stringify ! ( mPrefixLength ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetifAddress > ( ) ) ) . mNext as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( otNetifAddress ) , "::" , stringify ! ( mNext ) ) ) ; } impl otNetifAddress { # [ inline ] pub fn mPreferred ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mPreferred ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mValid ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 1usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mValid ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 1usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mScopeOverrideValid ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 2usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mScopeOverrideValid ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 2usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mScopeOverride ( & self ) -> :: std :: os :: raw :: c_uint { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 3usize , 4u8 ) as u32 ) } } # [ inline ] pub fn set_mScopeOverride ( & mut self , val : :: std :: os :: raw :: c_uint ) { unsafe { let val : u32 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 3usize , 4u8 , val as u64 ) } } # [ inline ] pub fn mRloc ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 7usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mRloc ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 7usize , 1u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( mPreferred : bool , mValid : bool , mScopeOverrideValid : bool , mScopeOverride : :: std :: os :: raw :: c_uint , mRloc : bool ) -> __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 1u8 , { let mPreferred : u8 = unsafe { :: std :: mem :: transmute ( mPreferred ) } ; mPreferred as u64 } ) ; __bindgen_bitfield_unit . set ( 1usize , 1u8 , { let mValid : u8 = unsafe { :: std :: mem :: transmute ( mValid ) } ; mValid as u64 } ) ; __bindgen_bitfield_unit . set ( 2usize , 1u8 , { let mScopeOverrideValid : u8 = unsafe { :: std :: mem :: transmute ( mScopeOverrideValid ) } ; mScopeOverrideValid as u64 } ) ; __bindgen_bitfield_unit . set ( 3usize , 4u8 , { let mScopeOverride : u32 = unsafe { :: std :: mem :: transmute ( mScopeOverride ) } ; mScopeOverride as u64 } ) ; __bindgen_bitfield_unit . set ( 7usize , 1u8 , { let mRloc : u8 = unsafe { :: std :: mem :: transmute ( mRloc ) } ; mRloc as u64 } ) ; __bindgen_bitfield_unit } } # [ doc = " This structure represents an IPv6 network interface multicast address." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otNetifMulticastAddress { # [ doc = "< The IPv6 multicast address." ] pub mAddress : otIp6Address , # [ doc = "< A pointer to the next network interface multicast address." ] pub mNext : * const otNetifMulticastAddress , } # [ test ] fn bindgen_test_layout_otNetifMulticastAddress ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otNetifMulticastAddress > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( otNetifMulticastAddress ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otNetifMulticastAddress > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otNetifMulticastAddress ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetifMulticastAddress > ( ) ) ) . mAddress as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetifMulticastAddress ) , "::" , stringify ! ( mAddress ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetifMulticastAddress > ( ) ) ) . mNext as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otNetifMulticastAddress ) , "::" , stringify ! ( mNext ) ) ) ; } # [ doc = " This structure represents an IPv6 socket address." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otSockAddr { # [ doc = "< An IPv6 address." ] pub mAddress : otIp6Address , # [ doc = "< A transport-layer port." ] pub mPort : u16 , # [ doc = "< An IPv6 scope identifier." ] pub mScopeId : i8 , } # [ test ] fn bindgen_test_layout_otSockAddr ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otSockAddr > ( ) , 20usize , concat ! ( "Size of: " , stringify ! ( otSockAddr ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otSockAddr > ( ) , 2usize , concat ! ( "Alignment of " , stringify ! ( otSockAddr ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otSockAddr > ( ) ) ) . mAddress as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otSockAddr ) , "::" , stringify ! ( mAddress ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otSockAddr > ( ) ) ) . mPort as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otSockAddr ) , "::" , stringify ! ( mPort ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otSockAddr > ( ) ) ) . mScopeId as * const _ as usize } , 18usize , concat ! ( "Offset of field: " , stringify ! ( otSockAddr ) , "::" , stringify ! ( mScopeId ) ) ) ; } # [ doc = " This structure represents the local and peer IPv6 socket addresses." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otMessageInfo { # [ doc = "< The local IPv6 address." ] pub mSockAddr : otIp6Address , # [ doc = "< The peer IPv6 address." ] pub mPeerAddr : otIp6Address , # [ doc = "< The local transport-layer port." ] pub mSockPort : u16 , # [ doc = "< The peer transport-layer port." ] pub mPeerPort : u16 , # [ doc = "< A pointer to link-specific information." ] pub mLinkInfo : * const :: std :: os :: raw :: c_void , # [ doc = "< The IPv6 Hop Limit value. Only applies if `mAllowZeroHopLimit` is FALSE." ] # [ doc = "< If `0`, IPv6 Hop Limit is default value `OPENTHREAD_CONFIG_IP6_HOP_LIMIT_DEFAULT`." ] # [ doc = "< Otherwise, specifies the IPv6 Hop Limit." ] pub mHopLimit : u8 , pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > , pub __bindgen_padding_0 : [ u16 ; 3usize ] , } # [ test ] fn bindgen_test_layout_otMessageInfo ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otMessageInfo > ( ) , 56usize , concat ! ( "Size of: " , stringify ! ( otMessageInfo ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otMessageInfo > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otMessageInfo ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMessageInfo > ( ) ) ) . mSockAddr as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otMessageInfo ) , "::" , stringify ! ( mSockAddr ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMessageInfo > ( ) ) ) . mPeerAddr as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otMessageInfo ) , "::" , stringify ! ( mPeerAddr ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMessageInfo > ( ) ) ) . mSockPort as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( otMessageInfo ) , "::" , stringify ! ( mSockPort ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMessageInfo > ( ) ) ) . mPeerPort as * const _ as usize } , 34usize , concat ! ( "Offset of field: " , stringify ! ( otMessageInfo ) , "::" , stringify ! ( mPeerPort ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMessageInfo > ( ) ) ) . mLinkInfo as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( otMessageInfo ) , "::" , stringify ! ( mLinkInfo ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMessageInfo > ( ) ) ) . mHopLimit as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( otMessageInfo ) , "::" , stringify ! ( mHopLimit ) ) ) ; } impl otMessageInfo { # [ inline ] pub fn mIsHostInterface ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsHostInterface ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mAllowZeroHopLimit ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 1usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mAllowZeroHopLimit ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 1usize , 1u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( mIsHostInterface : bool , mAllowZeroHopLimit : bool ) -> __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 1u8 , { let mIsHostInterface : u8 = unsafe { :: std :: mem :: transmute ( mIsHostInterface ) } ; mIsHostInterface as u64 } ) ; __bindgen_bitfield_unit . set ( 1usize , 1u8 , { let mAllowZeroHopLimit : u8 = unsafe { :: std :: mem :: transmute ( mAllowZeroHopLimit ) } ; mAllowZeroHopLimit as u64 } ) ; __bindgen_bitfield_unit } } extern "C" { # [ doc = " This function brings up/down the IPv6 interface." ] # [ doc = "" ] # [ doc = " Call this function to enable/disable IPv6 communication." ] # [ doc = "" ] # [ doc = " @param[in] aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in] aEnabled  TRUE to enable IPv6, FALSE otherwise." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE            Successfully brought the IPv6 interface up/down." ] # [ doc = " @retval OT_ERROR_INVALID_STATE   IPv6 interface is not available since device is operating in raw-link mode" ] # [ doc = "                                  (applicable only when `OPENTHREAD_CONFIG_LINK_RAW_ENABLE` feature is enabled)." ] # [ doc = "" ] pub fn otIp6SetEnabled ( aInstance : * mut otInstance , aEnabled : bool ) -> otError ; } extern "C" { # [ doc = " This function indicates whether or not the IPv6 interface is up." ] # [ doc = "" ] # [ doc = " @param[in] aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval TRUE   The IPv6 interface is enabled." ] # [ doc = " @retval FALSE  The IPv6 interface is disabled." ] # [ doc = "" ] pub fn otIp6IsEnabled ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " Add a Network Interface Address to the Thread interface." ] # [ doc = "" ] # [ doc = " The passed-in instance @p aAddress is copied by the Thread interface. The Thread interface only" ] # [ doc = " supports a fixed number of externally added unicast addresses. See OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aAddress  A pointer to a Network Interface Address." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully added (or updated) the Network Interface Address." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  The IP Address indicated by @p aAddress is an internal address." ] # [ doc = " @retval OT_ERROR_NO_BUFS       The Network Interface is already storing the maximum allowed external addresses." ] pub fn otIp6AddUnicastAddress ( aInstance : * mut otInstance , aAddress : * const otNetifAddress ) -> otError ; } extern "C" { # [ doc = " Remove a Network Interface Address from the Thread interface." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aAddress  A pointer to an IP Address." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully removed the Network Interface Address." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  The IP Address indicated by @p aAddress is an internal address." ] # [ doc = " @retval OT_ERROR_NOT_FOUND     The IP Address indicated by @p aAddress was not found." ] pub fn otIp6RemoveUnicastAddress ( aInstance : * mut otInstance , aAddress : * const otIp6Address ) -> otError ; } extern "C" { # [ doc = " Get the list of IPv6 addresses assigned to the Thread interface." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to the first Network Interface Address." ] pub fn otIp6GetUnicastAddresses ( aInstance : * mut otInstance ) -> * const otNetifAddress ; } extern "C" { # [ doc = " Subscribe the Thread interface to a Network Interface Multicast Address." ] # [ doc = "" ] # [ doc = " The passed in instance @p aAddress will be copied by the Thread interface. The Thread interface only" ] # [ doc = " supports a fixed number of externally added multicast addresses. See OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aAddress  A pointer to an IP Address." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully subscribed to the Network Interface Multicast Address." ] # [ doc = " @retval OT_ERROR_ALREADY        The multicast address is already subscribed." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS   The IP Address indicated by @p aAddress is invalid address." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  The Network Interface is not up." ] # [ doc = " @retval OT_ERROR_NO_BUFS        The Network Interface is already storing the maximum allowed external multicast" ] # [ doc = "                                 addresses." ] # [ doc = "" ] pub fn otIp6SubscribeMulticastAddress ( aInstance : * mut otInstance , aAddress : * const otIp6Address ) -> otError ; } extern "C" { # [ doc = " Unsubscribe the Thread interface to a Network Interface Multicast Address." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aAddress  A pointer to an IP Address." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully unsubscribed to the Network Interface Multicast Address." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  The IP Address indicated by @p aAddress is an internal address." ] # [ doc = " @retval OT_ERROR_NOT_FOUND     The IP Address indicated by @p aAddress was not found." ] pub fn otIp6UnsubscribeMulticastAddress ( aInstance : * mut otInstance , aAddress : * const otIp6Address ) -> otError ; } extern "C" { # [ doc = " Get the list of IPv6 multicast addresses subscribed to the Thread interface." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to the first Network Interface Multicast Address." ] # [ doc = "" ] pub fn otIp6GetMulticastAddresses ( aInstance : * mut otInstance ) -> * const otNetifMulticastAddress ; } extern "C" { # [ doc = " Check if multicast promiscuous mode is enabled on the Thread interface." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @sa otIp6SetMulticastPromiscuousEnabled" ] # [ doc = "" ] pub fn otIp6IsMulticastPromiscuousEnabled ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " Enable multicast promiscuous mode on the Thread interface." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aEnabled   TRUE to enable Multicast Promiscuous mode, FALSE otherwise." ] # [ doc = "" ] # [ doc = " @sa otIp6IsMulticastPromiscuousEnabled" ] # [ doc = "" ] pub fn otIp6SetMulticastPromiscuousEnabled ( aInstance : * mut otInstance , aEnabled : bool ) ; } extern "C" { # [ doc = " Allocate a new message buffer for sending an IPv6 message." ] # [ doc = "" ] # [ doc = " @note If @p aSettings is 'NULL', the link layer security is enabled and the message priority is set to" ] # [ doc = " OT_MESSAGE_PRIORITY_NORMAL by default." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aSettings  A pointer to the message settings or NULL to set default settings." ] # [ doc = "" ] # [ doc = " @returns A pointer to the message buffer or NULL if no message buffers are available or parameters are invalid." ] # [ doc = "" ] # [ doc = " @sa otMessageFree" ] # [ doc = "" ] pub fn otIp6NewMessage ( aInstance : * mut otInstance , aSettings : * const otMessageSettings ) -> * mut otMessage ; } extern "C" { # [ doc = " Allocate a new message buffer and write the IPv6 datagram to the message buffer for sending an IPv6 message." ] # [ doc = "" ] # [ doc = " @note If @p aSettings is NULL, the link layer security is enabled and the message priority is obtained from IPv6" ] # [ doc = "       message itself." ] # [ doc = "       If @p aSettings is not NULL, the @p aSetting->mPriority is ignored and obtained from IPv6 message itself." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aData        A pointer to the IPv6 datagram buffer." ] # [ doc = " @param[in]  aDataLength  The size of the IPv6 datagram buffer pointed by @p aData." ] # [ doc = " @param[in]  aSettings    A pointer to the message settings or NULL to set default settings." ] # [ doc = "" ] # [ doc = " @returns A pointer to the message or NULL if malformed IPv6 header or insufficient message buffers are available." ] # [ doc = "" ] # [ doc = " @sa otMessageFree" ] # [ doc = "" ] pub fn otIp6NewMessageFromBuffer ( aInstance : * mut otInstance , aData : * const u8 , aDataLength : u16 , aSettings : * const otMessageSettings ) -> * mut otMessage ; } # [ doc = " This function pointer is called when an IPv6 datagram is received." ] # [ doc = "" ] # [ doc = " @param[in]  aMessage  A pointer to the message buffer containing the received IPv6 datagram. This function transfers" ] # [ doc = "                       the ownership of the @p aMessage to the receiver of the callback. The message should be" ] # [ doc = "                       freed by the receiver of the callback after it is processed (see otMessageFree())." ] # [ doc = " @param[in]  aContext  A pointer to application-specific context." ] # [ doc = "" ] pub type otIp6ReceiveCallback = :: std :: option :: Option < unsafe extern "C" fn ( aMessage : * mut otMessage , aContext : * mut :: std :: os :: raw :: c_void ) > ; extern "C" { # [ doc = " This function registers a callback to provide received IPv6 datagrams." ] # [ doc = "" ] # [ doc = " By default, this callback does not pass Thread control traffic.  See otIp6SetReceiveFilterEnabled() to" ] # [ doc = " change the Thread control traffic filter setting." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance         A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aCallback         A pointer to a function that is called when an IPv6 datagram is received or" ] # [ doc = "                               NULL to disable the callback." ] # [ doc = " @param[in]  aCallbackContext  A pointer to application-specific context." ] # [ doc = "" ] # [ doc = " @sa otIp6IsReceiveFilterEnabled" ] # [ doc = " @sa otIp6SetReceiveFilterEnabled" ] # [ doc = "" ] pub fn otIp6SetReceiveCallback ( aInstance : * mut otInstance , aCallback : otIp6ReceiveCallback , aCallbackContext : * mut :: std :: os :: raw :: c_void ) ; } # [ doc = " This function pointer is called when an internal IPv6 address is added or removed." ] # [ doc = "" ] # [ doc = " @param[in]   aAddress            A pointer to the IPv6 address." ] # [ doc = " @param[in]   aPrefixLength       The prefix length if @p aAddress is unicast address, and 128 for multicast address." ] # [ doc = " @param[in]   aIsAdded            TRUE if the @p aAddress was added, FALSE if @p aAddress was removed." ] # [ doc = " @param[in]   aContext            A pointer to application-specific context." ] # [ doc = "" ] pub type otIp6AddressCallback = :: std :: option :: Option < unsafe extern "C" fn ( aAddress : * const otIp6Address , aPrefixLength : u8 , aIsAdded : bool , aContext : * mut :: std :: os :: raw :: c_void ) > ; extern "C" { # [ doc = " This function registers a callback to notify internal IPv6 address changes." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance           A pointer to an OpenThread instance." ] # [ doc = " @param[in]   aCallback           A pointer to a function that is called when an internal IPv6 address is added or" ] # [ doc = "                                  removed. NULL to disable the callback." ] # [ doc = " @param[in]   aCallbackContext    A pointer to application-specific context." ] # [ doc = "" ] pub fn otIp6SetAddressCallback ( aInstance : * mut otInstance , aCallback : otIp6AddressCallback , aCallbackContext : * mut :: std :: os :: raw :: c_void ) ; } extern "C" { # [ doc = " This function indicates whether or not Thread control traffic is filtered out when delivering IPv6 datagrams" ] # [ doc = " via the callback specified in otIp6SetReceiveCallback()." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns  TRUE if Thread control traffic is filtered out, FALSE otherwise." ] # [ doc = "" ] # [ doc = " @sa otIp6SetReceiveCallback" ] # [ doc = " @sa otIp6SetReceiveFilterEnabled" ] # [ doc = "" ] pub fn otIp6IsReceiveFilterEnabled ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " This function sets whether or not Thread control traffic is filtered out when delivering IPv6 datagrams" ] # [ doc = " via the callback specified in otIp6SetReceiveCallback()." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aEnabled  TRUE if Thread control traffic is filtered out, FALSE otherwise." ] # [ doc = "" ] # [ doc = " @sa otIp6SetReceiveCallback" ] # [ doc = " @sa otIsReceiveIp6FilterEnabled" ] # [ doc = "" ] pub fn otIp6SetReceiveFilterEnabled ( aInstance : * mut otInstance , aEnabled : bool ) ; } extern "C" { # [ doc = " This function sends an IPv6 datagram via the Thread interface." ] # [ doc = "" ] # [ doc = " The caller transfers ownership of @p aMessage when making this call. OpenThread will free @p aMessage when" ] # [ doc = " processing is complete, including when a value other than `OT_ERROR_NONE` is returned." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aMessage  A pointer to the message buffer containing the IPv6 datagram." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE      Successfully processed the message." ] # [ doc = " @retval OT_ERROR_DROP      Message was well-formed but not fully processed due to packet processing rules." ] # [ doc = " @retval OT_ERROR_NO_BUFS   Could not allocate necessary message buffers when processing the datagram." ] # [ doc = " @retval OT_ERROR_NO_ROUTE  No route to host." ] # [ doc = " @retval OT_ERROR_PARSE     Encountered a malformed header when processing the message." ] # [ doc = "" ] pub fn otIp6Send ( aInstance : * mut otInstance , aMessage : * mut otMessage ) -> otError ; } extern "C" { # [ doc = " This function adds a port to the allowed unsecured port list." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aPort     The port value." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE         The port was successfully added to the allowed unsecure port list." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS The port is invalid (value 0 is reserved for internal use)." ] # [ doc = " @retval OT_ERROR_NO_BUFS      The unsecure port list is full." ] # [ doc = "" ] pub fn otIp6AddUnsecurePort ( aInstance : * mut otInstance , aPort : u16 ) -> otError ; } extern "C" { # [ doc = " This function removes a port from the allowed unsecure port list." ] # [ doc = "" ] # [ doc = " @note This function removes @p aPort by overwriting @p aPort with the element after @p aPort in the internal port" ] # [ doc = "       list. Be careful when calling otIp6GetUnsecurePorts() followed by otIp6RemoveUnsecurePort() to remove unsecure" ] # [ doc = "       ports." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aPort     The port value." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE         The port was successfully removed from the allowed unsecure port list." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS The port is invalid (value 0 is reserved for internal use)." ] # [ doc = " @retval OT_ERROR_NOT_FOUND    The port was not found in the unsecure port list." ] # [ doc = "" ] pub fn otIp6RemoveUnsecurePort ( aInstance : * mut otInstance , aPort : u16 ) -> otError ; } extern "C" { # [ doc = " This function removes all ports from the allowed unsecure port list." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] pub fn otIp6RemoveAllUnsecurePorts ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " This function returns a pointer to the unsecure port list." ] # [ doc = "" ] # [ doc = " @note Port value 0 is used to indicate an invalid entry." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[out]  aNumEntries  The number of entries in the list." ] # [ doc = "" ] # [ doc = " @returns A pointer to the unsecure port list." ] # [ doc = "" ] pub fn otIp6GetUnsecurePorts ( aInstance : * mut otInstance , aNumEntries : * mut u8 ) -> * const u16 ; } extern "C" { # [ doc = " Test if two IPv6 addresses are the same." ] # [ doc = "" ] # [ doc = " @param[in]  aFirst   A pointer to the first IPv6 address to compare." ] # [ doc = " @param[in]  aSecond  A pointer to the second IPv6 address to compare." ] # [ doc = "" ] # [ doc = " @retval TRUE   The two IPv6 addresses are the same." ] # [ doc = " @retval FALSE  The two IPv6 addresses are not the same." ] # [ doc = "" ] pub fn otIp6IsAddressEqual ( aFirst : * const otIp6Address , aSecond : * const otIp6Address ) -> bool ; } extern "C" { # [ doc = " Convert a human-readable IPv6 address string into a binary representation." ] # [ doc = "" ] # [ doc = " @param[in]   aString   A pointer to a NULL-terminated string." ] # [ doc = " @param[out]  aAddress  A pointer to an IPv6 address." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully parsed the string." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  Failed to parse the string." ] # [ doc = "" ] pub fn otIp6AddressFromString ( aString : * const :: std :: os :: raw :: c_char , aAddress : * mut otIp6Address ) -> otError ; } extern "C" { # [ doc = " This function returns the prefix match length (bits) for two IPv6 addresses." ] # [ doc = "" ] # [ doc = " @param[in]  aFirst   A pointer to the first IPv6 address." ] # [ doc = " @param[in]  aSecond  A pointer to the second IPv6 address." ] # [ doc = "" ] # [ doc = " @returns  The prefix match length in bits." ] # [ doc = "" ] pub fn otIp6PrefixMatch ( aFirst : * const otIp6Address , aSecond : * const otIp6Address ) -> u8 ; } extern "C" { # [ doc = " This function indicates whether or not a given IPv6 address is the Unspecified Address." ] # [ doc = "" ] # [ doc = " @param[in]  aAddress   A pointer to an IPv6 address." ] # [ doc = "" ] # [ doc = " @retval TRUE   If the IPv6 address is the Unspecified Address." ] # [ doc = " @retval FALSE  If the IPv6 address is not the Unspecified Address." ] # [ doc = "" ] pub fn otIp6IsAddressUnspecified ( aAddress : * const otIp6Address ) -> bool ; } extern "C" { # [ doc = " This function perform OpenThread source address selection." ] # [ doc = "" ] # [ doc = " @param[in]     aInstance     A pointer to an OpenThread instance." ] # [ doc = " @param[inout]  aMessageInfo  A pointer to the message information." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE       Found a source address and is filled into mSockAddr of @p aMessageInfo." ] # [ doc = " @retval  OT_ERROR_NOT_FOUND  No source address was found and @p aMessageInfo is unchanged." ] # [ doc = "" ] pub fn otIp6SelectSourceAddress ( aInstance : * mut otInstance , aMessageInfo : * mut otMessageInfo ) -> otError ; } extern "C" { # [ doc = " This function indicates whether the SLAAC module is enabled or not." ] # [ doc = "" ] # [ doc = " This function requires the build-time feature `OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE` to be enabled." ] # [ doc = "" ] # [ doc = " @retval TRUE    SLAAC module is enabled." ] # [ doc = " @retval FALSE   SLAAC module is disabled." ] # [ doc = "" ] pub fn otIp6IsSlaacEnabled ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " This function enables/disables the SLAAC module." ] # [ doc = "" ] # [ doc = " This function requires the build-time feature `OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE` to be enabled." ] # [ doc = "" ] # [ doc = " When SLAAC module is enabled, SLAAC addresses (based on on-mesh prefixes in Network Data) are added to the interface." ] # [ doc = " When SLAAC module is disabled any previously added SLAAC address is removed." ] # [ doc = "" ] # [ doc = " @param[in] aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in] aEnabled  TRUE to enable, FALSE to disable." ] # [ doc = "" ] pub fn otIp6SetSlaacEnabled ( aInstance : * mut otInstance , aEnabled : bool ) ; } # [ doc = " This function pointer allows user to filter prefixes and not allow an SLAAC address based on a prefix to be added." ] # [ doc = "" ] # [ doc = " `otIp6SetSlaacPrefixFilter()` can be used to set the filter handler. The filter handler is invoked by SLAAC module" ] # [ doc = " when it is about to add a SLAAC address based on a prefix. Its boolean return value determines whether the address" ] # [ doc = " is filtered (not added) or not." ] # [ doc = "" ] # [ doc = " @param[in] aInstacne   A pointer to an OpenThread instance." ] # [ doc = " @param[in] aPrefix     A pointer to prefix for which SLAAC address is about to be added." ] # [ doc = "" ] # [ doc = " @retval TRUE    Indicates that the SLAAC address based on the prefix should be filtered and NOT added." ] # [ doc = " @retval FALSE   Indicates that the SLAAC address based on the prefix should be added." ] # [ doc = "" ] pub type otIp6SlaacPrefixFilter = :: std :: option :: Option < unsafe extern "C" fn ( aInstance : * mut otInstance , aPrefix : * const otIp6Prefix ) -> bool > ; extern "C" { # [ doc = " This function sets the SLAAC module filter handler." ] # [ doc = "" ] # [ doc = " This function requires the build-time feature `OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE` to be enabled." ] # [ doc = "" ] # [ doc = " The filter handler is called by SLAAC module when it is about to add a SLAAC address based on a prefix to decide" ] # [ doc = " whether the address should be added or not." ] # [ doc = "" ] # [ doc = " A NULL filter handler disables filtering and allows all SLAAC addresses to be added." ] # [ doc = "" ] # [ doc = " If this function is not called, the default filter used by SLAAC module will be NULL (filtering is disabled)." ] # [ doc = "" ] # [ doc = " @param[in] aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in] aFilter      A pointer to SLAAC prefix filter handler, or NULL to disable filtering." ] # [ doc = "" ] pub fn otIp6SetSlaacPrefixFilter ( aInstance : * mut otInstance , aFilter : otIp6SlaacPrefixFilter ) ; } # [ doc = " @struct otMasterKey" ] # [ doc = "" ] # [ doc = " This structure represents a Thread Master Key." ] # [ doc = "" ] # [ repr ( C , packed ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otMasterKey { # [ doc = "< Byte values" ] pub m8 : [ u8 ; 16usize ] , } # [ test ] fn bindgen_test_layout_otMasterKey ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otMasterKey > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( otMasterKey ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otMasterKey > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otMasterKey ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMasterKey > ( ) ) ) . m8 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otMasterKey ) , "::" , stringify ! ( m8 ) ) ) ; } # [ doc = " This structure represents a Network Name." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otNetworkName { # [ doc = "< Byte values" ] pub m8 : [ :: std :: os :: raw :: c_char ; 17usize ] , } # [ test ] fn bindgen_test_layout_otNetworkName ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otNetworkName > ( ) , 17usize , concat ! ( "Size of: " , stringify ! ( otNetworkName ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otNetworkName > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otNetworkName ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkName > ( ) ) ) . m8 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkName ) , "::" , stringify ! ( m8 ) ) ) ; } # [ doc = " This structure represents an Extended PAN ID." ] # [ doc = "" ] # [ repr ( C , packed ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otExtendedPanId { # [ doc = "< Byte values" ] pub m8 : [ u8 ; 8usize ] , } # [ test ] fn bindgen_test_layout_otExtendedPanId ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otExtendedPanId > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( otExtendedPanId ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otExtendedPanId > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otExtendedPanId ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otExtendedPanId > ( ) ) ) . m8 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otExtendedPanId ) , "::" , stringify ! ( m8 ) ) ) ; } # [ doc = " This structure represents a Mesh Local Prefix." ] # [ doc = "" ] # [ repr ( C , packed ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otMeshLocalPrefix { # [ doc = "< Byte values" ] pub m8 : [ u8 ; 8usize ] , } # [ test ] fn bindgen_test_layout_otMeshLocalPrefix ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otMeshLocalPrefix > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( otMeshLocalPrefix ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otMeshLocalPrefix > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otMeshLocalPrefix ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMeshLocalPrefix > ( ) ) ) . m8 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otMeshLocalPrefix ) , "::" , stringify ! ( m8 ) ) ) ; } # [ doc = " This structure represents PSKc." ] # [ doc = "" ] # [ repr ( C , packed ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otPskc { # [ doc = "< Byte values" ] pub m8 : [ u8 ; 16usize ] , } # [ test ] fn bindgen_test_layout_otPskc ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otPskc > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( otPskc ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otPskc > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otPskc ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPskc > ( ) ) ) . m8 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otPskc ) , "::" , stringify ! ( m8 ) ) ) ; } # [ doc = " This structure represent Security Policy." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otSecurityPolicy { # [ doc = "< The value for thrKeyRotation in units of hours" ] pub mRotationTime : u16 , # [ doc = "< Flags as defined in Thread 1.1 Section 8.10.1.15" ] pub mFlags : u8 , } # [ test ] fn bindgen_test_layout_otSecurityPolicy ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otSecurityPolicy > ( ) , 4usize , concat ! ( "Size of: " , stringify ! ( otSecurityPolicy ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otSecurityPolicy > ( ) , 2usize , concat ! ( "Alignment of " , stringify ! ( otSecurityPolicy ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otSecurityPolicy > ( ) ) ) . mRotationTime as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otSecurityPolicy ) , "::" , stringify ! ( mRotationTime ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otSecurityPolicy > ( ) ) ) . mFlags as * const _ as usize } , 2usize , concat ! ( "Offset of field: " , stringify ! ( otSecurityPolicy ) , "::" , stringify ! ( mFlags ) ) ) ; } # [ doc = "< Obtaining the Master Key" ] pub const OT_SECURITY_POLICY_OBTAIN_MASTER_KEY : _bindgen_ty_6 = 128 ; # [ doc = "< Native Commissioning" ] pub const OT_SECURITY_POLICY_NATIVE_COMMISSIONING : _bindgen_ty_6 = 64 ; # [ doc = "< Routers enabled" ] pub const OT_SECURITY_POLICY_ROUTERS : _bindgen_ty_6 = 32 ; # [ doc = "< External Commissioner allowed" ] pub const OT_SECURITY_POLICY_EXTERNAL_COMMISSIONER : _bindgen_ty_6 = 16 ; # [ doc = "< Beacons enabled" ] pub const OT_SECURITY_POLICY_BEACONS : _bindgen_ty_6 = 8 ; # [ doc = " This enumeration defines the Security Policy TLV flags." ] # [ doc = "" ] pub type _bindgen_ty_6 = u32 ; # [ doc = " This type represents Channel Mask." ] # [ doc = "" ] pub type otChannelMask = u32 ; # [ doc = " This structure represents presence of different components in Active or Pending Operational Dataset." ] # [ doc = "" ] # [ repr ( C , packed ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otOperationalDatasetComponents { pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 2usize ] , u8 > , } # [ test ] fn bindgen_test_layout_otOperationalDatasetComponents ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otOperationalDatasetComponents > ( ) , 2usize , concat ! ( "Size of: " , stringify ! ( otOperationalDatasetComponents ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otOperationalDatasetComponents > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otOperationalDatasetComponents ) ) ) ; } impl otOperationalDatasetComponents { # [ inline ] pub fn mIsActiveTimestampPresent ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsActiveTimestampPresent ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mIsPendingTimestampPresent ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 1usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsPendingTimestampPresent ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 1usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mIsMasterKeyPresent ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 2usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsMasterKeyPresent ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 2usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mIsNetworkNamePresent ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 3usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsNetworkNamePresent ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 3usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mIsExtendedPanIdPresent ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 4usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsExtendedPanIdPresent ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 4usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mIsMeshLocalPrefixPresent ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 5usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsMeshLocalPrefixPresent ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 5usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mIsDelayPresent ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 6usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsDelayPresent ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 6usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mIsPanIdPresent ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 7usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsPanIdPresent ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 7usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mIsChannelPresent ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 8usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsChannelPresent ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 8usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mIsPskcPresent ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 9usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsPskcPresent ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 9usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mIsSecurityPolicyPresent ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 10usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsSecurityPolicyPresent ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 10usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mIsChannelMaskPresent ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 11usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsChannelMaskPresent ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 11usize , 1u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( mIsActiveTimestampPresent : bool , mIsPendingTimestampPresent : bool , mIsMasterKeyPresent : bool , mIsNetworkNamePresent : bool , mIsExtendedPanIdPresent : bool , mIsMeshLocalPrefixPresent : bool , mIsDelayPresent : bool , mIsPanIdPresent : bool , mIsChannelPresent : bool , mIsPskcPresent : bool , mIsSecurityPolicyPresent : bool , mIsChannelMaskPresent : bool ) -> __BindgenBitfieldUnit < [ u8 ; 2usize ] , u8 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 2usize ] , u8 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 1u8 , { let mIsActiveTimestampPresent : u8 = unsafe { :: std :: mem :: transmute ( mIsActiveTimestampPresent ) } ; mIsActiveTimestampPresent as u64 } ) ; __bindgen_bitfield_unit . set ( 1usize , 1u8 , { let mIsPendingTimestampPresent : u8 = unsafe { :: std :: mem :: transmute ( mIsPendingTimestampPresent ) } ; mIsPendingTimestampPresent as u64 } ) ; __bindgen_bitfield_unit . set ( 2usize , 1u8 , { let mIsMasterKeyPresent : u8 = unsafe { :: std :: mem :: transmute ( mIsMasterKeyPresent ) } ; mIsMasterKeyPresent as u64 } ) ; __bindgen_bitfield_unit . set ( 3usize , 1u8 , { let mIsNetworkNamePresent : u8 = unsafe { :: std :: mem :: transmute ( mIsNetworkNamePresent ) } ; mIsNetworkNamePresent as u64 } ) ; __bindgen_bitfield_unit . set ( 4usize , 1u8 , { let mIsExtendedPanIdPresent : u8 = unsafe { :: std :: mem :: transmute ( mIsExtendedPanIdPresent ) } ; mIsExtendedPanIdPresent as u64 } ) ; __bindgen_bitfield_unit . set ( 5usize , 1u8 , { let mIsMeshLocalPrefixPresent : u8 = unsafe { :: std :: mem :: transmute ( mIsMeshLocalPrefixPresent ) } ; mIsMeshLocalPrefixPresent as u64 } ) ; __bindgen_bitfield_unit . set ( 6usize , 1u8 , { let mIsDelayPresent : u8 = unsafe { :: std :: mem :: transmute ( mIsDelayPresent ) } ; mIsDelayPresent as u64 } ) ; __bindgen_bitfield_unit . set ( 7usize , 1u8 , { let mIsPanIdPresent : u8 = unsafe { :: std :: mem :: transmute ( mIsPanIdPresent ) } ; mIsPanIdPresent as u64 } ) ; __bindgen_bitfield_unit . set ( 8usize , 1u8 , { let mIsChannelPresent : u8 = unsafe { :: std :: mem :: transmute ( mIsChannelPresent ) } ; mIsChannelPresent as u64 } ) ; __bindgen_bitfield_unit . set ( 9usize , 1u8 , { let mIsPskcPresent : u8 = unsafe { :: std :: mem :: transmute ( mIsPskcPresent ) } ; mIsPskcPresent as u64 } ) ; __bindgen_bitfield_unit . set ( 10usize , 1u8 , { let mIsSecurityPolicyPresent : u8 = unsafe { :: std :: mem :: transmute ( mIsSecurityPolicyPresent ) } ; mIsSecurityPolicyPresent as u64 } ) ; __bindgen_bitfield_unit . set ( 11usize , 1u8 , { let mIsChannelMaskPresent : u8 = unsafe { :: std :: mem :: transmute ( mIsChannelMaskPresent ) } ; mIsChannelMaskPresent as u64 } ) ; __bindgen_bitfield_unit } } # [ doc = " This structure represents an Active or Pending Operational Dataset." ] # [ doc = "" ] # [ doc = " Components in Dataset are optional. `mComponets` structure specifies which components are present in the Dataset." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otOperationalDataset { # [ doc = "< Active Timestamp" ] pub mActiveTimestamp : u64 , # [ doc = "< Pending Timestamp" ] pub mPendingTimestamp : u64 , # [ doc = "< Network Master Key" ] pub mMasterKey : otMasterKey , # [ doc = "< Network Name" ] pub mNetworkName : otNetworkName , # [ doc = "< Extended PAN ID" ] pub mExtendedPanId : otExtendedPanId , # [ doc = "< Mesh Local Prefix" ] pub mMeshLocalPrefix : otMeshLocalPrefix , # [ doc = "< Delay Timer" ] pub mDelay : u32 , # [ doc = "< PAN ID" ] pub mPanId : otPanId , # [ doc = "< Channel" ] pub mChannel : u16 , # [ doc = "< PSKc" ] pub mPskc : otPskc , # [ doc = "< Security Policy" ] pub mSecurityPolicy : otSecurityPolicy , # [ doc = "< Channel Mask" ] pub mChannelMask : otChannelMask , # [ doc = "< Specifies which components are set in the Dataset." ] pub mComponents : otOperationalDatasetComponents , } # [ test ] fn bindgen_test_layout_otOperationalDataset ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otOperationalDataset > ( ) , 104usize , concat ! ( "Size of: " , stringify ! ( otOperationalDataset ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otOperationalDataset > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otOperationalDataset ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otOperationalDataset > ( ) ) ) . mActiveTimestamp as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otOperationalDataset ) , "::" , stringify ! ( mActiveTimestamp ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otOperationalDataset > ( ) ) ) . mPendingTimestamp as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otOperationalDataset ) , "::" , stringify ! ( mPendingTimestamp ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otOperationalDataset > ( ) ) ) . mMasterKey as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otOperationalDataset ) , "::" , stringify ! ( mMasterKey ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otOperationalDataset > ( ) ) ) . mNetworkName as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( otOperationalDataset ) , "::" , stringify ! ( mNetworkName ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otOperationalDataset > ( ) ) ) . mExtendedPanId as * const _ as usize } , 49usize , concat ! ( "Offset of field: " , stringify ! ( otOperationalDataset ) , "::" , stringify ! ( mExtendedPanId ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otOperationalDataset > ( ) ) ) . mMeshLocalPrefix as * const _ as usize } , 57usize , concat ! ( "Offset of field: " , stringify ! ( otOperationalDataset ) , "::" , stringify ! ( mMeshLocalPrefix ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otOperationalDataset > ( ) ) ) . mDelay as * const _ as usize } , 68usize , concat ! ( "Offset of field: " , stringify ! ( otOperationalDataset ) , "::" , stringify ! ( mDelay ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otOperationalDataset > ( ) ) ) . mPanId as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( otOperationalDataset ) , "::" , stringify ! ( mPanId ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otOperationalDataset > ( ) ) ) . mChannel as * const _ as usize } , 74usize , concat ! ( "Offset of field: " , stringify ! ( otOperationalDataset ) , "::" , stringify ! ( mChannel ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otOperationalDataset > ( ) ) ) . mPskc as * const _ as usize } , 76usize , concat ! ( "Offset of field: " , stringify ! ( otOperationalDataset ) , "::" , stringify ! ( mPskc ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otOperationalDataset > ( ) ) ) . mSecurityPolicy as * const _ as usize } , 92usize , concat ! ( "Offset of field: " , stringify ! ( otOperationalDataset ) , "::" , stringify ! ( mSecurityPolicy ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otOperationalDataset > ( ) ) ) . mChannelMask as * const _ as usize } , 96usize , concat ! ( "Offset of field: " , stringify ! ( otOperationalDataset ) , "::" , stringify ! ( mChannelMask ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otOperationalDataset > ( ) ) ) . mComponents as * const _ as usize } , 100usize , concat ! ( "Offset of field: " , stringify ! ( otOperationalDataset ) , "::" , stringify ! ( mComponents ) ) ) ; } extern "C" { # [ doc = " This function indicates whether a valid network is present in the Active Operational Dataset or not." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns TRUE if a valid network is present in the Active Operational Dataset, FALSE otherwise." ] # [ doc = "" ] pub fn otDatasetIsCommissioned ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " This function gets the Active Operational Dataset." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[out]  aDataset  A pointer to where the Active Operational Dataset will be placed." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully retrieved the Active Operational Dataset." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  @p aDataset was NULL." ] # [ doc = "" ] pub fn otDatasetGetActive ( aInstance : * mut otInstance , aDataset : * mut otOperationalDataset ) -> otError ; } extern "C" { # [ doc = " This function sets the Active Operational Dataset." ] # [ doc = "" ] # [ doc = " If the dataset does not include an Active Timestamp, the dataset is only partially complete." ] # [ doc = "" ] # [ doc = " If Thread is enabled on a device that has a partially complete Active Dataset, the device will attempt to attach to" ] # [ doc = " an existing Thread network using any existing information in the dataset. Only the Thread Master Key is needed to" ] # [ doc = " attach to a network." ] # [ doc = "" ] # [ doc = " If channel is not included in the dataset, the device will send MLE Announce messages across different channels to" ] # [ doc = " find neighbors on other channels." ] # [ doc = "" ] # [ doc = " If the device successfully attaches to a Thread network, the device will then retrieve the full Active Dataset from" ] # [ doc = " its Parent. Note that a router-capable device will not transition to the Router or Leader roles until it has a" ] # [ doc = " complete Active Dataset." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aDataset  A pointer to the Active Operational Dataset." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully set the Active Operational Dataset." ] # [ doc = " @retval OT_ERROR_NO_BUFS       Insufficient buffer space to set the Active Operational Dataset." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  @p aDataset was NULL." ] # [ doc = "" ] pub fn otDatasetSetActive ( aInstance : * mut otInstance , aDataset : * const otOperationalDataset ) -> otError ; } extern "C" { # [ doc = " This function gets the Pending Operational Dataset." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[out]  aDataset  A pointer to where the Pending Operational Dataset will be placed." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully retrieved the Pending Operational Dataset." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  @p aDataset was NULL." ] # [ doc = "" ] pub fn otDatasetGetPending ( aInstance : * mut otInstance , aDataset : * mut otOperationalDataset ) -> otError ; } extern "C" { # [ doc = " This function sets the Pending Operational Dataset." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aDataset  A pointer to the Pending Operational Dataset." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully set the Pending Operational Dataset." ] # [ doc = " @retval OT_ERROR_NO_BUFS       Insufficient buffer space to set the Pending Operational Dataset." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  @p aDataset was NULL." ] # [ doc = "" ] pub fn otDatasetSetPending ( aInstance : * mut otInstance , aDataset : * const otOperationalDataset ) -> otError ; } extern "C" { # [ doc = " This function sends MGMT_ACTIVE_GET." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance           A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aDatasetComponents  A pointer to a Dataset Components structure specifying which components to request." ] # [ doc = " @param[in]  aTlvTypes           A pointer to array containing additional raw TLV types to be requested." ] # [ doc = " @param[in]  aLength             The length of @p aTlvTypes." ] # [ doc = " @param[in]  aAddress            A pointer to the IPv6 destination, if it is NULL, will use Leader ALOC as default." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully send the meshcop dataset command." ] # [ doc = " @retval OT_ERROR_NO_BUFS       Insufficient buffer space to send." ] # [ doc = "" ] pub fn otDatasetSendMgmtActiveGet ( aInstance : * mut otInstance , aDatasetComponents : * const otOperationalDatasetComponents , aTlvTypes : * const u8 , aLength : u8 , aAddress : * const otIp6Address ) -> otError ; } extern "C" { # [ doc = " This function sends MGMT_ACTIVE_SET." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aDataset   A pointer to operational dataset." ] # [ doc = " @param[in]  aTlvs      A pointer to TLVs." ] # [ doc = " @param[in]  aLength    The length of TLVs." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully send the meshcop dataset command." ] # [ doc = " @retval OT_ERROR_NO_BUFS       Insufficient buffer space to send." ] # [ doc = "" ] pub fn otDatasetSendMgmtActiveSet ( aInstance : * mut otInstance , aDataset : * const otOperationalDataset , aTlvs : * const u8 , aLength : u8 ) -> otError ; } extern "C" { # [ doc = " This function sends MGMT_PENDING_GET." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance           A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aDatasetComponents  A pointer to a Dataset Components structure specifying which components to request." ] # [ doc = " @param[in]  aTlvTypes           A pointer to array containing additional raw TLV types to be requested." ] # [ doc = " @param[in]  aLength             The length of @p aTlvTypes." ] # [ doc = " @param[in]  aAddress            A pointer to the IPv6 destination, if it is NULL, will use Leader ALOC as default." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully send the meshcop dataset command." ] # [ doc = " @retval OT_ERROR_NO_BUFS       Insufficient buffer space to send." ] # [ doc = "" ] pub fn otDatasetSendMgmtPendingGet ( aInstance : * mut otInstance , aDatasetComponents : * const otOperationalDatasetComponents , aTlvTypes : * const u8 , aLength : u8 , aAddress : * const otIp6Address ) -> otError ; } extern "C" { # [ doc = " This function sends MGMT_PENDING_SET." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aDataset   A pointer to operational dataset." ] # [ doc = " @param[in]  aTlvs      A pointer to TLVs." ] # [ doc = " @param[in]  aLength    The length of TLVs." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully send the meshcop dataset command." ] # [ doc = " @retval OT_ERROR_NO_BUFS       Insufficient buffer space to send." ] # [ doc = "" ] pub fn otDatasetSendMgmtPendingSet ( aInstance : * mut otInstance , aDataset : * const otOperationalDataset , aTlvs : * const u8 , aLength : u8 ) -> otError ; } extern "C" { # [ doc = " This function generates PSKc from a given pass-phrase, network name, and extended PAN ID." ] # [ doc = "" ] # [ doc = " PSKc is used to establish the Commissioner Session." ] # [ doc = "" ] # [ doc = " @param[in]  aPassPhrase   The commissioning pass-phrase." ] # [ doc = " @param[in]  aNetworkName  The network name for PSKc computation." ] # [ doc = " @param[in]  aExtPanId     The extended PAN ID for PSKc computation." ] # [ doc = " @param[out] aPskc         A pointer to variable to output the generated PSKc." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully generate PSKc." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  If any of the input arguments is invalid." ] # [ doc = "" ] pub fn otDatasetGeneratePskc ( aPassPhrase : * const :: std :: os :: raw :: c_char , aNetworkName : * const otNetworkName , aExtPanId : * const otExtendedPanId , aPskc : * mut otPskc ) -> otError ; } # [ doc = "< Commissioner role is disabled." ] pub const otCommissionerState_OT_COMMISSIONER_STATE_DISABLED : otCommissionerState = 0 ; # [ doc = "< Currently petitioning to become a Commissioner." ] pub const otCommissionerState_OT_COMMISSIONER_STATE_PETITION : otCommissionerState = 1 ; # [ doc = "< Commissioner role is active." ] pub const otCommissionerState_OT_COMMISSIONER_STATE_ACTIVE : otCommissionerState = 2 ; # [ doc = " This enumeration defines the Commissioner State." ] # [ doc = "" ] pub type otCommissionerState = u32 ; pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_START : otCommissionerJoinerEvent = 0 ; pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_CONNECTED : otCommissionerJoinerEvent = 1 ; pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_FINALIZE : otCommissionerJoinerEvent = 2 ; pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_END : otCommissionerJoinerEvent = 3 ; pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_REMOVED : otCommissionerJoinerEvent = 4 ; # [ doc = " This enumeration defines a Joiner Event on the Commissioner." ] # [ doc = "" ] pub type otCommissionerJoinerEvent = u32 ; # [ doc = " This structure represents the steering data." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otSteeringData { # [ doc = "< Length of steering data (bytes)" ] pub mLength : u8 , # [ doc = "< Byte values" ] pub m8 : [ u8 ; 16usize ] , } # [ test ] fn bindgen_test_layout_otSteeringData ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otSteeringData > ( ) , 17usize , concat ! ( "Size of: " , stringify ! ( otSteeringData ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otSteeringData > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otSteeringData ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otSteeringData > ( ) ) ) . mLength as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otSteeringData ) , "::" , stringify ! ( mLength ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otSteeringData > ( ) ) ) . m8 as * const _ as usize } , 1usize , concat ! ( "Offset of field: " , stringify ! ( otSteeringData ) , "::" , stringify ! ( m8 ) ) ) ; } # [ doc = " This structure represents a Commissioning Dataset." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otCommissioningDataset { # [ doc = "< Border Router RLOC16" ] pub mLocator : u16 , # [ doc = "< Commissioner Session Id" ] pub mSessionId : u16 , # [ doc = "< Steering Data" ] pub mSteeringData : otSteeringData , # [ doc = "< Joiner UDP Port" ] pub mJoinerUdpPort : u16 , pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > , pub __bindgen_padding_0 : u8 , } # [ test ] fn bindgen_test_layout_otCommissioningDataset ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otCommissioningDataset > ( ) , 26usize , concat ! ( "Size of: " , stringify ! ( otCommissioningDataset ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otCommissioningDataset > ( ) , 2usize , concat ! ( "Alignment of " , stringify ! ( otCommissioningDataset ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCommissioningDataset > ( ) ) ) . mLocator as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otCommissioningDataset ) , "::" , stringify ! ( mLocator ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCommissioningDataset > ( ) ) ) . mSessionId as * const _ as usize } , 2usize , concat ! ( "Offset of field: " , stringify ! ( otCommissioningDataset ) , "::" , stringify ! ( mSessionId ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCommissioningDataset > ( ) ) ) . mSteeringData as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( otCommissioningDataset ) , "::" , stringify ! ( mSteeringData ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCommissioningDataset > ( ) ) ) . mJoinerUdpPort as * const _ as usize } , 22usize , concat ! ( "Offset of field: " , stringify ! ( otCommissioningDataset ) , "::" , stringify ! ( mJoinerUdpPort ) ) ) ; } impl otCommissioningDataset { # [ inline ] pub fn mIsLocatorSet ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsLocatorSet ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mIsSessionIdSet ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 1usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsSessionIdSet ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 1usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mIsSteeringDataSet ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 2usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsSteeringDataSet ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 2usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mIsJoinerUdpPortSet ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 3usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsJoinerUdpPortSet ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 3usize , 1u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( mIsLocatorSet : bool , mIsSessionIdSet : bool , mIsSteeringDataSet : bool , mIsJoinerUdpPortSet : bool ) -> __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 1u8 , { let mIsLocatorSet : u8 = unsafe { :: std :: mem :: transmute ( mIsLocatorSet ) } ; mIsLocatorSet as u64 } ) ; __bindgen_bitfield_unit . set ( 1usize , 1u8 , { let mIsSessionIdSet : u8 = unsafe { :: std :: mem :: transmute ( mIsSessionIdSet ) } ; mIsSessionIdSet as u64 } ) ; __bindgen_bitfield_unit . set ( 2usize , 1u8 , { let mIsSteeringDataSet : u8 = unsafe { :: std :: mem :: transmute ( mIsSteeringDataSet ) } ; mIsSteeringDataSet as u64 } ) ; __bindgen_bitfield_unit . set ( 3usize , 1u8 , { let mIsJoinerUdpPortSet : u8 = unsafe { :: std :: mem :: transmute ( mIsJoinerUdpPortSet ) } ; mIsJoinerUdpPortSet as u64 } ) ; __bindgen_bitfield_unit } } # [ doc = " This structure represents a Joiner Info." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otJoinerInfo { # [ doc = "< Joiner eui64" ] pub mEui64 : otExtAddress , # [ doc = "< Joiner pskd" ] pub mPsk : [ :: std :: os :: raw :: c_char ; 33usize ] , # [ doc = "< Joiner expiration time in msec" ] pub mExpirationTime : u32 , pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > , pub __bindgen_padding_0 : [ u8 ; 3usize ] , } # [ test ] fn bindgen_test_layout_otJoinerInfo ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otJoinerInfo > ( ) , 52usize , concat ! ( "Size of: " , stringify ! ( otJoinerInfo ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otJoinerInfo > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( otJoinerInfo ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otJoinerInfo > ( ) ) ) . mEui64 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otJoinerInfo ) , "::" , stringify ! ( mEui64 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otJoinerInfo > ( ) ) ) . mPsk as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otJoinerInfo ) , "::" , stringify ! ( mPsk ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otJoinerInfo > ( ) ) ) . mExpirationTime as * const _ as usize } , 44usize , concat ! ( "Offset of field: " , stringify ! ( otJoinerInfo ) , "::" , stringify ! ( mExpirationTime ) ) ) ; } impl otJoinerInfo { # [ inline ] pub fn mAny ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mAny ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 1u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( mAny : bool ) -> __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 1u8 , { let mAny : u8 = unsafe { :: std :: mem :: transmute ( mAny ) } ; mAny as u64 } ) ; __bindgen_bitfield_unit } } # [ doc = " This function pointer is called whenever the commissioner state changes." ] # [ doc = "" ] # [ doc = " @param[in]  aChannelMask       The channel mask value." ] # [ doc = " @param[in]  aEnergyList        A pointer to the energy measurement list." ] # [ doc = " @param[in]  aEnergyListLength  Number of entries in @p aEnergyListLength." ] # [ doc = " @param[in]  aContext           A pointer to application-specific context." ] # [ doc = "" ] pub type otCommissionerStateCallback = :: std :: option :: Option < unsafe extern "C" fn ( aState : otCommissionerState , aContext : * mut :: std :: os :: raw :: c_void ) > ; # [ doc = " This function pointer is called whenever the joiner state changes." ] # [ doc = "" ] # [ doc = " @param[in]  aEvent     The joiner event type." ] # [ doc = " @param[in]  aJoinerId  A pointer to the Joiner ID." ] # [ doc = " @param[in]  aContext   A pointer to application-specific context." ] # [ doc = "" ] pub type otCommissionerJoinerCallback = :: std :: option :: Option < unsafe extern "C" fn ( aEvent : otCommissionerJoinerEvent , aJoinerId : * const otExtAddress , aContext : * mut :: std :: os :: raw :: c_void ) > ; extern "C" { # [ doc = " This function enables the Thread Commissioner role." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance         A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aStateCallback    A pointer to a function that is called when the commissioner state changes." ] # [ doc = " @param[in]  aJoinerCallback   A pointer to a function that is called with a joiner event occurs." ] # [ doc = " @param[in]  aCallbackContext  A pointer to application-specific context." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully started the Commissioner service." ] # [ doc = " @retval OT_ERROR_ALREADY        Commissioner is already started." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  Device is not currently attached to a network." ] # [ doc = "" ] pub fn otCommissionerStart ( aInstance : * mut otInstance , aStateCallback : otCommissionerStateCallback , aJoinerCallback : otCommissionerJoinerCallback , aCallbackContext : * mut :: std :: os :: raw :: c_void ) -> otError ; } extern "C" { # [ doc = " This function disables the Thread Commissioner role." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance         A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE     Successfully stopped the Commissioner service." ] # [ doc = " @retval OT_ERROR_ALREADY  Commissioner is already stopped." ] # [ doc = "" ] pub fn otCommissionerStop ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " This function adds a Joiner entry." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance          A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aEui64             A pointer to the Joiner's IEEE EUI-64 or NULL for any Joiner." ] # [ doc = " @param[in]  aPskd              A pointer to the PSKd." ] # [ doc = " @param[in]  aTimeout           A time after which a Joiner is automatically removed, in seconds." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully added the Joiner." ] # [ doc = " @retval OT_ERROR_NO_BUFS       No buffers available to add the Joiner." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  @p aEui64 or @p aPskd is invalid." ] # [ doc = " @retval OT_ERROR_INVALID_STATE The commissioner is not active." ] # [ doc = "" ] # [ doc = " @note Only use this after successfully starting the Commissioner role with otCommissionerStart()." ] # [ doc = "" ] pub fn otCommissionerAddJoiner ( aInstance : * mut otInstance , aEui64 : * const otExtAddress , aPskd : * const :: std :: os :: raw :: c_char , aTimeout : u32 ) -> otError ; } extern "C" { # [ doc = " This method get joiner info at aIterator position." ] # [ doc = "" ] # [ doc = " @param[in]      aInstance   A pointer to instance." ] # [ doc = " @param[inout]   aIterator   A pointer to the Joiner Info iterator context." ] # [ doc = " @param[out]     aJoiner     A reference to Joiner info." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE       Successfully get the Joiner info." ] # [ doc = " @retval OT_ERROR_NOT_FOUND  Not found next Joiner." ] # [ doc = "" ] pub fn otCommissionerGetNextJoinerInfo ( aInstance : * mut otInstance , aIterator : * mut u16 , aJoiner : * mut otJoinerInfo ) -> otError ; } extern "C" { # [ doc = " This function removes a Joiner entry." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance          A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aEui64             A pointer to the Joiner's IEEE EUI-64 or NULL for any Joiner." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully removed the Joiner." ] # [ doc = " @retval OT_ERROR_NOT_FOUND     The Joiner specified by @p aEui64 was not found." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  @p aEui64 is invalid." ] # [ doc = " @retval OT_ERROR_INVALID_STATE The commissioner is not active." ] # [ doc = "" ] # [ doc = " @note Only use this after successfully starting the Commissioner role with otCommissionerStart()." ] # [ doc = "" ] pub fn otCommissionerRemoveJoiner ( aInstance : * mut otInstance , aEui64 : * const otExtAddress ) -> otError ; } extern "C" { # [ doc = " This function gets the Provisioning URL." ] # [ doc = "" ] # [ doc = " @param[in]    aInstance       A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to the URL string." ] # [ doc = "" ] pub fn otCommissionerGetProvisioningUrl ( aInstance : * mut otInstance ) -> * const :: std :: os :: raw :: c_char ; } extern "C" { # [ doc = " This function sets the Provisioning URL." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance             A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aProvisioningUrl      A pointer to the Provisioning URL (may be NULL to set as empty string)." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully set the Provisioning URL." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  @p aProvisioningUrl is invalid (too long)." ] # [ doc = "" ] pub fn otCommissionerSetProvisioningUrl ( aInstance : * mut otInstance , aProvisioningUrl : * const :: std :: os :: raw :: c_char ) -> otError ; } extern "C" { # [ doc = " This function sends an Announce Begin message." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance             A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aChannelMask          The channel mask value." ] # [ doc = " @param[in]  aCount                The number of Announcement messages per channel." ] # [ doc = " @param[in]  aPeriod               The time between two successive MLE Announce transmissions (in milliseconds)." ] # [ doc = " @param[in]  aAddress              A pointer to the IPv6 destination." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully enqueued the Announce Begin message." ] # [ doc = " @retval OT_ERROR_NO_BUFS       Insufficient buffers to generate an Announce Begin message." ] # [ doc = " @retval OT_ERROR_INVALID_STATE The commissioner is not active." ] # [ doc = "" ] # [ doc = " @note Only use this after successfully starting the Commissioner role with otCommissionerStart()." ] # [ doc = "" ] pub fn otCommissionerAnnounceBegin ( aInstance : * mut otInstance , aChannelMask : u32 , aCount : u8 , aPeriod : u16 , aAddress : * const otIp6Address ) -> otError ; } # [ doc = " This function pointer is called when the Commissioner receives an Energy Report." ] # [ doc = "" ] # [ doc = " @param[in]  aChannelMask       The channel mask value." ] # [ doc = " @param[in]  aEnergyList        A pointer to the energy measurement list." ] # [ doc = " @param[in]  aEnergyListLength  Number of entries in @p aEnergyListLength." ] # [ doc = " @param[in]  aContext           A pointer to application-specific context." ] # [ doc = "" ] pub type otCommissionerEnergyReportCallback = :: std :: option :: Option < unsafe extern "C" fn ( aChannelMask : u32 , aEnergyList : * const u8 , aEnergyListLength : u8 , aContext : * mut :: std :: os :: raw :: c_void ) > ; extern "C" { # [ doc = " This function sends an Energy Scan Query message." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance             A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aChannelMask          The channel mask value." ] # [ doc = " @param[in]  aCount                The number of energy measurements per channel." ] # [ doc = " @param[in]  aPeriod               The time between energy measurements (milliseconds)." ] # [ doc = " @param[in]  aScanDuration         The scan duration for each energy measurement (milliseconds)." ] # [ doc = " @param[in]  aAddress              A pointer to the IPv6 destination." ] # [ doc = " @param[in]  aCallback             A pointer to a function called on receiving an Energy Report message." ] # [ doc = " @param[in]  aContext              A pointer to application-specific context." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully enqueued the Energy Scan Query message." ] # [ doc = " @retval OT_ERROR_NO_BUFS       Insufficient buffers to generate an Energy Scan Query message." ] # [ doc = " @retval OT_ERROR_INVALID_STATE The commissioner is not active." ] # [ doc = "" ] # [ doc = " @note Only use this after successfully starting the Commissioner role with otCommissionerStart()." ] # [ doc = "" ] pub fn otCommissionerEnergyScan ( aInstance : * mut otInstance , aChannelMask : u32 , aCount : u8 , aPeriod : u16 , aScanDuration : u16 , aAddress : * const otIp6Address , aCallback : otCommissionerEnergyReportCallback , aContext : * mut :: std :: os :: raw :: c_void ) -> otError ; } # [ doc = " This function pointer is called when the Commissioner receives a PAN ID Conflict message." ] # [ doc = "" ] # [ doc = " @param[in]  aPanId             The PAN ID value." ] # [ doc = " @param[in]  aChannelMask       The channel mask value." ] # [ doc = " @param[in]  aContext           A pointer to application-specific context." ] # [ doc = "" ] pub type otCommissionerPanIdConflictCallback = :: std :: option :: Option < unsafe extern "C" fn ( aPanId : u16 , aChannelMask : u32 , aContext : * mut :: std :: os :: raw :: c_void ) > ; extern "C" { # [ doc = " This function sends a PAN ID Query message." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance             A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aPanId                The PAN ID to query." ] # [ doc = " @param[in]  aChannelMask          The channel mask value." ] # [ doc = " @param[in]  aAddress              A pointer to the IPv6 destination." ] # [ doc = " @param[in]  aCallback             A pointer to a function called on receiving a PAN ID Conflict message." ] # [ doc = " @param[in]  aContext              A pointer to application-specific context." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully enqueued the PAN ID Query message." ] # [ doc = " @retval OT_ERROR_NO_BUFS       Insufficient buffers to generate a PAN ID Query message." ] # [ doc = " @retval OT_ERROR_INVALID_STATE The commissioner is not active." ] # [ doc = "" ] # [ doc = " @note Only use this after successfully starting the Commissioner role with otCommissionerStart()." ] # [ doc = "" ] pub fn otCommissionerPanIdQuery ( aInstance : * mut otInstance , aPanId : u16 , aChannelMask : u32 , aAddress : * const otIp6Address , aCallback : otCommissionerPanIdConflictCallback , aContext : * mut :: std :: os :: raw :: c_void ) -> otError ; } extern "C" { # [ doc = " This function sends MGMT_COMMISSIONER_GET." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aTlvs      A pointer to TLVs." ] # [ doc = " @param[in]  aLength    The length of TLVs." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully send the meshcop dataset command." ] # [ doc = " @retval OT_ERROR_NO_BUFS       Insufficient buffer space to send." ] # [ doc = " @retval OT_ERROR_INVALID_STATE The commissioner is not active." ] # [ doc = "" ] pub fn otCommissionerSendMgmtGet ( aInstance : * mut otInstance , aTlvs : * const u8 , aLength : u8 ) -> otError ; } extern "C" { # [ doc = " This function sends MGMT_COMMISSIONER_SET." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aDataset   A pointer to commissioning dataset." ] # [ doc = " @param[in]  aTlvs      A pointer to TLVs." ] # [ doc = " @param[in]  aLength    The length of TLVs." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully send the meshcop dataset command." ] # [ doc = " @retval OT_ERROR_NO_BUFS       Insufficient buffer space to send." ] # [ doc = " @retval OT_ERROR_INVALID_STATE The commissioner is not active." ] # [ doc = "" ] pub fn otCommissionerSendMgmtSet ( aInstance : * mut otInstance , aDataset : * const otCommissioningDataset , aTlvs : * const u8 , aLength : u8 ) -> otError ; } extern "C" { # [ doc = " This function returns the Commissioner Session ID." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The current commissioner session id." ] # [ doc = "" ] pub fn otCommissionerGetSessionId ( aInstance : * mut otInstance ) -> u16 ; } extern "C" { # [ doc = " This function returns the Commissioner State." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_COMMISSIONER_STATE_DISABLED  Commissioner disabled." ] # [ doc = " @retval OT_COMMISSIONER_STATE_PETITION  Becoming the commissioner." ] # [ doc = " @retval OT_COMMISSIONER_STATE_ACTIVE    Commissioner enabled." ] # [ doc = "" ] pub fn otCommissionerGetState ( aInstance : * mut otInstance ) -> otCommissionerState ; } # [ doc = " This structure represents Backbone Router configuration." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otBackboneRouterConfig { # [ doc = "< Only used when get Primary Backbone Router information in the Thread Network" ] pub mServer16 : u16 , # [ doc = "< Reregistration Delay (in seconds)" ] pub mReregistrationDelay : u16 , # [ doc = "< Multicast Listener Registration Timeout (in seconds)" ] pub mMlrTimeout : u32 , # [ doc = "< Sequence Number" ] pub mSequenceNumber : u8 , } # [ test ] fn bindgen_test_layout_otBackboneRouterConfig ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otBackboneRouterConfig > ( ) , 12usize , concat ! ( "Size of: " , stringify ! ( otBackboneRouterConfig ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otBackboneRouterConfig > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( otBackboneRouterConfig ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBackboneRouterConfig > ( ) ) ) . mServer16 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otBackboneRouterConfig ) , "::" , stringify ! ( mServer16 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBackboneRouterConfig > ( ) ) ) . mReregistrationDelay as * const _ as usize } , 2usize , concat ! ( "Offset of field: " , stringify ! ( otBackboneRouterConfig ) , "::" , stringify ! ( mReregistrationDelay ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBackboneRouterConfig > ( ) ) ) . mMlrTimeout as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( otBackboneRouterConfig ) , "::" , stringify ! ( mMlrTimeout ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBackboneRouterConfig > ( ) ) ) . mSequenceNumber as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otBackboneRouterConfig ) , "::" , stringify ! ( mSequenceNumber ) ) ) ; } extern "C" { # [ doc = " This function gets the Primary Backbone Router information in the Thread Network." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance            A pointer to an OpenThread instance." ] # [ doc = " @param[out]  aConfig              A pointer to where to put Primary Backbone Router information." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE              Successfully got Primary Backbone Router information." ] # [ doc = " @retval OT_ERROR_NOT_FOUND         No Primary Backbone Router exists." ] # [ doc = "" ] pub fn otBackboneRouterGetPrimary ( aInstance : * mut otInstance , aConfig : * mut otBackboneRouterConfig ) -> otError ; } pub type otNetworkDataIterator = u32 ; # [ doc = " This structure represents a Border Router configuration." ] # [ repr ( C ) ] # [ repr ( align ( 4 ) ) ] # [ derive ( Copy , Clone ) ] pub struct otBorderRouterConfig { # [ doc = " The IPv6 prefix." ] pub mPrefix : otIp6Prefix , pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 2usize ] , u8 > , # [ doc = " The Border Agent Rloc." ] pub mRloc16 : u16 , } # [ test ] fn bindgen_test_layout_otBorderRouterConfig ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otBorderRouterConfig > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( otBorderRouterConfig ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otBorderRouterConfig > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( otBorderRouterConfig ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBorderRouterConfig > ( ) ) ) . mPrefix as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otBorderRouterConfig ) , "::" , stringify ! ( mPrefix ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBorderRouterConfig > ( ) ) ) . mRloc16 as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( otBorderRouterConfig ) , "::" , stringify ! ( mRloc16 ) ) ) ; } impl otBorderRouterConfig { # [ inline ] pub fn mPreference ( & self ) -> :: std :: os :: raw :: c_int { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 2u8 ) as u32 ) } } # [ inline ] pub fn set_mPreference ( & mut self , val : :: std :: os :: raw :: c_int ) { unsafe { let val : u32 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 2u8 , val as u64 ) } } # [ inline ] pub fn mPreferred ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 2usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mPreferred ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 2usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mSlaac ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 3usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mSlaac ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 3usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mDhcp ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 4usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mDhcp ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 4usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mConfigure ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 5usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mConfigure ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 5usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mDefaultRoute ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 6usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mDefaultRoute ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 6usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mOnMesh ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 7usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mOnMesh ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 7usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mStable ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 8usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mStable ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 8usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mNdDns ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 9usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mNdDns ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 9usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mDp ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 10usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mDp ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 10usize , 1u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( mPreference : :: std :: os :: raw :: c_int , mPreferred : bool , mSlaac : bool , mDhcp : bool , mConfigure : bool , mDefaultRoute : bool , mOnMesh : bool , mStable : bool , mNdDns : bool , mDp : bool ) -> __BindgenBitfieldUnit < [ u8 ; 2usize ] , u8 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 2usize ] , u8 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 2u8 , { let mPreference : u32 = unsafe { :: std :: mem :: transmute ( mPreference ) } ; mPreference as u64 } ) ; __bindgen_bitfield_unit . set ( 2usize , 1u8 , { let mPreferred : u8 = unsafe { :: std :: mem :: transmute ( mPreferred ) } ; mPreferred as u64 } ) ; __bindgen_bitfield_unit . set ( 3usize , 1u8 , { let mSlaac : u8 = unsafe { :: std :: mem :: transmute ( mSlaac ) } ; mSlaac as u64 } ) ; __bindgen_bitfield_unit . set ( 4usize , 1u8 , { let mDhcp : u8 = unsafe { :: std :: mem :: transmute ( mDhcp ) } ; mDhcp as u64 } ) ; __bindgen_bitfield_unit . set ( 5usize , 1u8 , { let mConfigure : u8 = unsafe { :: std :: mem :: transmute ( mConfigure ) } ; mConfigure as u64 } ) ; __bindgen_bitfield_unit . set ( 6usize , 1u8 , { let mDefaultRoute : u8 = unsafe { :: std :: mem :: transmute ( mDefaultRoute ) } ; mDefaultRoute as u64 } ) ; __bindgen_bitfield_unit . set ( 7usize , 1u8 , { let mOnMesh : u8 = unsafe { :: std :: mem :: transmute ( mOnMesh ) } ; mOnMesh as u64 } ) ; __bindgen_bitfield_unit . set ( 8usize , 1u8 , { let mStable : u8 = unsafe { :: std :: mem :: transmute ( mStable ) } ; mStable as u64 } ) ; __bindgen_bitfield_unit . set ( 9usize , 1u8 , { let mNdDns : u8 = unsafe { :: std :: mem :: transmute ( mNdDns ) } ; mNdDns as u64 } ) ; __bindgen_bitfield_unit . set ( 10usize , 1u8 , { let mDp : u8 = unsafe { :: std :: mem :: transmute ( mDp ) } ; mDp as u64 } ) ; __bindgen_bitfield_unit } } # [ doc = " This structure represents an External Route configuration." ] # [ doc = "" ] # [ repr ( C ) ] # [ repr ( align ( 4 ) ) ] # [ derive ( Copy , Clone ) ] pub struct otExternalRouteConfig { # [ doc = " The prefix for the off-mesh route." ] pub mPrefix : otIp6Prefix , # [ doc = " The Rloc associated with the external route entry." ] # [ doc = "" ] # [ doc = " This value is ignored when adding an external route. For any added route, the device's Rloc is used." ] pub mRloc16 : u16 , pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > , pub __bindgen_padding_0 : [ u8 ; 3usize ] , } # [ test ] fn bindgen_test_layout_otExternalRouteConfig ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otExternalRouteConfig > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( otExternalRouteConfig ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otExternalRouteConfig > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( otExternalRouteConfig ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otExternalRouteConfig > ( ) ) ) . mPrefix as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otExternalRouteConfig ) , "::" , stringify ! ( mPrefix ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otExternalRouteConfig > ( ) ) ) . mRloc16 as * const _ as usize } , 18usize , concat ! ( "Offset of field: " , stringify ! ( otExternalRouteConfig ) , "::" , stringify ! ( mRloc16 ) ) ) ; } impl otExternalRouteConfig { # [ inline ] pub fn mPreference ( & self ) -> :: std :: os :: raw :: c_int { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 2u8 ) as u32 ) } } # [ inline ] pub fn set_mPreference ( & mut self , val : :: std :: os :: raw :: c_int ) { unsafe { let val : u32 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 2u8 , val as u64 ) } } # [ inline ] pub fn mStable ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 2usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mStable ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 2usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mNextHopIsThisDevice ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 3usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mNextHopIsThisDevice ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 3usize , 1u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( mPreference : :: std :: os :: raw :: c_int , mStable : bool , mNextHopIsThisDevice : bool ) -> __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 2u8 , { let mPreference : u32 = unsafe { :: std :: mem :: transmute ( mPreference ) } ; mPreference as u64 } ) ; __bindgen_bitfield_unit . set ( 2usize , 1u8 , { let mStable : u8 = unsafe { :: std :: mem :: transmute ( mStable ) } ; mStable as u64 } ) ; __bindgen_bitfield_unit . set ( 3usize , 1u8 , { let mNextHopIsThisDevice : u8 = unsafe { :: std :: mem :: transmute ( mNextHopIsThisDevice ) } ; mNextHopIsThisDevice as u64 } ) ; __bindgen_bitfield_unit } } # [ doc = " This structure represents a Server configuration." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otServerConfig { pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > , # [ doc = "< Length of server data." ] pub mServerDataLength : u8 , # [ doc = "< Server data bytes." ] pub mServerData : [ u8 ; 248usize ] , # [ doc = "< The Server RLOC16." ] pub mRloc16 : u16 , } # [ test ] fn bindgen_test_layout_otServerConfig ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otServerConfig > ( ) , 252usize , concat ! ( "Size of: " , stringify ! ( otServerConfig ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otServerConfig > ( ) , 2usize , concat ! ( "Alignment of " , stringify ! ( otServerConfig ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otServerConfig > ( ) ) ) . mServerDataLength as * const _ as usize } , 1usize , concat ! ( "Offset of field: " , stringify ! ( otServerConfig ) , "::" , stringify ! ( mServerDataLength ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otServerConfig > ( ) ) ) . mServerData as * const _ as usize } , 2usize , concat ! ( "Offset of field: " , stringify ! ( otServerConfig ) , "::" , stringify ! ( mServerData ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otServerConfig > ( ) ) ) . mRloc16 as * const _ as usize } , 250usize , concat ! ( "Offset of field: " , stringify ! ( otServerConfig ) , "::" , stringify ! ( mRloc16 ) ) ) ; } impl otServerConfig { # [ inline ] pub fn mStable ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mStable ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 1u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( mStable : bool ) -> __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 1u8 , { let mStable : u8 = unsafe { :: std :: mem :: transmute ( mStable ) } ; mStable as u64 } ) ; __bindgen_bitfield_unit } } # [ doc = " This structure represents a Service configuration." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otServiceConfig { # [ doc = "< Used to return Service ID when iterating over the partition's Network Data." ] pub mServiceId : u8 , # [ doc = "< IANA Enterprise Number." ] pub mEnterpriseNumber : u32 , # [ doc = "< Length of service data." ] pub mServiceDataLength : u8 , # [ doc = "< Service data bytes." ] pub mServiceData : [ u8 ; 252usize ] , # [ doc = "< The Server configuration." ] pub mServerConfig : otServerConfig , } # [ test ] fn bindgen_test_layout_otServiceConfig ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otServiceConfig > ( ) , 516usize , concat ! ( "Size of: " , stringify ! ( otServiceConfig ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otServiceConfig > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( otServiceConfig ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otServiceConfig > ( ) ) ) . mServiceId as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otServiceConfig ) , "::" , stringify ! ( mServiceId ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otServiceConfig > ( ) ) ) . mEnterpriseNumber as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( otServiceConfig ) , "::" , stringify ! ( mEnterpriseNumber ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otServiceConfig > ( ) ) ) . mServiceDataLength as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otServiceConfig ) , "::" , stringify ! ( mServiceDataLength ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otServiceConfig > ( ) ) ) . mServiceData as * const _ as usize } , 9usize , concat ! ( "Offset of field: " , stringify ! ( otServiceConfig ) , "::" , stringify ! ( mServiceData ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otServiceConfig > ( ) ) ) . mServerConfig as * const _ as usize } , 262usize , concat ! ( "Offset of field: " , stringify ! ( otServiceConfig ) , "::" , stringify ! ( mServerConfig ) ) ) ; } extern "C" { # [ doc = " This method provides a full or stable copy of the Partition's Thread Network Data." ] # [ doc = "" ] # [ doc = " @param[in]     aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]     aStable      TRUE when copying the stable version, FALSE when copying the full version." ] # [ doc = " @param[out]    aData        A pointer to the data buffer." ] # [ doc = " @param[inout]  aDataLength  On entry, size of the data buffer pointed to by @p aData." ] # [ doc = "                             On exit, number of copied bytes." ] # [ doc = "" ] pub fn otNetDataGet ( aInstance : * mut otInstance , aStable : bool , aData : * mut u8 , aDataLength : * mut u8 ) -> otError ; } extern "C" { # [ doc = " This function gets the next On Mesh Prefix in the partition's Network Data." ] # [ doc = "" ] # [ doc = " @param[in]     aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[inout]  aIterator  A pointer to the Network Data iterator context. To get the first on-mesh entry" ] # [ doc = "it should be set to OT_NETWORK_DATA_ITERATOR_INIT." ] # [ doc = " @param[out]    aConfig    A pointer to where the On Mesh Prefix information will be placed." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE       Successfully found the next On Mesh prefix." ] # [ doc = " @retval OT_ERROR_NOT_FOUND  No subsequent On Mesh prefix exists in the Thread Network Data." ] # [ doc = "" ] pub fn otNetDataGetNextOnMeshPrefix ( aInstance : * mut otInstance , aIterator : * mut otNetworkDataIterator , aConfig : * mut otBorderRouterConfig ) -> otError ; } extern "C" { # [ doc = " This function gets the next external route in the partition's Network Data." ] # [ doc = "" ] # [ doc = " @param[in]     aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[inout]  aIterator  A pointer to the Network Data iterator context. To get the first external route entry" ] # [ doc = "it should be set to OT_NETWORK_DATA_ITERATOR_INIT." ] # [ doc = " @param[out]    aConfig    A pointer to where the External Route information will be placed." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE       Successfully found the next External Route." ] # [ doc = " @retval OT_ERROR_NOT_FOUND  No subsequent external route entry exists in the Thread Network Data." ] # [ doc = "" ] pub fn otNetDataGetNextRoute ( aInstance : * mut otInstance , aIterator : * mut otNetworkDataIterator , aConfig : * mut otExternalRouteConfig ) -> otError ; } extern "C" { # [ doc = " This function gets the next service in the partition's Network Data." ] # [ doc = "" ] # [ doc = " @param[in]     aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[inout]  aIterator  A pointer to the Network Data iterator context. To get the first service entry" ] # [ doc = "it should be set to OT_NETWORK_DATA_ITERATOR_INIT." ] # [ doc = " @param[out]    aConfig    A pointer to where the service information will be placed." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE       Successfully found the next service." ] # [ doc = " @retval OT_ERROR_NOT_FOUND  No subsequent service exists in the partition's Network Data." ] # [ doc = "" ] pub fn otNetDataGetNextService ( aInstance : * mut otInstance , aIterator : * mut otNetworkDataIterator , aConfig : * mut otServiceConfig ) -> otError ; } extern "C" { # [ doc = " Get the Network Data Version." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The Network Data Version." ] # [ doc = "" ] pub fn otNetDataGetVersion ( aInstance : * mut otInstance ) -> u8 ; } extern "C" { # [ doc = " Get the Stable Network Data Version." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The Stable Network Data Version." ] # [ doc = "" ] pub fn otNetDataGetStableVersion ( aInstance : * mut otInstance ) -> u8 ; } # [ doc = "< Backbone function is disabled." ] pub const otBackboneRouterState_OT_BACKBONE_ROUTER_STATE_DISABLED : otBackboneRouterState = 0 ; # [ doc = "< Secondary Backbone Router." ] pub const otBackboneRouterState_OT_BACKBONE_ROUTER_STATE_SECONDARY : otBackboneRouterState = 1 ; # [ doc = "< The Primary Backbone Router." ] pub const otBackboneRouterState_OT_BACKBONE_ROUTER_STATE_PRIMARY : otBackboneRouterState = 2 ; # [ doc = " Represents the Backbone Router Status." ] # [ doc = "" ] pub type otBackboneRouterState = u32 ; extern "C" { # [ doc = " This function enables or disables Backbone functionality." ] # [ doc = "" ] # [ doc = " @param[in] aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in] aEnable   TRUE to enable Backbone functionality, FALSE otherwise." ] # [ doc = "" ] # [ doc = " @sa otBackboneRouterGetState" ] # [ doc = " @sa otBackboneRouterGetConfig" ] # [ doc = " @sa otBackboneRouterSetConfig" ] # [ doc = " @sa otBackboneRouterRegister" ] # [ doc = "" ] pub fn otBackboneRouterSetEnabled ( aInstance : * mut otInstance , aEnable : bool ) ; } extern "C" { # [ doc = " This function gets the Backbone Router state." ] # [ doc = "" ] # [ doc = " @param[in] aInstance       A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_BACKBONE_ROUTER_STATE_DISABLED   Backbone functionality is disabled." ] # [ doc = " @retval OT_BACKBONE_ROUTER_STATE_SECONDARY  Secondary Backbone Router." ] # [ doc = " @retval OT_BACKBONE_ROUTER_STATE_PRIMARY    The Primary Backbone Router." ] # [ doc = "" ] # [ doc = " @sa otBackboneRouterSetEnabled" ] # [ doc = " @sa otBackboneRouterGetConfig" ] # [ doc = " @sa otBackboneRouterSetConfig" ] # [ doc = " @sa otBackboneRouterRegister" ] # [ doc = "" ] pub fn otBackboneRouterGetState ( aInstance : * mut otInstance ) -> otBackboneRouterState ; } extern "C" { # [ doc = " This function gets the local Backbone Router configuration." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance            A pointer to an OpenThread instance." ] # [ doc = " @param[out]  aConfig              A pointer where to put local Backbone Router configuration." ] # [ doc = "" ] # [ doc = "" ] # [ doc = " @sa otBackboneRouterSetEnabled" ] # [ doc = " @sa otBackboneRouterGetState" ] # [ doc = " @sa otBackboneRouterSetConfig" ] # [ doc = " @sa otBackboneRouterRegister" ] # [ doc = "" ] pub fn otBackboneRouterGetConfig ( aInstance : * mut otInstance , aConfig : * mut otBackboneRouterConfig ) ; } extern "C" { # [ doc = " This function sets the local Backbone Router configuration." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance             A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aConfig               A pointer to the Backbone Router configuration to take effect." ] # [ doc = "" ] # [ doc = " @sa otBackboneRouterSetEnabled" ] # [ doc = " @sa otBackboneRouterGetState" ] # [ doc = " @sa otBackboneRouterGetConfig" ] # [ doc = " @sa otBackboneRouterRegister" ] # [ doc = "" ] pub fn otBackboneRouterSetConfig ( aInstance : * mut otInstance , aConfig : * const otBackboneRouterConfig ) ; } extern "C" { # [ doc = " This function explicitly registers local Backbone Router configuration." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance             A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NO_BUFS           Insufficient space to add the Backbone Router service." ] # [ doc = " @retval OT_ERROR_NONE              Successfully queued a Server Data Request message for delivery." ] # [ doc = "" ] # [ doc = " @sa otBackboneRouterSetEnabled" ] # [ doc = " @sa otBackboneRouterGetState" ] # [ doc = " @sa otBackboneRouterGetConfig" ] # [ doc = " @sa otBackboneRouterSetConfig" ] # [ doc = "" ] pub fn otBackboneRouterRegister ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " This method returns the Backbone Router registration jitter value." ] # [ doc = "" ] # [ doc = " @returns The Backbone Router registration jitter value." ] # [ doc = "" ] # [ doc = " @sa otBackboneRouterSetRegistrationJitter" ] # [ doc = "" ] pub fn otBackboneRouterGetRegistrationJitter ( aInstance : * mut otInstance ) -> u8 ; } extern "C" { # [ doc = " This method sets the Backbone Router registration jitter value." ] # [ doc = "" ] # [ doc = " @param[in]  aJitter the Backbone Router registration jitter value to set." ] # [ doc = "" ] # [ doc = " @sa otBackboneRouterGetRegistrationJitter" ] # [ doc = "" ] pub fn otBackboneRouterSetRegistrationJitter ( aInstance : * mut otInstance , aJitter : u8 ) ; } extern "C" { # [ doc = " This method gets the local Domain Prefix configuration." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[out] aConfig   A pointer to the Domain Prefix configuration." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE       Successfully got the Domain Prefix configuration." ] # [ doc = " @retval OT_ERROR_NOT_FOUND  No Domain Prefix was configured." ] # [ doc = "" ] pub fn otBackboneRouterGetDomainPrefix ( aInstance : * mut otInstance , aConfig : * mut otBorderRouterConfig ) -> otError ; } # [ doc = "< Border agent role is disabled." ] pub const otBorderAgentState_OT_BORDER_AGENT_STATE_STOPPED : otBorderAgentState = 0 ; # [ doc = "< Border agent is started." ] pub const otBorderAgentState_OT_BORDER_AGENT_STATE_STARTED : otBorderAgentState = 1 ; # [ doc = "< Border agent is connected with external commissioner." ] pub const otBorderAgentState_OT_BORDER_AGENT_STATE_ACTIVE : otBorderAgentState = 2 ; # [ doc = " This enumeration defines the Border Agent state." ] # [ doc = "" ] pub type otBorderAgentState = u32 ; extern "C" { # [ doc = " This function gets the state of Thread Border Agent role." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance         A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns State of the Border Agent." ] # [ doc = "" ] pub fn otBorderAgentGetState ( aInstance : * mut otInstance ) -> otBorderAgentState ; } extern "C" { # [ doc = " This method provides a full or stable copy of the local Thread Network Data." ] # [ doc = "" ] # [ doc = " @param[in]     aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]     aStable      TRUE when copying the stable version, FALSE when copying the full version." ] # [ doc = " @param[out]    aData        A pointer to the data buffer." ] # [ doc = " @param[inout]  aDataLength  On entry, size of the data buffer pointed to by @p aData." ] # [ doc = "                             On exit, number of copied bytes." ] pub fn otBorderRouterGetNetData ( aInstance : * mut otInstance , aStable : bool , aData : * mut u8 , aDataLength : * mut u8 ) -> otError ; } extern "C" { # [ doc = " Add a border router configuration to the local network data." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aConfig   A pointer to the border router configuration." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully added the configuration to the local network data." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  One or more configuration parameters were invalid." ] # [ doc = " @retval OT_ERROR_NO_BUFS       Not enough room is available to add the configuration to the local network data." ] # [ doc = "" ] # [ doc = " @sa otBorderRouterRemoveOnMeshPrefix" ] # [ doc = " @sa otBorderRouterRegister" ] pub fn otBorderRouterAddOnMeshPrefix ( aInstance : * mut otInstance , aConfig : * const otBorderRouterConfig ) -> otError ; } extern "C" { # [ doc = " Remove a border router configuration from the local network data." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aPrefix   A pointer to an IPv6 prefix." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE       Successfully removed the configuration from the local network data." ] # [ doc = " @retval OT_ERROR_NOT_FOUND  Could not find the Border Router entry." ] # [ doc = "" ] # [ doc = " @sa otBorderRouterAddOnMeshPrefix" ] # [ doc = " @sa otBorderRouterRegister" ] pub fn otBorderRouterRemoveOnMeshPrefix ( aInstance : * mut otInstance , aPrefix : * const otIp6Prefix ) -> otError ; } extern "C" { # [ doc = " This function gets the next On Mesh Prefix in the local Network Data." ] # [ doc = "" ] # [ doc = " @param[in]     aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[inout]  aIterator  A pointer to the Network Data iterator context. To get the first on-mesh entry" ] # [ doc = "it should be set to OT_NETWORK_DATA_ITERATOR_INIT." ] # [ doc = " @param[out]    aConfig    A pointer to the On Mesh Prefix information." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE       Successfully found the next On Mesh prefix." ] # [ doc = " @retval OT_ERROR_NOT_FOUND  No subsequent On Mesh prefix exists in the Thread Network Data." ] # [ doc = "" ] pub fn otBorderRouterGetNextOnMeshPrefix ( aInstance : * mut otInstance , aIterator : * mut otNetworkDataIterator , aConfig : * mut otBorderRouterConfig ) -> otError ; } extern "C" { # [ doc = " Add an external route configuration to the local network data." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aConfig   A pointer to the external route configuration." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully added the configuration to the local network data." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  One or more configuration parameters were invalid." ] # [ doc = " @retval OT_ERROR_NO_BUFS       Not enough room is available to add the configuration to the local network data." ] # [ doc = "" ] # [ doc = " @sa otBorderRouterRemoveRoute" ] # [ doc = " @sa otBorderRouterRegister" ] pub fn otBorderRouterAddRoute ( aInstance : * mut otInstance , aConfig : * const otExternalRouteConfig ) -> otError ; } extern "C" { # [ doc = " Remove an external route configuration from the local network data." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aPrefix   A pointer to an IPv6 prefix." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE       Successfully removed the configuration from the local network data." ] # [ doc = " @retval OT_ERROR_NOT_FOUND  Could not find the Border Router entry." ] # [ doc = "" ] # [ doc = " @sa otBorderRouterAddRoute" ] # [ doc = " @sa otBorderRouterRegister" ] pub fn otBorderRouterRemoveRoute ( aInstance : * mut otInstance , aPrefix : * const otIp6Prefix ) -> otError ; } extern "C" { # [ doc = " This function gets the next external route in the local Network Data." ] # [ doc = "" ] # [ doc = " @param[in]     aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[inout]  aIterator  A pointer to the Network Data iterator context. To get the first external route entry" ] # [ doc = "it should be set to OT_NETWORK_DATA_ITERATOR_INIT." ] # [ doc = " @param[out]    aConfig    A pointer to the External Route information." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE       Successfully found the next External Route." ] # [ doc = " @retval OT_ERROR_NOT_FOUND  No subsequent external route entry exists in the Thread Network Data." ] # [ doc = "" ] pub fn otBorderRouterGetNextRoute ( aInstance : * mut otInstance , aIterator : * mut otNetworkDataIterator , aConfig : * mut otExternalRouteConfig ) -> otError ; } extern "C" { # [ doc = " Immediately register the local network data with the Leader." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE  Successfully queued a Server Data Request message for delivery." ] # [ doc = "" ] # [ doc = " @sa otBorderRouterAddOnMeshPrefix" ] # [ doc = " @sa otBorderRouterRemoveOnMeshPrefix" ] # [ doc = " @sa otBorderRouterAddRoute" ] # [ doc = " @sa otBorderRouterRemoveRoute" ] pub fn otBorderRouterRegister ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " Get the child supervision interval (in seconds)." ] # [ doc = "" ] # [ doc = " Child supervision feature provides a mechanism for parent to ensure that a message is sent to each sleepy child" ] # [ doc = " within the supervision interval. If there is no transmission to the child within the supervision interval," ] # [ doc = " OpenThread enqueues and sends a supervision message (a data message with empty payload) to the child." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance       A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns  The child supervision interval. Zero indicates that child supervision is disabled." ] # [ doc = "" ] pub fn otChildSupervisionGetInterval ( aInstance : * mut otInstance ) -> u16 ; } extern "C" { # [ doc = " Set the child supervision interval (in seconds)." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance       A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aInterval       The supervision interval (in seconds). Zero to disable supervision on parent." ] # [ doc = "" ] pub fn otChildSupervisionSetInterval ( aInstance : * mut otInstance , aInterval : u16 ) ; } extern "C" { # [ doc = " Get the supervision check timeout interval (in seconds)." ] # [ doc = "" ] # [ doc = " If the device is a sleepy child and it does not hear from its parent within the specified check timeout, it initiates" ] # [ doc = " the re-attach process (MLE Child Update Request/Response exchange with its parent)." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance       A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns  The supervision check timeout. Zero indicates that supervision check on the child is disabled." ] # [ doc = "" ] pub fn otChildSupervisionGetCheckTimeout ( aInstance : * mut otInstance ) -> u16 ; } extern "C" { # [ doc = " Set the supervision check timeout interval (in seconds)." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance       A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aTimeout        The check timeout (in seconds). Zero to disable supervision check on the child." ] # [ doc = "" ] pub fn otChildSupervisionSetCheckTimeout ( aInstance : * mut otInstance , aTimeout : u16 ) ; } # [ doc = " This structure represents a CLI command." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otCliCommand { # [ doc = "< A pointer to the command string." ] pub mName : * const :: std :: os :: raw :: c_char , # [ doc = "< A function pointer to process the command." ] pub mCommand : :: std :: option :: Option < unsafe extern "C" fn ( aArgsLength : u8 , aArgs : * mut * mut :: std :: os :: raw :: c_char ) > , } # [ test ] fn bindgen_test_layout_otCliCommand ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otCliCommand > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( otCliCommand ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otCliCommand > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otCliCommand ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCliCommand > ( ) ) ) . mName as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otCliCommand ) , "::" , stringify ! ( mName ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCliCommand > ( ) ) ) . mCommand as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otCliCommand ) , "::" , stringify ! ( mCommand ) ) ) ; } # [ doc = " This function pointer is called to notify about Console output." ] # [ doc = "" ] # [ doc = " @param[in]  aBuf        A pointer to a buffer with an output." ] # [ doc = " @param[in]  aBufLength  A length of the output data stored in the buffer." ] # [ doc = " @param[out] aContext    A user context pointer." ] # [ doc = "" ] # [ doc = " @returns                Number of bytes processed by the callback." ] # [ doc = "" ] pub type otCliConsoleOutputCallback = :: std :: option :: Option < unsafe extern "C" fn ( aBuf : * const :: std :: os :: raw :: c_char , aBufLength : u16 , aContext : * mut :: std :: os :: raw :: c_void ) -> :: std :: os :: raw :: c_int > ; extern "C" { # [ doc = " Initialize the CLI CONSOLE module." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   The OpenThread instance structure." ] # [ doc = " @param[in]  aCallback   A callback method called to process console output." ] # [ doc = " @param[in]  aContext    A user context pointer." ] # [ doc = "" ] pub fn otCliConsoleInit ( aInstance : * mut otInstance , aCallback : otCliConsoleOutputCallback , aContext : * mut :: std :: os :: raw :: c_void ) ; } extern "C" { # [ doc = " This method is called to feed in a console input line." ] # [ doc = "" ] # [ doc = " @param[in]  aBuf        A pointer to a buffer with an input." ] # [ doc = " @param[in]  aBufLength  A length of the input data stored in the buffer." ] # [ doc = "" ] pub fn otCliConsoleInputLine ( aBuf : * mut :: std :: os :: raw :: c_char , aBufLength : u16 ) ; } extern "C" { # [ doc = " Initialize the CLI UART module." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  The OpenThread instance structure." ] # [ doc = "" ] pub fn otCliUartInit ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " Set a user command table." ] # [ doc = "" ] # [ doc = " @param[in]  aUserCommands  A pointer to an array with user commands." ] # [ doc = " @param[in]  aLength        @p aUserCommands length." ] pub fn otCliSetUserCommands ( aUserCommands : * const otCliCommand , aLength : u8 ) ; } extern "C" { # [ doc = " Write a number of bytes to the CLI console as a hex string." ] # [ doc = "" ] # [ doc = " @param[in]  aBytes   A pointer to data which should be printed." ] # [ doc = " @param[in]  aLength  @p aBytes length." ] pub fn otCliOutputBytes ( aBytes : * const u8 , aLength : u8 ) ; } extern "C" { # [ doc = " Write formatted string to the CLI console" ] # [ doc = "" ] # [ doc = " @param[in]  aFmt   A pointer to the format string." ] # [ doc = " @param[in]  ...    A matching list of arguments." ] pub fn otCliOutputFormat ( aFmt : * const :: std :: os :: raw :: c_char , ... ) ; } extern "C" { # [ doc = " Write string to the CLI console" ] # [ doc = "" ] # [ doc = " @param[in]  aString  A pointer to the string, which may not be null-terminated." ] # [ doc = " @param[in]  aLength  Number of bytes." ] pub fn otCliOutput ( aString : * const :: std :: os :: raw :: c_char , aLength : u16 ) ; } extern "C" { # [ doc = " Write error code to the CLI console" ] # [ doc = "" ] # [ doc = " @param[in]  aError Error code value." ] pub fn otCliAppendResult ( aError : otError ) ; } extern "C" { # [ doc = " Callback to write the OpenThread Log to the CLI console" ] # [ doc = "" ] # [ doc = " @param[in]  aLogLevel   The log level." ] # [ doc = " @param[in]  aLogRegion  The log region." ] # [ doc = " @param[in]  aFormat     A pointer to the format string." ] # [ doc = " @param[in]  aArgs       va_list matching aFormat." ] pub fn otCliPlatLogv ( aLogLevel : otLogLevel , aLogRegion : otLogRegion , aFormat : * const :: std :: os :: raw :: c_char , aArgs : * mut __va_list_tag ) ; } # [ doc = "< Confirmable" ] pub const otCoapType_OT_COAP_TYPE_CONFIRMABLE : otCoapType = 0 ; # [ doc = "< Non-confirmable" ] pub const otCoapType_OT_COAP_TYPE_NON_CONFIRMABLE : otCoapType = 16 ; # [ doc = "< Acknowledgment" ] pub const otCoapType_OT_COAP_TYPE_ACKNOWLEDGMENT : otCoapType = 32 ; # [ doc = "< Reset" ] pub const otCoapType_OT_COAP_TYPE_RESET : otCoapType = 48 ; # [ doc = " CoAP Type values." ] # [ doc = "" ] pub type otCoapType = u32 ; # [ doc = "< Empty message code" ] pub const otCoapCode_OT_COAP_CODE_EMPTY : otCoapCode = 0 ; # [ doc = "< Get" ] pub const otCoapCode_OT_COAP_CODE_GET : otCoapCode = 1 ; # [ doc = "< Post" ] pub const otCoapCode_OT_COAP_CODE_POST : otCoapCode = 2 ; # [ doc = "< Put" ] pub const otCoapCode_OT_COAP_CODE_PUT : otCoapCode = 3 ; # [ doc = "< Delete" ] pub const otCoapCode_OT_COAP_CODE_DELETE : otCoapCode = 4 ; # [ doc = "< 2.00" ] pub const otCoapCode_OT_COAP_CODE_RESPONSE_MIN : otCoapCode = 64 ; # [ doc = "< Created" ] pub const otCoapCode_OT_COAP_CODE_CREATED : otCoapCode = 65 ; # [ doc = "< Deleted" ] pub const otCoapCode_OT_COAP_CODE_DELETED : otCoapCode = 66 ; # [ doc = "< Valid" ] pub const otCoapCode_OT_COAP_CODE_VALID : otCoapCode = 67 ; # [ doc = "< Changed" ] pub const otCoapCode_OT_COAP_CODE_CHANGED : otCoapCode = 68 ; # [ doc = "< Content" ] pub const otCoapCode_OT_COAP_CODE_CONTENT : otCoapCode = 69 ; # [ doc = "< RFC7959 Continue" ] pub const otCoapCode_OT_COAP_CODE_CONTINUE : otCoapCode = 95 ; # [ doc = "< Bad Request" ] pub const otCoapCode_OT_COAP_CODE_BAD_REQUEST : otCoapCode = 128 ; # [ doc = "< Unauthorized" ] pub const otCoapCode_OT_COAP_CODE_UNAUTHORIZED : otCoapCode = 129 ; # [ doc = "< Bad Option" ] pub const otCoapCode_OT_COAP_CODE_BAD_OPTION : otCoapCode = 130 ; # [ doc = "< Forbidden" ] pub const otCoapCode_OT_COAP_CODE_FORBIDDEN : otCoapCode = 131 ; # [ doc = "< Not Found" ] pub const otCoapCode_OT_COAP_CODE_NOT_FOUND : otCoapCode = 132 ; # [ doc = "< Method Not Allowed" ] pub const otCoapCode_OT_COAP_CODE_METHOD_NOT_ALLOWED : otCoapCode = 133 ; # [ doc = "< Not Acceptable" ] pub const otCoapCode_OT_COAP_CODE_NOT_ACCEPTABLE : otCoapCode = 134 ; # [ doc = "< RFC7959 Request Entity Incomplete" ] pub const otCoapCode_OT_COAP_CODE_REQUEST_INCOMPLETE : otCoapCode = 136 ; # [ doc = "< Precondition Failed" ] pub const otCoapCode_OT_COAP_CODE_PRECONDITION_FAILED : otCoapCode = 140 ; # [ doc = "< Request Entity Too Large" ] pub const otCoapCode_OT_COAP_CODE_REQUEST_TOO_LARGE : otCoapCode = 141 ; # [ doc = "< Unsupported Content-Format" ] pub const otCoapCode_OT_COAP_CODE_UNSUPPORTED_FORMAT : otCoapCode = 143 ; # [ doc = "< Internal Server Error" ] pub const otCoapCode_OT_COAP_CODE_INTERNAL_ERROR : otCoapCode = 160 ; # [ doc = "< Not Implemented" ] pub const otCoapCode_OT_COAP_CODE_NOT_IMPLEMENTED : otCoapCode = 161 ; # [ doc = "< Bad Gateway" ] pub const otCoapCode_OT_COAP_CODE_BAD_GATEWAY : otCoapCode = 162 ; # [ doc = "< Service Unavailable" ] pub const otCoapCode_OT_COAP_CODE_SERVICE_UNAVAILABLE : otCoapCode = 163 ; # [ doc = "< Gateway Timeout" ] pub const otCoapCode_OT_COAP_CODE_GATEWAY_TIMEOUT : otCoapCode = 164 ; # [ doc = "< Proxying Not Supported" ] pub const otCoapCode_OT_COAP_CODE_PROXY_NOT_SUPPORTED : otCoapCode = 165 ; # [ doc = " CoAP Code values." ] # [ doc = "" ] pub type otCoapCode = u32 ; pub const otCoapBlockSize_OT_COAP_BLOCK_SIZE_16 : otCoapBlockSize = 0 ; pub const otCoapBlockSize_OT_COAP_BLOCK_SIZE_32 : otCoapBlockSize = 1 ; pub const otCoapBlockSize_OT_COAP_BLOCK_SIZE_64 : otCoapBlockSize = 2 ; pub const otCoapBlockSize_OT_COAP_BLOCK_SIZE_128 : otCoapBlockSize = 3 ; pub const otCoapBlockSize_OT_COAP_BLOCK_SIZE_256 : otCoapBlockSize = 4 ; pub const otCoapBlockSize_OT_COAP_BLOCK_SIZE_512 : otCoapBlockSize = 5 ; pub const otCoapBlockSize_OT_COAP_BLOCK_SIZE_1024 : otCoapBlockSize = 6 ; # [ doc = " CoAP Block Size Exponents" ] pub type otCoapBlockSize = u32 ; # [ doc = " This structure represents a CoAP option." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otCoapOption { # [ doc = "< Option Number" ] pub mNumber : u16 , # [ doc = "< Option Length" ] pub mLength : u16 , } # [ test ] fn bindgen_test_layout_otCoapOption ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otCoapOption > ( ) , 4usize , concat ! ( "Size of: " , stringify ! ( otCoapOption ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otCoapOption > ( ) , 2usize , concat ! ( "Alignment of " , stringify ! ( otCoapOption ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCoapOption > ( ) ) ) . mNumber as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otCoapOption ) , "::" , stringify ! ( mNumber ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCoapOption > ( ) ) ) . mLength as * const _ as usize } , 2usize , concat ! ( "Offset of field: " , stringify ! ( otCoapOption ) , "::" , stringify ! ( mLength ) ) ) ; } # [ doc = " This structure acts as an iterator for CoAP options" ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otCoapOptionIterator { # [ doc = "< CoAP message" ] pub mMessage : * const otMessage , # [ doc = "< CoAP message option" ] pub mOption : otCoapOption , # [ doc = "< Byte offset of next option" ] pub mNextOptionOffset : u16 , } # [ test ] fn bindgen_test_layout_otCoapOptionIterator ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otCoapOptionIterator > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( otCoapOptionIterator ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otCoapOptionIterator > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otCoapOptionIterator ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCoapOptionIterator > ( ) ) ) . mMessage as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otCoapOptionIterator ) , "::" , stringify ! ( mMessage ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCoapOptionIterator > ( ) ) ) . mOption as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otCoapOptionIterator ) , "::" , stringify ! ( mOption ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCoapOptionIterator > ( ) ) ) . mNextOptionOffset as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( otCoapOptionIterator ) , "::" , stringify ! ( mNextOptionOffset ) ) ) ; } # [ doc = " text/plain; charset=utf-8: [RFC2046][RFC3676][RFC5147]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_TEXT_PLAIN : otCoapOptionContentFormat = 0 ; # [ doc = " application/cose; cose-type=\"cose-encrypt0\": [RFC8152]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_COSE_ENCRYPT0 : otCoapOptionContentFormat = 16 ; # [ doc = " application/cose; cose-type=\"cose-mac0\": [RFC8152]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_COSE_MAC0 : otCoapOptionContentFormat = 17 ; # [ doc = " application/cose; cose-type=\"cose-sign1\": [RFC8152]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_COSE_SIGN1 : otCoapOptionContentFormat = 18 ; # [ doc = " application/link-format: [RFC6690]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_LINK_FORMAT : otCoapOptionContentFormat = 40 ; # [ doc = " application/xml: [RFC3023]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_XML : otCoapOptionContentFormat = 41 ; # [ doc = " application/octet-stream: [RFC2045][RFC2046]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_OCTET_STREAM : otCoapOptionContentFormat = 42 ; # [ doc = " application/exi:" ] # [ doc = " [\"Efficient XML Interchange (EXI) Format 1.0 (Second Edition)\", February 2014]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_EXI : otCoapOptionContentFormat = 47 ; # [ doc = " application/json: [RFC7159]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_JSON : otCoapOptionContentFormat = 50 ; # [ doc = " application/json-patch+json: [RFC6902]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_JSON_PATCH_JSON : otCoapOptionContentFormat = 51 ; # [ doc = " application/merge-patch+json: [RFC7396]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_MERGE_PATCH_JSON : otCoapOptionContentFormat = 52 ; # [ doc = " application/cbor: [RFC7049]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_CBOR : otCoapOptionContentFormat = 60 ; # [ doc = " application/cwt: [RFC8392]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_CWT : otCoapOptionContentFormat = 61 ; # [ doc = " application/cose; cose-type=\"cose-encrypt\": [RFC8152]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_COSE_ENCRYPT : otCoapOptionContentFormat = 96 ; # [ doc = " application/cose; cose-type=\"cose-mac\": [RFC8152]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_COSE_MAC : otCoapOptionContentFormat = 97 ; # [ doc = " application/cose; cose-type=\"cose-sign\": [RFC8152]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_COSE_SIGN : otCoapOptionContentFormat = 98 ; # [ doc = " application/cose-key: [RFC8152]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_COSE_KEY : otCoapOptionContentFormat = 101 ; # [ doc = " application/cose-key-set: [RFC8152]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_COSE_KEY_SET : otCoapOptionContentFormat = 102 ; # [ doc = " application/senml+json: [RFC8428]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_SENML_JSON : otCoapOptionContentFormat = 110 ; # [ doc = " application/sensml+json: [RFC8428]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_SENSML_JSON : otCoapOptionContentFormat = 111 ; # [ doc = " application/senml+cbor: [RFC8428]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_SENML_CBOR : otCoapOptionContentFormat = 112 ; # [ doc = " application/sensml+cbor: [RFC8428]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_SENSML_CBOR : otCoapOptionContentFormat = 113 ; # [ doc = " application/senml-exi: [RFC8428]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_SENML_EXI : otCoapOptionContentFormat = 114 ; # [ doc = " application/sensml-exi: [RFC8428]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_SENSML_EXI : otCoapOptionContentFormat = 115 ; # [ doc = " application/coap-group+json: [RFC7390]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_COAP_GROUP_JSON : otCoapOptionContentFormat = 256 ; # [ doc = " application/senml+xml: [RFC8428]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_SENML_XML : otCoapOptionContentFormat = 310 ; # [ doc = " application/sensml+xml: [RFC8428]" ] pub const otCoapOptionContentFormat_OT_COAP_OPTION_CONTENT_FORMAT_SENSML_XML : otCoapOptionContentFormat = 311 ; # [ doc = " CoAP Content Format codes.  The full list is documented at" ] # [ doc = " https://www.iana.org/assignments/core-parameters/core-parameters.xhtml#content-formats" ] pub type otCoapOptionContentFormat = u32 ; # [ doc = " This function pointer is called when a CoAP response is received or on the request timeout." ] # [ doc = "" ] # [ doc = " @param[in]  aContext      A pointer to application-specific context." ] # [ doc = " @param[in]  aMessage      A pointer to the message buffer containing the response. NULL if no response was received." ] # [ doc = " @param[in]  aMessageInfo  A pointer to the message info for @p aMessage. NULL if no response was received." ] # [ doc = " @param[in]  aResult       A result of the CoAP transaction." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE              A response was received successfully." ] # [ doc = " @retval  OT_ERROR_ABORT             A CoAP transaction was reset by peer." ] # [ doc = " @retval  OT_ERROR_RESPONSE_TIMEOUT  No response or acknowledgment received during timeout period." ] # [ doc = "" ] pub type otCoapResponseHandler = :: std :: option :: Option < unsafe extern "C" fn ( aContext : * mut :: std :: os :: raw :: c_void , aMessage : * mut otMessage , aMessageInfo : * const otMessageInfo , aResult : otError ) > ; # [ doc = " This function pointer is called when a CoAP request with a given Uri-Path is received." ] # [ doc = "" ] # [ doc = " @param[in]  aContext      A pointer to arbitrary context information." ] # [ doc = " @param[in]  aMessage      A pointer to the message." ] # [ doc = " @param[in]  aMessageInfo  A pointer to the message info for @p aMessage." ] # [ doc = "" ] pub type otCoapRequestHandler = :: std :: option :: Option < unsafe extern "C" fn ( aContext : * mut :: std :: os :: raw :: c_void , aMessage : * mut otMessage , aMessageInfo : * const otMessageInfo ) > ; # [ doc = " This structure represents a CoAP resource." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otCoapResource { # [ doc = "< The URI Path string" ] pub mUriPath : * const :: std :: os :: raw :: c_char , # [ doc = "< The callback for handling a received request" ] pub mHandler : otCoapRequestHandler , # [ doc = "< Application-specific context" ] pub mContext : * mut :: std :: os :: raw :: c_void , # [ doc = "< The next CoAP resource in the list" ] pub mNext : * mut otCoapResource , } # [ test ] fn bindgen_test_layout_otCoapResource ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otCoapResource > ( ) , 32usize , concat ! ( "Size of: " , stringify ! ( otCoapResource ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otCoapResource > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otCoapResource ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCoapResource > ( ) ) ) . mUriPath as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otCoapResource ) , "::" , stringify ! ( mUriPath ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCoapResource > ( ) ) ) . mHandler as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otCoapResource ) , "::" , stringify ! ( mHandler ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCoapResource > ( ) ) ) . mContext as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otCoapResource ) , "::" , stringify ! ( mContext ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCoapResource > ( ) ) ) . mNext as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( otCoapResource ) , "::" , stringify ! ( mNext ) ) ) ; } # [ doc = " This structure represents the CoAP transmission parameters." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otCoapTxParameters { # [ doc = " Minimum spacing before first retransmission when ACK is not received, in milliseconds (RFC7252 default value is" ] # [ doc = " 2000ms)." ] # [ doc = "" ] pub mAckTimeout : u32 , # [ doc = " Numerator of ACK_RANDOM_FACTOR used to calculate maximum spacing before first retransmission when ACK is not" ] # [ doc = " received (RFC7252 default value of ACK_RANDOM_FACTOR is 1.5; must not be decreased below 1)." ] # [ doc = "" ] pub mAckRandomFactorNumerator : u8 , # [ doc = " Denominator of ACK_RANDOM_FACTOR used to calculate maximum spacing before first retransmission when ACK is not" ] # [ doc = " received (RFC7252 default value of ACK_RANDOM_FACTOR is 1.5; must not be decreased below 1)." ] # [ doc = "" ] pub mAckRandomFactorDenominator : u8 , # [ doc = " Maximum number of retransmissions for CoAP Confirmable messages (RFC7252 default value is 4)." ] # [ doc = "" ] pub mMaxRetransmit : u8 , } # [ test ] fn bindgen_test_layout_otCoapTxParameters ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otCoapTxParameters > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( otCoapTxParameters ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otCoapTxParameters > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( otCoapTxParameters ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCoapTxParameters > ( ) ) ) . mAckTimeout as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otCoapTxParameters ) , "::" , stringify ! ( mAckTimeout ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCoapTxParameters > ( ) ) ) . mAckRandomFactorNumerator as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( otCoapTxParameters ) , "::" , stringify ! ( mAckRandomFactorNumerator ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCoapTxParameters > ( ) ) ) . mAckRandomFactorDenominator as * const _ as usize } , 5usize , concat ! ( "Offset of field: " , stringify ! ( otCoapTxParameters ) , "::" , stringify ! ( mAckRandomFactorDenominator ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCoapTxParameters > ( ) ) ) . mMaxRetransmit as * const _ as usize } , 6usize , concat ! ( "Offset of field: " , stringify ! ( otCoapTxParameters ) , "::" , stringify ! ( mMaxRetransmit ) ) ) ; } extern "C" { # [ doc = " This function initializes the CoAP header." ] # [ doc = "" ] # [ doc = " @param[inout] aMessage   A pointer to the CoAP message to initialize." ] # [ doc = " @param[in]    aType      CoAP message type." ] # [ doc = " @param[in]    aCode      CoAP message code." ] # [ doc = "" ] pub fn otCoapMessageInit ( aMessage : * mut otMessage , aType : otCoapType , aCode : otCoapCode ) ; } extern "C" { # [ doc = " This function initializes a response message." ] # [ doc = "" ] # [ doc = " @note Both message ID and token are set according to @p aRequest." ] # [ doc = "" ] # [ doc = " @param[inout] aResponse  A pointer to the CoAP response message." ] # [ doc = " @param[in]    aRequest   A pointer to the CoAP request message." ] # [ doc = " @param[in]    aType      CoAP message type." ] # [ doc = " @param[in]    aCode      CoAP message code." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE     Successfully initialized the response message." ] # [ doc = " @retval OT_ERROR_NO_BUFS  Insufficient message buffers available to initialize the response message." ] # [ doc = "" ] pub fn otCoapMessageInitResponse ( aResponse : * mut otMessage , aRequest : * const otMessage , aType : otCoapType , aCode : otCoapCode ) -> otError ; } extern "C" { # [ doc = " This function sets the Token value and length in a header." ] # [ doc = "" ] # [ doc = " @param[inout]  aMessage          A pointer to the CoAP message." ] # [ doc = " @param[in]     aToken            A pointer to the Token value." ] # [ doc = " @param[in]     aTokenLength      The Length of @p aToken." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE     Successfully set the Token value." ] # [ doc = " @retval OT_ERROR_NO_BUFS  Insufficient buffers to set the Token value." ] # [ doc = "" ] pub fn otCoapMessageSetToken ( aMessage : * mut otMessage , aToken : * const u8 , aTokenLength : u8 ) -> otError ; } extern "C" { # [ doc = " This function sets the Token length and randomizes its value." ] # [ doc = "" ] # [ doc = " @param[inout]  aMessage      A pointer to the CoAP message." ] # [ doc = " @param[in]     aTokenLength  The Length of a Token to set." ] # [ doc = "" ] pub fn otCoapMessageGenerateToken ( aMessage : * mut otMessage , aTokenLength : u8 ) ; } extern "C" { # [ doc = " This function appends the Content Format CoAP option as specified in" ] # [ doc = " https://tools.ietf.org/html/rfc7252#page-92.  This *must* be called before" ] # [ doc = " setting otCoapMessageSetPayloadMarker if a payload is to be included in the" ] # [ doc = " message." ] # [ doc = "" ] # [ doc = " The function is a convenience wrapper around otCoapMessageAppendUintOption," ] # [ doc = " and if the desired format type code isn't listed in otCoapOptionContentFormat," ] # [ doc = " this base function should be used instead." ] # [ doc = "" ] # [ doc = " @param[inout]  aMessage          A pointer to the CoAP message." ] # [ doc = " @param[in]     aContentFormat    One of the content formats listed in" ] # [ doc = "                                  otCoapOptionContentFormat above." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully appended the option." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  The option type is not equal or greater than the last option type." ] # [ doc = " @retval OT_ERROR_NO_BUFS       The option length exceeds the buffer size." ] # [ doc = "" ] pub fn otCoapMessageAppendContentFormatOption ( aMessage : * mut otMessage , aContentFormat : otCoapOptionContentFormat ) -> otError ; } extern "C" { # [ doc = " This function appends a CoAP option in a header." ] # [ doc = "" ] # [ doc = " @param[inout]  aMessage  A pointer to the CoAP message." ] # [ doc = " @param[in]     aNumber   The CoAP Option number." ] # [ doc = " @param[in]     aLength   The CoAP Option length." ] # [ doc = " @param[in]     aValue    A pointer to the CoAP value." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully appended the option." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  The option type is not equal or greater than the last option type." ] # [ doc = " @retval OT_ERROR_NO_BUFS       The option length exceeds the buffer size." ] # [ doc = "" ] pub fn otCoapMessageAppendOption ( aMessage : * mut otMessage , aNumber : u16 , aLength : u16 , aValue : * const :: std :: os :: raw :: c_void ) -> otError ; } extern "C" { # [ doc = " This function appends an unsigned integer CoAP option as specified in" ] # [ doc = " https://tools.ietf.org/html/rfc7252#section-3.2" ] # [ doc = "" ] # [ doc = " @param[inout]  aMessage A pointer to the CoAP message." ] # [ doc = " @param[in]     aNumber  The CoAP Option number." ] # [ doc = " @param[in]     aValue   The CoAP Option unsigned integer value." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully appended the option." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  The option type is not equal or greater than the last option type." ] # [ doc = " @retval OT_ERROR_NO_BUFS       The option length exceeds the buffer size." ] # [ doc = "" ] # [ doc = " @see otCoapMessageGetOptionUintValue" ] pub fn otCoapMessageAppendUintOption ( aMessage : * mut otMessage , aNumber : u16 , aValue : u32 ) -> otError ; } extern "C" { # [ doc = " This function appends an Observe option." ] # [ doc = "" ] # [ doc = " @param[inout]  aMessage  A pointer to the CoAP message." ] # [ doc = " @param[in]     aObserve  Observe field value." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully appended the option." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  The option type is not equal or greater than the last option type." ] # [ doc = " @retval OT_ERROR_NO_BUFS       The option length exceeds the buffer size." ] # [ doc = "" ] pub fn otCoapMessageAppendObserveOption ( aMessage : * mut otMessage , aObserve : u32 ) -> otError ; } extern "C" { # [ doc = " This function appends a Uri-Path option." ] # [ doc = "" ] # [ doc = " @param[inout]  aMessage  A pointer to the CoAP message." ] # [ doc = " @param[in]     aUriPath  A pointer to a NULL-terminated string." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully appended the option." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  The option type is not equal or greater than the last option type." ] # [ doc = " @retval OT_ERROR_NO_BUFS       The option length exceeds the buffer size." ] # [ doc = "" ] pub fn otCoapMessageAppendUriPathOptions ( aMessage : * mut otMessage , aUriPath : * const :: std :: os :: raw :: c_char ) -> otError ; } extern "C" { # [ doc = " This function converts a CoAP Block option SZX field to the actual block size" ] # [ doc = "" ] # [ doc = " @param[in]     aSize     Block size exponent." ] # [ doc = "" ] # [ doc = " @returns The actual size exponent value." ] # [ doc = "" ] pub fn otCoapBlockSizeFromExponent ( aSize : otCoapBlockSize ) -> u16 ; } extern "C" { # [ doc = " This function appends a Block2 option" ] # [ doc = "" ] # [ doc = " @param[inout]  aMessage  A pointer to the CoAP message." ] # [ doc = " @param[in]     aNum      Current block number." ] # [ doc = " @param[in]     aMore     Boolean to indicate more blocks are to be sent." ] # [ doc = " @param[in]     aSize     Block Size Exponent." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully appended the option." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  The option type is not equal or greater than the last option type." ] # [ doc = " @retval OT_ERROR_NO_BUFS       The option length exceeds the buffer size." ] # [ doc = "" ] pub fn otCoapMessageAppendBlock2Option ( aMessage : * mut otMessage , aNum : u32 , aMore : bool , aSize : otCoapBlockSize ) -> otError ; } extern "C" { # [ doc = " This function appends a Block1 option" ] # [ doc = "" ] # [ doc = " @param[inout]  aMessage  A pointer to the CoAP message." ] # [ doc = " @param[in]     aNum      Current block number." ] # [ doc = " @param[in]     aMore     Boolean to indicate more blocks are to be sent." ] # [ doc = " @param[in]     aSize     Block Size Exponent." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully appended the option." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  The option type is not equal or greater than the last option type." ] # [ doc = " @retval OT_ERROR_NO_BUFS       The option length exceeds the buffer size." ] # [ doc = "" ] pub fn otCoapMessageAppendBlock1Option ( aMessage : * mut otMessage , aNum : u32 , aMore : bool , aSize : otCoapBlockSize ) -> otError ; } extern "C" { # [ doc = " This function appends a Proxy-Uri option." ] # [ doc = "" ] # [ doc = " @param[inout]  aMessage  A pointer to the CoAP message." ] # [ doc = " @param[in]     aUriPath  A pointer to a NULL-terminated string." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully appended the option." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  The option type is not equal or greater than the last option type." ] # [ doc = " @retval OT_ERROR_NO_BUFS       The option length exceeds the buffer size." ] # [ doc = "" ] pub fn otCoapMessageAppendProxyUriOption ( aMessage : * mut otMessage , aUriPath : * const :: std :: os :: raw :: c_char ) -> otError ; } extern "C" { # [ doc = " This function appends a Max-Age option." ] # [ doc = "" ] # [ doc = " @param[inout]  aMessage  A pointer to the CoAP message." ] # [ doc = " @param[in]     aMaxAge   The Max-Age value." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully appended the option." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  The option type is not equal or greater than the last option type." ] # [ doc = " @retval OT_ERROR_NO_BUFS       The option length exceeds the buffer size." ] # [ doc = "" ] pub fn otCoapMessageAppendMaxAgeOption ( aMessage : * mut otMessage , aMaxAge : u32 ) -> otError ; } extern "C" { # [ doc = " This function appends a single Uri-Query option." ] # [ doc = "" ] # [ doc = " @param[inout]  aMessage  A pointer to the CoAP message." ] # [ doc = " @param[in]     aUriQuery A pointer to NULL-terminated string, which should contain a single key=value pair." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully appended the option." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  The option type is not equal or greater than the last option type." ] # [ doc = " @retval OT_ERROR_NO_BUFS       The option length exceeds the buffer size." ] pub fn otCoapMessageAppendUriQueryOption ( aMessage : * mut otMessage , aUriQuery : * const :: std :: os :: raw :: c_char ) -> otError ; } extern "C" { # [ doc = " This function adds Payload Marker indicating beginning of the payload to the CoAP header." ] # [ doc = "" ] # [ doc = " @param[inout]  aMessage  A pointer to the CoAP message." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE     Payload Marker successfully added." ] # [ doc = " @retval OT_ERROR_NO_BUFS  Header Payload Marker exceeds the buffer size." ] # [ doc = "" ] pub fn otCoapMessageSetPayloadMarker ( aMessage : * mut otMessage ) -> otError ; } extern "C" { # [ doc = " This function returns the Type value." ] # [ doc = "" ] # [ doc = " @param[in]  aMessage  A pointer to the CoAP message." ] # [ doc = "" ] # [ doc = " @returns The Type value." ] # [ doc = "" ] pub fn otCoapMessageGetType ( aMessage : * const otMessage ) -> otCoapType ; } extern "C" { # [ doc = " This function returns the Code value." ] # [ doc = "" ] # [ doc = " @param[in]  aMessage  A pointer to the CoAP message." ] # [ doc = "" ] # [ doc = " @returns The Code value." ] # [ doc = "" ] pub fn otCoapMessageGetCode ( aMessage : * const otMessage ) -> otCoapCode ; } extern "C" { # [ doc = " This method returns the CoAP Code as human readable string." ] # [ doc = "" ] # [ doc = " @param[in]   aMessage    A pointer to the CoAP message." ] # [ doc = "" ] # [ doc = " @ returns The CoAP Code as string." ] # [ doc = "" ] pub fn otCoapMessageCodeToString ( aMessage : * const otMessage ) -> * const :: std :: os :: raw :: c_char ; } extern "C" { # [ doc = " This function returns the Message ID value." ] # [ doc = "" ] # [ doc = " @param[in]  aMessage  A pointer to the CoAP message." ] # [ doc = "" ] # [ doc = " @returns The Message ID value." ] # [ doc = "" ] pub fn otCoapMessageGetMessageId ( aMessage : * const otMessage ) -> u16 ; } extern "C" { # [ doc = " This function returns the Token length." ] # [ doc = "" ] # [ doc = " @param[in]  aMessage  A pointer to the CoAP message." ] # [ doc = "" ] # [ doc = " @returns The Token length." ] # [ doc = "" ] pub fn otCoapMessageGetTokenLength ( aMessage : * const otMessage ) -> u8 ; } extern "C" { # [ doc = " This function returns a pointer to the Token value." ] # [ doc = "" ] # [ doc = " @param[in]  aMessage  A pointer to the CoAP message." ] # [ doc = "" ] # [ doc = " @returns A pointer to the Token value." ] # [ doc = "" ] pub fn otCoapMessageGetToken ( aMessage : * const otMessage ) -> * const u8 ; } extern "C" { # [ doc = " This function initialises an iterator for the options in the given message." ] # [ doc = "" ] # [ doc = " @param[inout]  aIterator A pointer to the CoAP message option iterator." ] # [ doc = " @param[in]     aMessage  A pointer to the CoAP message." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE   Successfully initialised." ] # [ doc = " @retval  OT_ERROR_PARSE  Message state is inconsistent." ] # [ doc = "" ] pub fn otCoapOptionIteratorInit ( aIterator : * mut otCoapOptionIterator , aMessage : * const otMessage ) -> otError ; } extern "C" { # [ doc = " This function returns a pointer to the first option matching the specified option number." ] # [ doc = "" ] # [ doc = " @param[in]  aIterator A pointer to the CoAP message option iterator." ] # [ doc = " @param[in]  aOption   The option number sought." ] # [ doc = "" ] # [ doc = " @returns A pointer to the first matching option. If no matching option is present NULL pointer is returned." ] # [ doc = "" ] pub fn otCoapOptionIteratorGetFirstOptionMatching ( aIterator : * mut otCoapOptionIterator , aOption : u16 ) -> * const otCoapOption ; } extern "C" { # [ doc = " This function returns a pointer to the first option." ] # [ doc = "" ] # [ doc = " @param[inout]  aIterator A pointer to the CoAP message option iterator." ] # [ doc = "" ] # [ doc = " @returns A pointer to the first option. If no option is present NULL pointer is returned." ] # [ doc = "" ] pub fn otCoapOptionIteratorGetFirstOption ( aIterator : * mut otCoapOptionIterator ) -> * const otCoapOption ; } extern "C" { # [ doc = " This function returns a pointer to the next option matching the specified option number." ] # [ doc = "" ] # [ doc = " @param[in]  aIterator A pointer to the CoAP message option iterator." ] # [ doc = " @param[in]  aOption   The option number sought." ] # [ doc = "" ] # [ doc = " @returns A pointer to the next matching option. If no further matching option is present NULL pointer is returned." ] # [ doc = "" ] pub fn otCoapOptionIteratorGetNextOptionMatching ( aIterator : * mut otCoapOptionIterator , aOption : u16 ) -> * const otCoapOption ; } extern "C" { # [ doc = " This function returns a pointer to the next option." ] # [ doc = "" ] # [ doc = " @param[inout]  aIterator A pointer to the CoAP message option iterator." ] # [ doc = "" ] # [ doc = " @returns A pointer to the next option. If no more options are present NULL pointer is returned." ] # [ doc = "" ] pub fn otCoapOptionIteratorGetNextOption ( aIterator : * mut otCoapOptionIterator ) -> * const otCoapOption ; } extern "C" { # [ doc = " This function fills current option value into @p aValue assuming the current value is an unsigned integer encoded" ] # [ doc = " according to https://tools.ietf.org/html/rfc7252#section-3.2" ] # [ doc = "" ] # [ doc = " @param[inout]    aIterator   A pointer to the CoAP message option iterator." ] # [ doc = " @param[out]      aValue      A pointer to an unsigned integer to receive the option value." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE       Successfully filled value." ] # [ doc = " @retval  OT_ERROR_NOT_FOUND  No current option." ] # [ doc = " @retval  OT_ERROR_NO_BUFS    Value is too long to fit in a uint64_t." ] # [ doc = "" ] # [ doc = " @see otCoapMessageAppendUintOption" ] pub fn otCoapOptionIteratorGetOptionUintValue ( aIterator : * mut otCoapOptionIterator , aValue : * mut u64 ) -> otError ; } extern "C" { # [ doc = " This function fills current option value into @p aValue." ] # [ doc = "" ] # [ doc = " @param[inout]  aIterator A pointer to the CoAP message option iterator." ] # [ doc = " @param[out]    aValue    A pointer to a buffer to receive the option value." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE       Successfully filled value." ] # [ doc = " @retval  OT_ERROR_NOT_FOUND  No current option." ] # [ doc = "" ] pub fn otCoapOptionIteratorGetOptionValue ( aIterator : * mut otCoapOptionIterator , aValue : * mut :: std :: os :: raw :: c_void ) -> otError ; } extern "C" { # [ doc = " This function creates a new CoAP message." ] # [ doc = "" ] # [ doc = " @note If @p aSettings is 'NULL', the link layer security is enabled and the message priority is set to" ] # [ doc = " OT_MESSAGE_PRIORITY_NORMAL by default." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aSettings  A pointer to the message settings or NULL to set default settings." ] # [ doc = "" ] # [ doc = " @returns A pointer to the message buffer or NULL if no message buffers are available or parameters are invalid." ] # [ doc = "" ] pub fn otCoapNewMessage ( aInstance : * mut otInstance , aSettings : * const otMessageSettings ) -> * mut otMessage ; } extern "C" { # [ doc = " This function sends a CoAP request with custom transmission parameters." ] # [ doc = "" ] # [ doc = " If a response for a request is expected, respective function and context information should be provided." ] # [ doc = " If no response is expected, these arguments should be NULL pointers." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance        A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aMessage         A pointer to the message to send." ] # [ doc = " @param[in]  aMessageInfo     A pointer to the message info associated with @p aMessage." ] # [ doc = " @param[in]  aHandler         A function pointer that shall be called on response reception or timeout." ] # [ doc = " @param[in]  aContext         A pointer to arbitrary context information. May be NULL if not used." ] # [ doc = " @param[in]  aTxParameters    A pointer to transmission parameters for this request. Use NULL for defaults." ] # [ doc = "                              Otherwise, parameters given must meet the following conditions:" ] # [ doc = "                              1. mMaxRetransmit is no more than OT_COAP_MAX_RETRANSMIT." ] # [ doc = "                              2. mAckRandomFactorNumerator / mAckRandomFactorDenominator must not be below 1.0." ] # [ doc = "                              3. The calculated exchange life time must not overflow uint32_t." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_INVALID_ARGS    @p aTxParameters is invalid." ] # [ doc = " @retval OT_ERROR_NONE            Successfully sent CoAP message." ] # [ doc = " @retval OT_ERROR_NO_BUFS         Failed to allocate retransmission data." ] # [ doc = "" ] pub fn otCoapSendRequestWithParameters ( aInstance : * mut otInstance , aMessage : * mut otMessage , aMessageInfo : * const otMessageInfo , aHandler : otCoapResponseHandler , aContext : * mut :: std :: os :: raw :: c_void , aTxParameters : * const otCoapTxParameters ) -> otError ; } extern "C" { # [ doc = " This function starts the CoAP server." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aPort      The local UDP port to bind to." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE  Successfully started the CoAP server." ] # [ doc = "" ] pub fn otCoapStart ( aInstance : * mut otInstance , aPort : u16 ) -> otError ; } extern "C" { # [ doc = " This function stops the CoAP server." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE  Successfully stopped the CoAP server." ] # [ doc = "" ] pub fn otCoapStop ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " This function adds a resource to the CoAP server." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aResource  A pointer to the resource." ] # [ doc = "" ] pub fn otCoapAddResource ( aInstance : * mut otInstance , aResource : * mut otCoapResource ) ; } extern "C" { # [ doc = " This function removes a resource from the CoAP server." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aResource  A pointer to the resource." ] # [ doc = "" ] pub fn otCoapRemoveResource ( aInstance : * mut otInstance , aResource : * mut otCoapResource ) ; } extern "C" { # [ doc = " This function sets the default handler for unhandled CoAP requests." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aHandler   A function pointer that shall be called when an unhandled request arrives." ] # [ doc = " @param[in]  aContext   A pointer to arbitrary context information. May be NULL if not used." ] # [ doc = "" ] pub fn otCoapSetDefaultHandler ( aInstance : * mut otInstance , aHandler : otCoapRequestHandler , aContext : * mut :: std :: os :: raw :: c_void ) ; } extern "C" { # [ doc = " This function sends a CoAP response from the server with custom transmission parameters." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance        A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aMessage         A pointer to the CoAP response to send." ] # [ doc = " @param[in]  aMessageInfo     A pointer to the message info associated with @p aMessage." ] # [ doc = " @param[in]  aTxParameters    A pointer to transmission parameters for this response. Use NULL for defaults." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE     Successfully enqueued the CoAP response message." ] # [ doc = " @retval OT_ERROR_NO_BUFS  Insufficient buffers available to send the CoAP response." ] # [ doc = "" ] pub fn otCoapSendResponseWithParameters ( aInstance : * mut otInstance , aMessage : * mut otMessage , aMessageInfo : * const otMessageInfo , aTxParameters : * const otCoapTxParameters ) -> otError ; } # [ doc = " This function pointer is called when the DTLS connection state changes." ] # [ doc = "" ] # [ doc = " @param[in]  aConnected  true, if a connection was established, false otherwise." ] # [ doc = " @param[in]  aContext    A pointer to arbitrary context information." ] # [ doc = "" ] pub type otHandleCoapSecureClientConnect = :: std :: option :: Option < unsafe extern "C" fn ( aConnected : bool , aContext : * mut :: std :: os :: raw :: c_void ) > ; extern "C" { # [ doc = " This function starts the CoAP Secure service." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aPort      The local UDP port to bind to." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE  Successfully started the CoAP Secure server." ] # [ doc = "" ] pub fn otCoapSecureStart ( aInstance : * mut otInstance , aPort : u16 ) -> otError ; } extern "C" { # [ doc = " This function stops the CoAP Secure server." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] pub fn otCoapSecureStop ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " This method sets the Pre-Shared Key (PSK) and cipher suite" ] # [ doc = " DTLS_PSK_WITH_AES_128_CCM_8." ] # [ doc = "" ] # [ doc = " @note This function requires the build-time feature `MBEDTLS_KEY_EXCHANGE_PSK_ENABLED` to be enabled." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance     A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aPsk          A pointer to the PSK." ] # [ doc = " @param[in]  aPskLength    The PSK length." ] # [ doc = " @param[in]  aPskIdentity  The Identity Name for the PSK." ] # [ doc = " @param[in]  aPskIdLength  The PSK Identity Length." ] # [ doc = "" ] pub fn otCoapSecureSetPsk ( aInstance : * mut otInstance , aPsk : * const u8 , aPskLength : u16 , aPskIdentity : * const u8 , aPskIdLength : u16 ) ; } extern "C" { # [ doc = " This method returns the peer x509 certificate base64 encoded." ] # [ doc = "" ] # [ doc = " @note This function requires the build-time feature `MBEDTLS_BASE64_C` to be enabled." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance        A pointer to an OpenThread instance." ] # [ doc = " @param[out]  aPeerCert        A pointer to the base64 encoded certificate buffer." ] # [ doc = " @param[out]  aCertLength      The length of the base64 encoded peer certificate." ] # [ doc = " @param[in]   aCertBufferSize  The buffer size of aPeerCert." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_INVALID_STATE   Not connected yet." ] # [ doc = " @retval OT_ERROR_NONE            Successfully get the peer certificate." ] # [ doc = " @retval OT_ERROR_NO_BUFS         Can't allocate memory for certificate." ] # [ doc = "" ] pub fn otCoapSecureGetPeerCertificateBase64 ( aInstance : * mut otInstance , aPeerCert : * mut :: std :: os :: raw :: c_uchar , aCertLength : * mut size_t , aCertBufferSize : size_t ) -> otError ; } extern "C" { # [ doc = " This method sets the authentication mode for the coap secure connection." ] # [ doc = "" ] # [ doc = " Disable or enable the verification of peer certificate." ] # [ doc = " Must be called before start." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance               A pointer to an OpenThread instance." ] # [ doc = " @param[in]   aVerifyPeerCertificate  true, to verify the peer certificate." ] # [ doc = "" ] pub fn otCoapSecureSetSslAuthMode ( aInstance : * mut otInstance , aVerifyPeerCertificate : bool ) ; } extern "C" { # [ doc = " This method sets the local device's X509 certificate with corresponding private key for" ] # [ doc = " DTLS session with DTLS_ECDHE_ECDSA_WITH_AES_128_CCM_8." ] # [ doc = "" ] # [ doc = " @note This function requires `MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED=1`." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance          A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aX509Cert          A pointer to the PEM formatted X509 certificate." ] # [ doc = " @param[in]  aX509Length        The length of certificate." ] # [ doc = " @param[in]  aPrivateKey        A pointer to the PEM formatted private key." ] # [ doc = " @param[in]  aPrivateKeyLength  The length of the private key." ] # [ doc = "" ] pub fn otCoapSecureSetCertificate ( aInstance : * mut otInstance , aX509Cert : * const u8 , aX509Length : u32 , aPrivateKey : * const u8 , aPrivateKeyLength : u32 ) ; } extern "C" { # [ doc = " This method sets the trusted top level CAs. It is needed for validating the" ] # [ doc = " certificate of the peer." ] # [ doc = "" ] # [ doc = " DTLS mode \"ECDHE ECDSA with AES 128 CCM 8\" for Application CoAPS." ] # [ doc = "" ] # [ doc = " @note This function requires `MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED=1`." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance                A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aX509CaCertificateChain  A pointer to the PEM formatted X509 CA chain." ] # [ doc = " @param[in]  aX509CaCertChainLength   The length of chain." ] # [ doc = "" ] pub fn otCoapSecureSetCaCertificateChain ( aInstance : * mut otInstance , aX509CaCertificateChain : * const u8 , aX509CaCertChainLength : u32 ) ; } extern "C" { # [ doc = " This method initializes DTLS session with a peer." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance               A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aSockAddr               A pointer to the remote sockaddr." ] # [ doc = " @param[in]  aHandler                A pointer to a function that will be called when the DTLS connection" ] # [ doc = "                                     state changes." ] # [ doc = " @param[in]  aContext                A pointer to arbitrary context information." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE  Successfully started DTLS connection." ] # [ doc = "" ] pub fn otCoapSecureConnect ( aInstance : * mut otInstance , aSockAddr : * const otSockAddr , aHandler : otHandleCoapSecureClientConnect , aContext : * mut :: std :: os :: raw :: c_void ) -> otError ; } extern "C" { # [ doc = " This method stops the DTLS connection." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] pub fn otCoapSecureDisconnect ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " This method indicates whether or not the DTLS session is connected." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval TRUE   The DTLS session is connected." ] # [ doc = " @retval FALSE  The DTLS session is not connected." ] # [ doc = "" ] pub fn otCoapSecureIsConnected ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " This method indicates whether or not the DTLS session is active." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval TRUE  If DTLS session is active." ] # [ doc = " @retval FALSE If DTLS session is not active." ] # [ doc = "" ] pub fn otCoapSecureIsConnectionActive ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " This method sends a CoAP request over secure DTLS connection." ] # [ doc = "" ] # [ doc = " If a response for a request is expected, respective function and context information should be provided." ] # [ doc = " If no response is expected, these arguments should be NULL pointers." ] # [ doc = " If Message Id was not set in the header (equal to 0), this function will assign unique Message Id to the message." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance     A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aMessage      A reference to the message to send." ] # [ doc = " @param[in]  aHandler      A function pointer that shall be called on response reception or time-out." ] # [ doc = " @param[in]  aContext      A pointer to arbitrary context information." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully sent CoAP message." ] # [ doc = " @retval OT_ERROR_NO_BUFS        Failed to allocate retransmission data." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  DTLS connection was not initialized." ] # [ doc = "" ] pub fn otCoapSecureSendRequest ( aInstance : * mut otInstance , aMessage : * mut otMessage , aHandler : otCoapResponseHandler , aContext : * mut :: std :: os :: raw :: c_void ) -> otError ; } extern "C" { # [ doc = " This function adds a resource to the CoAP Secure server." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aResource  A pointer to the resource." ] # [ doc = "" ] pub fn otCoapSecureAddResource ( aInstance : * mut otInstance , aResource : * mut otCoapResource ) ; } extern "C" { # [ doc = " This function removes a resource from the CoAP Secure server." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aResource  A pointer to the resource." ] # [ doc = "" ] pub fn otCoapSecureRemoveResource ( aInstance : * mut otInstance , aResource : * mut otCoapResource ) ; } extern "C" { # [ doc = " This function sets the default handler for unhandled CoAP Secure requests." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aHandler   A function pointer that shall be called when an unhandled request arrives." ] # [ doc = " @param[in]  aContext   A pointer to arbitrary context information. May be NULL if not used." ] # [ doc = "" ] pub fn otCoapSecureSetDefaultHandler ( aInstance : * mut otInstance , aHandler : otCoapRequestHandler , aContext : * mut :: std :: os :: raw :: c_void ) ; } extern "C" { # [ doc = " This method sets the connected callback to indicate, when" ] # [ doc = " a Client connect to the CoAP Secure server." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance     A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aHandler      A pointer to a function that will be called once DTLS connection is established." ] # [ doc = " @param[in]  aContext      A pointer to arbitrary context information. May be NULL if not used." ] # [ doc = "" ] pub fn otCoapSecureSetClientConnectedCallback ( aInstance : * mut otInstance , aHandler : otHandleCoapSecureClientConnect , aContext : * mut :: std :: os :: raw :: c_void ) ; } extern "C" { # [ doc = " This function sends a CoAP response from the CoAP Secure server." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance     A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aMessage      A pointer to the CoAP response to send." ] # [ doc = " @param[in]  aMessageInfo  A pointer to the message info associated with @p aMessage." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE     Successfully enqueued the CoAP response message." ] # [ doc = " @retval OT_ERROR_NO_BUFS  Insufficient buffers available to send the CoAP response." ] # [ doc = "" ] pub fn otCoapSecureSendResponse ( aInstance : * mut otInstance , aMessage : * mut otMessage , aMessageInfo : * const otMessageInfo ) -> otError ; } extern "C" { # [ doc = " This function requests a Thread network channel change." ] # [ doc = "" ] # [ doc = " The network switches to the given channel after a specified delay (see otChannelManagerSetDelay()). The channel" ] # [ doc = " change is performed by updating the Pending Operational Dataset." ] # [ doc = "" ] # [ doc = " A subsequent call to this function will cancel an ongoing previously requested channel change." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance          A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aChannel           The new channel for the Thread network." ] # [ doc = "" ] pub fn otChannelManagerRequestChannelChange ( aInstance : * mut otInstance , aChannel : u8 ) ; } extern "C" { # [ doc = " This function gets the channel from the last successful call to `otChannelManagerRequestChannelChange()`" ] # [ doc = "" ] # [ doc = " @returns The last requested channel or zero if there has been no channel change request yet." ] # [ doc = "" ] pub fn otChannelManagerGetRequestedChannel ( aInstance : * mut otInstance ) -> u8 ; } extern "C" { # [ doc = " This function gets the delay (in seconds) used by Channel Manager for a channel change." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance          A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The delay (in seconds) for channel change." ] # [ doc = "" ] pub fn otChannelManagerGetDelay ( aInstance : * mut otInstance ) -> u16 ; } extern "C" { # [ doc = " This function sets the delay (in seconds) used for a channel change." ] # [ doc = "" ] # [ doc = " The delay should preferably be longer than maximum data poll interval used by all sleepy-end-devices within the" ] # [ doc = " Thread network." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance          A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aDelay             Delay in seconds." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Delay was updated successfully." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  The given delay @p aDelay is too short." ] # [ doc = "" ] pub fn otChannelManagerSetDelay ( aInstance : * mut otInstance , aDelay : u16 ) -> otError ; } extern "C" { # [ doc = " This function requests that `ChannelManager` checks and selects a new channel and starts a channel change." ] # [ doc = "" ] # [ doc = " Unlike the `otChannelManagerRequestChannelChange()` where the channel must be given as a parameter, this function" ] # [ doc = " asks the `ChannelManager` to select a channel by itself (based of collected channel quality info)." ] # [ doc = "" ] # [ doc = " Once called, the Channel Manager will perform the following 3 steps:" ] # [ doc = "" ] # [ doc = " 1) `ChannelManager` decides if the channel change would be helpful. This check can be skipped if" ] # [ doc = "    `aSkipQualityCheck` is set to true (forcing a channel selection to happen and skipping the quality check)." ] # [ doc = "    This step uses the collected link quality metrics on the device (such as CCA failure rate, frame and message" ] # [ doc = "    error rates per neighbor, etc.) to determine if the current channel quality is at the level that justifies" ] # [ doc = "    a channel change." ] # [ doc = "" ] # [ doc = " 2) If the first step passes, then `ChannelManager` selects a potentially better channel. It uses the collected" ] # [ doc = "    channel quality data by `ChannelMonitor` module. The supported and favored channels are used at this step." ] # [ doc = "    (see otChannelManagerSetSupportedChannels() and otChannelManagerSetFavoredChannels())." ] # [ doc = "" ] # [ doc = " 3) If the newly selected channel is different from the current channel, `ChannelManager` requests/starts the" ] # [ doc = "    channel change process (internally invoking a `RequestChannelChange()`)." ] # [ doc = "" ] # [ doc = " @param[in] aInstance                A pointer to an OpenThread instance." ] # [ doc = " @param[in] aSkipQualityCheck        Indicates whether the quality check (step 1) should be skipped." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE               Channel selection finished successfully." ] # [ doc = " @retval OT_ERROR_NOT_FOUND          Supported channel mask is empty, therefore could not select a channel." ] # [ doc = "" ] pub fn otChannelManagerRequestChannelSelect ( aInstance : * mut otInstance , aSkipQualityCheck : bool ) -> otError ; } extern "C" { # [ doc = " This function enables/disables the auto-channel-selection functionality." ] # [ doc = "" ] # [ doc = " When enabled, `ChannelManager` will periodically invoke a `RequestChannelSelect(false)`. The period interval" ] # [ doc = " can be set by `SetAutoChannelSelectionInterval()`." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aEnabled     Indicates whether to enable or disable this functionality." ] # [ doc = "" ] pub fn otChannelManagerSetAutoChannelSelectionEnabled ( aInstance : * mut otInstance , aEnabled : bool ) ; } extern "C" { # [ doc = " This function indicates whether the auto-channel-selection functionality is enabled or not." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns TRUE if enabled, FALSE if disabled." ] # [ doc = "" ] pub fn otChannelManagerGetAutoChannelSelectionEnabled ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " This function sets the period interval (in seconds) used by auto-channel-selection functionality." ] # [ doc = "" ] # [ doc = " @param[in] aInstance   A pointer to an OpenThread instance." ] # [ doc = " @param[in] aInterval   The interval in seconds." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           The interval was set successfully." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS   The @p aInterval is not valid (zero)." ] # [ doc = "" ] pub fn otChannelManagerSetAutoChannelSelectionInterval ( aInstance : * mut otInstance , aInterval : u32 ) -> otError ; } extern "C" { # [ doc = " This function gets the period interval (in seconds) used by auto-channel-selection functionality." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The interval in seconds." ] # [ doc = "" ] pub fn otChannelManagerGetAutoChannelSelectionInterval ( aInstance : * mut otInstance ) -> u32 ; } extern "C" { # [ doc = " This function gets the supported channel mask." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance       A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns  The supported channels as a bit-mask." ] # [ doc = "" ] pub fn otChannelManagerGetSupportedChannels ( aInstance : * mut otInstance ) -> u32 ; } extern "C" { # [ doc = " This function sets the supported channel mask." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance     A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aChannelMask  A channel mask." ] # [ doc = "" ] pub fn otChannelManagerSetSupportedChannels ( aInstance : * mut otInstance , aChannelMask : u32 ) ; } extern "C" { # [ doc = " This function gets the favored channel mask." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance       A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns  The favored channels as a bit-mask." ] # [ doc = "" ] pub fn otChannelManagerGetFavoredChannels ( aInstance : * mut otInstance ) -> u32 ; } extern "C" { # [ doc = " This function sets the favored channel mask." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance     A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aChannelMask  A channel mask." ] # [ doc = "" ] pub fn otChannelManagerSetFavoredChannels ( aInstance : * mut otInstance , aChannelMask : u32 ) ; } extern "C" { # [ doc = " This function enables/disables the Channel Monitoring operation." ] # [ doc = "" ] # [ doc = " Once operation starts, any previously collected data is cleared. However, after operation is disabled, the previous" ] # [ doc = " collected data is still valid and can be read." ] # [ doc = "" ] # [ doc = " @note OpenThread core internally enables/disables the Channel Monitoring operation when the IPv6 interface is" ] # [ doc = " brought up/down (i.e., call to `otIp6SetEnabled()`)." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance       A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aEnabled        TRUE to enable/start Channel Monitoring operation, FALSE to disable/stop it." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE      Channel Monitoring state changed successfully" ] # [ doc = " @retval OT_ERROR_ALREADY   Channel Monitoring is already in the same state." ] # [ doc = "" ] pub fn otChannelMonitorSetEnabled ( aInstance : * mut otInstance , aEnabled : bool ) -> otError ; } extern "C" { # [ doc = " This function indicates whether the Channel Monitoring operation is enabled and running." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance       A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns TRUE if the Channel Monitoring operation is enabled, FALSE otherwise." ] # [ doc = "" ] pub fn otChannelMonitorIsEnabled ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " Get channel monitoring sample interval in milliseconds." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance       A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns  The channel monitor sample interval in milliseconds." ] # [ doc = "" ] pub fn otChannelMonitorGetSampleInterval ( aInstance : * mut otInstance ) -> u32 ; } extern "C" { # [ doc = " Get channel monitoring RSSI threshold in dBm." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance       A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns  The RSSI threshold in dBm." ] # [ doc = "" ] pub fn otChannelMonitorGetRssiThreshold ( aInstance : * mut otInstance ) -> i8 ; } extern "C" { # [ doc = " Get channel monitoring averaging sample window length (number of samples)." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance       A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns  The averaging sample window." ] # [ doc = "" ] pub fn otChannelMonitorGetSampleWindow ( aInstance : * mut otInstance ) -> u32 ; } extern "C" { # [ doc = " Get channel monitoring total number of RSSI samples (per channel)." ] # [ doc = "" ] # [ doc = " The count indicates total number samples per channel by channel monitoring module since its start (since Thread" ] # [ doc = " network interface was enabled)." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance       A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns  Total number of RSSI samples (per channel) taken so far." ] # [ doc = "" ] pub fn otChannelMonitorGetSampleCount ( aInstance : * mut otInstance ) -> u32 ; } extern "C" { # [ doc = " Gets the current channel occupancy for a given channel." ] # [ doc = "" ] # [ doc = " The channel occupancy value represents the average rate/percentage of RSSI samples that were above RSSI threshold" ] # [ doc = " (\"bad\" RSSI samples)." ] # [ doc = "" ] # [ doc = " For the first \"sample window\" samples, the average is maintained as the actual percentage (i.e., ratio of number" ] # [ doc = " of \"bad\" samples by total number of samples). After \"window\" samples, the averager uses an exponentially" ] # [ doc = " weighted moving average. Practically, this means the average is representative of up to `3 * window` last samples" ] # [ doc = " with highest weight given to the latest `kSampleWindow` samples." ] # [ doc = "" ] # [ doc = " Max value of `0xffff` indicates all RSSI samples were above RSSI threshold (i.e. 100% of samples were \"bad\")." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance       A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aChannel        The channel for which to get the link occupancy." ] # [ doc = "" ] # [ doc = " @returns The current channel occupancy for the given channel." ] # [ doc = "" ] pub fn otChannelMonitorGetChannelOccupancy ( aInstance : * mut otInstance , aChannel : u8 ) -> u16 ; } extern "C" { # [ doc = " This function performs HMAC computation." ] # [ doc = "" ] # [ doc = " @param[in]     aKey           A pointer to the key." ] # [ doc = " @param[in]     aKeyLength     The key length in bytes." ] # [ doc = " @param[in]     aBuf           A pointer to the input buffer." ] # [ doc = " @param[in]     aBufLength     The length of @p aBuf in bytes." ] # [ doc = " @param[out]    aHash          A pointer to the output hash buffer." ] # [ doc = "" ] pub fn otCryptoHmacSha256 ( aKey : * const u8 , aKeyLength : u16 , aBuf : * const u8 , aBufLength : u16 , aHash : * mut u8 ) ; } extern "C" { # [ doc = " This method performs AES CCM computation." ] # [ doc = "" ] # [ doc = " @param[in]     aKey           A pointer to the key." ] # [ doc = " @param[in]     aKeyLength     Length of the key in bytes." ] # [ doc = " @param[in]     aTagLength     Length of tag in bytes." ] # [ doc = " @param[in]     aNonce         A pointer to the nonce." ] # [ doc = " @param[in]     aNonceLength   Length of nonce in bytes." ] # [ doc = "" ] # [ doc = " @param[in]     aHeader        A pointer to the header." ] # [ doc = " @param[in]     aHeaderLength  Length of header in bytes." ] # [ doc = "" ] # [ doc = " @param[inout]  aPlainText     A pointer to the plaintext." ] # [ doc = " @param[inout]  aCipherText    A pointer to the ciphertext." ] # [ doc = " @param[in]     aLength        Plaintext length in bytes." ] # [ doc = " @param[in]     aEncrypt       `true` on encrypt and `false` on decrypt." ] # [ doc = "" ] # [ doc = " @param[out]    aTag           A pointer to the tag." ] # [ doc = "" ] pub fn otCryptoAesCcm ( aKey : * const u8 , aKeyLength : u16 , aTagLength : u8 , aNonce : * const :: std :: os :: raw :: c_void , aNonceLength : u8 , aHeader : * const :: std :: os :: raw :: c_void , aHeaderLength : u32 , aPlainText : * mut :: std :: os :: raw :: c_void , aCipherText : * mut :: std :: os :: raw :: c_void , aLength : u32 , aEncrypt : bool , aTag : * mut :: std :: os :: raw :: c_void ) ; } extern "C" { # [ doc = " This method creates ECDSA sign." ] # [ doc = "" ] # [ doc = " @param[out]    aOutput            An output buffer where ECDSA sign should be stored." ] # [ doc = " @param[inout]  aOutputLength      The length of the @p aOutput buffer." ] # [ doc = " @param[in]     aInputHash         An input hash." ] # [ doc = " @param[in]     aInputHashLength   The length of the @p aClaims buffer." ] # [ doc = " @param[in]     aPrivateKey        A private key in PEM format." ] # [ doc = " @param[in]     aPrivateKeyLength  The length of the @p aPrivateKey buffer." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE         ECDSA sign has been created successfully." ] # [ doc = " @retval  OT_ERROR_NO_BUFS      Output buffer is too small." ] # [ doc = " @retval  OT_ERROR_INVALID_ARGS Private key is not valid EC Private Key." ] # [ doc = " @retval  OT_ERROR_FAILED       Error during signing." ] pub fn otCryptoEcdsaSign ( aOutput : * mut u8 , aOutputLength : * mut u16 , aInputHash : * const u8 , aInputHashLength : u16 , aPrivateKey : * const u8 , aPrivateKeyLength : u16 ) -> otError ; } extern "C" { # [ doc = " This method creates a new Operational Dataset to use when forming a new network." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[out] aDataset   The Operational Dataset." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE    Successfully created a new Operational Dataset." ] # [ doc = " @retval OT_ERROR_FAILED  Failed to generate random values for new parameters." ] # [ doc = "" ] pub fn otDatasetCreateNewNetwork ( aInstance : * mut otInstance , aDataset : * mut otOperationalDataset ) -> otError ; } extern "C" { # [ doc = " Get minimal delay timer." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval the value of minimal delay timer (in ms)." ] # [ doc = "" ] pub fn otDatasetGetDelayTimerMinimal ( aInstance : * mut otInstance ) -> u32 ; } extern "C" { # [ doc = " Set minimal delay timer." ] # [ doc = "" ] # [ doc = " @note This API is reserved for testing and demo purposes only. Changing settings with" ] # [ doc = " this API will render a production application non-compliant with the Thread Specification." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance           A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aDelayTimerMinimal  The value of minimal delay timer (in ms)." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE          Successfully set minimal delay timer." ] # [ doc = " @retval  OT_ERROR_INVALID_ARGS  If @p aDelayTimerMinimal is not valid." ] # [ doc = "" ] pub fn otDatasetSetDelayTimerMinimal ( aInstance : * mut otInstance , aDelayTimerMinimal : u32 ) -> otError ; } extern "C" { # [ doc = " This function processes a factory diagnostics command line." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance       A pointer to an OpenThread instance." ] # [ doc = " @param[in]   aArgsLength     The number of elements in @p aArgs." ] # [ doc = " @param[in]   aArgs           An array of arguments." ] # [ doc = " @param[out]  aOutput         The diagnostics execution result." ] # [ doc = " @param[in]   aOutputMaxLen   The output buffer size." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_INVALID_ARGS       The command is supported but invalid arguments provided." ] # [ doc = " @retval  OT_ERROR_NONE               The command is successfully process." ] # [ doc = " @retval  OT_ERROR_NOT_IMPLEMENTED    The command is not supported." ] # [ doc = "" ] pub fn otDiagProcessCmd ( aInstance : * mut otInstance , aArgsLength : u8 , aArgs : * mut * mut :: std :: os :: raw :: c_char , aOutput : * mut :: std :: os :: raw :: c_char , aOutputMaxLen : size_t ) -> otError ; } extern "C" { # [ doc = " This function processes a factory diagnostics command line." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance       A pointer to an OpenThread instance." ] # [ doc = " @param[in]   aString         A NULL-terminated input string." ] # [ doc = " @param[out]  aOutput         The diagnostics execution result." ] # [ doc = " @param[in]   aOutputMaxLen   The output buffer size." ] # [ doc = "" ] pub fn otDiagProcessCmdLine ( aInstance : * mut otInstance , aString : * const :: std :: os :: raw :: c_char , aOutput : * mut :: std :: os :: raw :: c_char , aOutputMaxLen : size_t ) ; } extern "C" { # [ doc = " This function indicates whether or not the factory diagnostics mode is enabled." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval TRUE if factory diagnostics mode is enabled" ] # [ doc = " @retval FALSE if factory diagnostics mode is disabled." ] # [ doc = "" ] pub fn otDiagIsEnabled ( aInstance : * mut otInstance ) -> bool ; } # [ doc = " This structure implements DNS Query parameters." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otDnsQuery { # [ doc = "< Identifies hostname to be found. It shall not change during resolving." ] pub mHostname : * const :: std :: os :: raw :: c_char , # [ doc = "< A reference to the message info related with DNS Server." ] pub mMessageInfo : * const otMessageInfo , # [ doc = "< If cleared, it directs name server to pursue the query recursively." ] pub mNoRecursion : bool , } # [ test ] fn bindgen_test_layout_otDnsQuery ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otDnsQuery > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( otDnsQuery ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otDnsQuery > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otDnsQuery ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otDnsQuery > ( ) ) ) . mHostname as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otDnsQuery ) , "::" , stringify ! ( mHostname ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otDnsQuery > ( ) ) ) . mMessageInfo as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otDnsQuery ) , "::" , stringify ! ( mMessageInfo ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otDnsQuery > ( ) ) ) . mNoRecursion as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otDnsQuery ) , "::" , stringify ! ( mNoRecursion ) ) ) ; } # [ doc = " This function pointer is called when a DNS response is received." ] # [ doc = "" ] # [ doc = " @param[in]  aContext   A pointer to application-specific context." ] # [ doc = " @param[in]  aHostname  Identifies hostname related with DNS response." ] # [ doc = " @param[in]  aAddress   A pointer to the IPv6 address received in DNS response. May be null." ] # [ doc = " @param[in]  aTtl       Specifies the maximum time in seconds that the resource record may be cached." ] # [ doc = " @param[in]  aResult    A result of the DNS transaction." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE              A response was received successfully and IPv6 address is provided" ] # [ doc = "                                     in @p aAddress." ] # [ doc = " @retval  OT_ERROR_ABORT             A DNS transaction was aborted by stack." ] # [ doc = " @retval  OT_ERROR_RESPONSE_TIMEOUT  No DNS response has been received within timeout." ] # [ doc = " @retval  OT_ERROR_NOT_FOUND         A response was received but no IPv6 address has been found." ] # [ doc = " @retval  OT_ERROR_FAILED            A response was received but status code is different than success." ] # [ doc = "" ] pub type otDnsResponseHandler = :: std :: option :: Option < unsafe extern "C" fn ( aContext : * mut :: std :: os :: raw :: c_void , aHostname : * const :: std :: os :: raw :: c_char , aAddress : * const otIp6Address , aTtl : u32 , aResult : otError ) > ; extern "C" { # [ doc = " This function sends a DNS query for AAAA (IPv6) record." ] # [ doc = "" ] # [ doc = " This function is available only if feature `OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE` is enabled." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aQuery      A pointer to specify DNS query parameters." ] # [ doc = " @param[in]  aHandler    A function pointer that shall be called on response reception or time-out." ] # [ doc = " @param[in]  aContext    A pointer to arbitrary context information." ] # [ doc = "" ] pub fn otDnsClientQuery ( aInstance : * mut otInstance , aQuery : * const otDnsQuery , aHandler : otDnsResponseHandler , aContext : * mut :: std :: os :: raw :: c_void ) -> otError ; } # [ doc = " Function pointer used to set external CAlloc function for OpenThread." ] # [ doc = "" ] # [ doc = " @param[in]   aCount  Number of allocate units." ] # [ doc = " @param[in]   aSize   Unit size in bytes." ] # [ doc = "" ] # [ doc = " @returns A pointer to the allocated memory." ] # [ doc = "" ] # [ doc = " @retval  NULL    Indicates not enough memory." ] # [ doc = "" ] pub type otHeapCAllocFn = :: std :: option :: Option < unsafe extern "C" fn ( aCount : size_t , aSize : size_t ) -> * mut :: std :: os :: raw :: c_void > ; # [ doc = " Function pointer used to set external Free function for OpenThread." ] # [ doc = "" ] # [ doc = " @param[in]   aPointer    A pointer to the memory to free." ] # [ doc = "" ] pub type otHeapFreeFn = :: std :: option :: Option < unsafe extern "C" fn ( aPointer : * mut :: std :: os :: raw :: c_void ) > ; extern "C" { # [ doc = " @note This API is deprecated and use of it is discouraged." ] # [ doc = "" ] pub fn otHeapCAlloc ( aCount : size_t , aSize : size_t ) -> * mut :: std :: os :: raw :: c_void ; } extern "C" { # [ doc = " @note This API is deprecated and use of it is discouraged." ] # [ doc = "" ] pub fn otHeapFree ( aPointer : * mut :: std :: os :: raw :: c_void ) ; } extern "C" { # [ doc = " This function sets the external heap CAlloc and Free" ] # [ doc = " functions to be used by the OpenThread stack." ] # [ doc = "" ] # [ doc = " This function must be used before invoking instance initialization." ] # [ doc = "" ] # [ doc = " @param[in]  aCAlloc  A pointer to external CAlloc function." ] # [ doc = " @param[in]  aFree    A pointer to external Free function." ] # [ doc = "" ] pub fn otHeapSetCAllocFree ( aCAlloc : otHeapCAllocFn , aFree : otHeapFreeFn ) ; } # [ doc = " @struct otIcmp6Header" ] # [ doc = "" ] # [ doc = " This structure represents an ICMPv6 header." ] # [ doc = "" ] # [ repr ( C , packed ) ] # [ derive ( Copy , Clone ) ] pub struct otIcmp6Header { # [ doc = "< Type" ] pub mType : u8 , # [ doc = "< Code" ] pub mCode : u8 , # [ doc = "< Checksum" ] pub mChecksum : u16 , # [ doc = "< Message-specific data" ] pub mData : otIcmp6Header__bindgen_ty_1 , } # [ repr ( C , packed ) ] # [ derive ( Copy , Clone ) ] pub union otIcmp6Header__bindgen_ty_1 { pub m8 : [ u8 ; 4usize ] , pub m16 : [ u16 ; 2usize ] , pub m32 : [ u32 ; 1usize ] , _bindgen_union_align : [ u8 ; 4usize ] , } # [ test ] fn bindgen_test_layout_otIcmp6Header__bindgen_ty_1 ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otIcmp6Header__bindgen_ty_1 > ( ) , 4usize , concat ! ( "Size of: " , stringify ! ( otIcmp6Header__bindgen_ty_1 ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otIcmp6Header__bindgen_ty_1 > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otIcmp6Header__bindgen_ty_1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIcmp6Header__bindgen_ty_1 > ( ) ) ) . m8 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otIcmp6Header__bindgen_ty_1 ) , "::" , stringify ! ( m8 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIcmp6Header__bindgen_ty_1 > ( ) ) ) . m16 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otIcmp6Header__bindgen_ty_1 ) , "::" , stringify ! ( m16 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIcmp6Header__bindgen_ty_1 > ( ) ) ) . m32 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otIcmp6Header__bindgen_ty_1 ) , "::" , stringify ! ( m32 ) ) ) ; } # [ test ] fn bindgen_test_layout_otIcmp6Header ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otIcmp6Header > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( otIcmp6Header ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otIcmp6Header > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otIcmp6Header ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIcmp6Header > ( ) ) ) . mType as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otIcmp6Header ) , "::" , stringify ! ( mType ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIcmp6Header > ( ) ) ) . mCode as * const _ as usize } , 1usize , concat ! ( "Offset of field: " , stringify ! ( otIcmp6Header ) , "::" , stringify ! ( mCode ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIcmp6Header > ( ) ) ) . mChecksum as * const _ as usize } , 2usize , concat ! ( "Offset of field: " , stringify ! ( otIcmp6Header ) , "::" , stringify ! ( mChecksum ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIcmp6Header > ( ) ) ) . mData as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( otIcmp6Header ) , "::" , stringify ! ( mData ) ) ) ; } # [ doc = " This callback allows OpenThread to inform the application of a received ICMPv6 message." ] # [ doc = "" ] # [ doc = " @param[in]  aContext      A pointer to arbitrary context information." ] # [ doc = " @param[in]  aMessage      A pointer to the received message." ] # [ doc = " @param[in]  aMessageInfo  A pointer to message information associated with @p aMessage." ] # [ doc = " @param[in]  aIcmpHeader   A pointer to the received ICMPv6 header." ] # [ doc = "" ] pub type otIcmp6ReceiveCallback = :: std :: option :: Option < unsafe extern "C" fn ( aContext : * mut :: std :: os :: raw :: c_void , aMessage : * mut otMessage , aMessageInfo : * const otMessageInfo , aIcmpHeader : * const otIcmp6Header ) > ; # [ doc = " This structure implements ICMPv6 message handler." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otIcmp6Handler { # [ doc = "< The ICMPv6 received callback" ] pub mReceiveCallback : otIcmp6ReceiveCallback , # [ doc = "< A pointer to arbitrary context information." ] pub mContext : * mut :: std :: os :: raw :: c_void , # [ doc = "< A pointer to the next handler in the list." ] pub mNext : * mut otIcmp6Handler , } # [ test ] fn bindgen_test_layout_otIcmp6Handler ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otIcmp6Handler > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( otIcmp6Handler ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otIcmp6Handler > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otIcmp6Handler ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIcmp6Handler > ( ) ) ) . mReceiveCallback as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otIcmp6Handler ) , "::" , stringify ! ( mReceiveCallback ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIcmp6Handler > ( ) ) ) . mContext as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otIcmp6Handler ) , "::" , stringify ! ( mContext ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIcmp6Handler > ( ) ) ) . mNext as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otIcmp6Handler ) , "::" , stringify ! ( mNext ) ) ) ; } # [ doc = "< ICMPv6 Echo processing disabled" ] pub const otIcmp6EchoMode_OT_ICMP6_ECHO_HANDLER_DISABLED : otIcmp6EchoMode = 0 ; # [ doc = "< ICMPv6 Echo processing enabled only for unicast requests only" ] pub const otIcmp6EchoMode_OT_ICMP6_ECHO_HANDLER_UNICAST_ONLY : otIcmp6EchoMode = 1 ; # [ doc = "< ICMPv6 Echo processing enabled only for multicast requests only" ] pub const otIcmp6EchoMode_OT_ICMP6_ECHO_HANDLER_MULTICAST_ONLY : otIcmp6EchoMode = 2 ; # [ doc = "< ICMPv6 Echo processing enabled for unicast and multicast requests" ] pub const otIcmp6EchoMode_OT_ICMP6_ECHO_HANDLER_ALL : otIcmp6EchoMode = 3 ; # [ doc = " ICMPv6 Echo Reply Modes" ] # [ doc = "" ] pub type otIcmp6EchoMode = u32 ; extern "C" { # [ doc = " This function indicates whether or not ICMPv6 Echo processing is enabled." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_ICMP6_ECHO_HANDLER_DISABLED        ICMPv6 Echo processing is disabled." ] # [ doc = " @retval OT_ICMP6_ECHO_HANDLER_UNICAST_ONLY    ICMPv6 Echo processing enabled for unicast requests only" ] # [ doc = " @retval OT_ICMP6_ECHO_HANDLER_MULTICAST_ONLY  ICMPv6 Echo processing enabled for multicast requests only" ] # [ doc = " @retval OT_ICMP6_ECHO_HANDLER_ALL             ICMPv6 Echo processing enabled for unicast and multicast requests" ] # [ doc = "" ] pub fn otIcmp6GetEchoMode ( aInstance : * mut otInstance ) -> otIcmp6EchoMode ; } extern "C" { # [ doc = " This function sets whether or not ICMPv6 Echo processing is enabled." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aMode     The ICMPv6 Echo processing mode." ] # [ doc = "" ] pub fn otIcmp6SetEchoMode ( aInstance : * mut otInstance , aMode : otIcmp6EchoMode ) ; } extern "C" { # [ doc = " This function registers a handler to provide received ICMPv6 messages." ] # [ doc = "" ] # [ doc = " @note A handler structure @p aHandler has to be stored in persistent (static) memory." ] # [ doc = "       OpenThread does not make a copy of handler structure." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aHandler  A pointer to a handler containing callback that is called when" ] # [ doc = "                       an ICMPv6 message is received." ] # [ doc = "" ] pub fn otIcmp6RegisterHandler ( aInstance : * mut otInstance , aHandler : * mut otIcmp6Handler ) -> otError ; } extern "C" { # [ doc = " This function sends an ICMPv6 Echo Request via the Thread interface." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance     A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aMessage      A pointer to the message buffer containing the ICMPv6 payload." ] # [ doc = " @param[in]  aMessageInfo  A reference to message information associated with @p aMessage." ] # [ doc = " @param[in]  aIdentifier   An identifier to aid in matching Echo Replies to this Echo Request." ] # [ doc = "                           May be zero." ] # [ doc = "" ] pub fn otIcmp6SendEchoRequest ( aInstance : * mut otInstance , aMessage : * mut otMessage , aMessageInfo : * const otMessageInfo , aIdentifier : u16 ) -> otError ; } # [ doc = " This function pointer is called if signal jam detection is enabled and a jam is detected." ] # [ doc = "" ] # [ doc = " @param[in]  aJamState Current jam state (`true` if jam is detected, `false` otherwise)." ] # [ doc = " @param[in]  aContext  A pointer to application-specific context." ] # [ doc = "" ] pub type otJamDetectionCallback = :: std :: option :: Option < unsafe extern "C" fn ( aJamState : bool , aContext : * mut :: std :: os :: raw :: c_void ) > ; extern "C" { # [ doc = " Set the Jam Detection RSSI Threshold (in dBm)." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance       A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aRssiThreshold  The RSSI threshold." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE    Successfully set the threshold." ] # [ doc = "" ] pub fn otJamDetectionSetRssiThreshold ( aInstance : * mut otInstance , aRssiThreshold : i8 ) -> otError ; } extern "C" { # [ doc = " Get the Jam Detection RSSI Threshold (in dBm)." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The Jam Detection RSSI Threshold." ] pub fn otJamDetectionGetRssiThreshold ( aInstance : * mut otInstance ) -> i8 ; } extern "C" { # [ doc = " Set the Jam Detection Detection Window (in seconds)." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance            A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aWindow              The Jam Detection window (valid range is 1 to 63)" ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully set the window." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  The given input parameter not within valid range (1-63)" ] # [ doc = "" ] pub fn otJamDetectionSetWindow ( aInstance : * mut otInstance , aWindow : u8 ) -> otError ; } extern "C" { # [ doc = " Get the Jam Detection Detection Window (in seconds)." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance            A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The Jam Detection Window." ] # [ doc = "" ] pub fn otJamDetectionGetWindow ( aInstance : * mut otInstance ) -> u8 ; } extern "C" { # [ doc = " Set the Jam Detection Busy Period (in seconds)." ] # [ doc = "" ] # [ doc = " The number of aggregate seconds within the detection window where the RSSI must be above" ] # [ doc = " threshold to trigger detection." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance            A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aBusyPeriod          The Jam Detection busy period (should be non-zero and" ] # [ doc = "less than or equal to Jam Detection Window)" ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully set the window." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  The given input is not within the valid range." ] # [ doc = "" ] pub fn otJamDetectionSetBusyPeriod ( aInstance : * mut otInstance , aBusyPeriod : u8 ) -> otError ; } extern "C" { # [ doc = " Get the Jam Detection Busy Period (in seconds)" ] # [ doc = "" ] # [ doc = " @param[in]  aInstance            A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The Jam Detection Busy Period." ] # [ doc = "" ] pub fn otJamDetectionGetBusyPeriod ( aInstance : * mut otInstance ) -> u8 ; } extern "C" { # [ doc = " Start the jamming detection." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance            A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aCallback            A pointer to a function called to notify of jamming state change." ] # [ doc = " @param[in]  aContext             A pointer to application-specific context." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE         Successfully started the jamming detection." ] # [ doc = " @retval OT_ERROR_ALREADY      Jam detection has been started before." ] # [ doc = "" ] pub fn otJamDetectionStart ( aInstance : * mut otInstance , aCallback : otJamDetectionCallback , aContext : * mut :: std :: os :: raw :: c_void ) -> otError ; } extern "C" { # [ doc = " Stop the jamming detection." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance            A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE         Successfully stopped the jamming detection." ] # [ doc = " @retval OT_ERROR_ALREADY      Jam detection is already stopped." ] # [ doc = "" ] pub fn otJamDetectionStop ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " Get the Jam Detection Status (enabled/disabled)" ] # [ doc = "" ] # [ doc = " @param[in]  aInstance            A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The Jam Detection status (true if enabled, false otherwise)." ] # [ doc = "" ] pub fn otJamDetectionIsEnabled ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " Get the Jam Detection State" ] # [ doc = "" ] # [ doc = " @param[in]  aInstance            A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The Jam Detection state (`true` jam is detected, `false' otherwise)." ] # [ doc = "" ] pub fn otJamDetectionGetState ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " Get the current history bitmap." ] # [ doc = "" ] # [ doc = " This value provides information about current state of jamming detection" ] # [ doc = " module for monitoring/debugging purpose. It returns a 64-bit value where" ] # [ doc = " each bit corresponds to one second interval starting with bit 0 for the" ] # [ doc = " most recent interval and bit 63 for the oldest intervals (63 sec earlier)." ] # [ doc = " The bit is set to 1 if the jamming detection module observed/detected" ] # [ doc = " high signal level during the corresponding one second interval." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance            A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The current history bitmap." ] # [ doc = "" ] pub fn otJamDetectionGetHistoryBitmap ( aInstance : * mut otInstance ) -> u64 ; } pub const otJoinerState_OT_JOINER_STATE_IDLE : otJoinerState = 0 ; pub const otJoinerState_OT_JOINER_STATE_DISCOVER : otJoinerState = 1 ; pub const otJoinerState_OT_JOINER_STATE_CONNECT : otJoinerState = 2 ; pub const otJoinerState_OT_JOINER_STATE_CONNECTED : otJoinerState = 3 ; pub const otJoinerState_OT_JOINER_STATE_ENTRUST : otJoinerState = 4 ; pub const otJoinerState_OT_JOINER_STATE_JOINED : otJoinerState = 5 ; # [ doc = " This enumeration defines the Joiner State." ] # [ doc = "" ] pub type otJoinerState = u32 ; # [ doc = " This function pointer is called to notify the completion of a join operation." ] # [ doc = "" ] # [ doc = " @param[in]  aError    OT_ERROR_NONE if the join process succeeded." ] # [ doc = "                       OT_ERROR_SECURITY if the join process failed due to security credentials." ] # [ doc = "                       OT_ERROR_NOT_FOUND if no joinable network was discovered." ] # [ doc = "                       OT_ERROR_RESPONSE_TIMEOUT if a response timed out." ] # [ doc = " @param[in]  aContext  A pointer to application-specific context." ] # [ doc = "" ] pub type otJoinerCallback = :: std :: option :: Option < unsafe extern "C" fn ( aError : otError , aContext : * mut :: std :: os :: raw :: c_void ) > ; extern "C" { # [ doc = " This function enables the Thread Joiner role." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance         A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aPskd             A pointer to the PSKd." ] # [ doc = " @param[in]  aProvisioningUrl  A pointer to the Provisioning URL (may be NULL)." ] # [ doc = " @param[in]  aVendorName       A pointer to the Vendor Name (may be NULL)." ] # [ doc = " @param[in]  aVendorModel      A pointer to the Vendor Model (may be NULL)." ] # [ doc = " @param[in]  aVendorSwVersion  A pointer to the Vendor SW Version (may be NULL)." ] # [ doc = " @param[in]  aVendorData       A pointer to the Vendor Data (may be NULL)." ] # [ doc = " @param[in]  aCallback         A pointer to a function that is called when the join operation completes." ] # [ doc = " @param[in]  aContext          A pointer to application-specific context." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE              Successfully started the Commissioner role." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS      @p aPskd or @p aProvisioningUrl is invalid." ] # [ doc = "" ] pub fn otJoinerStart ( aInstance : * mut otInstance , aPskd : * const :: std :: os :: raw :: c_char , aProvisioningUrl : * const :: std :: os :: raw :: c_char , aVendorName : * const :: std :: os :: raw :: c_char , aVendorModel : * const :: std :: os :: raw :: c_char , aVendorSwVersion : * const :: std :: os :: raw :: c_char , aVendorData : * const :: std :: os :: raw :: c_char , aCallback : otJoinerCallback , aContext : * mut :: std :: os :: raw :: c_void ) -> otError ; } extern "C" { # [ doc = " This function disables the Thread Joiner role." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] pub fn otJoinerStop ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " This function returns the Joiner State." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_JOINER_STATE_IDLE" ] # [ doc = " @retval OT_JOINER_STATE_DISCOVER" ] # [ doc = " @retval OT_JOINER_STATE_CONNECT" ] # [ doc = " @retval OT_JOINER_STATE_CONNECTED" ] # [ doc = " @retval OT_JOINER_STATE_ENTRUST" ] # [ doc = " @retval OT_JOINER_STATE_JOINED" ] # [ doc = "" ] pub fn otJoinerGetState ( aInstance : * mut otInstance ) -> otJoinerState ; } extern "C" { # [ doc = " Get the Joiner ID." ] # [ doc = "" ] # [ doc = " Joiner ID is the first 64 bits of the result of computing SHA-256 over factory-assigned" ] # [ doc = " IEEE EUI-64, which is used as IEEE 802.15.4 Extended Address during commissioning process." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance  A pointer to the OpenThread instance." ] # [ doc = " @param[out]  aJoinerId  A pointer to where the Joiner ID is placed." ] # [ doc = "" ] pub fn otJoinerGetId ( aInstance : * mut otInstance , aJoinerId : * mut otExtAddress ) ; } pub type otMacFilterIterator = u8 ; # [ doc = "< Address filter is disabled." ] pub const otMacFilterAddressMode_OT_MAC_FILTER_ADDRESS_MODE_DISABLED : otMacFilterAddressMode = 0 ; # [ doc = "< Whitelist address filter mode is enabled." ] pub const otMacFilterAddressMode_OT_MAC_FILTER_ADDRESS_MODE_WHITELIST : otMacFilterAddressMode = 1 ; # [ doc = "< Blacklist address filter mode is enabled." ] pub const otMacFilterAddressMode_OT_MAC_FILTER_ADDRESS_MODE_BLACKLIST : otMacFilterAddressMode = 2 ; # [ doc = " Defines address mode of the mac filter." ] # [ doc = "" ] pub type otMacFilterAddressMode = u32 ; # [ doc = " This structure represents a Mac Filter entry." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otMacFilterEntry { # [ doc = "< IEEE 802.15.4 Extended Address" ] pub mExtAddress : otExtAddress , # [ doc = "< Received signal strength" ] pub mRssIn : i8 , } # [ test ] fn bindgen_test_layout_otMacFilterEntry ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otMacFilterEntry > ( ) , 9usize , concat ! ( "Size of: " , stringify ! ( otMacFilterEntry ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otMacFilterEntry > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otMacFilterEntry ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacFilterEntry > ( ) ) ) . mExtAddress as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otMacFilterEntry ) , "::" , stringify ! ( mExtAddress ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacFilterEntry > ( ) ) ) . mRssIn as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otMacFilterEntry ) , "::" , stringify ! ( mRssIn ) ) ) ; } # [ doc = " This structure represents the MAC layer counters." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otMacCounters { # [ doc = " The total number of unique MAC frame transmission requests." ] # [ doc = "" ] # [ doc = " Note that this counter is incremented for each MAC transmission request only by one," ] # [ doc = " regardless of the amount of CCA failures, CSMA-CA attempts, or retransmissions." ] # [ doc = "" ] # [ doc = " This increment rule applies to the following counters:" ] # [ doc = "   - @p mTxUnicast" ] # [ doc = "   - @p mTxBroadcast" ] # [ doc = "   - @p mTxAckRequested" ] # [ doc = "   - @p mTxNoAckRequested" ] # [ doc = "   - @p mTxData" ] # [ doc = "   - @p mTxDataPoll" ] # [ doc = "   - @p mTxBeacon" ] # [ doc = "   - @p mTxBeaconRequest" ] # [ doc = "   - @p mTxOther" ] # [ doc = "   - @p mTxErrAbort" ] # [ doc = "   - @p mTxErrBusyChannel" ] # [ doc = "" ] # [ doc = " The following equations are valid:" ] # [ doc = "   - @p mTxTotal = @p mTxUnicast + @p mTxBroadcast" ] # [ doc = "   - @p mTxTotal = @p mTxAckRequested + @p mTxNoAckRequested" ] # [ doc = "   - @p mTxTotal = @p mTxData + @p mTxDataPoll + @p mTxBeacon + @p mTxBeaconRequest + @p mTxOther" ] # [ doc = "" ] pub mTxTotal : u32 , # [ doc = " The total number of unique unicast MAC frame transmission requests." ] # [ doc = "" ] pub mTxUnicast : u32 , # [ doc = " The total number of unique broadcast MAC frame transmission requests." ] # [ doc = "" ] pub mTxBroadcast : u32 , # [ doc = " The total number of unique MAC frame transmission requests with requested acknowledgment." ] # [ doc = "" ] pub mTxAckRequested : u32 , # [ doc = " The total number of unique MAC frame transmission requests that were acked." ] # [ doc = "" ] pub mTxAcked : u32 , # [ doc = " The total number of unique MAC frame transmission requests without requested acknowledgment." ] # [ doc = "" ] pub mTxNoAckRequested : u32 , # [ doc = " The total number of unique MAC Data frame transmission requests." ] # [ doc = "" ] pub mTxData : u32 , # [ doc = " The total number of unique MAC Data Poll frame transmission requests." ] # [ doc = "" ] pub mTxDataPoll : u32 , # [ doc = " The total number of unique MAC Beacon frame transmission requests." ] # [ doc = "" ] pub mTxBeacon : u32 , # [ doc = " The total number of unique MAC Beacon Request frame transmission requests." ] # [ doc = "" ] pub mTxBeaconRequest : u32 , # [ doc = " The total number of unique other MAC frame transmission requests." ] # [ doc = "" ] # [ doc = " This counter is currently used for counting out-of-band frames." ] # [ doc = "" ] pub mTxOther : u32 , # [ doc = " The total number of MAC retransmission attempts." ] # [ doc = "" ] # [ doc = " Note that this counter is incremented by one for each retransmission attempt that may be" ] # [ doc = " triggered by lack of acknowledgement, CSMA/CA failure, or other type of transmission error." ] # [ doc = " The @p mTxRetry counter is incremented both for unicast and broadcast MAC frames." ] # [ doc = "" ] # [ doc = " Modify the following configuration parameters to control the amount of retransmissions in the system:" ] # [ doc = "" ] # [ doc = " - OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_DIRECT" ] # [ doc = " - OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_INDIRECT" ] # [ doc = " - OPENTHREAD_CONFIG_MAC_TX_NUM_BCAST" ] # [ doc = " - OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT" ] # [ doc = " - OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_INDIRECT" ] # [ doc = "" ] # [ doc = " Currently, this counter is invalid if the platform's radio driver capability includes" ] # [ doc = " @ref OT_RADIO_CAPS_TRANSMIT_RETRIES." ] # [ doc = "" ] pub mTxRetry : u32 , # [ doc = " The total number of unique MAC transmission packets that meet maximal retry limit for direct packets." ] # [ doc = "" ] pub mTxDirectMaxRetryExpiry : u32 , # [ doc = " The total number of unique MAC transmission packets that meet maximal retry limit for indirect packets." ] # [ doc = "" ] pub mTxIndirectMaxRetryExpiry : u32 , # [ doc = " The total number of CCA failures." ] # [ doc = "" ] # [ doc = " The meaning of this counter can be different and it depends on the platform's radio driver capabilities." ] # [ doc = "" ] # [ doc = " If @ref OT_RADIO_CAPS_CSMA_BACKOFF is enabled, this counter represents the total number of full CSMA/CA" ] # [ doc = " failed attempts and it is incremented by one also for each retransmission (in case of a CSMA/CA fail)." ] # [ doc = "" ] # [ doc = " If @ref OT_RADIO_CAPS_TRANSMIT_RETRIES is enabled, this counter represents the total number of full CSMA/CA" ] # [ doc = " failed attempts and it is incremented by one for each individual data frame request (regardless of the" ] # [ doc = " amount of retransmissions)." ] # [ doc = "" ] pub mTxErrCca : u32 , # [ doc = " The total number of unique MAC transmission request failures cause by an abort error." ] # [ doc = "" ] pub mTxErrAbort : u32 , # [ doc = " The total number of unique MAC transmission requests failures caused by a busy channel (a CSMA/CA fail)." ] # [ doc = "" ] pub mTxErrBusyChannel : u32 , # [ doc = " The total number of received frames." ] # [ doc = "" ] # [ doc = " This counter counts all frames reported by the platform's radio driver, including frames" ] # [ doc = " that were dropped, for example because of an FCS error." ] # [ doc = "" ] pub mRxTotal : u32 , # [ doc = " The total number of unicast frames received." ] # [ doc = "" ] pub mRxUnicast : u32 , # [ doc = " The total number of broadcast frames received." ] # [ doc = "" ] pub mRxBroadcast : u32 , # [ doc = " The total number of MAC Data frames received." ] # [ doc = "" ] pub mRxData : u32 , # [ doc = " The total number of MAC Data Poll frames received." ] # [ doc = "" ] pub mRxDataPoll : u32 , # [ doc = " The total number of MAC Beacon frames received." ] # [ doc = "" ] pub mRxBeacon : u32 , # [ doc = " The total number of MAC Beacon Request frames received." ] # [ doc = "" ] pub mRxBeaconRequest : u32 , # [ doc = " The total number of other types of frames received." ] # [ doc = "" ] pub mRxOther : u32 , # [ doc = " The total number of frames dropped by MAC Filter module, for example received from blacklisted node." ] # [ doc = "" ] pub mRxAddressFiltered : u32 , # [ doc = " The total number of frames dropped by destination address check, for example received frame for other node." ] # [ doc = "" ] pub mRxDestAddrFiltered : u32 , # [ doc = " The total number of frames dropped due to duplication, that is when the frame has been already received." ] # [ doc = "" ] # [ doc = " This counter may be incremented, for example when ACK frame generated by the receiver hasn't reached" ] # [ doc = " transmitter node which performed retransmission." ] # [ doc = "" ] pub mRxDuplicated : u32 , # [ doc = " The total number of frames dropped because of missing or malformed content." ] # [ doc = "" ] pub mRxErrNoFrame : u32 , # [ doc = " The total number of frames dropped due to unknown neighbor." ] # [ doc = "" ] pub mRxErrUnknownNeighbor : u32 , # [ doc = " The total number of frames dropped due to invalid source address." ] # [ doc = "" ] pub mRxErrInvalidSrcAddr : u32 , # [ doc = " The total number of frames dropped due to security error." ] # [ doc = "" ] # [ doc = " This counter may be incremented, for example when lower than expected Frame Counter is used" ] # [ doc = " to encrypt the frame." ] # [ doc = "" ] pub mRxErrSec : u32 , # [ doc = " The total number of frames dropped due to invalid FCS." ] # [ doc = "" ] pub mRxErrFcs : u32 , # [ doc = " The total number of frames dropped due to other error." ] # [ doc = "" ] pub mRxErrOther : u32 , } # [ test ] fn bindgen_test_layout_otMacCounters ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otMacCounters > ( ) , 136usize , concat ! ( "Size of: " , stringify ! ( otMacCounters ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otMacCounters > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( otMacCounters ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mTxTotal as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mTxTotal ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mTxUnicast as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mTxUnicast ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mTxBroadcast as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mTxBroadcast ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mTxAckRequested as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mTxAckRequested ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mTxAcked as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mTxAcked ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mTxNoAckRequested as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mTxNoAckRequested ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mTxData as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mTxData ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mTxDataPoll as * const _ as usize } , 28usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mTxDataPoll ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mTxBeacon as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mTxBeacon ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mTxBeaconRequest as * const _ as usize } , 36usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mTxBeaconRequest ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mTxOther as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mTxOther ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mTxRetry as * const _ as usize } , 44usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mTxRetry ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mTxDirectMaxRetryExpiry as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mTxDirectMaxRetryExpiry ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mTxIndirectMaxRetryExpiry as * const _ as usize } , 52usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mTxIndirectMaxRetryExpiry ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mTxErrCca as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mTxErrCca ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mTxErrAbort as * const _ as usize } , 60usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mTxErrAbort ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mTxErrBusyChannel as * const _ as usize } , 64usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mTxErrBusyChannel ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mRxTotal as * const _ as usize } , 68usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mRxTotal ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mRxUnicast as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mRxUnicast ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mRxBroadcast as * const _ as usize } , 76usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mRxBroadcast ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mRxData as * const _ as usize } , 80usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mRxData ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mRxDataPoll as * const _ as usize } , 84usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mRxDataPoll ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mRxBeacon as * const _ as usize } , 88usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mRxBeacon ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mRxBeaconRequest as * const _ as usize } , 92usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mRxBeaconRequest ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mRxOther as * const _ as usize } , 96usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mRxOther ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mRxAddressFiltered as * const _ as usize } , 100usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mRxAddressFiltered ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mRxDestAddrFiltered as * const _ as usize } , 104usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mRxDestAddrFiltered ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mRxDuplicated as * const _ as usize } , 108usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mRxDuplicated ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mRxErrNoFrame as * const _ as usize } , 112usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mRxErrNoFrame ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mRxErrUnknownNeighbor as * const _ as usize } , 116usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mRxErrUnknownNeighbor ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mRxErrInvalidSrcAddr as * const _ as usize } , 120usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mRxErrInvalidSrcAddr ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mRxErrSec as * const _ as usize } , 124usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mRxErrSec ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mRxErrFcs as * const _ as usize } , 128usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mRxErrFcs ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMacCounters > ( ) ) ) . mRxErrOther as * const _ as usize } , 132usize , concat ! ( "Offset of field: " , stringify ! ( otMacCounters ) , "::" , stringify ! ( mRxErrOther ) ) ) ; } # [ doc = " This structure represents a received IEEE 802.15.4 Beacon." ] # [ doc = "" ] # [ repr ( C ) ] # [ repr ( align ( 4 ) ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otActiveScanResult { # [ doc = "< IEEE 802.15.4 Extended Address" ] pub mExtAddress : otExtAddress , # [ doc = "< Thread Network Name" ] pub mNetworkName : otNetworkName , # [ doc = "< Thread Extended PAN ID" ] pub mExtendedPanId : otExtendedPanId , # [ doc = "< Steering Data" ] pub mSteeringData : otSteeringData , # [ doc = "< IEEE 802.15.4 PAN ID" ] pub mPanId : u16 , # [ doc = "< Joiner UDP Port" ] pub mJoinerUdpPort : u16 , # [ doc = "< IEEE 802.15.4 Channel" ] pub mChannel : u8 , # [ doc = "< RSSI (dBm)" ] pub mRssi : i8 , # [ doc = "< LQI" ] pub mLqi : u8 , pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > , pub __bindgen_padding_0 : u16 , } # [ test ] fn bindgen_test_layout_otActiveScanResult ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otActiveScanResult > ( ) , 60usize , concat ! ( "Size of: " , stringify ! ( otActiveScanResult ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otActiveScanResult > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( otActiveScanResult ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otActiveScanResult > ( ) ) ) . mExtAddress as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otActiveScanResult ) , "::" , stringify ! ( mExtAddress ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otActiveScanResult > ( ) ) ) . mNetworkName as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otActiveScanResult ) , "::" , stringify ! ( mNetworkName ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otActiveScanResult > ( ) ) ) . mExtendedPanId as * const _ as usize } , 25usize , concat ! ( "Offset of field: " , stringify ! ( otActiveScanResult ) , "::" , stringify ! ( mExtendedPanId ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otActiveScanResult > ( ) ) ) . mSteeringData as * const _ as usize } , 33usize , concat ! ( "Offset of field: " , stringify ! ( otActiveScanResult ) , "::" , stringify ! ( mSteeringData ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otActiveScanResult > ( ) ) ) . mPanId as * const _ as usize } , 50usize , concat ! ( "Offset of field: " , stringify ! ( otActiveScanResult ) , "::" , stringify ! ( mPanId ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otActiveScanResult > ( ) ) ) . mJoinerUdpPort as * const _ as usize } , 52usize , concat ! ( "Offset of field: " , stringify ! ( otActiveScanResult ) , "::" , stringify ! ( mJoinerUdpPort ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otActiveScanResult > ( ) ) ) . mChannel as * const _ as usize } , 54usize , concat ! ( "Offset of field: " , stringify ! ( otActiveScanResult ) , "::" , stringify ! ( mChannel ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otActiveScanResult > ( ) ) ) . mRssi as * const _ as usize } , 55usize , concat ! ( "Offset of field: " , stringify ! ( otActiveScanResult ) , "::" , stringify ! ( mRssi ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otActiveScanResult > ( ) ) ) . mLqi as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( otActiveScanResult ) , "::" , stringify ! ( mLqi ) ) ) ; } impl otActiveScanResult { # [ inline ] pub fn mVersion ( & self ) -> :: std :: os :: raw :: c_uint { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 4u8 ) as u32 ) } } # [ inline ] pub fn set_mVersion ( & mut self , val : :: std :: os :: raw :: c_uint ) { unsafe { let val : u32 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 4u8 , val as u64 ) } } # [ inline ] pub fn mIsNative ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 4usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsNative ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 4usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mIsJoinable ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 5usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsJoinable ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 5usize , 1u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( mVersion : :: std :: os :: raw :: c_uint , mIsNative : bool , mIsJoinable : bool ) -> __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 4u8 , { let mVersion : u32 = unsafe { :: std :: mem :: transmute ( mVersion ) } ; mVersion as u64 } ) ; __bindgen_bitfield_unit . set ( 4usize , 1u8 , { let mIsNative : u8 = unsafe { :: std :: mem :: transmute ( mIsNative ) } ; mIsNative as u64 } ) ; __bindgen_bitfield_unit . set ( 5usize , 1u8 , { let mIsJoinable : u8 = unsafe { :: std :: mem :: transmute ( mIsJoinable ) } ; mIsJoinable as u64 } ) ; __bindgen_bitfield_unit } } # [ doc = " This structure represents an energy scan result." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otEnergyScanResult { # [ doc = "< IEEE 802.15.4 Channel" ] pub mChannel : u8 , # [ doc = "< The max RSSI (dBm)" ] pub mMaxRssi : i8 , } # [ test ] fn bindgen_test_layout_otEnergyScanResult ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otEnergyScanResult > ( ) , 2usize , concat ! ( "Size of: " , stringify ! ( otEnergyScanResult ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otEnergyScanResult > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otEnergyScanResult ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otEnergyScanResult > ( ) ) ) . mChannel as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otEnergyScanResult ) , "::" , stringify ! ( mChannel ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otEnergyScanResult > ( ) ) ) . mMaxRssi as * const _ as usize } , 1usize , concat ! ( "Offset of field: " , stringify ! ( otEnergyScanResult ) , "::" , stringify ! ( mMaxRssi ) ) ) ; } # [ doc = " This function pointer is called during an IEEE 802.15.4 Active Scan when an IEEE 802.15.4 Beacon is received or" ] # [ doc = " the scan completes." ] # [ doc = "" ] # [ doc = " @param[in]  aResult   A valid pointer to the beacon information or NULL when the active scan completes." ] # [ doc = " @param[in]  aContext  A pointer to application-specific context." ] # [ doc = "" ] pub type otHandleActiveScanResult = :: std :: option :: Option < unsafe extern "C" fn ( aResult : * mut otActiveScanResult , aContext : * mut :: std :: os :: raw :: c_void ) > ; extern "C" { # [ doc = " This function starts an IEEE 802.15.4 Active Scan" ] # [ doc = "" ] # [ doc = " @param[in]  aInstance         A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aScanChannels     A bit vector indicating which channels to scan (e.g. OT_CHANNEL_11_MASK)." ] # [ doc = " @param[in]  aScanDuration     The time in milliseconds to spend scanning each channel." ] # [ doc = " @param[in]  aCallback         A pointer to a function called on receiving a beacon or scan completes." ] # [ doc = " @param[in]  aCallbackContext  A pointer to application-specific context." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE  Accepted the Active Scan request." ] # [ doc = " @retval OT_ERROR_BUSY  Already performing an Active Scan." ] # [ doc = "" ] pub fn otLinkActiveScan ( aInstance : * mut otInstance , aScanChannels : u32 , aScanDuration : u16 , aCallback : otHandleActiveScanResult , aCallbackContext : * mut :: std :: os :: raw :: c_void ) -> otError ; } extern "C" { # [ doc = " This function indicates whether or not an IEEE 802.15.4 Active Scan is currently in progress." ] # [ doc = "" ] # [ doc = " @param[in] aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns true if an IEEE 802.15.4 Active Scan is in progress, false otherwise." ] pub fn otLinkIsActiveScanInProgress ( aInstance : * mut otInstance ) -> bool ; } # [ doc = " This function pointer is called during an IEEE 802.15.4 Energy Scan when the result for a channel is ready or the" ] # [ doc = " scan completes." ] # [ doc = "" ] # [ doc = " @param[in]  aResult   A valid pointer to the energy scan result information or NULL when the energy scan completes." ] # [ doc = " @param[in]  aContext  A pointer to application-specific context." ] # [ doc = "" ] pub type otHandleEnergyScanResult = :: std :: option :: Option < unsafe extern "C" fn ( aResult : * mut otEnergyScanResult , aContext : * mut :: std :: os :: raw :: c_void ) > ; extern "C" { # [ doc = " This function starts an IEEE 802.15.4 Energy Scan" ] # [ doc = "" ] # [ doc = " @param[in]  aInstance         A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aScanChannels     A bit vector indicating on which channels to perform energy scan." ] # [ doc = " @param[in]  aScanDuration     The time in milliseconds to spend scanning each channel." ] # [ doc = " @param[in]  aCallback         A pointer to a function called to pass on scan result on indicate scan completion." ] # [ doc = " @param[in]  aCallbackContext  A pointer to application-specific context." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE  Accepted the Energy Scan request." ] # [ doc = " @retval OT_ERROR_BUSY  Could not start the energy scan." ] # [ doc = "" ] pub fn otLinkEnergyScan ( aInstance : * mut otInstance , aScanChannels : u32 , aScanDuration : u16 , aCallback : otHandleEnergyScanResult , aCallbackContext : * mut :: std :: os :: raw :: c_void ) -> otError ; } extern "C" { # [ doc = " This function indicates whether or not an IEEE 802.15.4 Energy Scan is currently in progress." ] # [ doc = "" ] # [ doc = " @param[in] aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns true if an IEEE 802.15.4 Energy Scan is in progress, false otherwise." ] # [ doc = "" ] pub fn otLinkIsEnergyScanInProgress ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " This function enqueues an IEEE 802.15.4 Data Request message for transmission." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully enqueued an IEEE 802.15.4 Data Request message." ] # [ doc = " @retval OT_ERROR_ALREADY        An IEEE 802.15.4 Data Request message is already enqueued." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  Device is not in rx-off-when-idle mode." ] # [ doc = " @retval OT_ERROR_NO_BUFS        Insufficient message buffers available." ] # [ doc = "" ] pub fn otLinkSendDataRequest ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " This function indicates whether or not an IEEE 802.15.4 MAC is in the transmit state." ] # [ doc = "" ] # [ doc = " MAC module is in the transmit state during CSMA/CA procedure, CCA, Data, Beacon or Data Request frame transmission" ] # [ doc = " and receiving an ACK of a transmitted frame. MAC module is not in the transmit state during transmission of an ACK" ] # [ doc = " frame or a Beacon Request frame." ] # [ doc = "" ] # [ doc = " @param[in] aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns true if an IEEE 802.15.4 MAC is in the transmit state, false otherwise." ] # [ doc = "" ] pub fn otLinkIsInTransmitState ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " This function enqueues an IEEE 802.15.4 out of band Frame for transmission." ] # [ doc = "" ] # [ doc = " An Out of Band frame is one that was generated outside of OpenThread." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in] aOobFrame  A pointer to the frame to transmit." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully scheduled the frame transmission." ] # [ doc = " @retval OT_ERROR_ALREADY        MAC layer is busy sending a previously requested frame." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  The MAC layer is not enabled." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS   The argument @p aOobFrame is NULL." ] # [ doc = "" ] pub fn otLinkOutOfBandTransmitRequest ( aInstance : * mut otInstance , aOobFrame : * mut otRadioFrame ) -> otError ; } extern "C" { # [ doc = " Get the IEEE 802.15.4 channel." ] # [ doc = "" ] # [ doc = " @param[in] aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The IEEE 802.15.4 channel." ] # [ doc = "" ] # [ doc = " @sa otLinkSetChannel" ] # [ doc = "" ] pub fn otLinkGetChannel ( aInstance : * mut otInstance ) -> u8 ; } extern "C" { # [ doc = " Set the IEEE 802.15.4 channel" ] # [ doc = "" ] # [ doc = " This function succeeds only when Thread protocols are disabled.  A successful call to this function invalidates the" ] # [ doc = " Active and Pending Operational Datasets in non-volatile memory." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aChannel    The IEEE 802.15.4 channel." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE           Successfully set the channel." ] # [ doc = " @retval  OT_ERROR_INVALID_ARGS   If @p aChannel is not in the range [11, 26] or is not in the supported channel mask." ] # [ doc = " @retval  OT_ERROR_INVALID_STATE  Thread protocols are enabled." ] # [ doc = "" ] # [ doc = " @sa otLinkGetChannel" ] # [ doc = "" ] pub fn otLinkSetChannel ( aInstance : * mut otInstance , aChannel : u8 ) -> otError ; } extern "C" { # [ doc = " Get the supported channel mask of MAC layer." ] # [ doc = "" ] # [ doc = " @param[in] aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The supported channel mask as `uint32_t` with bit 0 (lsb) mapping to channel 0, bit 1 to channel 1, so on." ] # [ doc = "" ] pub fn otLinkGetSupportedChannelMask ( aInstance : * mut otInstance ) -> u32 ; } extern "C" { # [ doc = " Set the supported channel mask of MAC layer." ] # [ doc = "" ] # [ doc = " This function succeeds only when Thread protocols are disabled." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance     A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aChannelMask  The supported channel mask (bit 0 or lsb mapping to channel 0, and so on)." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE           Successfully set the supported channel mask." ] # [ doc = " @retval  OT_ERROR_INVALID_STATE  Thread protocols are enabled." ] # [ doc = "" ] pub fn otLinkSetSupportedChannelMask ( aInstance : * mut otInstance , aChannelMask : u32 ) -> otError ; } extern "C" { # [ doc = " Get the IEEE 802.15.4 Extended Address." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to the IEEE 802.15.4 Extended Address." ] # [ doc = "" ] pub fn otLinkGetExtendedAddress ( aInstance : * mut otInstance ) -> * const otExtAddress ; } extern "C" { # [ doc = " This function sets the IEEE 802.15.4 Extended Address." ] # [ doc = "" ] # [ doc = " This function succeeds only when Thread protocols are disabled." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aExtAddress  A pointer to the IEEE 802.15.4 Extended Address." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully set the IEEE 802.15.4 Extended Address." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS   @p aExtAddress was NULL." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  Thread protocols are enabled." ] # [ doc = "" ] pub fn otLinkSetExtendedAddress ( aInstance : * mut otInstance , aExtAddress : * const otExtAddress ) -> otError ; } extern "C" { # [ doc = " Get the factory-assigned IEEE EUI-64." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance  A pointer to the OpenThread instance." ] # [ doc = " @param[out]  aEui64     A pointer to where the factory-assigned IEEE EUI-64 is placed." ] # [ doc = "" ] pub fn otLinkGetFactoryAssignedIeeeEui64 ( aInstance : * mut otInstance , aEui64 : * mut otExtAddress ) ; } extern "C" { # [ doc = " Get the IEEE 802.15.4 PAN ID." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The IEEE 802.15.4 PAN ID." ] # [ doc = "" ] # [ doc = " @sa otLinkSetPanId" ] # [ doc = "" ] pub fn otLinkGetPanId ( aInstance : * mut otInstance ) -> otPanId ; } extern "C" { # [ doc = " Set the IEEE 802.15.4 PAN ID." ] # [ doc = "" ] # [ doc = " This function succeeds only when Thread protocols are disabled.  A successful call to this function also invalidates" ] # [ doc = " the Active and Pending Operational Datasets in non-volatile memory." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aPanId       The IEEE 802.15.4 PAN ID." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully set the PAN ID." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS   If aPanId is not in the range [0, 65534]." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  Thread protocols are enabled." ] # [ doc = "" ] # [ doc = " @sa otLinkGetPanId" ] # [ doc = "" ] pub fn otLinkSetPanId ( aInstance : * mut otInstance , aPanId : otPanId ) -> otError ; } extern "C" { # [ doc = " Get the data poll period of sleepy end device." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns  The data poll period of sleepy end device in milliseconds." ] # [ doc = "" ] # [ doc = " @sa otLinkSetPollPeriod" ] # [ doc = "" ] pub fn otLinkGetPollPeriod ( aInstance : * mut otInstance ) -> u32 ; } extern "C" { # [ doc = " Set/clear user-specified/external data poll period for sleepy end device." ] # [ doc = "" ] # [ doc = " @note This function updates only poll period of sleepy end device. To update child timeout the function" ] # [ doc = "       `otThreadSetChildTimeout()` shall be called." ] # [ doc = "" ] # [ doc = " @note Minimal non-zero value should be `OPENTHREAD_CONFIG_MAC_MINIMUM_POLL_PERIOD` (10ms)." ] # [ doc = "       Or zero to clear user-specified poll period." ] # [ doc = "" ] # [ doc = " @note User-specified value should be no more than the maximal value 0x3FFFFFF ((1 << 26) - 1) allowed," ] # [ doc = " otherwise it would be clipped by the maximal value." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aPollPeriod  data poll period in milliseconds." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully set/cleared user-specified poll period." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS   If aPollPeriod is invalid." ] # [ doc = "" ] # [ doc = " @sa otLinkGetPollPeriod" ] # [ doc = "" ] pub fn otLinkSetPollPeriod ( aInstance : * mut otInstance , aPollPeriod : u32 ) -> otError ; } extern "C" { # [ doc = " Get the IEEE 802.15.4 Short Address." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to the IEEE 802.15.4 Short Address." ] # [ doc = "" ] pub fn otLinkGetShortAddress ( aInstance : * mut otInstance ) -> otShortAddress ; } extern "C" { # [ doc = " This method returns the maximum number of frame retries during direct transmission." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The maximum number of retries during direct transmission." ] # [ doc = "" ] pub fn otLinkGetMaxFrameRetriesDirect ( aInstance : * mut otInstance ) -> u8 ; } extern "C" { # [ doc = " This method sets the maximum number of frame retries during direct transmission." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance               A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aMaxFrameRetriesDirect  The maximum number of retries during direct transmission." ] # [ doc = "" ] pub fn otLinkSetMaxFrameRetriesDirect ( aInstance : * mut otInstance , aMaxFrameRetriesDirect : u8 ) ; } extern "C" { # [ doc = " This method returns the maximum number of frame retries during indirect transmission." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The maximum number of retries during indirect transmission." ] # [ doc = "" ] pub fn otLinkGetMaxFrameRetriesIndirect ( aInstance : * mut otInstance ) -> u8 ; } extern "C" { # [ doc = " This method sets the maximum number of frame retries during indirect transmission." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance                 A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aMaxFrameRetriesIndirect  The maximum number of retries during indirect transmission." ] # [ doc = "" ] pub fn otLinkSetMaxFrameRetriesIndirect ( aInstance : * mut otInstance , aMaxFrameRetriesIndirect : u8 ) ; } extern "C" { # [ doc = " This function gets the address mode of MAC filter." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns  the address mode." ] # [ doc = "" ] # [ doc = " @sa otLinkFilterSetAddressMode" ] # [ doc = " @sa otLinkFilterAddAddress" ] # [ doc = " @sa otLinkFilterRemoveAddress" ] # [ doc = " @sa otLinkFilterClearAddresses" ] # [ doc = " @sa otLinkFilterGetNextAddress" ] # [ doc = " @sa otLinkFilterAddRssIn" ] # [ doc = " @sa otLinkFilterRemoveRssIn" ] # [ doc = " @sa otLinkFilterClearRssIn" ] # [ doc = " @sa otLinkFilterGetNextRssIn" ] # [ doc = "" ] pub fn otLinkFilterGetAddressMode ( aInstance : * mut otInstance ) -> otMacFilterAddressMode ; } extern "C" { # [ doc = " This function sets the address mode of MAC filter." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aMode      The address mode to set." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully set the address mode." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS   @p aMode is not valid." ] # [ doc = "" ] # [ doc = " @sa otLinkFilterGetAddressMode" ] # [ doc = " @sa otLinkFilterAddAddress" ] # [ doc = " @sa otLinkFilterRemoveAddress" ] # [ doc = " @sa otLinkFilterClearAddresses" ] # [ doc = " @sa otLinkFilterGetNextAddress" ] # [ doc = " @sa otLinkFilterAddRssIn" ] # [ doc = " @sa otLinkFilterRemoveRssIn" ] # [ doc = " @sa otLinkFilterClearRssIn" ] # [ doc = " @sa otLinkFilterGetNextRssIn" ] # [ doc = "" ] pub fn otLinkFilterSetAddressMode ( aInstance : * mut otInstance , aMode : otMacFilterAddressMode ) -> otError ; } extern "C" { # [ doc = " This method adds an Extended Address to MAC filter." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aExtAddress  A reference to the Extended Address." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully added @p aExtAddress to MAC filter." ] # [ doc = " @retval OT_ERROR_ALREADY        If @p aExtAddress was already in MAC filter." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS   If @p aExtAddress is NULL." ] # [ doc = " @retval OT_ERROR_NO_BUFS        No available entry exists." ] # [ doc = "" ] # [ doc = " @sa otLinkFilterGetAddressMode" ] # [ doc = " @sa otLinkFilterSetAddressMode" ] # [ doc = " @sa otLinkFilterRemoveAddress" ] # [ doc = " @sa otLinkFilterClearAddresses" ] # [ doc = " @sa otLinkFilterGetNextAddress" ] # [ doc = " @sa otLinkFilterAddRssIn" ] # [ doc = " @sa otLinkFilterRemoveRssIn" ] # [ doc = " @sa otLinkFilterClearRssIn" ] # [ doc = " @sa otLinkFilterGetNextRssIn" ] # [ doc = "" ] pub fn otLinkFilterAddAddress ( aInstance : * mut otInstance , aExtAddress : * const otExtAddress ) -> otError ; } extern "C" { # [ doc = " This method removes an Extended Address from MAC filter." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aExtAddress  A reference to the Extended Address." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully removed @p aExtAddress from MAC filter." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS   If @p aExtAddress is NULL." ] # [ doc = " @retval OT_ERROR_NOT_FOUND      @p aExtAddress is not in MAC filter." ] # [ doc = "" ] # [ doc = " @sa otLinkFilterGetAddressMode" ] # [ doc = " @sa otLinkFilterSetAddressMode" ] # [ doc = " @sa otLinkFilterAddAddress" ] # [ doc = " @sa otLinkFilterClearAddresses" ] # [ doc = " @sa otLinkFilterGetNextAddress" ] # [ doc = " @sa otLinkFilterAddRssIn" ] # [ doc = " @sa otLinkFilterRemoveRssIn" ] # [ doc = " @sa otLinkFilterClearRssIn" ] # [ doc = " @sa otLinkFilterGetNextRssIn" ] # [ doc = "" ] pub fn otLinkFilterRemoveAddress ( aInstance : * mut otInstance , aExtAddress : * const otExtAddress ) -> otError ; } extern "C" { # [ doc = " This method clears all the Extended Addresses from MAC filter." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @sa otLinkFilterGetAddressMode" ] # [ doc = " @sa otLinkFilterSetAddressMode" ] # [ doc = " @sa otLinkFilterAddAddress" ] # [ doc = " @sa otLinkFilterRemoveAddress" ] # [ doc = " @sa otLinkFilterGetNextAddress" ] # [ doc = " @sa otLinkFilterAddRssIn" ] # [ doc = " @sa otLinkFilterRemoveRssIn" ] # [ doc = " @sa otLinkFilterClearRssIn" ] # [ doc = " @sa otLinkFilterGetNextRssIn" ] # [ doc = "" ] pub fn otLinkFilterClearAddresses ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " This method gets an in-use address filter entry." ] # [ doc = "" ] # [ doc = " @param[in]     aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[inout]  aIterator  A pointer to the MAC filter iterator context. To get the first in-use address filter entry," ] # [ doc = "                           it should be set to OT_MAC_FILTER_ITERATOR_INIT." ] # [ doc = " @param[out]    aEntry     A pointer to where the information is placed." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully retrieved an in-use address filter entry." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  If @p aIterator or @p aEntry is NULL." ] # [ doc = " @retval OT_ERROR_NOT_FOUND     No subsequent entry exists." ] # [ doc = "" ] # [ doc = " @sa otLinkFilterGetAddressMode" ] # [ doc = " @sa otLinkFilterSetAddressMode" ] # [ doc = " @sa otLinkFilterAddAddress" ] # [ doc = " @sa otLinkFilterRemoveAddress" ] # [ doc = " @sa otLinkFilterClearAddresses" ] # [ doc = " @sa otLinkFilterAddRssIn" ] # [ doc = " @sa otLinkFilterRemoveRssIn" ] # [ doc = " @sa otLinkFilterClearRssIn" ] # [ doc = " @sa otLinkFilterGetNextRssIn" ] # [ doc = "" ] pub fn otLinkFilterGetNextAddress ( aInstance : * mut otInstance , aIterator : * mut otMacFilterIterator , aEntry : * mut otMacFilterEntry ) -> otError ; } extern "C" { # [ doc = " This method sets the received signal strength (in dBm) for the messages from the Extended Address." ] # [ doc = " The default received signal strength for all received messages would be set if no Extended Address is specified." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aExtAddress  A pointer to the IEEE 802.15.4 Extended Address, or NULL to set the default received signal" ] # [ doc = "                          strength." ] # [ doc = " @param[in]  aRss         The received signal strength (in dBm) to set." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully set @p aRss for @p aExtAddress or set the default @p aRss for all" ] # [ doc = "                                 received messages if @p aExtAddress is NULL." ] # [ doc = " @retval OT_ERROR_NO_BUFS        No available entry exists." ] # [ doc = "" ] # [ doc = " @sa otLinkFilterGetAddressMode" ] # [ doc = " @sa otLinkFilterSetAddressMode" ] # [ doc = " @sa otLinkFilterAddAddress" ] # [ doc = " @sa otLinkFilterRemoveAddress" ] # [ doc = " @sa otLinkFilterClearAddresses" ] # [ doc = " @sa otLinkFilterGetNextAddress" ] # [ doc = " @sa otLinkFilterRemoveRssIn" ] # [ doc = " @sa otLinkFilterClearRssIn" ] # [ doc = " @sa otLinkFilterGetNextRssIn" ] # [ doc = "" ] pub fn otLinkFilterAddRssIn ( aInstance : * mut otInstance , aExtAddress : * const otExtAddress , aRss : i8 ) -> otError ; } extern "C" { # [ doc = " This method removes the received signal strength setting for the received messages from the Extended Address or" ] # [ doc = " removes the default received signal strength setting if no Extended Address is specified." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aExtAddress  A pointer to the IEEE 802.15.4 Extended Address, or NULL to reset the default received" ] # [ doc = "                          signal strength." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE       Successfully removed received signal strength setting for @p aExtAddress or" ] # [ doc = "                             removed the default received signal strength setting if @p aExtAddress is NULL." ] # [ doc = " @retval OT_ERROR_NOT_FOUND  @p aExtAddress is not in MAC filter if it is not NULL." ] # [ doc = "" ] # [ doc = " @sa otLinkFilterGetAddressMode" ] # [ doc = " @sa otLinkFilterSetAddressMode" ] # [ doc = " @sa otLinkFilterAddAddress" ] # [ doc = " @sa otLinkFilterRemoveAddress" ] # [ doc = " @sa otLinkFilterClearAddresses" ] # [ doc = " @sa otLinkFilterGetNextAddress" ] # [ doc = " @sa otLinkFilterAddRssIn" ] # [ doc = " @sa otLinkFilterClearRssIn" ] # [ doc = " @sa otLinkFilterGetNextRssIn" ] # [ doc = "" ] pub fn otLinkFilterRemoveRssIn ( aInstance : * mut otInstance , aExtAddress : * const otExtAddress ) -> otError ; } extern "C" { # [ doc = " This method clears all the received signal strength settings." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @sa otLinkFilterGetAddressMode" ] # [ doc = " @sa otLinkFilterSetAddressMode" ] # [ doc = " @sa otLinkFilterAddAddress" ] # [ doc = " @sa otLinkFilterRemoveAddress" ] # [ doc = " @sa otLinkFilterClearAddresses" ] # [ doc = " @sa otLinkFilterGetNextAddress" ] # [ doc = " @sa otLinkFilterAddRssIn" ] # [ doc = " @sa otLinkFilterRemoveRssIn" ] # [ doc = " @sa otLinkFilterGetNextRssIn" ] # [ doc = "" ] pub fn otLinkFilterClearRssIn ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " This method gets an in-use RssIn filter entry." ] # [ doc = "" ] # [ doc = " @param[in]     aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[inout]  aIterator  A reference to the MAC filter iterator context. To get the first in-use RssIn Filter entry," ] # [ doc = "                           it should be set to OT_MAC_FILTER_ITERATOR_INIT." ] # [ doc = " @param[out]    aEntry     A reference to where the information is placed. The last entry would have the extended" ] # [ doc = "                           address as all 0xff to indicate the default received signal strength if it was set." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully retrieved an in-use RssIn Filter entry." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  If @p aIterator or @p aEntry is NULL." ] # [ doc = " @retval OT_ERROR_NOT_FOUND     No subsequent entry exists." ] # [ doc = "" ] # [ doc = " @sa otLinkFilterGetAddressMode" ] # [ doc = " @sa otLinkFilterSetAddressMode" ] # [ doc = " @sa otLinkFilterAddAddress" ] # [ doc = " @sa otLinkFilterRemoveAddress" ] # [ doc = " @sa otLinkFilterClearAddresses" ] # [ doc = " @sa otLinkFilterGetNextAddress" ] # [ doc = " @sa otLinkFilterAddRssIn" ] # [ doc = " @sa otLinkFilterRemoveRssIn" ] # [ doc = " @sa otLinkFilterClearRssIn" ] # [ doc = "" ] pub fn otLinkFilterGetNextRssIn ( aInstance : * mut otInstance , aIterator : * mut otMacFilterIterator , aEntry : * mut otMacFilterEntry ) -> otError ; } extern "C" { # [ doc = " This method converts received signal strength to link quality." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aRss       The received signal strength value to be converted." ] # [ doc = "" ] # [ doc = " @return Link quality value mapping to @p aRss." ] # [ doc = "" ] pub fn otLinkConvertRssToLinkQuality ( aInstance : * mut otInstance , aRss : i8 ) -> u8 ; } extern "C" { # [ doc = " This method converts link quality to typical received signal strength." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance     A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aLinkQuality  LinkQuality value, should be in range [0,3]." ] # [ doc = "" ] # [ doc = " @return Typical platform received signal strength mapping to @p aLinkQuality." ] # [ doc = "" ] pub fn otLinkConvertLinkQualityToRss ( aInstance : * mut otInstance , aLinkQuality : u8 ) -> i8 ; } extern "C" { # [ doc = " This method gets histogram of retries for a single direct packet until success." ] # [ doc = "" ] # [ doc = " This function is valid when OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_ENABLE configuration is enabled." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance          A pointer to an OpenThread instance." ] # [ doc = " @param[out]  aNumberOfEntries   A pointer to where the size of returned histogram array is placed." ] # [ doc = "" ] # [ doc = " @returns     A pointer to the histogram of retries (in a form of an array)." ] # [ doc = "              The n-th element indicates that the packet has been sent with n-th retry." ] pub fn otLinkGetTxDirectRetrySuccessHistogram ( aInstance : * mut otInstance , aNumberOfEntries : * mut u8 ) -> * const u32 ; } extern "C" { # [ doc = " This method gets histogram of retries for a single indirect packet until success." ] # [ doc = "" ] # [ doc = " This function is valid when OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_ENABLE configuration is enabled." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance          A pointer to an OpenThread instance." ] # [ doc = " @param[out]  aNumberOfEntries   A pointer to where the size of returned histogram array is placed." ] # [ doc = "" ] # [ doc = " @returns     A pointer to the histogram of retries (in a form of an array)." ] # [ doc = "              The n-th element indicates that the packet has been sent with n-th retry." ] # [ doc = "" ] pub fn otLinkGetTxIndirectRetrySuccessHistogram ( aInstance : * mut otInstance , aNumberOfEntries : * mut u8 ) -> * const u32 ; } extern "C" { # [ doc = " This method clears histogram statistics for direct and indirect transmissions." ] # [ doc = "" ] # [ doc = " This function is valid when OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_ENABLE configuration is enabled." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance          A pointer to an OpenThread instance." ] # [ doc = "" ] pub fn otLinkResetTxRetrySuccessHistogram ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " Get the MAC layer counters." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to the MAC layer counters." ] # [ doc = "" ] pub fn otLinkGetCounters ( aInstance : * mut otInstance ) -> * const otMacCounters ; } extern "C" { # [ doc = " Reset the MAC layer counters." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] pub fn otLinkResetCounters ( aInstance : * mut otInstance ) ; } # [ doc = " This function pointer is called when an IEEE 802.15.4 frame is received." ] # [ doc = "" ] # [ doc = " @note This callback is called after FCS processing and @p aFrame may not contain the actual FCS that was received." ] # [ doc = "" ] # [ doc = " @note This callback is called before IEEE 802.15.4 security processing." ] # [ doc = "" ] # [ doc = " @param[in]  aFrame    A pointer to the received IEEE 802.15.4 frame." ] # [ doc = " @param[in]  aIsTx     Whether this frame is transmitted, not received." ] # [ doc = " @param[in]  aContext  A pointer to application-specific context." ] # [ doc = "" ] pub type otLinkPcapCallback = :: std :: option :: Option < unsafe extern "C" fn ( aFrame : * const otRadioFrame , aIsTx : bool , aContext : * mut :: std :: os :: raw :: c_void ) > ; extern "C" { # [ doc = " This function registers a callback to provide received raw IEEE 802.15.4 frames." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance         A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aPcapCallback     A pointer to a function that is called when receiving an IEEE 802.15.4 link frame or" ] # [ doc = "                               NULL to disable the callback." ] # [ doc = " @param[in]  aCallbackContext  A pointer to application-specific context." ] # [ doc = "" ] pub fn otLinkSetPcapCallback ( aInstance : * mut otInstance , aPcapCallback : otLinkPcapCallback , aCallbackContext : * mut :: std :: os :: raw :: c_void ) ; } extern "C" { # [ doc = " This function indicates whether or not promiscuous mode is enabled at the link layer." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval true   Promiscuous mode is enabled." ] # [ doc = " @retval false  Promiscuous mode is not enabled." ] # [ doc = "" ] pub fn otLinkIsPromiscuous ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " This function enables or disables the link layer promiscuous mode." ] # [ doc = "" ] # [ doc = " @note Promiscuous mode may only be enabled when the Thread interface is disabled." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance     A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aPromiscuous  true to enable promiscuous mode, or false otherwise." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully enabled promiscuous mode." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  Could not enable promiscuous mode because" ] # [ doc = "                                 the Thread interface is enabled." ] # [ doc = "" ] pub fn otLinkSetPromiscuous ( aInstance : * mut otInstance , aPromiscuous : bool ) -> otError ; } extern "C" { # [ doc = " This function returns the current CCA (Clear Channel Assessment) failure rate." ] # [ doc = "" ] # [ doc = " The rate is maintained over a window of (roughly) last `OPENTHREAD_CONFIG_CCA_FAILURE_RATE_AVERAGING_WINDOW`" ] # [ doc = " frame transmissions." ] # [ doc = "" ] # [ doc = " @returns The CCA failure rate with maximum value `0xffff` corresponding to 100% failure rate." ] # [ doc = "" ] pub fn otLinkGetCcaFailureRate ( aInstance : * mut otInstance ) -> u16 ; } extern "C" { # [ doc = " This function enables or disables the link layer." ] # [ doc = "" ] # [ doc = " @note The link layer may only be enabled / disabled when the Thread Interface is disabled." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance     A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aEnable       true to enable the link layer, or false otherwise." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully enabled / disabled the link layer." ] # [ doc = " @retval OT_ERROR_INVALID_STATE Could not disable the link layer because" ] # [ doc = "                                the Thread interface is enabled." ] # [ doc = "" ] pub fn otLinkSetEnabled ( aInstance : * mut otInstance , aEnable : bool ) -> otError ; } extern "C" { # [ doc = " This function indicates whether or not the link layer is enabled." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval true   Link layer is enabled." ] # [ doc = " @retval false  Link layer is not enabled." ] # [ doc = "" ] pub fn otLinkIsEnabled ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " This function enables/disables the raw link-layer." ] # [ doc = "" ] # [ doc = " @param[in] aInstance     A pointer to an OpenThread instance." ] # [ doc = " @param[in] aEnabled      TRUE to enable raw link-layer, FALSE otherwise." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE            If the enable state was successfully set." ] # [ doc = " @retval OT_ERROR_INVALID_STATE   If the OpenThread Ip6 interface is already enabled." ] # [ doc = "" ] pub fn otLinkRawSetEnable ( aInstance : * mut otInstance , aEnabled : bool ) -> otError ; } extern "C" { # [ doc = " This function indicates whether or not the raw link-layer is enabled." ] # [ doc = "" ] # [ doc = " @param[in] aInstance     A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval true     The raw link-layer is enabled." ] # [ doc = " @retval false    The raw link-layer is disabled." ] # [ doc = "" ] pub fn otLinkRawIsEnabled ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " This function gets the status of promiscuous mode." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval true     Promiscuous mode is enabled." ] # [ doc = " @retval false    Promiscuous mode is disabled." ] # [ doc = "" ] pub fn otLinkRawGetPromiscuous ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " This function enables or disables promiscuous mode." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aEnable      A value to enable or disable promiscuous mode." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE             If successful." ] # [ doc = " @retval OT_ERROR_INVALID_STATE    If the raw link-layer isn't enabled." ] # [ doc = "" ] pub fn otLinkRawSetPromiscuous ( aInstance : * mut otInstance , aEnable : bool ) -> otError ; } extern "C" { # [ doc = " Set the Short Address for address filtering." ] # [ doc = "" ] # [ doc = " @param[in] aInstance      A pointer to an OpenThread instance." ] # [ doc = " @param[in] aShortAddress  The IEEE 802.15.4 Short Address." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE             If successful." ] # [ doc = " @retval OT_ERROR_INVALID_STATE    If the raw link-layer isn't enabled." ] # [ doc = "" ] pub fn otLinkRawSetShortAddress ( aInstance : * mut otInstance , aShortAddress : u16 ) -> otError ; } extern "C" { # [ doc = " Transition the radio from Receive to Sleep." ] # [ doc = " Turn off the radio." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE             Successfully transitioned to Sleep." ] # [ doc = " @retval OT_ERROR_BUSY             The radio was transmitting" ] # [ doc = " @retval OT_ERROR_INVALID_STATE    The radio was disabled" ] # [ doc = "" ] pub fn otLinkRawSleep ( aInstance : * mut otInstance ) -> otError ; } # [ doc = " This function pointer on receipt of a IEEE 802.15.4 frame." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aFrame       A pointer to the received frame or NULL if the receive operation was aborted." ] # [ doc = " @param[in]  aError       OT_ERROR_NONE when successfully received a frame." ] # [ doc = "                          OT_ERROR_ABORT when reception was aborted and a frame was not received." ] # [ doc = "" ] pub type otLinkRawReceiveDone = :: std :: option :: Option < unsafe extern "C" fn ( aInstance : * mut otInstance , aFrame : * mut otRadioFrame , aError : otError ) > ; extern "C" { # [ doc = " Transitioning the radio from Sleep to Receive." ] # [ doc = " Turn on the radio." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aCallback    A pointer to a function called on receipt of a IEEE 802.15.4 frame." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE             Successfully transitioned to Receive." ] # [ doc = " @retval OT_ERROR_INVALID_STATE    The radio was disabled or transmitting." ] # [ doc = "" ] pub fn otLinkRawReceive ( aInstance : * mut otInstance , aCallback : otLinkRawReceiveDone ) -> otError ; } extern "C" { # [ doc = " The radio transitions from Transmit to Receive." ] # [ doc = " This method returns a pointer to the transmit buffer." ] # [ doc = "" ] # [ doc = " The caller forms the IEEE 802.15.4 frame in this buffer then calls otLinkRawTransmit()" ] # [ doc = " to request transmission." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to the transmit buffer or NULL if the raw link-layer isn't enabled." ] # [ doc = "" ] pub fn otLinkRawGetTransmitBuffer ( aInstance : * mut otInstance ) -> * mut otRadioFrame ; } # [ doc = " This function pointer on receipt of a IEEE 802.15.4 frame." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance        A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aFrame           A pointer to the frame that was transmitted." ] # [ doc = " @param[in]  aAckFrame        A pointer to the ACK frame." ] # [ doc = " @param[in]  aError           OT_ERROR_NONE when the frame was transmitted." ] # [ doc = "                              OT_ERROR_NO_ACK when the frame was transmitted but no ACK was received" ] # [ doc = "                              OT_ERROR_CHANNEL_ACCESS_FAILURE when the transmission could not take place" ] # [ doc = "due to activity on the channel." ] # [ doc = "                              OT_ERROR_ABORT when transmission was aborted for other reasons." ] # [ doc = "" ] pub type otLinkRawTransmitDone = :: std :: option :: Option < unsafe extern "C" fn ( aInstance : * mut otInstance , aFrame : * mut otRadioFrame , aAckFrame : * mut otRadioFrame , aError : otError ) > ; extern "C" { # [ doc = " This method begins the transmit sequence on the radio." ] # [ doc = "" ] # [ doc = " The caller must form the IEEE 802.15.4 frame in the buffer provided by otLinkRawGetTransmitBuffer() before" ] # [ doc = " requesting transmission.  The channel and transmit power are also included in the otRadioFrame structure." ] # [ doc = "" ] # [ doc = " The transmit sequence consists of:" ] # [ doc = " 1. Transitioning the radio to Transmit from Receive." ] # [ doc = " 2. Transmits the PSDU on the given channel and at the given transmit power." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aCallback    A pointer to a function called on completion of the transmission." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully transitioned to Transmit." ] # [ doc = " @retval OT_ERROR_INVALID_STATE The radio was not in the Receive state." ] # [ doc = "" ] pub fn otLinkRawTransmit ( aInstance : * mut otInstance , aCallback : otLinkRawTransmitDone ) -> otError ; } extern "C" { # [ doc = " Get the most recent RSSI measurement." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The RSSI in dBm when it is valid. 127 when RSSI is invalid." ] # [ doc = "" ] pub fn otLinkRawGetRssi ( aInstance : * mut otInstance ) -> i8 ; } extern "C" { # [ doc = " Get the radio capabilities." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The radio capability bit vector. The stack enables or disables some functions based on this value." ] # [ doc = "" ] pub fn otLinkRawGetCaps ( aInstance : * mut otInstance ) -> otRadioCaps ; } # [ doc = " This function pointer on receipt of a IEEE 802.15.4 frame." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance            A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aEnergyScanMaxRssi   The maximum RSSI encountered on the scanned channel." ] # [ doc = "" ] pub type otLinkRawEnergyScanDone = :: std :: option :: Option < unsafe extern "C" fn ( aInstance : * mut otInstance , aEnergyScanMaxRssi : i8 ) > ; extern "C" { # [ doc = " This method begins the energy scan sequence on the radio." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance        A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aScanChannel     The channel to perform the energy scan on." ] # [ doc = " @param[in]  aScanDuration    The duration, in milliseconds, for the channel to be scanned." ] # [ doc = " @param[in]  aCallback        A pointer to a function called on completion of a scanned channel." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE             Successfully started scanning the channel." ] # [ doc = " @retval OT_ERROR_NOT_IMPLEMENTED  The radio doesn't support energy scanning." ] # [ doc = " @retval OT_ERROR_INVALID_STATE    If the raw link-layer isn't enabled." ] # [ doc = "" ] pub fn otLinkRawEnergyScan ( aInstance : * mut otInstance , aScanChannel : u8 , aScanDuration : u16 , aCallback : otLinkRawEnergyScanDone ) -> otError ; } extern "C" { # [ doc = " Enable/Disable source match for frame pending." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aEnable      Enable/disable source match for frame pending." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE             If successful." ] # [ doc = " @retval OT_ERROR_INVALID_STATE    If the raw link-layer isn't enabled." ] # [ doc = "" ] pub fn otLinkRawSrcMatchEnable ( aInstance : * mut otInstance , aEnable : bool ) -> otError ; } extern "C" { # [ doc = " Adding short address to the source match table." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance        A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aShortAddress    The short address to be added." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE             Successfully added short address to the source match table." ] # [ doc = " @retval OT_ERROR_NO_BUFS          No available entry in the source match table." ] # [ doc = " @retval OT_ERROR_INVALID_STATE    If the raw link-layer isn't enabled." ] # [ doc = "" ] pub fn otLinkRawSrcMatchAddShortEntry ( aInstance : * mut otInstance , aShortAddress : u16 ) -> otError ; } extern "C" { # [ doc = " Adding extended address to the source match table." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance        A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aExtAddress      The extended address to be added." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE             Successfully added extended address to the source match table." ] # [ doc = " @retval OT_ERROR_NO_BUFS          No available entry in the source match table." ] # [ doc = " @retval OT_ERROR_INVALID_STATE    If the raw link-layer isn't enabled." ] # [ doc = "" ] pub fn otLinkRawSrcMatchAddExtEntry ( aInstance : * mut otInstance , aExtAddress : * const otExtAddress ) -> otError ; } extern "C" { # [ doc = " Removing short address to the source match table." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance        A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aShortAddress    The short address to be removed." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE             Successfully removed short address from the source match table." ] # [ doc = " @retval OT_ERROR_NO_ADDRESS       The short address is not in source match table." ] # [ doc = " @retval OT_ERROR_INVALID_STATE    If the raw link-layer isn't enabled." ] # [ doc = "" ] pub fn otLinkRawSrcMatchClearShortEntry ( aInstance : * mut otInstance , aShortAddress : u16 ) -> otError ; } extern "C" { # [ doc = " Removing extended address to the source match table of the radio." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance        A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aExtAddress      The extended address to be removed." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE             Successfully removed the extended address from the source match table." ] # [ doc = " @retval OT_ERROR_NO_ADDRESS       The extended address is not in source match table." ] # [ doc = " @retval OT_ERROR_INVALID_STATE    If the raw link-layer isn't enabled." ] # [ doc = "" ] pub fn otLinkRawSrcMatchClearExtEntry ( aInstance : * mut otInstance , aExtAddress : * const otExtAddress ) -> otError ; } extern "C" { # [ doc = " Removing all the short addresses from the source match table." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE             If successful." ] # [ doc = " @retval OT_ERROR_INVALID_STATE    If the raw link-layer isn't enabled." ] # [ doc = "" ] pub fn otLinkRawSrcMatchClearShortEntries ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " Removing all the extended addresses from the source match table." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE             If successful." ] # [ doc = " @retval OT_ERROR_INVALID_STATE    If the raw link-layer isn't enabled." ] # [ doc = "" ] pub fn otLinkRawSrcMatchClearExtEntries ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " Update MAC keys and key index." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]   aKeyIdMode   The key ID mode." ] # [ doc = " @param[in]   aKeyId       The key index." ] # [ doc = " @param[in]   aPrevKey     The previous MAC key." ] # [ doc = " @param[in]   aCurrKey     The current MAC key." ] # [ doc = " @param[in]   aNextKey     The next MAC key." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE             If successful." ] # [ doc = " @retval OT_ERROR_INVALID_STATE    If the raw link-layer isn't enabled." ] # [ doc = "" ] pub fn otLinkRawSetMacKey ( aInstance : * mut otInstance , aKeyIdMode : u8 , aKeyId : u8 , aPrevKey : * const otMacKey , aCurrKey : * const otMacKey , aNextKey : * const otMacKey ) -> otError ; } extern "C" { # [ doc = " This function returns the current log level." ] # [ doc = "" ] # [ doc = " If dynamic log level feature `OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE` is enabled, this function returns the" ] # [ doc = " currently set dynamic log level. Otherwise, this function returns the build-time configured log level." ] # [ doc = "" ] # [ doc = " @returns The log level." ] # [ doc = "" ] pub fn otLoggingGetLevel ( ) -> otLogLevel ; } extern "C" { # [ doc = " This function sets the log level." ] # [ doc = "" ] # [ doc = " @note This function requires `OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1`." ] # [ doc = "" ] # [ doc = " @param[in]  aLogLevel               The log level." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE            Successfully updated log level." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS    Log level value is invalid." ] # [ doc = "" ] pub fn otLoggingSetLevel ( aLogLevel : otLogLevel ) -> otError ; } extern "C" { # [ doc = " Initialize the NCP." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  The OpenThread instance structure." ] # [ doc = "" ] pub fn otNcpInit ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " @brief Send data to the host via a specific stream." ] # [ doc = "" ] # [ doc = " This function attempts to send the given data to the host" ] # [ doc = " using the given aStreamId. This is useful for reporting" ] # [ doc = " error messages, implementing debug/diagnostic consoles," ] # [ doc = " and potentially other types of datastreams." ] # [ doc = "" ] # [ doc = " The write either is accepted in its entirety or rejected." ] # [ doc = " Partial writes are not attempted." ] # [ doc = "" ] # [ doc = " @param[in]  aStreamId  A numeric identifier for the stream to write to." ] # [ doc = "                        If set to '0', will default to the debug stream." ] # [ doc = " @param[in]  aDataPtr   A pointer to the data to send on the stream." ] # [ doc = "                        If aDataLen is non-zero, this param MUST NOT be NULL." ] # [ doc = " @param[in]  aDataLen   The number of bytes of data from aDataPtr to send." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE         The data was queued for delivery to the host." ] # [ doc = " @retval OT_ERROR_BUSY         There are not enough resources to complete this" ] # [ doc = "                               request. This is usually a temporary condition." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS The given aStreamId was invalid." ] pub fn otNcpStreamWrite ( aStreamId : :: std :: os :: raw :: c_int , aDataPtr : * const u8 , aDataLen : :: std :: os :: raw :: c_int ) -> otError ; } extern "C" { # [ doc = " Writes OpenThread Log using `otNcpStreamWrite`." ] # [ doc = "" ] # [ doc = " @param[in]  aLogLevel   The log level." ] # [ doc = " @param[in]  aLogRegion  The log region." ] # [ doc = " @param[in]  aFormat     A pointer to the format string." ] # [ doc = " @param[in]  aArgs       va_list matching aFormat." ] pub fn otNcpPlatLogv ( aLogLevel : otLogLevel , aLogRegion : otLogRegion , aFormat : * const :: std :: os :: raw :: c_char , aArgs : * mut __va_list_tag ) ; } # [ doc = " Defines delegate (function pointer) type to control behavior of peek/poke operation." ] # [ doc = "" ] # [ doc = " This delegate function is called to decide whether to allow peek or poke of a specific memory region. It is used" ] # [ doc = " if NCP support for peek/poke commands is enabled." ] # [ doc = "" ] # [ doc = " @param[in] aAddress    Start address of memory region." ] # [ doc = " @param[in] aCount      Number of bytes to peek or poke." ] # [ doc = "" ] # [ doc = " @returns  TRUE to allow peek/poke of the given memory region, FALSE otherwise." ] # [ doc = "" ] pub type otNcpDelegateAllowPeekPoke = :: std :: option :: Option < unsafe extern "C" fn ( aAddress : u32 , aCount : u16 ) -> bool > ; extern "C" { # [ doc = " This method registers peek/poke delegate functions with NCP module." ] # [ doc = "" ] # [ doc = " The delegate functions are called by NCP module to decide whether to allow peek or poke of a specific memory region." ] # [ doc = " If the delegate pointer is set to NULL, it allows peek/poke operation for any address." ] # [ doc = "" ] # [ doc = " @param[in] aAllowPeekDelegate      Delegate function pointer for peek operation." ] # [ doc = " @param[in] aAllowPokeDelegate      Delegate function pointer for poke operation." ] # [ doc = "" ] pub fn otNcpRegisterPeekPokeDelagates ( aAllowPeekDelegate : otNcpDelegateAllowPeekPoke , aAllowPokeDelegate : otNcpDelegateAllowPeekPoke ) ; } # [ doc = " Defines handler (function pointer) type for starting legacy network" ] # [ doc = "" ] # [ doc = " Invoked to start the legacy network." ] # [ doc = "" ] pub type otNcpHandlerStartLegacy = :: std :: option :: Option < unsafe extern "C" fn ( ) > ; # [ doc = " Defines handler (function pointer) type for stopping legacy network" ] # [ doc = "" ] # [ doc = " Invoked to stop the legacy network." ] # [ doc = "" ] pub type otNcpHandlerStopLegacy = :: std :: option :: Option < unsafe extern "C" fn ( ) > ; # [ doc = " Defines handler (function pointer) type for initiating joining process." ] # [ doc = "" ] # [ doc = " @param[in] aExtAddress   A pointer to the extended address for the node to join" ] # [ doc = "                          or NULL if desired to join any neighboring node." ] # [ doc = "" ] # [ doc = " Invoked to initiate a legacy join procedure to any or a specific node." ] # [ doc = "" ] pub type otNcpHandlerJoinLegacyNode = :: std :: option :: Option < unsafe extern "C" fn ( aExtAddress : * const otExtAddress ) > ; # [ doc = " Defines handler (function pointer) type for setting the legacy ULA prefix." ] # [ doc = "" ] # [ doc = " @param[in] aUlaPrefix   A pointer to buffer containing the legacy ULA prefix." ] # [ doc = "" ] # [ doc = " Invoked to set the legacy ULA prefix." ] # [ doc = "" ] pub type otNcpHandlerSetLegacyUlaPrefix = :: std :: option :: Option < unsafe extern "C" fn ( aUlaPrefix : * const u8 ) > ; # [ doc = " Defines a struct containing all the legacy handlers (function pointers)." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otNcpLegacyHandlers { # [ doc = "< Start handler" ] pub mStartLegacy : otNcpHandlerStartLegacy , # [ doc = "< Stop handler" ] pub mStopLegacy : otNcpHandlerStopLegacy , # [ doc = "< Join handler" ] pub mJoinLegacyNode : otNcpHandlerJoinLegacyNode , # [ doc = "< Set ULA handler" ] pub mSetLegacyUlaPrefix : otNcpHandlerSetLegacyUlaPrefix , } # [ test ] fn bindgen_test_layout_otNcpLegacyHandlers ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otNcpLegacyHandlers > ( ) , 32usize , concat ! ( "Size of: " , stringify ! ( otNcpLegacyHandlers ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otNcpLegacyHandlers > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otNcpLegacyHandlers ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNcpLegacyHandlers > ( ) ) ) . mStartLegacy as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNcpLegacyHandlers ) , "::" , stringify ! ( mStartLegacy ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNcpLegacyHandlers > ( ) ) ) . mStopLegacy as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otNcpLegacyHandlers ) , "::" , stringify ! ( mStopLegacy ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNcpLegacyHandlers > ( ) ) ) . mJoinLegacyNode as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otNcpLegacyHandlers ) , "::" , stringify ! ( mJoinLegacyNode ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNcpLegacyHandlers > ( ) ) ) . mSetLegacyUlaPrefix as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( otNcpLegacyHandlers ) , "::" , stringify ! ( mSetLegacyUlaPrefix ) ) ) ; } extern "C" { # [ doc = " This callback is invoked by the legacy stack to notify that a new" ] # [ doc = " legacy node did join the network." ] # [ doc = "" ] # [ doc = " @param[in]   aExtAddr    A pointer to the extended address of the joined node." ] # [ doc = "" ] pub fn otNcpHandleLegacyNodeDidJoin ( aExtAddr : * const otExtAddress ) ; } extern "C" { # [ doc = " This callback is invoked by the legacy stack to notify that the" ] # [ doc = " legacy ULA prefix has changed." ] # [ doc = "" ] # [ doc = " @param[in]    aUlaPrefix  A pointer to the received ULA prefix." ] # [ doc = "" ] pub fn otNcpHandleDidReceiveNewLegacyUlaPrefix ( aUlaPrefix : * const u8 ) ; } extern "C" { # [ doc = " This method registers a set of legacy handlers with NCP." ] # [ doc = "" ] # [ doc = " The set of handlers provided by the struct @p aHandlers are used by" ] # [ doc = " NCP code to start/stop legacy network." ] # [ doc = " The @p aHandlers can be NULL to disable legacy support on NCP." ] # [ doc = " Individual handlers in the given handlers struct can also be NULL." ] # [ doc = "" ] # [ doc = " @param[in] aHandlers    A pointer to a handler struct." ] # [ doc = "" ] pub fn otNcpRegisterLegacyHandlers ( aHandlers : * const otNcpLegacyHandlers ) ; } # [ doc = "< The Thread stack is disabled." ] pub const otDeviceRole_OT_DEVICE_ROLE_DISABLED : otDeviceRole = 0 ; # [ doc = "< Not currently participating in a Thread network/partition." ] pub const otDeviceRole_OT_DEVICE_ROLE_DETACHED : otDeviceRole = 1 ; # [ doc = "< The Thread Child role." ] pub const otDeviceRole_OT_DEVICE_ROLE_CHILD : otDeviceRole = 2 ; # [ doc = "< The Thread Router role." ] pub const otDeviceRole_OT_DEVICE_ROLE_ROUTER : otDeviceRole = 3 ; # [ doc = "< The Thread Leader role." ] pub const otDeviceRole_OT_DEVICE_ROLE_LEADER : otDeviceRole = 4 ; # [ doc = " Represents a Thread device role." ] # [ doc = "" ] pub type otDeviceRole = u32 ; # [ doc = " This structure represents an MLE Link Mode configuration." ] # [ repr ( C , packed ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otLinkModeConfig { pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > , } # [ test ] fn bindgen_test_layout_otLinkModeConfig ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otLinkModeConfig > ( ) , 1usize , concat ! ( "Size of: " , stringify ! ( otLinkModeConfig ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otLinkModeConfig > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otLinkModeConfig ) ) ) ; } impl otLinkModeConfig { # [ inline ] pub fn mRxOnWhenIdle ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mRxOnWhenIdle ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mSecureDataRequests ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 1usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mSecureDataRequests ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 1usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mDeviceType ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 2usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mDeviceType ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 2usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mNetworkData ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 3usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mNetworkData ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 3usize , 1u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( mRxOnWhenIdle : bool , mSecureDataRequests : bool , mDeviceType : bool , mNetworkData : bool ) -> __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 1u8 , { let mRxOnWhenIdle : u8 = unsafe { :: std :: mem :: transmute ( mRxOnWhenIdle ) } ; mRxOnWhenIdle as u64 } ) ; __bindgen_bitfield_unit . set ( 1usize , 1u8 , { let mSecureDataRequests : u8 = unsafe { :: std :: mem :: transmute ( mSecureDataRequests ) } ; mSecureDataRequests as u64 } ) ; __bindgen_bitfield_unit . set ( 2usize , 1u8 , { let mDeviceType : u8 = unsafe { :: std :: mem :: transmute ( mDeviceType ) } ; mDeviceType as u64 } ) ; __bindgen_bitfield_unit . set ( 3usize , 1u8 , { let mNetworkData : u8 = unsafe { :: std :: mem :: transmute ( mNetworkData ) } ; mNetworkData as u64 } ) ; __bindgen_bitfield_unit } } # [ doc = " This structure holds diagnostic information for a neighboring Thread node" ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otNeighborInfo { # [ doc = "< IEEE 802.15.4 Extended Address" ] pub mExtAddress : otExtAddress , # [ doc = "< Time last heard" ] pub mAge : u32 , # [ doc = "< RLOC16" ] pub mRloc16 : u16 , # [ doc = "< Link Frame Counter" ] pub mLinkFrameCounter : u32 , # [ doc = "< MLE Frame Counter" ] pub mMleFrameCounter : u32 , # [ doc = "< Link Quality In" ] pub mLinkQualityIn : u8 , # [ doc = "< Average RSSI" ] pub mAverageRssi : i8 , # [ doc = "< Last observed RSSI" ] pub mLastRssi : i8 , # [ doc = "< Frame error rate (0xffff->100%). Requires error tracking feature." ] pub mFrameErrorRate : u16 , # [ doc = "< (IPv6) msg error rate (0xffff->100%). Requires error tracking feature." ] pub mMessageErrorRate : u16 , pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > , pub __bindgen_padding_0 : [ u8 ; 3usize ] , } # [ test ] fn bindgen_test_layout_otNeighborInfo ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otNeighborInfo > ( ) , 36usize , concat ! ( "Size of: " , stringify ! ( otNeighborInfo ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otNeighborInfo > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( otNeighborInfo ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNeighborInfo > ( ) ) ) . mExtAddress as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNeighborInfo ) , "::" , stringify ! ( mExtAddress ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNeighborInfo > ( ) ) ) . mAge as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otNeighborInfo ) , "::" , stringify ! ( mAge ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNeighborInfo > ( ) ) ) . mRloc16 as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( otNeighborInfo ) , "::" , stringify ! ( mRloc16 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNeighborInfo > ( ) ) ) . mLinkFrameCounter as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otNeighborInfo ) , "::" , stringify ! ( mLinkFrameCounter ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNeighborInfo > ( ) ) ) . mMleFrameCounter as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( otNeighborInfo ) , "::" , stringify ! ( mMleFrameCounter ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNeighborInfo > ( ) ) ) . mLinkQualityIn as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( otNeighborInfo ) , "::" , stringify ! ( mLinkQualityIn ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNeighborInfo > ( ) ) ) . mAverageRssi as * const _ as usize } , 25usize , concat ! ( "Offset of field: " , stringify ! ( otNeighborInfo ) , "::" , stringify ! ( mAverageRssi ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNeighborInfo > ( ) ) ) . mLastRssi as * const _ as usize } , 26usize , concat ! ( "Offset of field: " , stringify ! ( otNeighborInfo ) , "::" , stringify ! ( mLastRssi ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNeighborInfo > ( ) ) ) . mFrameErrorRate as * const _ as usize } , 28usize , concat ! ( "Offset of field: " , stringify ! ( otNeighborInfo ) , "::" , stringify ! ( mFrameErrorRate ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNeighborInfo > ( ) ) ) . mMessageErrorRate as * const _ as usize } , 30usize , concat ! ( "Offset of field: " , stringify ! ( otNeighborInfo ) , "::" , stringify ! ( mMessageErrorRate ) ) ) ; } impl otNeighborInfo { # [ inline ] pub fn mRxOnWhenIdle ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mRxOnWhenIdle ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mSecureDataRequest ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 1usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mSecureDataRequest ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 1usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mFullThreadDevice ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 2usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mFullThreadDevice ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 2usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mFullNetworkData ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 3usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mFullNetworkData ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 3usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mIsChild ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 4usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsChild ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 4usize , 1u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( mRxOnWhenIdle : bool , mSecureDataRequest : bool , mFullThreadDevice : bool , mFullNetworkData : bool , mIsChild : bool ) -> __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 1u8 , { let mRxOnWhenIdle : u8 = unsafe { :: std :: mem :: transmute ( mRxOnWhenIdle ) } ; mRxOnWhenIdle as u64 } ) ; __bindgen_bitfield_unit . set ( 1usize , 1u8 , { let mSecureDataRequest : u8 = unsafe { :: std :: mem :: transmute ( mSecureDataRequest ) } ; mSecureDataRequest as u64 } ) ; __bindgen_bitfield_unit . set ( 2usize , 1u8 , { let mFullThreadDevice : u8 = unsafe { :: std :: mem :: transmute ( mFullThreadDevice ) } ; mFullThreadDevice as u64 } ) ; __bindgen_bitfield_unit . set ( 3usize , 1u8 , { let mFullNetworkData : u8 = unsafe { :: std :: mem :: transmute ( mFullNetworkData ) } ; mFullNetworkData as u64 } ) ; __bindgen_bitfield_unit . set ( 4usize , 1u8 , { let mIsChild : u8 = unsafe { :: std :: mem :: transmute ( mIsChild ) } ; mIsChild as u64 } ) ; __bindgen_bitfield_unit } } pub type otNeighborInfoIterator = i16 ; # [ doc = " This structure represents the Thread Leader Data." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otLeaderData { # [ doc = "< Partition ID" ] pub mPartitionId : u32 , # [ doc = "< Leader Weight" ] pub mWeighting : u8 , # [ doc = "< Full Network Data Version" ] pub mDataVersion : u8 , # [ doc = "< Stable Network Data Version" ] pub mStableDataVersion : u8 , # [ doc = "< Leader Router ID" ] pub mLeaderRouterId : u8 , } # [ test ] fn bindgen_test_layout_otLeaderData ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otLeaderData > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( otLeaderData ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otLeaderData > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( otLeaderData ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otLeaderData > ( ) ) ) . mPartitionId as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otLeaderData ) , "::" , stringify ! ( mPartitionId ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otLeaderData > ( ) ) ) . mWeighting as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( otLeaderData ) , "::" , stringify ! ( mWeighting ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otLeaderData > ( ) ) ) . mDataVersion as * const _ as usize } , 5usize , concat ! ( "Offset of field: " , stringify ! ( otLeaderData ) , "::" , stringify ! ( mDataVersion ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otLeaderData > ( ) ) ) . mStableDataVersion as * const _ as usize } , 6usize , concat ! ( "Offset of field: " , stringify ! ( otLeaderData ) , "::" , stringify ! ( mStableDataVersion ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otLeaderData > ( ) ) ) . mLeaderRouterId as * const _ as usize } , 7usize , concat ! ( "Offset of field: " , stringify ! ( otLeaderData ) , "::" , stringify ! ( mLeaderRouterId ) ) ) ; } # [ doc = " This structure holds diagnostic information for a Thread Router" ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otRouterInfo { # [ doc = "< IEEE 802.15.4 Extended Address" ] pub mExtAddress : otExtAddress , # [ doc = "< RLOC16" ] pub mRloc16 : u16 , # [ doc = "< Router ID" ] pub mRouterId : u8 , # [ doc = "< Next hop to router" ] pub mNextHop : u8 , # [ doc = "< Path cost to router" ] pub mPathCost : u8 , # [ doc = "< Link Quality In" ] pub mLinkQualityIn : u8 , # [ doc = "< Link Quality Out" ] pub mLinkQualityOut : u8 , # [ doc = "< Time last heard" ] pub mAge : u8 , pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > , pub __bindgen_padding_0 : u8 , } # [ test ] fn bindgen_test_layout_otRouterInfo ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otRouterInfo > ( ) , 18usize , concat ! ( "Size of: " , stringify ! ( otRouterInfo ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otRouterInfo > ( ) , 2usize , concat ! ( "Alignment of " , stringify ! ( otRouterInfo ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRouterInfo > ( ) ) ) . mExtAddress as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otRouterInfo ) , "::" , stringify ! ( mExtAddress ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRouterInfo > ( ) ) ) . mRloc16 as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otRouterInfo ) , "::" , stringify ! ( mRloc16 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRouterInfo > ( ) ) ) . mRouterId as * const _ as usize } , 10usize , concat ! ( "Offset of field: " , stringify ! ( otRouterInfo ) , "::" , stringify ! ( mRouterId ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRouterInfo > ( ) ) ) . mNextHop as * const _ as usize } , 11usize , concat ! ( "Offset of field: " , stringify ! ( otRouterInfo ) , "::" , stringify ! ( mNextHop ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRouterInfo > ( ) ) ) . mPathCost as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( otRouterInfo ) , "::" , stringify ! ( mPathCost ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRouterInfo > ( ) ) ) . mLinkQualityIn as * const _ as usize } , 13usize , concat ! ( "Offset of field: " , stringify ! ( otRouterInfo ) , "::" , stringify ! ( mLinkQualityIn ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRouterInfo > ( ) ) ) . mLinkQualityOut as * const _ as usize } , 14usize , concat ! ( "Offset of field: " , stringify ! ( otRouterInfo ) , "::" , stringify ! ( mLinkQualityOut ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otRouterInfo > ( ) ) ) . mAge as * const _ as usize } , 15usize , concat ! ( "Offset of field: " , stringify ! ( otRouterInfo ) , "::" , stringify ! ( mAge ) ) ) ; } impl otRouterInfo { # [ inline ] pub fn mAllocated ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mAllocated ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mLinkEstablished ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 1usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mLinkEstablished ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 1usize , 1u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( mAllocated : bool , mLinkEstablished : bool ) -> __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 1u8 , { let mAllocated : u8 = unsafe { :: std :: mem :: transmute ( mAllocated ) } ; mAllocated as u64 } ) ; __bindgen_bitfield_unit . set ( 1usize , 1u8 , { let mLinkEstablished : u8 = unsafe { :: std :: mem :: transmute ( mLinkEstablished ) } ; mLinkEstablished as u64 } ) ; __bindgen_bitfield_unit } } # [ doc = " This structure represents the IP level counters." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otIpCounters { # [ doc = "< The number of IPv6 packets successfully transmitted." ] pub mTxSuccess : u32 , # [ doc = "< The number of IPv6 packets successfully received." ] pub mRxSuccess : u32 , # [ doc = "< The number of IPv6 packets failed to transmit." ] pub mTxFailure : u32 , # [ doc = "< The number of IPv6 packets failed to receive." ] pub mRxFailure : u32 , } # [ test ] fn bindgen_test_layout_otIpCounters ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otIpCounters > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( otIpCounters ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otIpCounters > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( otIpCounters ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIpCounters > ( ) ) ) . mTxSuccess as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otIpCounters ) , "::" , stringify ! ( mTxSuccess ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIpCounters > ( ) ) ) . mRxSuccess as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( otIpCounters ) , "::" , stringify ! ( mRxSuccess ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIpCounters > ( ) ) ) . mTxFailure as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otIpCounters ) , "::" , stringify ! ( mTxFailure ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otIpCounters > ( ) ) ) . mRxFailure as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( otIpCounters ) , "::" , stringify ! ( mRxFailure ) ) ) ; } # [ doc = " This structure represents the Thread MLE counters." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otMleCounters { # [ doc = "< Number of times device entered OT_DEVICE_ROLE_DISABLED role." ] pub mDisabledRole : u16 , # [ doc = "< Number of times device entered OT_DEVICE_ROLE_DETACHED role." ] pub mDetachedRole : u16 , # [ doc = "< Number of times device entered OT_DEVICE_ROLE_CHILD role." ] pub mChildRole : u16 , # [ doc = "< Number of times device entered OT_DEVICE_ROLE_ROUTER role." ] pub mRouterRole : u16 , # [ doc = "< Number of times device entered OT_DEVICE_ROLE_LEADER role." ] pub mLeaderRole : u16 , # [ doc = "< Number of attach attempts while device was detached." ] pub mAttachAttempts : u16 , # [ doc = "< Number of changes to partition ID." ] pub mPartitionIdChanges : u16 , # [ doc = "< Number of attempts to attach to a better partition." ] pub mBetterPartitionAttachAttempts : u16 , # [ doc = " Number of times device changed its parents." ] # [ doc = "" ] # [ doc = " Support for this counter requires the feature option OPENTHREAD_CONFIG_MLE_INFORM_PREVIOUS_PARENT_ON_REATTACH to" ] # [ doc = " be enabled." ] # [ doc = "" ] # [ doc = " A parent change can happen if device detaches from its current parent and attaches to a different one, or even" ] # [ doc = " while device is attached when the periodic parent search feature is enabled  (please see option" ] # [ doc = " OPENTHREAD_CONFIG_PARENT_SEARCH_ENABLE)." ] # [ doc = "" ] pub mParentChanges : u16 , } # [ test ] fn bindgen_test_layout_otMleCounters ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otMleCounters > ( ) , 18usize , concat ! ( "Size of: " , stringify ! ( otMleCounters ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otMleCounters > ( ) , 2usize , concat ! ( "Alignment of " , stringify ! ( otMleCounters ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMleCounters > ( ) ) ) . mDisabledRole as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otMleCounters ) , "::" , stringify ! ( mDisabledRole ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMleCounters > ( ) ) ) . mDetachedRole as * const _ as usize } , 2usize , concat ! ( "Offset of field: " , stringify ! ( otMleCounters ) , "::" , stringify ! ( mDetachedRole ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMleCounters > ( ) ) ) . mChildRole as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( otMleCounters ) , "::" , stringify ! ( mChildRole ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMleCounters > ( ) ) ) . mRouterRole as * const _ as usize } , 6usize , concat ! ( "Offset of field: " , stringify ! ( otMleCounters ) , "::" , stringify ! ( mRouterRole ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMleCounters > ( ) ) ) . mLeaderRole as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otMleCounters ) , "::" , stringify ! ( mLeaderRole ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMleCounters > ( ) ) ) . mAttachAttempts as * const _ as usize } , 10usize , concat ! ( "Offset of field: " , stringify ! ( otMleCounters ) , "::" , stringify ! ( mAttachAttempts ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMleCounters > ( ) ) ) . mPartitionIdChanges as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( otMleCounters ) , "::" , stringify ! ( mPartitionIdChanges ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMleCounters > ( ) ) ) . mBetterPartitionAttachAttempts as * const _ as usize } , 14usize , concat ! ( "Offset of field: " , stringify ! ( otMleCounters ) , "::" , stringify ! ( mBetterPartitionAttachAttempts ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otMleCounters > ( ) ) ) . mParentChanges as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otMleCounters ) , "::" , stringify ! ( mParentChanges ) ) ) ; } # [ doc = " This structure represents the MLE Parent Response data." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otThreadParentResponseInfo { # [ doc = "< IEEE 802.15.4 Extended Address of the Parent" ] pub mExtAddr : otExtAddress , # [ doc = "< Short address of the Parent" ] pub mRloc16 : u16 , # [ doc = "< Rssi of the Parent" ] pub mRssi : i8 , # [ doc = "< Parent priority" ] pub mPriority : i8 , # [ doc = "< Parent Link Quality 3" ] pub mLinkQuality3 : u8 , # [ doc = "< Parent Link Quality 2" ] pub mLinkQuality2 : u8 , # [ doc = "< Parent Link Quality 1" ] pub mLinkQuality1 : u8 , # [ doc = "< Is the node receiving parent response attached" ] pub mIsAttached : bool , } # [ test ] fn bindgen_test_layout_otThreadParentResponseInfo ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otThreadParentResponseInfo > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( otThreadParentResponseInfo ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otThreadParentResponseInfo > ( ) , 2usize , concat ! ( "Alignment of " , stringify ! ( otThreadParentResponseInfo ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otThreadParentResponseInfo > ( ) ) ) . mExtAddr as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otThreadParentResponseInfo ) , "::" , stringify ! ( mExtAddr ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otThreadParentResponseInfo > ( ) ) ) . mRloc16 as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otThreadParentResponseInfo ) , "::" , stringify ! ( mRloc16 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otThreadParentResponseInfo > ( ) ) ) . mRssi as * const _ as usize } , 10usize , concat ! ( "Offset of field: " , stringify ! ( otThreadParentResponseInfo ) , "::" , stringify ! ( mRssi ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otThreadParentResponseInfo > ( ) ) ) . mPriority as * const _ as usize } , 11usize , concat ! ( "Offset of field: " , stringify ! ( otThreadParentResponseInfo ) , "::" , stringify ! ( mPriority ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otThreadParentResponseInfo > ( ) ) ) . mLinkQuality3 as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( otThreadParentResponseInfo ) , "::" , stringify ! ( mLinkQuality3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otThreadParentResponseInfo > ( ) ) ) . mLinkQuality2 as * const _ as usize } , 13usize , concat ! ( "Offset of field: " , stringify ! ( otThreadParentResponseInfo ) , "::" , stringify ! ( mLinkQuality2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otThreadParentResponseInfo > ( ) ) ) . mLinkQuality1 as * const _ as usize } , 14usize , concat ! ( "Offset of field: " , stringify ! ( otThreadParentResponseInfo ) , "::" , stringify ! ( mLinkQuality1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otThreadParentResponseInfo > ( ) ) ) . mIsAttached as * const _ as usize } , 15usize , concat ! ( "Offset of field: " , stringify ! ( otThreadParentResponseInfo ) , "::" , stringify ! ( mIsAttached ) ) ) ; } extern "C" { # [ doc = " This function starts Thread protocol operation." ] # [ doc = "" ] # [ doc = " The interface must be up when calling this function." ] # [ doc = "" ] # [ doc = " @param[in] aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in] aEnabled  TRUE if Thread is enabled, FALSE otherwise." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully started Thread protocol operation." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  The network interface was not not up." ] # [ doc = "" ] pub fn otThreadSetEnabled ( aInstance : * mut otInstance , aEnabled : bool ) -> otError ; } extern "C" { # [ doc = " This function gets the Thread protocol version." ] # [ doc = "" ] # [ doc = " @returns the Thread protocol version." ] # [ doc = "" ] pub fn otThreadGetVersion ( ) -> u16 ; } extern "C" { # [ doc = " This function indicates whether a node is the only router on the network." ] # [ doc = "" ] # [ doc = " @param[in] aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval TRUE   It is the only router in the network." ] # [ doc = " @retval FALSE  It is a child or is not a single router in the network." ] # [ doc = "" ] pub fn otThreadIsSingleton ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " This function starts a Thread Discovery scan." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance              A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aScanChannels          A bit vector indicating which channels to scan (e.g. OT_CHANNEL_11_MASK)." ] # [ doc = " @param[in]  aPanId                 The PAN ID filter (set to Broadcast PAN to disable filter)." ] # [ doc = " @param[in]  aJoiner                Value of the Joiner Flag in the Discovery Request TLV." ] # [ doc = " @param[in]  aEnableEui64Filtering  TRUE to filter responses on EUI-64, FALSE otherwise." ] # [ doc = " @param[in]  aCallback              A pointer to a function called on receiving an MLE Discovery Response or" ] # [ doc = "                                    scan completes." ] # [ doc = " @param[in]  aCallbackContext       A pointer to application-specific context." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE  Accepted the Thread Discovery request." ] # [ doc = " @retval OT_ERROR_BUSY  Already performing an Thread Discovery." ] # [ doc = "" ] pub fn otThreadDiscover ( aInstance : * mut otInstance , aScanChannels : u32 , aPanId : u16 , aJoiner : bool , aEnableEui64Filtering : bool , aCallback : otHandleActiveScanResult , aCallbackContext : * mut :: std :: os :: raw :: c_void ) -> otError ; } extern "C" { # [ doc = " This function determines if an MLE Thread Discovery is currently in progress." ] # [ doc = "" ] # [ doc = " @param[in] aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] pub fn otThreadIsDiscoverInProgress ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " Get the Thread Child Timeout used when operating in the Child role." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The Thread Child Timeout value in seconds." ] # [ doc = "" ] # [ doc = " @sa otThreadSetChildTimeout" ] # [ doc = "" ] pub fn otThreadGetChildTimeout ( aInstance : * mut otInstance ) -> u32 ; } extern "C" { # [ doc = " Set the Thread Child Timeout used when operating in the Child role." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aTimeout  The timeout value in seconds." ] # [ doc = "" ] # [ doc = " @sa otThreadGetChildTimeout" ] # [ doc = "" ] pub fn otThreadSetChildTimeout ( aInstance : * mut otInstance , aTimeout : u32 ) ; } extern "C" { # [ doc = " Get the IEEE 802.15.4 Extended PAN ID." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to the IEEE 802.15.4 Extended PAN ID." ] # [ doc = "" ] # [ doc = " @sa otThreadSetExtendedPanId" ] # [ doc = "" ] pub fn otThreadGetExtendedPanId ( aInstance : * mut otInstance ) -> * const otExtendedPanId ; } extern "C" { # [ doc = " Set the IEEE 802.15.4 Extended PAN ID." ] # [ doc = "" ] # [ doc = " This function can only be called while Thread protocols are disabled.  A successful" ] # [ doc = " call to this function invalidates the Active and Pending Operational Datasets in" ] # [ doc = " non-volatile memory." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance       A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aExtendedPanId  A pointer to the IEEE 802.15.4 Extended PAN ID." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully set the Extended PAN ID." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  Thread protocols are enabled." ] # [ doc = "" ] # [ doc = " @sa otThreadGetExtendedPanId" ] # [ doc = "" ] pub fn otThreadSetExtendedPanId ( aInstance : * mut otInstance , aExtendedPanId : * const otExtendedPanId ) -> otError ; } extern "C" { # [ doc = " This function returns a pointer to the Leader's RLOC." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[out]  aLeaderRloc  A pointer to the Leader's RLOC." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          The Leader's RLOC was successfully written to @p aLeaderRloc." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  @p aLeaderRloc was NULL." ] # [ doc = " @retval OT_ERROR_DETACHED      Not currently attached to a Thread Partition." ] # [ doc = "" ] pub fn otThreadGetLeaderRloc ( aInstance : * mut otInstance , aLeaderRloc : * mut otIp6Address ) -> otError ; } extern "C" { # [ doc = " Get the MLE Link Mode configuration." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The MLE Link Mode configuration." ] # [ doc = "" ] # [ doc = " @sa otThreadSetLinkMode" ] # [ doc = "" ] pub fn otThreadGetLinkMode ( aInstance : * mut otInstance ) -> otLinkModeConfig ; } extern "C" { # [ doc = " Set the MLE Link Mode configuration." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aConfig   A pointer to the Link Mode configuration." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE  Successfully set the MLE Link Mode configuration." ] # [ doc = "" ] # [ doc = " @sa otThreadGetLinkMode" ] # [ doc = "" ] pub fn otThreadSetLinkMode ( aInstance : * mut otInstance , aConfig : otLinkModeConfig ) -> otError ; } extern "C" { # [ doc = " Get the thrMasterKey." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance   A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to a buffer containing the thrMasterKey." ] # [ doc = "" ] # [ doc = " @sa otThreadSetMasterKey" ] # [ doc = "" ] pub fn otThreadGetMasterKey ( aInstance : * mut otInstance ) -> * const otMasterKey ; } extern "C" { # [ doc = " Set the thrMasterKey." ] # [ doc = "" ] # [ doc = " This function succeeds only when Thread protocols are disabled.  A successful" ] # [ doc = " call to this function invalidates the Active and Pending Operational Datasets in" ] # [ doc = " non-volatile memory." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aKey        A pointer to a buffer containing the thrMasterKey." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE            Successfully set the thrMasterKey." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS    If aKeyLength is larger than 16." ] # [ doc = " @retval OT_ERROR_INVALID_STATE   Thread protocols are enabled." ] # [ doc = "" ] # [ doc = " @sa otThreadGetMasterKey" ] # [ doc = "" ] pub fn otThreadSetMasterKey ( aInstance : * mut otInstance , aKey : * const otMasterKey ) -> otError ; } extern "C" { # [ doc = " This function returns a pointer to the Thread Routing Locator (RLOC) address." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to the Thread Routing Locator (RLOC) address." ] # [ doc = "" ] pub fn otThreadGetRloc ( aInstance : * mut otInstance ) -> * const otIp6Address ; } extern "C" { # [ doc = " This function returns a pointer to the Mesh Local EID address." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to the Mesh Local EID address." ] # [ doc = "" ] pub fn otThreadGetMeshLocalEid ( aInstance : * mut otInstance ) -> * const otIp6Address ; } extern "C" { # [ doc = " This function returns a pointer to the Mesh Local Prefix." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to the Mesh Local Prefix." ] # [ doc = "" ] pub fn otThreadGetMeshLocalPrefix ( aInstance : * mut otInstance ) -> * const otMeshLocalPrefix ; } extern "C" { # [ doc = " This function sets the Mesh Local Prefix." ] # [ doc = "" ] # [ doc = " This function succeeds only when Thread protocols are disabled.  A successful" ] # [ doc = " call to this function invalidates the Active and Pending Operational Datasets in" ] # [ doc = " non-volatile memory." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance         A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aMeshLocalPrefix  A pointer to the Mesh Local Prefix." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully set the Mesh Local Prefix." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  Thread protocols are enabled." ] # [ doc = "" ] pub fn otThreadSetMeshLocalPrefix ( aInstance : * mut otInstance , aMeshLocalPrefix : * const otMeshLocalPrefix ) -> otError ; } extern "C" { # [ doc = " This function returns the Thread link-local IPv6 address." ] # [ doc = "" ] # [ doc = " The Thread link local address is derived using IEEE802.15.4 Extended Address as Interface Identifier." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to Thread link-local IPv6 address." ] # [ doc = "" ] pub fn otThreadGetLinkLocalIp6Address ( aInstance : * mut otInstance ) -> * const otIp6Address ; } extern "C" { # [ doc = " Get the Thread Network Name." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to the Thread Network Name." ] # [ doc = "" ] # [ doc = " @sa otThreadSetNetworkName" ] # [ doc = "" ] pub fn otThreadGetNetworkName ( aInstance : * mut otInstance ) -> * const :: std :: os :: raw :: c_char ; } extern "C" { # [ doc = " Set the Thread Network Name." ] # [ doc = "" ] # [ doc = " This function succeeds only when Thread protocols are disabled.  A successful" ] # [ doc = " call to this function invalidates the Active and Pending Operational Datasets in" ] # [ doc = " non-volatile memory." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance     A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aNetworkName  A pointer to the Thread Network Name." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully set the Thread Network Name." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  Thread protocols are enabled." ] # [ doc = "" ] # [ doc = " @sa otThreadGetNetworkName" ] # [ doc = "" ] pub fn otThreadSetNetworkName ( aInstance : * mut otInstance , aNetworkName : * const :: std :: os :: raw :: c_char ) -> otError ; } extern "C" { # [ doc = " Get the Thread Domain Name." ] # [ doc = "" ] # [ doc = " This function is only availble since Thread 1.2." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to the Thread Domain Name." ] # [ doc = "" ] # [ doc = " @sa otThreadSetDomainName" ] # [ doc = "" ] pub fn otThreadGetDomainName ( aInstance : * mut otInstance ) -> * const :: std :: os :: raw :: c_char ; } extern "C" { # [ doc = " Set the Thread Domain Name." ] # [ doc = "" ] # [ doc = " This function is only availble since Thread 1.2." ] # [ doc = " This function succeeds only when Thread protocols are disabled." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance     A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aDomainName   A pointer to the Thread Domain Name." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully set the Thread Domain Name." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  Thread protocols are enabled." ] # [ doc = "" ] # [ doc = " @sa otThreadGetDomainName" ] # [ doc = "" ] pub fn otThreadSetDomainName ( aInstance : * mut otInstance , aDomainName : * const :: std :: os :: raw :: c_char ) -> otError ; } extern "C" { # [ doc = " Get the thrKeySequenceCounter." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The thrKeySequenceCounter value." ] # [ doc = "" ] # [ doc = " @sa otThreadSetKeySequenceCounter" ] # [ doc = "" ] pub fn otThreadGetKeySequenceCounter ( aInstance : * mut otInstance ) -> u32 ; } extern "C" { # [ doc = " Set the thrKeySequenceCounter." ] # [ doc = "" ] # [ doc = " @note This API is reserved for testing and demo purposes only. Changing settings with" ] # [ doc = " this API will render a production application non-compliant with the Thread Specification." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance            A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aKeySequenceCounter  The thrKeySequenceCounter value." ] # [ doc = "" ] # [ doc = " @sa otThreadGetKeySequenceCounter" ] # [ doc = "" ] pub fn otThreadSetKeySequenceCounter ( aInstance : * mut otInstance , aKeySequenceCounter : u32 ) ; } extern "C" { # [ doc = " Get the thrKeySwitchGuardTime" ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The thrKeySwitchGuardTime value (in hours)." ] # [ doc = "" ] # [ doc = " @sa otThreadSetKeySwitchGuardTime" ] # [ doc = "" ] pub fn otThreadGetKeySwitchGuardTime ( aInstance : * mut otInstance ) -> u32 ; } extern "C" { # [ doc = " Set the thrKeySwitchGuardTime" ] # [ doc = "" ] # [ doc = " @note This API is reserved for testing and demo purposes only. Changing settings with" ] # [ doc = " this API will render a production application non-compliant with the Thread Specification." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance            A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aKeySwitchGuardTime  The thrKeySwitchGuardTime value (in hours)." ] # [ doc = "" ] # [ doc = " @sa otThreadGetKeySwitchGuardTime" ] # [ doc = "" ] pub fn otThreadSetKeySwitchGuardTime ( aInstance : * mut otInstance , aKeySwitchGuardTime : u32 ) ; } extern "C" { # [ doc = " Detach from the Thread network." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully detached from the Thread network." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  Thread is disabled." ] # [ doc = "" ] pub fn otThreadBecomeDetached ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " Attempt to reattach as a child." ] # [ doc = "" ] # [ doc = " @note This API is reserved for testing and demo purposes only. Changing settings with" ] # [ doc = " this API will render a production application non-compliant with the Thread Specification." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully begin attempt to become a child." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  Thread is disabled." ] # [ doc = "" ] pub fn otThreadBecomeChild ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " This function gets the next neighbor information. It is used to go through the entries of" ] # [ doc = " the neighbor table." ] # [ doc = "" ] # [ doc = " @param[in]     aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[inout]  aIterator  A pointer to the iterator context. To get the first neighbor entry" ] # [ doc = "it should be set to OT_NEIGHBOR_INFO_ITERATOR_INIT." ] # [ doc = " @param[out]    aInfo      A pointer to the neighbor information." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE         Successfully found the next neighbor entry in table." ] # [ doc = " @retval OT_ERROR_NOT_FOUND     No subsequent neighbor entry exists in the table." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  @p aIterator or @p aInfo was NULL." ] # [ doc = "" ] pub fn otThreadGetNextNeighborInfo ( aInstance : * mut otInstance , aIterator : * mut otNeighborInfoIterator , aInfo : * mut otNeighborInfo ) -> otError ; } extern "C" { # [ doc = " Get the device role." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_DEVICE_ROLE_DISABLED  The Thread stack is disabled." ] # [ doc = " @retval OT_DEVICE_ROLE_DETACHED  The device is not currently participating in a Thread network/partition." ] # [ doc = " @retval OT_DEVICE_ROLE_CHILD     The device is currently operating as a Thread Child." ] # [ doc = " @retval OT_DEVICE_ROLE_ROUTER    The device is currently operating as a Thread Router." ] # [ doc = " @retval OT_DEVICE_ROLE_LEADER    The device is currently operating as a Thread Leader." ] # [ doc = "" ] pub fn otThreadGetDeviceRole ( aInstance : * mut otInstance ) -> otDeviceRole ; } extern "C" { # [ doc = " This function get the Thread Leader Data." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[out]  aLeaderData  A pointer to where the leader data is placed." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully retrieved the leader data." ] # [ doc = " @retval OT_ERROR_DETACHED      Not currently attached." ] # [ doc = "" ] pub fn otThreadGetLeaderData ( aInstance : * mut otInstance , aLeaderData : * mut otLeaderData ) -> otError ; } extern "C" { # [ doc = " Get the Leader's Router ID." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The Leader's Router ID." ] # [ doc = "" ] pub fn otThreadGetLeaderRouterId ( aInstance : * mut otInstance ) -> u8 ; } extern "C" { # [ doc = " Get the Leader's Weight." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The Leader's Weight." ] # [ doc = "" ] pub fn otThreadGetLeaderWeight ( aInstance : * mut otInstance ) -> u8 ; } extern "C" { # [ doc = " Get the Partition ID." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The Partition ID." ] # [ doc = "" ] pub fn otThreadGetPartitionId ( aInstance : * mut otInstance ) -> u32 ; } extern "C" { # [ doc = " Get the RLOC16." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The RLOC16." ] # [ doc = "" ] pub fn otThreadGetRloc16 ( aInstance : * mut otInstance ) -> u16 ; } extern "C" { # [ doc = " The function retrieves diagnostic information for a Thread Router as parent." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[out]  aParentInfo  A pointer to where the parent router information is placed." ] # [ doc = "" ] pub fn otThreadGetParentInfo ( aInstance : * mut otInstance , aParentInfo : * mut otRouterInfo ) -> otError ; } extern "C" { # [ doc = " The function retrieves the average RSSI for the Thread Parent." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[out]  aParentRssi  A pointer to where the parent RSSI should be placed." ] # [ doc = "" ] pub fn otThreadGetParentAverageRssi ( aInstance : * mut otInstance , aParentRssi : * mut i8 ) -> otError ; } extern "C" { # [ doc = " The function retrieves the RSSI of the last packet from the Thread Parent." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[out]  aLastRssi    A pointer to where the last RSSI should be placed." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully retrieved the RSSI data." ] # [ doc = " @retval OT_ERROR_FAILED        Unable to get RSSI data." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  @p aLastRssi is NULL." ] # [ doc = "" ] pub fn otThreadGetParentLastRssi ( aInstance : * mut otInstance , aLastRssi : * mut i8 ) -> otError ; } extern "C" { # [ doc = " Get the IPv6 counters." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to the IPv6 counters." ] # [ doc = "" ] pub fn otThreadGetIp6Counters ( aInstance : * mut otInstance ) -> * const otIpCounters ; } extern "C" { # [ doc = " Reset the IPv6 counters." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] pub fn otThreadResetIp6Counters ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " Get the Thread MLE counters." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to the Thread MLE counters." ] # [ doc = "" ] pub fn otThreadGetMleCounters ( aInstance : * mut otInstance ) -> * const otMleCounters ; } extern "C" { # [ doc = " Reset the Thread MLE counters." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] pub fn otThreadResetMleCounters ( aInstance : * mut otInstance ) ; } # [ doc = " This function pointer is called every time an MLE Parent Response message is received." ] # [ doc = "" ] # [ doc = " @param[in]  aStats    pointer to a location on stack holding the stats data." ] # [ doc = " @param[in]  aContext  A pointer to callback client-specific context." ] # [ doc = "" ] pub type otThreadParentResponseCallback = :: std :: option :: Option < unsafe extern "C" fn ( aInfo : * mut otThreadParentResponseInfo , aContext : * mut :: std :: os :: raw :: c_void ) > ; extern "C" { # [ doc = " This function registers a callback to receive MLE Parent Response data." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aCallback  A pointer to a function that is called upon receiving an MLE Parent Response message." ] # [ doc = " @param[in]  aContext   A pointer to callback client-specific context." ] # [ doc = "" ] pub fn otThreadRegisterParentResponseCallback ( aInstance : * mut otInstance , aCallback : otThreadParentResponseCallback , aContext : * mut :: std :: os :: raw :: c_void ) ; } # [ doc = "< MAC Extended Address TLV" ] pub const OT_NETWORK_DIAGNOSTIC_TLV_EXT_ADDRESS : _bindgen_ty_7 = 0 ; # [ doc = "< Address16 TLV" ] pub const OT_NETWORK_DIAGNOSTIC_TLV_SHORT_ADDRESS : _bindgen_ty_7 = 1 ; # [ doc = "< Mode TLV" ] pub const OT_NETWORK_DIAGNOSTIC_TLV_MODE : _bindgen_ty_7 = 2 ; # [ doc = "< Timeout TLV (the maximum polling time period for SEDs)" ] pub const OT_NETWORK_DIAGNOSTIC_TLV_TIMEOUT : _bindgen_ty_7 = 3 ; # [ doc = "< Connectivity TLV" ] pub const OT_NETWORK_DIAGNOSTIC_TLV_CONNECTIVITY : _bindgen_ty_7 = 4 ; # [ doc = "< Route64 TLV" ] pub const OT_NETWORK_DIAGNOSTIC_TLV_ROUTE : _bindgen_ty_7 = 5 ; # [ doc = "< Leader Data TLV" ] pub const OT_NETWORK_DIAGNOSTIC_TLV_LEADER_DATA : _bindgen_ty_7 = 6 ; # [ doc = "< Network Data TLV" ] pub const OT_NETWORK_DIAGNOSTIC_TLV_NETWORK_DATA : _bindgen_ty_7 = 7 ; # [ doc = "< IPv6 Address List TLV" ] pub const OT_NETWORK_DIAGNOSTIC_TLV_IP6_ADDR_LIST : _bindgen_ty_7 = 8 ; # [ doc = "< MAC Counters TLV" ] pub const OT_NETWORK_DIAGNOSTIC_TLV_MAC_COUNTERS : _bindgen_ty_7 = 9 ; # [ doc = "< Battery Level TLV" ] pub const OT_NETWORK_DIAGNOSTIC_TLV_BATTERY_LEVEL : _bindgen_ty_7 = 14 ; # [ doc = "< Supply Voltage TLV" ] pub const OT_NETWORK_DIAGNOSTIC_TLV_SUPPLY_VOLTAGE : _bindgen_ty_7 = 15 ; # [ doc = "< Child Table TLV" ] pub const OT_NETWORK_DIAGNOSTIC_TLV_CHILD_TABLE : _bindgen_ty_7 = 16 ; # [ doc = "< Channel Pages TLV" ] pub const OT_NETWORK_DIAGNOSTIC_TLV_CHANNEL_PAGES : _bindgen_ty_7 = 17 ; # [ doc = "< Type List TLV" ] pub const OT_NETWORK_DIAGNOSTIC_TLV_TYPE_LIST : _bindgen_ty_7 = 18 ; # [ doc = "< Max Child Timeout TLV" ] pub const OT_NETWORK_DIAGNOSTIC_TLV_MAX_CHILD_TIMEOUT : _bindgen_ty_7 = 19 ; pub type _bindgen_ty_7 = u32 ; pub type otNetworkDiagIterator = u16 ; # [ doc = " This structure represents a Network Diagnostic Connectivity value." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otNetworkDiagConnectivity { # [ doc = " The priority of the sender as a parent." ] pub mParentPriority : i8 , # [ doc = " The number of neighboring devices with which the sender shares a link of quality 3." ] pub mLinkQuality3 : u8 , # [ doc = " The number of neighboring devices with which the sender shares a link of quality 2." ] pub mLinkQuality2 : u8 , # [ doc = " The number of neighboring devices with which the sender shares a link of quality 1." ] pub mLinkQuality1 : u8 , # [ doc = " The sender's routing cost to the Leader." ] pub mLeaderCost : u8 , # [ doc = " The most recent ID sequence number received by the sender." ] pub mIdSequence : u8 , # [ doc = " The number of active Routers in the sender's Thread Network Partition." ] pub mActiveRouters : u8 , # [ doc = " The guaranteed buffer capacity in octets for all IPv6 datagrams destined to a given SED. Optional." ] pub mSedBufferSize : u16 , # [ doc = " The guaranteed queue capacity in number of IPv6 datagrams destined to a given SED. Optional." ] pub mSedDatagramCount : u8 , } # [ test ] fn bindgen_test_layout_otNetworkDiagConnectivity ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otNetworkDiagConnectivity > ( ) , 12usize , concat ! ( "Size of: " , stringify ! ( otNetworkDiagConnectivity ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otNetworkDiagConnectivity > ( ) , 2usize , concat ! ( "Alignment of " , stringify ! ( otNetworkDiagConnectivity ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagConnectivity > ( ) ) ) . mParentPriority as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagConnectivity ) , "::" , stringify ! ( mParentPriority ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagConnectivity > ( ) ) ) . mLinkQuality3 as * const _ as usize } , 1usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagConnectivity ) , "::" , stringify ! ( mLinkQuality3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagConnectivity > ( ) ) ) . mLinkQuality2 as * const _ as usize } , 2usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagConnectivity ) , "::" , stringify ! ( mLinkQuality2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagConnectivity > ( ) ) ) . mLinkQuality1 as * const _ as usize } , 3usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagConnectivity ) , "::" , stringify ! ( mLinkQuality1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagConnectivity > ( ) ) ) . mLeaderCost as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagConnectivity ) , "::" , stringify ! ( mLeaderCost ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagConnectivity > ( ) ) ) . mIdSequence as * const _ as usize } , 5usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagConnectivity ) , "::" , stringify ! ( mIdSequence ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagConnectivity > ( ) ) ) . mActiveRouters as * const _ as usize } , 6usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagConnectivity ) , "::" , stringify ! ( mActiveRouters ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagConnectivity > ( ) ) ) . mSedBufferSize as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagConnectivity ) , "::" , stringify ! ( mSedBufferSize ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagConnectivity > ( ) ) ) . mSedDatagramCount as * const _ as usize } , 10usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagConnectivity ) , "::" , stringify ! ( mSedDatagramCount ) ) ) ; } # [ doc = " This structure represents a Network Diagnostic Route data." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otNetworkDiagRouteData { # [ doc = "< The Assigned Router ID." ] pub mRouterId : u8 , pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > , } # [ test ] fn bindgen_test_layout_otNetworkDiagRouteData ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otNetworkDiagRouteData > ( ) , 2usize , concat ! ( "Size of: " , stringify ! ( otNetworkDiagRouteData ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otNetworkDiagRouteData > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otNetworkDiagRouteData ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagRouteData > ( ) ) ) . mRouterId as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagRouteData ) , "::" , stringify ! ( mRouterId ) ) ) ; } impl otNetworkDiagRouteData { # [ inline ] pub fn mLinkQualityOut ( & self ) -> u8 { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 2u8 ) as u8 ) } } # [ inline ] pub fn set_mLinkQualityOut ( & mut self , val : u8 ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 2u8 , val as u64 ) } } # [ inline ] pub fn mLinkQualityIn ( & self ) -> u8 { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 2usize , 2u8 ) as u8 ) } } # [ inline ] pub fn set_mLinkQualityIn ( & mut self , val : u8 ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 2usize , 2u8 , val as u64 ) } } # [ inline ] pub fn mRouteCost ( & self ) -> u8 { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 4usize , 4u8 ) as u8 ) } } # [ inline ] pub fn set_mRouteCost ( & mut self , val : u8 ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 4usize , 4u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( mLinkQualityOut : u8 , mLinkQualityIn : u8 , mRouteCost : u8 ) -> __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 2u8 , { let mLinkQualityOut : u8 = unsafe { :: std :: mem :: transmute ( mLinkQualityOut ) } ; mLinkQualityOut as u64 } ) ; __bindgen_bitfield_unit . set ( 2usize , 2u8 , { let mLinkQualityIn : u8 = unsafe { :: std :: mem :: transmute ( mLinkQualityIn ) } ; mLinkQualityIn as u64 } ) ; __bindgen_bitfield_unit . set ( 4usize , 4u8 , { let mRouteCost : u8 = unsafe { :: std :: mem :: transmute ( mRouteCost ) } ; mRouteCost as u64 } ) ; __bindgen_bitfield_unit } } # [ doc = " This structure represents a Network Diagnostic Route TLV value." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otNetworkDiagRoute { # [ doc = " The sequence number associated with the set of Router ID assignments in #mRouteData." ] pub mIdSequence : u8 , # [ doc = " Number of elements in #mRouteData." ] pub mRouteCount : u8 , # [ doc = " Link Quality and Routing Cost data." ] pub mRouteData : [ otNetworkDiagRouteData ; 63usize ] , } # [ test ] fn bindgen_test_layout_otNetworkDiagRoute ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otNetworkDiagRoute > ( ) , 128usize , concat ! ( "Size of: " , stringify ! ( otNetworkDiagRoute ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otNetworkDiagRoute > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otNetworkDiagRoute ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagRoute > ( ) ) ) . mIdSequence as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagRoute ) , "::" , stringify ! ( mIdSequence ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagRoute > ( ) ) ) . mRouteCount as * const _ as usize } , 1usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagRoute ) , "::" , stringify ! ( mRouteCount ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagRoute > ( ) ) ) . mRouteData as * const _ as usize } , 2usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagRoute ) , "::" , stringify ! ( mRouteData ) ) ) ; } # [ doc = " This structure represents a Network Diagnostic Mac Counters value." ] # [ doc = "" ] # [ doc = " See <a href=\"https://www.ietf.org/rfc/rfc2863\">RFC 2863</a> for definitions of member fields." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otNetworkDiagMacCounters { pub mIfInUnknownProtos : u32 , pub mIfInErrors : u32 , pub mIfOutErrors : u32 , pub mIfInUcastPkts : u32 , pub mIfInBroadcastPkts : u32 , pub mIfInDiscards : u32 , pub mIfOutUcastPkts : u32 , pub mIfOutBroadcastPkts : u32 , pub mIfOutDiscards : u32 , } # [ test ] fn bindgen_test_layout_otNetworkDiagMacCounters ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otNetworkDiagMacCounters > ( ) , 36usize , concat ! ( "Size of: " , stringify ! ( otNetworkDiagMacCounters ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otNetworkDiagMacCounters > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( otNetworkDiagMacCounters ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagMacCounters > ( ) ) ) . mIfInUnknownProtos as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagMacCounters ) , "::" , stringify ! ( mIfInUnknownProtos ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagMacCounters > ( ) ) ) . mIfInErrors as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagMacCounters ) , "::" , stringify ! ( mIfInErrors ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagMacCounters > ( ) ) ) . mIfOutErrors as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagMacCounters ) , "::" , stringify ! ( mIfOutErrors ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagMacCounters > ( ) ) ) . mIfInUcastPkts as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagMacCounters ) , "::" , stringify ! ( mIfInUcastPkts ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagMacCounters > ( ) ) ) . mIfInBroadcastPkts as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagMacCounters ) , "::" , stringify ! ( mIfInBroadcastPkts ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagMacCounters > ( ) ) ) . mIfInDiscards as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagMacCounters ) , "::" , stringify ! ( mIfInDiscards ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagMacCounters > ( ) ) ) . mIfOutUcastPkts as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagMacCounters ) , "::" , stringify ! ( mIfOutUcastPkts ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagMacCounters > ( ) ) ) . mIfOutBroadcastPkts as * const _ as usize } , 28usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagMacCounters ) , "::" , stringify ! ( mIfOutBroadcastPkts ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagMacCounters > ( ) ) ) . mIfOutDiscards as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagMacCounters ) , "::" , stringify ! ( mIfOutDiscards ) ) ) ; } # [ doc = " This structure represents a Network Diagnostic Child Table Entry." ] # [ doc = "" ] # [ repr ( C ) ] # [ repr ( align ( 2 ) ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otNetworkDiagChildEntry { pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 2usize ] , u16 > , # [ doc = " Link mode bits." ] pub mMode : otLinkModeConfig , } # [ test ] fn bindgen_test_layout_otNetworkDiagChildEntry ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otNetworkDiagChildEntry > ( ) , 4usize , concat ! ( "Size of: " , stringify ! ( otNetworkDiagChildEntry ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otNetworkDiagChildEntry > ( ) , 2usize , concat ! ( "Alignment of " , stringify ! ( otNetworkDiagChildEntry ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagChildEntry > ( ) ) ) . mMode as * const _ as usize } , 2usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagChildEntry ) , "::" , stringify ! ( mMode ) ) ) ; } impl otNetworkDiagChildEntry { # [ inline ] pub fn mTimeout ( & self ) -> u16 { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 5u8 ) as u16 ) } } # [ inline ] pub fn set_mTimeout ( & mut self , val : u16 ) { unsafe { let val : u16 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 5u8 , val as u64 ) } } # [ inline ] pub fn mChildId ( & self ) -> u16 { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 5usize , 9u8 ) as u16 ) } } # [ inline ] pub fn set_mChildId ( & mut self , val : u16 ) { unsafe { let val : u16 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 5usize , 9u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( mTimeout : u16 , mChildId : u16 ) -> __BindgenBitfieldUnit < [ u8 ; 2usize ] , u16 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 2usize ] , u16 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 5u8 , { let mTimeout : u16 = unsafe { :: std :: mem :: transmute ( mTimeout ) } ; mTimeout as u64 } ) ; __bindgen_bitfield_unit . set ( 5usize , 9u8 , { let mChildId : u16 = unsafe { :: std :: mem :: transmute ( mChildId ) } ; mChildId as u64 } ) ; __bindgen_bitfield_unit } } # [ doc = " This structure represents a Network Diagnostic TLV." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otNetworkDiagTlv { # [ doc = " The Network Diagnostic TLV type." ] pub mType : u8 , pub mData : otNetworkDiagTlv__bindgen_ty_1 , } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub union otNetworkDiagTlv__bindgen_ty_1 { pub mExtAddress : otExtAddress , pub mAddr16 : u16 , pub mMode : otLinkModeConfig , pub mTimeout : u32 , pub mConnectivity : otNetworkDiagConnectivity , pub mRoute : otNetworkDiagRoute , pub mLeaderData : otLeaderData , pub mMacCounters : otNetworkDiagMacCounters , pub mBatteryLevel : u8 , pub mSupplyVoltage : u16 , pub mMaxChildTimeout : u32 , pub mNetworkData : otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_1 , pub mIp6AddrList : otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_2 , pub mChildTable : otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_3 , pub mChannelPages : otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_4 , _bindgen_union_align : [ u32 ; 85usize ] , } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_1 { pub mCount : u8 , pub m8 : [ u8 ; 254usize ] , } # [ test ] fn bindgen_test_layout_otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_1 ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_1 > ( ) , 255usize , concat ! ( "Size of: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_1 ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_1 > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_1 > ( ) ) ) . mCount as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_1 ) , "::" , stringify ! ( mCount ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_1 > ( ) ) ) . m8 as * const _ as usize } , 1usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_1 ) , "::" , stringify ! ( m8 ) ) ) ; } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_2 { pub mCount : u8 , pub mList : [ otIp6Address ; 15usize ] , } # [ test ] fn bindgen_test_layout_otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_2 ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_2 > ( ) , 241usize , concat ! ( "Size of: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_2 ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_2 > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_2 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_2 > ( ) ) ) . mCount as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_2 ) , "::" , stringify ! ( mCount ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_2 > ( ) ) ) . mList as * const _ as usize } , 1usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_2 ) , "::" , stringify ! ( mList ) ) ) ; } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_3 { pub mCount : u8 , pub mTable : [ otNetworkDiagChildEntry ; 84usize ] , } # [ test ] fn bindgen_test_layout_otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_3 ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_3 > ( ) , 338usize , concat ! ( "Size of: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_3 ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_3 > ( ) , 2usize , concat ! ( "Alignment of " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_3 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_3 > ( ) ) ) . mCount as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_3 ) , "::" , stringify ! ( mCount ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_3 > ( ) ) ) . mTable as * const _ as usize } , 2usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_3 ) , "::" , stringify ! ( mTable ) ) ) ; } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_4 { pub mCount : u8 , pub m8 : [ u8 ; 254usize ] , } # [ test ] fn bindgen_test_layout_otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_4 ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_4 > ( ) , 255usize , concat ! ( "Size of: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_4 ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_4 > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_4 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_4 > ( ) ) ) . mCount as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_4 ) , "::" , stringify ! ( mCount ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_4 > ( ) ) ) . m8 as * const _ as usize } , 1usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1__bindgen_ty_4 ) , "::" , stringify ! ( m8 ) ) ) ; } # [ test ] fn bindgen_test_layout_otNetworkDiagTlv__bindgen_ty_1 ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otNetworkDiagTlv__bindgen_ty_1 > ( ) , 340usize , concat ! ( "Size of: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1 ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otNetworkDiagTlv__bindgen_ty_1 > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1 > ( ) ) ) . mExtAddress as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1 ) , "::" , stringify ! ( mExtAddress ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1 > ( ) ) ) . mAddr16 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1 ) , "::" , stringify ! ( mAddr16 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1 > ( ) ) ) . mMode as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1 ) , "::" , stringify ! ( mMode ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1 > ( ) ) ) . mTimeout as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1 ) , "::" , stringify ! ( mTimeout ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1 > ( ) ) ) . mConnectivity as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1 ) , "::" , stringify ! ( mConnectivity ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1 > ( ) ) ) . mRoute as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1 ) , "::" , stringify ! ( mRoute ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1 > ( ) ) ) . mLeaderData as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1 ) , "::" , stringify ! ( mLeaderData ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1 > ( ) ) ) . mMacCounters as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1 ) , "::" , stringify ! ( mMacCounters ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1 > ( ) ) ) . mBatteryLevel as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1 ) , "::" , stringify ! ( mBatteryLevel ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1 > ( ) ) ) . mSupplyVoltage as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1 ) , "::" , stringify ! ( mSupplyVoltage ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1 > ( ) ) ) . mMaxChildTimeout as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1 ) , "::" , stringify ! ( mMaxChildTimeout ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1 > ( ) ) ) . mNetworkData as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1 ) , "::" , stringify ! ( mNetworkData ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1 > ( ) ) ) . mIp6AddrList as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1 ) , "::" , stringify ! ( mIp6AddrList ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1 > ( ) ) ) . mChildTable as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1 ) , "::" , stringify ! ( mChildTable ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv__bindgen_ty_1 > ( ) ) ) . mChannelPages as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv__bindgen_ty_1 ) , "::" , stringify ! ( mChannelPages ) ) ) ; } # [ test ] fn bindgen_test_layout_otNetworkDiagTlv ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otNetworkDiagTlv > ( ) , 344usize , concat ! ( "Size of: " , stringify ! ( otNetworkDiagTlv ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otNetworkDiagTlv > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( otNetworkDiagTlv ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv > ( ) ) ) . mType as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv ) , "::" , stringify ! ( mType ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNetworkDiagTlv > ( ) ) ) . mData as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( otNetworkDiagTlv ) , "::" , stringify ! ( mData ) ) ) ; } extern "C" { # [ doc = " This function gets the next Network Diagnostic TLV in the message." ] # [ doc = "" ] # [ doc = " @param[in]     aMessage         A pointer to a message." ] # [ doc = " @param[inout]  aIterator        A pointer to the Network Diagnostic iterator context. To get the first" ] # [ doc = "                                 Network Diagnostic TLV it should be set to OT_NETWORK_DIAGNOSTIC_ITERATOR_INIT." ] # [ doc = " @param[out]    aNetworkDiagTlv  A pointer to where the Network Diagnostic TLV information will be placed." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE       Successfully found the next Network Diagnostic TLV." ] # [ doc = " @retval OT_ERROR_NOT_FOUND  No subsequent Network Diagnostic TLV exists in the message." ] # [ doc = " @retval OT_ERROR_PARSE      Parsing the next Network Diagnostic failed." ] # [ doc = "" ] # [ doc = " @Note A subsequent call to this function is allowed only when current return value is OT_ERROR_NONE." ] # [ doc = "" ] pub fn otThreadGetNextDiagnosticTlv ( aMessage : * const otMessage , aIterator : * mut otNetworkDiagIterator , aNetworkDiagTlv : * mut otNetworkDiagTlv ) -> otError ; } # [ doc = " This function pointer is called when Network Diagnostic Get response is received." ] # [ doc = "" ] # [ doc = " @param[in]  aMessage      A pointer to the message buffer containing the received Network Diagnostic" ] # [ doc = "                           Get response payload." ] # [ doc = " @param[in]  aMessageInfo  A pointer to the message info for @p aMessage." ] # [ doc = " @param[in]  aContext      A pointer to application-specific context." ] # [ doc = "" ] pub type otReceiveDiagnosticGetCallback = :: std :: option :: Option < unsafe extern "C" fn ( aMessage : * mut otMessage , aMessageInfo : * const otMessageInfo , aContext : * mut :: std :: os :: raw :: c_void ) > ; extern "C" { # [ doc = " This function registers a callback to provide received raw Network Diagnostic Get response payload." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance         A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aCallback         A pointer to a function that is called when Network Diagnostic Get response" ] # [ doc = "                               is received or NULL to disable the callback." ] # [ doc = " @param[in]  aCallbackContext  A pointer to application-specific context." ] # [ doc = "" ] pub fn otThreadSetReceiveDiagnosticGetCallback ( aInstance : * mut otInstance , aCallback : otReceiveDiagnosticGetCallback , aCallbackContext : * mut :: std :: os :: raw :: c_void ) ; } extern "C" { # [ doc = " Send a Network Diagnostic Get request." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance      A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aDestination   A pointer to destination address." ] # [ doc = " @param[in]  aTlvTypes      An array of Network Diagnostic TLV types." ] # [ doc = " @param[in]  aCount         Number of types in aTlvTypes." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE    Successfully queued the DIAG_GET.req." ] # [ doc = " @retval OT_ERROR_NO_BUFS Insufficient message buffers available to send DIAG_GET.req." ] # [ doc = "" ] pub fn otThreadSendDiagnosticGet ( aInstance : * mut otInstance , aDestination : * const otIp6Address , aTlvTypes : * const u8 , aCount : u8 ) -> otError ; } extern "C" { # [ doc = " Send a Network Diagnostic Reset request." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance      A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aDestination   A pointer to destination address." ] # [ doc = " @param[in]  aTlvTypes      An array of Network Diagnostic TLV types. Currently only Type 9 is allowed." ] # [ doc = " @param[in]  aCount         Number of types in aTlvTypes" ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE    Successfully queued the DIAG_RST.ntf." ] # [ doc = " @retval OT_ERROR_NO_BUFS Insufficient message buffers available to send DIAG_RST.ntf." ] # [ doc = "" ] pub fn otThreadSendDiagnosticReset ( aInstance : * mut otInstance , aDestination : * const otIp6Address , aTlvTypes : * const u8 , aCount : u8 ) -> otError ; } # [ doc = "< The device hasn't attached to a network." ] pub const otNetworkTimeStatus_OT_NETWORK_TIME_UNSYNCHRONIZED : otNetworkTimeStatus = - 1 ; # [ doc = "< The device hasn’t received time sync for more than two periods time." ] pub const otNetworkTimeStatus_OT_NETWORK_TIME_RESYNC_NEEDED : otNetworkTimeStatus = 0 ; # [ doc = "< The device network time is synchronized." ] pub const otNetworkTimeStatus_OT_NETWORK_TIME_SYNCHRONIZED : otNetworkTimeStatus = 1 ; # [ doc = " This enumeration represents OpenThread time synchronization status." ] # [ doc = "" ] pub type otNetworkTimeStatus = i32 ; # [ doc = " This function pointer is called when a network time sync or status change occurs." ] # [ doc = "" ] pub type otNetworkTimeSyncCallbackFn = :: std :: option :: Option < unsafe extern "C" fn ( aCallbackContext : * mut :: std :: os :: raw :: c_void ) > ; extern "C" { # [ doc = " Get the Thread network time." ] # [ doc = "" ] # [ doc = " @param[in]    aInstance     The OpenThread instance structure." ] # [ doc = " @param[inout] aNetworkTime  The Thread network time in microseconds." ] # [ doc = "" ] # [ doc = " @returns The time synchronization status." ] # [ doc = "" ] pub fn otNetworkTimeGet ( aInstance : * mut otInstance , aNetworkTime : * mut u64 ) -> otNetworkTimeStatus ; } extern "C" { # [ doc = " Set the time synchronization period." ] # [ doc = "" ] # [ doc = " This function can only be called while Thread protocols are disabled." ] # [ doc = "" ] # [ doc = " @param[in] aInstance         The OpenThread instance structure." ] # [ doc = " @param[in] aTimeSyncPeriod   The time synchronization period, in seconds." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully set the time sync period." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  Thread protocols are enabled." ] # [ doc = "" ] pub fn otNetworkTimeSetSyncPeriod ( aInstance : * mut otInstance , aTimeSyncPeriod : u16 ) -> otError ; } extern "C" { # [ doc = " Get the time synchronization period." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @returns The time synchronization period." ] # [ doc = "" ] pub fn otNetworkTimeGetSyncPeriod ( aInstance : * mut otInstance ) -> u16 ; } extern "C" { # [ doc = " Set the time synchronization XTAL accuracy threshold for Router-Capable device." ] # [ doc = "" ] # [ doc = " This function can only be called while Thread protocols are disabled." ] # [ doc = "" ] # [ doc = " @param[in] aInstance        The OpenThread instance structure." ] # [ doc = " @param[in] aXTALThreshold   The XTAL accuracy threshold for Router, in PPM." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully set the time sync period." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  Thread protocols are enabled." ] # [ doc = "" ] pub fn otNetworkTimeSetXtalThreshold ( aInstance : * mut otInstance , aXTALThreshold : u16 ) -> otError ; } extern "C" { # [ doc = " Get the time synchronization XTAL accuracy threshold for Router." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @returns The XTAL accuracy threshold for Router, in PPM." ] # [ doc = "" ] pub fn otNetworkTimeGetXtalThreshold ( aInstance : * mut otInstance ) -> u16 ; } extern "C" { # [ doc = " Set a callback to be called when a network time sync or status change occurs" ] # [ doc = "" ] # [ doc = " This callback shall be called only when the network time offset jumps by" ] # [ doc = " OPENTHREAD_CONFIG_TIME_SYNC_JUMP_NOTIF_MIN_US or when the status changes." ] # [ doc = "" ] # [ doc = " @param[in] aInstance The OpenThread instance structure." ] # [ doc = " @param[in] aCallbackFn The callback function to be called" ] # [ doc = " @param[in] aCallbackContext The context to be passed to the callback function upon invocation" ] # [ doc = "" ] pub fn otNetworkTimeSyncSetCallback ( aInstance : * mut otInstance , aCallbackFn : otNetworkTimeSyncCallbackFn , aCallbackContext : * mut :: std :: os :: raw :: c_void ) ; } extern "C" { # [ doc = " This function generates and returns a random `uint32_t` value." ] # [ doc = "" ] # [ doc = " @returns    A random `uint32_t` value." ] # [ doc = "" ] pub fn otRandomNonCryptoGetUint32 ( ) -> u32 ; } extern "C" { # [ doc = " This function generates and returns a random byte." ] # [ doc = "" ] # [ doc = " @returns A random `uint8_t` value." ] # [ doc = "" ] pub fn otRandomNonCryptoGetUint8 ( ) -> u8 ; } extern "C" { # [ doc = " This function generates and returns a random `uint16_t` value." ] # [ doc = "" ] # [ doc = " @returns A random `uint16_t` value." ] # [ doc = "" ] pub fn otRandomNonCryptoGetUint16 ( ) -> u16 ; } extern "C" { # [ doc = " This function generates and returns a random `uint8_t` value within a given range `[aMin, aMax)`." ] # [ doc = "" ] # [ doc = " @param[in]  aMin  A minimum value (this value can be included in returned random result)." ] # [ doc = " @param[in]  aMax  A maximum value (this value is excluded from returned random result)." ] # [ doc = "" ] # [ doc = " @returns    A random `uint8_t` value in the given range (i.e., aMin <= random value < aMax)." ] pub fn otRandomNonCryptoGetUint8InRange ( aMin : u8 , aMax : u8 ) -> u8 ; } extern "C" { # [ doc = " This function generates and returns a random `uint16_t` value within a given range `[aMin, aMax)`." ] # [ doc = "" ] # [ doc = " @note The returned random value can include the @p aMin value but excludes the @p aMax." ] # [ doc = "" ] # [ doc = " @param[in]  aMin  A minimum value (this value can be included in returned random result)." ] # [ doc = " @param[in]  aMax  A maximum value (this value is excluded from returned random result)." ] # [ doc = "" ] # [ doc = " @returns    A random `uint16_t` value in the given range (i.e., aMin <= random value < aMax)." ] pub fn otRandomNonCryptoGetUint16InRange ( aMin : u16 , aMax : u16 ) -> u16 ; } extern "C" { # [ doc = " This function generates and returns a random `uint32_t` value within a given range `[aMin, aMax)`." ] # [ doc = "" ] # [ doc = " @note The returned random value can include the @p aMin value but excludes the @p aMax." ] # [ doc = "" ] # [ doc = " @param[in]  aMin  A minimum value (this value can be included in returned random result)." ] # [ doc = " @param[in]  aMax  A maximum value (this value is excluded from returned random result)." ] # [ doc = "" ] # [ doc = " @returns    A random `uint32_t` value in the given range (i.e., aMin <= random value < aMax)." ] # [ doc = "" ] pub fn otRandomNonCryptoGetUint32InRange ( aMin : u32 , aMax : u32 ) -> u32 ; } extern "C" { # [ doc = " This function fills a given buffer with random bytes." ] # [ doc = "" ] # [ doc = " @param[out] aBuffer  A pointer to a buffer to fill with the random bytes." ] # [ doc = " @param[in]  aSize    Size of buffer (number of bytes to fill)." ] # [ doc = "" ] pub fn otRandomNonCryptoFillBuffer ( aBuffer : * mut u8 , aSize : u16 ) ; } extern "C" { # [ doc = " This function adds a random jitter within a given range to a given value." ] # [ doc = "" ] # [ doc = " @param[in]  aValue     A value to which the random jitter is added." ] # [ doc = " @param[in]  aJitter    Maximum jitter. Random jitter is selected from the range `[-aJitter, aJitter]`." ] # [ doc = "" ] # [ doc = " @returns    The given value with an added random jitter." ] # [ doc = "" ] pub fn otRandomNonCryptoAddJitter ( aValue : u32 , aJitter : u16 ) -> u32 ; } extern "C" { # [ doc = " This method provides a full or stable copy of the local Thread Network Data." ] # [ doc = "" ] # [ doc = " @param[in]     aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]     aStable      TRUE when copying the stable version, FALSE when copying the full version." ] # [ doc = " @param[out]    aData        A pointer to the data buffer." ] # [ doc = " @param[inout]  aDataLength  On entry, size of the data buffer pointed to by @p aData." ] # [ doc = "                             On exit, number of copied bytes." ] # [ doc = "" ] pub fn otServerGetNetDataLocal ( aInstance : * mut otInstance , aStable : bool , aData : * mut u8 , aDataLength : * mut u8 ) -> otError ; } extern "C" { # [ doc = " Add a service configuration to the local network data." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aConfig   A pointer to the service configuration." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully added the configuration to the local network data." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  One or more configuration parameters were invalid." ] # [ doc = " @retval OT_ERROR_NO_BUFS       Not enough room is available to add the configuration to the local network data." ] # [ doc = "" ] # [ doc = " @sa otServerRemoveService" ] # [ doc = " @sa otServerRegister" ] # [ doc = "" ] pub fn otServerAddService ( aInstance : * mut otInstance , aConfig : * const otServiceConfig ) -> otError ; } extern "C" { # [ doc = " Remove a service configuration from the local network data." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance          A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aEnterpriseNumber  Enterprise Number of the service entry to be deleted." ] # [ doc = " @param[in]  aServiceData       A pointer to an Service Data to look for during deletion." ] # [ doc = " @param[in]  aServiceDataLength The length of @p aServiceData in bytes." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE       Successfully removed the configuration from the local network data." ] # [ doc = " @retval OT_ERROR_NOT_FOUND  Could not find the Border Router entry." ] # [ doc = "" ] # [ doc = " @sa otServerAddService" ] # [ doc = " @sa otServerRegister" ] # [ doc = "" ] pub fn otServerRemoveService ( aInstance : * mut otInstance , aEnterpriseNumber : u32 , aServiceData : * const u8 , aServiceDataLength : u8 ) -> otError ; } extern "C" { # [ doc = " This function gets the next service in the local Network Data." ] # [ doc = "" ] # [ doc = " @param[in]     aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[inout]  aIterator  A pointer to the Network Data iterator context. To get the first service entry" ] # [ doc = "it should be set to OT_NETWORK_DATA_ITERATOR_INIT." ] # [ doc = " @param[out]    aConfig    A pointer to where the service information will be placed." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE       Successfully found the next service." ] # [ doc = " @retval OT_ERROR_NOT_FOUND  No subsequent service exists in the Thread Network Data." ] # [ doc = "" ] pub fn otServerGetNextService ( aInstance : * mut otInstance , aIterator : * mut otNetworkDataIterator , aConfig : * mut otServiceConfig ) -> otError ; } extern "C" { # [ doc = " Immediately register the local network data with the Leader." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE  Successfully queued a Server Data Request message for delivery." ] # [ doc = "" ] # [ doc = " @sa otServerAddService" ] # [ doc = " @sa otServerRemoveService" ] # [ doc = "" ] pub fn otServerRegister ( aInstance : * mut otInstance ) -> otError ; } # [ doc = " This structure implements SNTP Query parameters." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otSntpQuery { # [ doc = "< A reference to the message info related with SNTP Server." ] pub mMessageInfo : * const otMessageInfo , } # [ test ] fn bindgen_test_layout_otSntpQuery ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otSntpQuery > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( otSntpQuery ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otSntpQuery > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otSntpQuery ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otSntpQuery > ( ) ) ) . mMessageInfo as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otSntpQuery ) , "::" , stringify ! ( mMessageInfo ) ) ) ; } # [ doc = " This function pointer is called when a SNTP response is received." ] # [ doc = "" ] # [ doc = " @param[in]  aContext   A pointer to application-specific context." ] # [ doc = " @param[in]  aTime      Specifies the time at the server when the response left for the client, in UNIX time." ] # [ doc = " @param[in]  aResult    A result of the SNTP transaction." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE              A response was received successfully and time is provided" ] # [ doc = "                                     in @p aTime." ] # [ doc = " @retval  OT_ERROR_ABORT             A SNTP transaction was aborted by stack." ] # [ doc = " @retval  OT_ERROR_BUSY              The Kiss-o'-death packet has been received." ] # [ doc = " @retval  OT_ERROR_RESPONSE_TIMEOUT  No SNTP response has been received within timeout." ] # [ doc = " @retval  OT_ERROR_FAILED            A response was received but contains incorrect data." ] # [ doc = "" ] pub type otSntpResponseHandler = :: std :: option :: Option < unsafe extern "C" fn ( aContext : * mut :: std :: os :: raw :: c_void , aTime : u64 , aResult : otError ) > ; extern "C" { # [ doc = " This function sends a SNTP query." ] # [ doc = "" ] # [ doc = " This function is available only if feature `OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE_CLIENT` is enabled." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aQuery      A pointer to specify SNTP query parameters." ] # [ doc = " @param[in]  aHandler    A function pointer that shall be called on response reception or time-out." ] # [ doc = " @param[in]  aContext    A pointer to arbitrary context information." ] # [ doc = "" ] pub fn otSntpClientQuery ( aInstance : * mut otInstance , aQuery : * const otSntpQuery , aHandler : otSntpResponseHandler , aContext : * mut :: std :: os :: raw :: c_void ) -> otError ; } extern "C" { # [ doc = " This function sets the unix era number." ] # [ doc = "" ] # [ doc = " The default value of unix era is set to 0. The subsequent eras start after year 2106." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aUnixEra    Unix era number." ] # [ doc = "" ] pub fn otSntpClientSetUnixEra ( aInstance : * mut otInstance , aUnixEra : u32 ) ; } extern "C" { # [ doc = " Run all queued OpenThread tasklets at the time this is called." ] # [ doc = "" ] # [ doc = " @param[in] aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] pub fn otTaskletsProcess ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " Indicates whether or not OpenThread has tasklets pending." ] # [ doc = "" ] # [ doc = " @param[in] aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval TRUE   If there are tasklets pending." ] # [ doc = " @retval FALSE  If there are no tasklets pending." ] # [ doc = "" ] pub fn otTaskletsArePending ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " OpenThread calls this function when the tasklet queue transitions from empty to non-empty." ] # [ doc = "" ] # [ doc = " @param[in] aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] pub fn otTaskletsSignalPending ( aInstance : * mut otInstance ) ; } # [ doc = " This structure holds diagnostic information for a Thread Child" ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otChildInfo { # [ doc = "< IEEE 802.15.4 Extended Address" ] pub mExtAddress : otExtAddress , # [ doc = "< Timeout" ] pub mTimeout : u32 , # [ doc = "< Time last heard" ] pub mAge : u32 , # [ doc = "< RLOC16" ] pub mRloc16 : u16 , # [ doc = "< Child ID" ] pub mChildId : u16 , # [ doc = "< Network Data Version" ] pub mNetworkDataVersion : u8 , # [ doc = "< Link Quality In" ] pub mLinkQualityIn : u8 , # [ doc = "< Average RSSI" ] pub mAverageRssi : i8 , # [ doc = "< Last observed RSSI" ] pub mLastRssi : i8 , # [ doc = "< Frame error rate (0xffff->100%). Requires error tracking feature." ] pub mFrameErrorRate : u16 , # [ doc = "< (IPv6) msg error rate (0xffff->100%). Requires error tracking feature." ] pub mMessageErrorRate : u16 , pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > , pub __bindgen_padding_0 : [ u8 ; 3usize ] , } # [ test ] fn bindgen_test_layout_otChildInfo ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otChildInfo > ( ) , 32usize , concat ! ( "Size of: " , stringify ! ( otChildInfo ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otChildInfo > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( otChildInfo ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otChildInfo > ( ) ) ) . mExtAddress as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otChildInfo ) , "::" , stringify ! ( mExtAddress ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otChildInfo > ( ) ) ) . mTimeout as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otChildInfo ) , "::" , stringify ! ( mTimeout ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otChildInfo > ( ) ) ) . mAge as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( otChildInfo ) , "::" , stringify ! ( mAge ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otChildInfo > ( ) ) ) . mRloc16 as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otChildInfo ) , "::" , stringify ! ( mRloc16 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otChildInfo > ( ) ) ) . mChildId as * const _ as usize } , 18usize , concat ! ( "Offset of field: " , stringify ! ( otChildInfo ) , "::" , stringify ! ( mChildId ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otChildInfo > ( ) ) ) . mNetworkDataVersion as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( otChildInfo ) , "::" , stringify ! ( mNetworkDataVersion ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otChildInfo > ( ) ) ) . mLinkQualityIn as * const _ as usize } , 21usize , concat ! ( "Offset of field: " , stringify ! ( otChildInfo ) , "::" , stringify ! ( mLinkQualityIn ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otChildInfo > ( ) ) ) . mAverageRssi as * const _ as usize } , 22usize , concat ! ( "Offset of field: " , stringify ! ( otChildInfo ) , "::" , stringify ! ( mAverageRssi ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otChildInfo > ( ) ) ) . mLastRssi as * const _ as usize } , 23usize , concat ! ( "Offset of field: " , stringify ! ( otChildInfo ) , "::" , stringify ! ( mLastRssi ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otChildInfo > ( ) ) ) . mFrameErrorRate as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( otChildInfo ) , "::" , stringify ! ( mFrameErrorRate ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otChildInfo > ( ) ) ) . mMessageErrorRate as * const _ as usize } , 26usize , concat ! ( "Offset of field: " , stringify ! ( otChildInfo ) , "::" , stringify ! ( mMessageErrorRate ) ) ) ; } impl otChildInfo { # [ inline ] pub fn mRxOnWhenIdle ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mRxOnWhenIdle ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mSecureDataRequest ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 1usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mSecureDataRequest ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 1usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mFullThreadDevice ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 2usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mFullThreadDevice ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 2usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mFullNetworkData ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 3usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mFullNetworkData ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 3usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mIsStateRestoring ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 4usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mIsStateRestoring ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 4usize , 1u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( mRxOnWhenIdle : bool , mSecureDataRequest : bool , mFullThreadDevice : bool , mFullNetworkData : bool , mIsStateRestoring : bool ) -> __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 1u8 , { let mRxOnWhenIdle : u8 = unsafe { :: std :: mem :: transmute ( mRxOnWhenIdle ) } ; mRxOnWhenIdle as u64 } ) ; __bindgen_bitfield_unit . set ( 1usize , 1u8 , { let mSecureDataRequest : u8 = unsafe { :: std :: mem :: transmute ( mSecureDataRequest ) } ; mSecureDataRequest as u64 } ) ; __bindgen_bitfield_unit . set ( 2usize , 1u8 , { let mFullThreadDevice : u8 = unsafe { :: std :: mem :: transmute ( mFullThreadDevice ) } ; mFullThreadDevice as u64 } ) ; __bindgen_bitfield_unit . set ( 3usize , 1u8 , { let mFullNetworkData : u8 = unsafe { :: std :: mem :: transmute ( mFullNetworkData ) } ; mFullNetworkData as u64 } ) ; __bindgen_bitfield_unit . set ( 4usize , 1u8 , { let mIsStateRestoring : u8 = unsafe { :: std :: mem :: transmute ( mIsStateRestoring ) } ; mIsStateRestoring as u64 } ) ; __bindgen_bitfield_unit } } pub type otChildIp6AddressIterator = u16 ; pub const otCacheEntryState_OT_CACHE_ENTRY_STATE_CACHED : otCacheEntryState = 0 ; pub const otCacheEntryState_OT_CACHE_ENTRY_STATE_SNOOPED : otCacheEntryState = 1 ; pub const otCacheEntryState_OT_CACHE_ENTRY_STATE_QUERY : otCacheEntryState = 2 ; pub const otCacheEntryState_OT_CACHE_ENTRY_STATE_RETRY_QUERY : otCacheEntryState = 3 ; # [ doc = " This enumeration defines the EID cache entry state." ] # [ doc = "" ] pub type otCacheEntryState = u32 ; # [ doc = " This structure represents an EID cache entry." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otCacheEntryInfo { # [ doc = "< Target EID" ] pub mTarget : otIp6Address , # [ doc = "< RLOC16" ] pub mRloc16 : otShortAddress , # [ doc = "< Entry state" ] pub mState : otCacheEntryState , pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > , # [ doc = "< Last transaction time (applicable in cached state)." ] pub mLastTransTime : u32 , # [ doc = "< Mesh Local EID (applicable if entry in cached state)." ] pub mMeshLocalEid : otIp6Address , # [ doc = "< Timeout in seconds (applicable if in snooped/query/retry-query states)." ] pub mTimeout : u16 , # [ doc = "< Retry delay in seconds (applicable if in query-retry state)." ] pub mRetryDelay : u16 , } # [ test ] fn bindgen_test_layout_otCacheEntryInfo ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otCacheEntryInfo > ( ) , 52usize , concat ! ( "Size of: " , stringify ! ( otCacheEntryInfo ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otCacheEntryInfo > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( otCacheEntryInfo ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCacheEntryInfo > ( ) ) ) . mTarget as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otCacheEntryInfo ) , "::" , stringify ! ( mTarget ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCacheEntryInfo > ( ) ) ) . mRloc16 as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otCacheEntryInfo ) , "::" , stringify ! ( mRloc16 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCacheEntryInfo > ( ) ) ) . mState as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( otCacheEntryInfo ) , "::" , stringify ! ( mState ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCacheEntryInfo > ( ) ) ) . mLastTransTime as * const _ as usize } , 28usize , concat ! ( "Offset of field: " , stringify ! ( otCacheEntryInfo ) , "::" , stringify ! ( mLastTransTime ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCacheEntryInfo > ( ) ) ) . mMeshLocalEid as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( otCacheEntryInfo ) , "::" , stringify ! ( mMeshLocalEid ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCacheEntryInfo > ( ) ) ) . mTimeout as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( otCacheEntryInfo ) , "::" , stringify ! ( mTimeout ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCacheEntryInfo > ( ) ) ) . mRetryDelay as * const _ as usize } , 50usize , concat ! ( "Offset of field: " , stringify ! ( otCacheEntryInfo ) , "::" , stringify ! ( mRetryDelay ) ) ) ; } impl otCacheEntryInfo { # [ inline ] pub fn mCanEvict ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 0usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mCanEvict ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 0usize , 1u8 , val as u64 ) } } # [ inline ] pub fn mValidLastTrans ( & self ) -> bool { unsafe { :: std :: mem :: transmute ( self . _bitfield_1 . get ( 1usize , 1u8 ) as u8 ) } } # [ inline ] pub fn set_mValidLastTrans ( & mut self , val : bool ) { unsafe { let val : u8 = :: std :: mem :: transmute ( val ) ; self . _bitfield_1 . set ( 1usize , 1u8 , val as u64 ) } } # [ inline ] pub fn new_bitfield_1 ( mCanEvict : bool , mValidLastTrans : bool ) -> __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [ u8 ; 1usize ] , u8 > = Default :: default ( ) ; __bindgen_bitfield_unit . set ( 0usize , 1u8 , { let mCanEvict : u8 = unsafe { :: std :: mem :: transmute ( mCanEvict ) } ; mCanEvict as u64 } ) ; __bindgen_bitfield_unit . set ( 1usize , 1u8 , { let mValidLastTrans : u8 = unsafe { :: std :: mem :: transmute ( mValidLastTrans ) } ; mValidLastTrans as u64 } ) ; __bindgen_bitfield_unit } } # [ doc = " This type represents an iterator used for iterating through the EID cache table entries." ] # [ doc = "" ] # [ doc = " To initialize the iterator and start from the first entry in the cache table, set all its fields in the structure to" ] # [ doc = " zero (e.g., `memset` the iterator to zero)." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otCacheEntryIterator { # [ doc = "< Opaque data used by the core implementation. Should not be changed by user." ] pub mData : [ * const :: std :: os :: raw :: c_void ; 2usize ] , } # [ test ] fn bindgen_test_layout_otCacheEntryIterator ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otCacheEntryIterator > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( otCacheEntryIterator ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otCacheEntryIterator > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otCacheEntryIterator ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otCacheEntryIterator > ( ) ) ) . mData as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otCacheEntryIterator ) , "::" , stringify ! ( mData ) ) ) ; } extern "C" { # [ doc = " Get the maximum number of children currently allowed." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The maximum number of children currently allowed." ] # [ doc = "" ] # [ doc = " @sa otThreadSetMaxAllowedChildren" ] # [ doc = "" ] pub fn otThreadGetMaxAllowedChildren ( aInstance : * mut otInstance ) -> u16 ; } extern "C" { # [ doc = " Set the maximum number of children currently allowed." ] # [ doc = "" ] # [ doc = " This parameter can only be set when Thread protocol operation has been stopped." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance     A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aMaxChildren  The maximum allowed children." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE           Successfully set the max." ] # [ doc = " @retval  OT_ERROR_INVALID_ARGS   If @p aMaxChildren is not in the range [1, OPENTHREAD_CONFIG_MLE_MAX_CHILDREN]." ] # [ doc = " @retval  OT_ERROR_INVALID_STATE  If Thread isn't stopped." ] # [ doc = "" ] # [ doc = " @sa otThreadGetMaxAllowedChildren" ] # [ doc = "" ] pub fn otThreadSetMaxAllowedChildren ( aInstance : * mut otInstance , aMaxChildren : u16 ) -> otError ; } extern "C" { # [ doc = " This method indicates whether or not the device is router-eligible." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval TRUE   If device is router-eligible." ] # [ doc = " @retval FALSE  If device is not router-eligible." ] # [ doc = "" ] pub fn otThreadIsRouterEligible ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " This function sets whether or not the device is router-eligible." ] # [ doc = "" ] # [ doc = " If @p aEligible is false and the device is currently operating as a router, this call will cause the device to" ] # [ doc = " detach and attempt to reattach as a child." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aEligible  TRUE to configure the device as router-eligible, FALSE otherwise." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE         Successfully set the router-eligible configuration." ] # [ doc = " @retval OT_ERROR_NOT_CAPABLE  The device is not capable of becoming a router." ] # [ doc = "" ] pub fn otThreadSetRouterEligible ( aInstance : * mut otInstance , aEligible : bool ) -> otError ; } extern "C" { # [ doc = " Set the preferred Router Id." ] # [ doc = "" ] # [ doc = " Upon becoming a router/leader the node attempts to use this Router Id. If the preferred Router Id is not set or if" ] # [ doc = " it can not be used, a randomly generated router id is picked. This property can be set only when the device role is" ] # [ doc = " either detached or disabled." ] # [ doc = "" ] # [ doc = " @note This API is reserved for testing and demo purposes only. Changing settings with" ] # [ doc = " this API will render a production application non-compliant with the Thread Specification." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aRouterId    The preferred Router Id." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully set the preferred Router Id." ] # [ doc = " @retval OT_ERROR_INVALID_STATE Could not set (role is not detached or disabled)" ] # [ doc = "" ] pub fn otThreadSetPreferredRouterId ( aInstance : * mut otInstance , aRouterId : u8 ) -> otError ; } extern "C" { # [ doc = " Get the Thread Leader Weight used when operating in the Leader role." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The Thread Leader Weight value." ] # [ doc = "" ] # [ doc = " @sa otThreadSetLeaderWeight" ] # [ doc = "" ] pub fn otThreadGetLocalLeaderWeight ( aInstance : * mut otInstance ) -> u8 ; } extern "C" { # [ doc = " Set the Thread Leader Weight used when operating in the Leader role." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aWeight   The Thread Leader Weight value." ] # [ doc = "" ] # [ doc = " @sa otThreadGetLeaderWeight" ] # [ doc = "" ] pub fn otThreadSetLocalLeaderWeight ( aInstance : * mut otInstance , aWeight : u8 ) ; } extern "C" { # [ doc = " Get the Thread Leader Partition Id used when operating in the Leader role." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The Thread Leader Partition Id value." ] # [ doc = "" ] pub fn otThreadGetLocalLeaderPartitionId ( aInstance : * mut otInstance ) -> u32 ; } extern "C" { # [ doc = " Set the Thread Leader Partition Id used when operating in the Leader role." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance     A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aPartitionId  The Thread Leader Partition Id value." ] # [ doc = "" ] pub fn otThreadSetLocalLeaderPartitionId ( aInstance : * mut otInstance , aPartitionId : u32 ) ; } extern "C" { # [ doc = " Get the Joiner UDP Port." ] # [ doc = "" ] # [ doc = " @param[in] aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The Joiner UDP Port number." ] # [ doc = "" ] # [ doc = " @sa otThreadSetJoinerUdpPort" ] # [ doc = "" ] pub fn otThreadGetJoinerUdpPort ( aInstance : * mut otInstance ) -> u16 ; } extern "C" { # [ doc = " Set the Joiner UDP Port." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance       A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aJoinerUdpPort  The Joiner UDP Port number." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE  Successfully set the Joiner UDP Port." ] # [ doc = "" ] # [ doc = " @sa otThreadGetJoinerUdpPort" ] # [ doc = "" ] pub fn otThreadSetJoinerUdpPort ( aInstance : * mut otInstance , aJoinerUdpPort : u16 ) -> otError ; } extern "C" { # [ doc = " Set Steering data out of band." ] # [ doc = "" ] # [ doc = " Configuration option `OPENTHREAD_CONFIG_MLE_STEERING_DATA_SET_OOB_ENABLE` should be set to enable setting of steering" ] # [ doc = " data out of band." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance       A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aExtAddress     Address used to update the steering data." ] # [ doc = "                             All zeros to clear the steering data (no steering data)." ] # [ doc = "                             All 0xFFs to set steering data/bloom filter to accept/allow all." ] # [ doc = "                             A specific EUI64 which is then added to current steering data/bloom filter." ] # [ doc = "" ] pub fn otThreadSetSteeringData ( aInstance : * mut otInstance , aExtAddress : * const otExtAddress ) ; } extern "C" { # [ doc = " Get the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The CONTEXT_ID_REUSE_DELAY value." ] # [ doc = "" ] # [ doc = " @sa otThreadSetContextIdReuseDelay" ] # [ doc = "" ] pub fn otThreadGetContextIdReuseDelay ( aInstance : * mut otInstance ) -> u32 ; } extern "C" { # [ doc = " Set the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role." ] # [ doc = "" ] # [ doc = " @note This API is reserved for testing and demo purposes only. Changing settings with" ] # [ doc = " this API will render a production application non-compliant with the Thread Specification." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aDelay    The CONTEXT_ID_REUSE_DELAY value." ] # [ doc = "" ] # [ doc = " @sa otThreadGetContextIdReuseDelay" ] # [ doc = "" ] pub fn otThreadSetContextIdReuseDelay ( aInstance : * mut otInstance , aDelay : u32 ) ; } extern "C" { # [ doc = " Get the NETWORK_ID_TIMEOUT parameter used in the Router role." ] # [ doc = "" ] # [ doc = " @note This API is reserved for testing and demo purposes only. Changing settings with" ] # [ doc = " this API will render a production application non-compliant with the Thread Specification." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The NETWORK_ID_TIMEOUT value." ] # [ doc = "" ] # [ doc = " @sa otThreadSetNetworkIdTimeout" ] # [ doc = "" ] pub fn otThreadGetNetworkIdTimeout ( aInstance : * mut otInstance ) -> u8 ; } extern "C" { # [ doc = " Set the NETWORK_ID_TIMEOUT parameter used in the Leader role." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aTimeout  The NETWORK_ID_TIMEOUT value." ] # [ doc = "" ] # [ doc = " @sa otThreadGetNetworkIdTimeout" ] # [ doc = "" ] pub fn otThreadSetNetworkIdTimeout ( aInstance : * mut otInstance , aTimeout : u8 ) ; } extern "C" { # [ doc = " Get the ROUTER_UPGRADE_THRESHOLD parameter used in the REED role." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The ROUTER_UPGRADE_THRESHOLD value." ] # [ doc = "" ] # [ doc = " @sa otThreadSetRouterUpgradeThreshold" ] # [ doc = "" ] pub fn otThreadGetRouterUpgradeThreshold ( aInstance : * mut otInstance ) -> u8 ; } extern "C" { # [ doc = " Set the ROUTER_UPGRADE_THRESHOLD parameter used in the Leader role." ] # [ doc = "" ] # [ doc = " @note This API is reserved for testing and demo purposes only. Changing settings with" ] # [ doc = " this API will render a production application non-compliant with the Thread Specification." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aThreshold  The ROUTER_UPGRADE_THRESHOLD value." ] # [ doc = "" ] # [ doc = " @sa otThreadGetRouterUpgradeThreshold" ] # [ doc = "" ] pub fn otThreadSetRouterUpgradeThreshold ( aInstance : * mut otInstance , aThreshold : u8 ) ; } extern "C" { # [ doc = " Release a Router ID that has been allocated by the device in the Leader role." ] # [ doc = "" ] # [ doc = " @note This API is reserved for testing and demo purposes only. Changing settings with" ] # [ doc = " this API will render a production application non-compliant with the Thread Specification." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aRouterId  The Router ID to release. Valid range is [0, 62]." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully released the router id." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS   @p aRouterId is not in the range [0, 62]." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  The device is not currently operating as a leader." ] # [ doc = " @retval OT_ERROR_NOT_FOUND      The router id is not currently allocated." ] # [ doc = "" ] pub fn otThreadReleaseRouterId ( aInstance : * mut otInstance , aRouterId : u8 ) -> otError ; } extern "C" { # [ doc = " Attempt to become a router." ] # [ doc = "" ] # [ doc = " @note This API is reserved for testing and demo purposes only. Changing settings with" ] # [ doc = " this API will render a production application non-compliant with the Thread Specification." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully begin attempt to become a router." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  Thread is disabled." ] pub fn otThreadBecomeRouter ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " Become a leader and start a new partition." ] # [ doc = "" ] # [ doc = " @note This API is reserved for testing and demo purposes only. Changing settings with" ] # [ doc = " this API will render a production application non-compliant with the Thread Specification." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully became a leader and started a new partition." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  Thread is disabled." ] pub fn otThreadBecomeLeader ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " Get the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Router role." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The ROUTER_DOWNGRADE_THRESHOLD value." ] # [ doc = "" ] # [ doc = " @sa otThreadSetRouterDowngradeThreshold" ] # [ doc = "" ] pub fn otThreadGetRouterDowngradeThreshold ( aInstance : * mut otInstance ) -> u8 ; } extern "C" { # [ doc = " Set the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Leader role." ] # [ doc = "" ] # [ doc = " @note This API is reserved for testing and demo purposes only. Changing settings with" ] # [ doc = " this API will render a production application non-compliant with the Thread Specification." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aThreshold  The ROUTER_DOWNGRADE_THRESHOLD value." ] # [ doc = "" ] # [ doc = " @sa otThreadGetRouterDowngradeThreshold" ] # [ doc = "" ] pub fn otThreadSetRouterDowngradeThreshold ( aInstance : * mut otInstance , aThreshold : u8 ) ; } extern "C" { # [ doc = " Get the ROUTER_SELECTION_JITTER parameter used in the REED/Router role." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The ROUTER_SELECTION_JITTER value." ] # [ doc = "" ] # [ doc = " @sa otThreadSetRouterSelectionJitter" ] # [ doc = "" ] pub fn otThreadGetRouterSelectionJitter ( aInstance : * mut otInstance ) -> u8 ; } extern "C" { # [ doc = " Set the ROUTER_SELECTION_JITTER parameter used in the REED/Router role." ] # [ doc = "" ] # [ doc = " @note This API is reserved for testing and demo purposes only. Changing settings with" ] # [ doc = " this API will render a production application non-compliant with the Thread Specification." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance      A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aRouterJitter  The ROUTER_SELECTION_JITTER value." ] # [ doc = "" ] # [ doc = " @sa otThreadGetRouterSelectionJitter" ] # [ doc = "" ] pub fn otThreadSetRouterSelectionJitter ( aInstance : * mut otInstance , aRouterJitter : u8 ) ; } extern "C" { # [ doc = " The function retains diagnostic information for an attached Child by its Child ID or RLOC16." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance   A pointer to an OpenThread instance." ] # [ doc = " @param[in]   aChildId    The Child ID or RLOC16 for the attached child." ] # [ doc = " @param[out]  aChildInfo  A pointer to where the child information is placed." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          @p aChildInfo was successfully updated with the info for the given ID." ] # [ doc = " @retval OT_ERROR_NOT_FOUND     No valid child with this Child ID." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  If @p aChildInfo is NULL." ] # [ doc = "" ] pub fn otThreadGetChildInfoById ( aInstance : * mut otInstance , aChildId : u16 , aChildInfo : * mut otChildInfo ) -> otError ; } extern "C" { # [ doc = " The function retains diagnostic information for an attached Child by the internal table index." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]   aChildIndex  The table index." ] # [ doc = " @param[out]  aChildInfo   A pointer to where the child information is placed." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE             @p aChildInfo was successfully updated with the info for the given index." ] # [ doc = " @retval OT_ERROR_NOT_FOUND        No valid child at this index." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS     Either @p aChildInfo is NULL, or @p aChildIndex is out of range (higher" ] # [ doc = "                                   than max table index)." ] # [ doc = "" ] # [ doc = " @sa otGetMaxAllowedChildren" ] # [ doc = "" ] pub fn otThreadGetChildInfoByIndex ( aInstance : * mut otInstance , aChildIndex : u16 , aChildInfo : * mut otChildInfo ) -> otError ; } extern "C" { # [ doc = " This function gets the next IPv6 address (using an iterator) for a given child." ] # [ doc = "" ] # [ doc = " @param[in]     aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]     aChildIndex  The child index." ] # [ doc = " @param[inout]  aIterator    A pointer to the iterator. On success the iterator will be updated to point to next" ] # [ doc = "                             entry in the list. To get the first IPv6 address the iterator should be set to" ] # [ doc = "                             OT_CHILD_IP6_ADDRESS_ITERATOR_INIT." ] # [ doc = " @param[out]    aAddress     A pointer to an IPv6 address where the child's next address is placed (on success)." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully found the next IPv6 address (@p aAddress was successfully updated)." ] # [ doc = " @retval OT_ERROR_NOT_FOUND     The child has no subsequent IPv6 address entry." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  @p aIterator or @p aAddress are NULL, or child at @p aChildIndex is not valid." ] # [ doc = "" ] # [ doc = " @sa otThreadGetChildInfoByIndex" ] # [ doc = "" ] pub fn otThreadGetChildNextIp6Address ( aInstance : * mut otInstance , aChildIndex : u16 , aIterator : * mut otChildIp6AddressIterator , aAddress : * mut otIp6Address ) -> otError ; } extern "C" { # [ doc = " Get the current Router ID Sequence." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The Router ID Sequence." ] # [ doc = "" ] pub fn otThreadGetRouterIdSequence ( aInstance : * mut otInstance ) -> u8 ; } extern "C" { # [ doc = " The function returns the maximum allowed router ID" ] # [ doc = "" ] # [ doc = " @param[in]   aInstance    A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The maximum allowed router ID." ] # [ doc = "" ] pub fn otThreadGetMaxRouterId ( aInstance : * mut otInstance ) -> u8 ; } extern "C" { # [ doc = " The function retains diagnostic information for a given Thread Router." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance    A pointer to an OpenThread instance." ] # [ doc = " @param[in]   aRouterId    The router ID or RLOC16 for a given router." ] # [ doc = " @param[out]  aRouterInfo  A pointer to where the router information is placed." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully retrieved the router info for given id." ] # [ doc = " @retval OT_ERROR_NOT_FOUND     No router entry with the given id." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  @p aRouterInfo is NULL." ] # [ doc = "" ] pub fn otThreadGetRouterInfo ( aInstance : * mut otInstance , aRouterId : u16 , aRouterInfo : * mut otRouterInfo ) -> otError ; } extern "C" { # [ doc = " This function gets the next EID cache entry (using an iterator)." ] # [ doc = "" ] # [ doc = " @param[in]    aInstance   A pointer to an OpenThread instance." ] # [ doc = " @param[out]   aEntryInfo  A pointer to where the EID cache entry information is placed." ] # [ doc = " @param[inout] aIterator   A pointer to an iterator. It will be updated to point to next entry on success. To get the" ] # [ doc = "                           first entry, initialize the iterator by setting all its fields to zero (e.g., `memset` the" ] # [ doc = "                           the iterator structure to zero)." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully populated @p aEntryInfo for next EID cache entry." ] # [ doc = " @retval OT_ERROR_NOT_FOUND     No more entries in the address cache table." ] # [ doc = "" ] pub fn otThreadGetNextCacheEntry ( aInstance : * mut otInstance , aEntryInfo : * mut otCacheEntryInfo , aIterator : * mut otCacheEntryIterator ) -> otError ; } extern "C" { # [ doc = " Get the Thread PSKc" ] # [ doc = "" ] # [ doc = " @param[in]   aInstance   A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to Thread PSKc" ] # [ doc = "" ] # [ doc = " @sa otThreadSetPskc" ] # [ doc = "" ] pub fn otThreadGetPskc ( aInstance : * mut otInstance ) -> * const otPskc ; } extern "C" { # [ doc = " Set the Thread PSKc" ] # [ doc = "" ] # [ doc = " This function will only succeed when Thread protocols are disabled.  A successful" ] # [ doc = " call to this function will also invalidate the Active and Pending Operational Datasets in" ] # [ doc = " non-volatile memory." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aPskc       A pointer to the new Thread PSKc." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully set the Thread PSKc." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  Thread protocols are enabled." ] # [ doc = "" ] # [ doc = " @sa otThreadGetPskc" ] # [ doc = "" ] pub fn otThreadSetPskc ( aInstance : * mut otInstance , aPskc : * const otPskc ) -> otError ; } extern "C" { # [ doc = " Get the assigned parent priority." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance   A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The assigned parent priority value, -2 means not assigned." ] # [ doc = "" ] # [ doc = " @sa otThreadSetParentPriority" ] # [ doc = "" ] pub fn otThreadGetParentPriority ( aInstance : * mut otInstance ) -> i8 ; } extern "C" { # [ doc = " Set the parent priority." ] # [ doc = "" ] # [ doc = " @note This API is reserved for testing and demo purposes only. Changing settings with" ] # [ doc = " this API will render a production application non-compliant with the Thread Specification." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance        A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aParentPriority  The parent priority value." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully set the parent priority." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS   If the parent priority value is not among 1, 0, -1 and -2." ] # [ doc = "" ] # [ doc = " @sa otThreadGetParentPriority" ] # [ doc = "" ] pub fn otThreadSetParentPriority ( aInstance : * mut otInstance , aParentPriority : i8 ) -> otError ; } extern "C" { # [ doc = " This function gets the maximum number of IP addresses that each MTD child may register with this device as parent." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance    A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The maximum number of IP addresses that each MTD child may register with this device as parent." ] # [ doc = "" ] # [ doc = " @sa otThreadSetMaxChildIpAddresses" ] # [ doc = "" ] pub fn otThreadGetMaxChildIpAddresses ( aInstance : * mut otInstance ) -> u8 ; } extern "C" { # [ doc = " This function sets/restores the maximum number of IP addresses that each MTD child may register with this" ] # [ doc = " device as parent." ] # [ doc = "" ] # [ doc = " @note This API requires `OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE`, and is only used by Thread Test Harness" ] # [ doc = "       to limit the address registrations of the reference parent in order to test the MTD DUT reaction." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance        A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aMaxIpAddresses  The maximum number of IP addresses that each MTD child may register with this" ] # [ doc = "                              device as parent. 0 to clear the setting and restore the default." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Successfully set/cleared the number." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS   If exceeds the allowed maximum number." ] # [ doc = "" ] # [ doc = " @sa otThreadGetMaxChildIpAddresses" ] # [ doc = "" ] pub fn otThreadSetMaxChildIpAddresses ( aInstance : * mut otInstance , aMaxIpAddresses : u8 ) -> otError ; } # [ doc = "< A child is being added." ] pub const otNeighborTableEvent_OT_NEIGHBOR_TABLE_EVENT_CHILD_ADDED : otNeighborTableEvent = 0 ; # [ doc = "< A child is being removed." ] pub const otNeighborTableEvent_OT_NEIGHBOR_TABLE_EVENT_CHILD_REMOVED : otNeighborTableEvent = 1 ; # [ doc = "< A router is being added." ] pub const otNeighborTableEvent_OT_NEIGHBOR_TABLE_EVENT_ROUTER_ADDED : otNeighborTableEvent = 2 ; # [ doc = "< A router is being removed." ] pub const otNeighborTableEvent_OT_NEIGHBOR_TABLE_EVENT_ROUTER_REMOVED : otNeighborTableEvent = 3 ; # [ doc = " This enumeration defines the constants used in `otNeighborTableCallback` to indicate whether a child or router" ] # [ doc = " neighbor is being added or removed." ] # [ doc = "" ] pub type otNeighborTableEvent = u32 ; # [ doc = " This type represent a neighbor table entry info (child or router) and is used as a parameter in the neighbor table" ] # [ doc = " callback `otNeighborTableCallback`." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otNeighborTableEntryInfo { # [ doc = "< The OpenThread instance." ] pub mInstance : * mut otInstance , pub mInfo : otNeighborTableEntryInfo__bindgen_ty_1 , } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub union otNeighborTableEntryInfo__bindgen_ty_1 { # [ doc = "< The child neighbor info." ] pub mChild : otChildInfo , # [ doc = "< The router neighbor info." ] pub mRouter : otNeighborInfo , _bindgen_union_align : [ u32 ; 9usize ] , } # [ test ] fn bindgen_test_layout_otNeighborTableEntryInfo__bindgen_ty_1 ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otNeighborTableEntryInfo__bindgen_ty_1 > ( ) , 36usize , concat ! ( "Size of: " , stringify ! ( otNeighborTableEntryInfo__bindgen_ty_1 ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otNeighborTableEntryInfo__bindgen_ty_1 > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( otNeighborTableEntryInfo__bindgen_ty_1 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNeighborTableEntryInfo__bindgen_ty_1 > ( ) ) ) . mChild as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNeighborTableEntryInfo__bindgen_ty_1 ) , "::" , stringify ! ( mChild ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNeighborTableEntryInfo__bindgen_ty_1 > ( ) ) ) . mRouter as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNeighborTableEntryInfo__bindgen_ty_1 ) , "::" , stringify ! ( mRouter ) ) ) ; } # [ test ] fn bindgen_test_layout_otNeighborTableEntryInfo ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otNeighborTableEntryInfo > ( ) , 48usize , concat ! ( "Size of: " , stringify ! ( otNeighborTableEntryInfo ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otNeighborTableEntryInfo > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otNeighborTableEntryInfo ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNeighborTableEntryInfo > ( ) ) ) . mInstance as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otNeighborTableEntryInfo ) , "::" , stringify ! ( mInstance ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otNeighborTableEntryInfo > ( ) ) ) . mInfo as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otNeighborTableEntryInfo ) , "::" , stringify ! ( mInfo ) ) ) ; } # [ doc = " This function pointer is called to notify that a child or router neighbor is being added to or removed from neighbor" ] # [ doc = " table." ] # [ doc = "" ] # [ doc = " @param[in]  aEvent      A event flag." ] # [ doc = " @param[in]  aEntryInfo  A pointer to table entry info." ] # [ doc = "" ] pub type otNeighborTableCallback = :: std :: option :: Option < unsafe extern "C" fn ( aEvent : otNeighborTableEvent , aEntryInfo : * const otNeighborTableEntryInfo ) > ; extern "C" { # [ doc = " This function registers a neighbor table callback function." ] # [ doc = "" ] # [ doc = " The provided callback (if non-NULL) will be invoked when a child or router neighbor entry is being added/removed" ] # [ doc = " to/from the neighbor table. Subsequent calls to this method will overwrite the previous callback.  Note that this" ] # [ doc = " callback in invoked while the neighbor/child table is being updated and always before the `otStateChangedCallback`." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in] aCallback  A pointer to callback handler function." ] # [ doc = "" ] pub fn otThreadRegisterNeighborTableCallback ( aInstance : * mut otInstance , aCallback : otNeighborTableCallback ) ; } # [ doc = " This callback allows OpenThread to provide specific handlers for certain UDP messages." ] # [ doc = "" ] # [ doc = " @retval  true    The message is handled by this receiver and should not be further processed." ] # [ doc = " @retval  false   The message is not handled by this receiver." ] # [ doc = "" ] pub type otUdpHandler = :: std :: option :: Option < unsafe extern "C" fn ( aContext : * mut :: std :: os :: raw :: c_void , aMessage : * const otMessage , aMessageInfo : * const otMessageInfo ) -> bool > ; # [ doc = " This structure represents a UDP receiver." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otUdpReceiver { # [ doc = "< A pointer to the next UDP receiver (internal use only)." ] pub mNext : * mut otUdpReceiver , # [ doc = "< A function pointer to the receiver callback." ] pub mHandler : otUdpHandler , # [ doc = "< A pointer to application-specific context." ] pub mContext : * mut :: std :: os :: raw :: c_void , } # [ test ] fn bindgen_test_layout_otUdpReceiver ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otUdpReceiver > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( otUdpReceiver ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otUdpReceiver > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otUdpReceiver ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otUdpReceiver > ( ) ) ) . mNext as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otUdpReceiver ) , "::" , stringify ! ( mNext ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otUdpReceiver > ( ) ) ) . mHandler as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otUdpReceiver ) , "::" , stringify ! ( mHandler ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otUdpReceiver > ( ) ) ) . mContext as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otUdpReceiver ) , "::" , stringify ! ( mContext ) ) ) ; } extern "C" { # [ doc = " This function adds a UDP receiver." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance       A pointer to an OpenThread instance." ] # [ doc = " @param[in]   aUdpReceiver    A pointer to the UDP receiver." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE       The receiver is successfully added." ] # [ doc = " @retval  OT_ERROR_ALREADY    The UDP receiver was already added." ] # [ doc = "" ] pub fn otUdpAddReceiver ( aInstance : * mut otInstance , aUdpReceiver : * mut otUdpReceiver ) -> otError ; } extern "C" { # [ doc = " This function removes a UDP receiver." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance       A pointer to an OpenThread instance." ] # [ doc = " @param[in]   aUdpReceiver    A pointer to the UDP receiver." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE       The receiver is successfully removed." ] # [ doc = " @retval  OT_ERROR_NOT_FOUND  The UDP receiver was not added." ] # [ doc = "" ] pub fn otUdpRemoveReceiver ( aInstance : * mut otInstance , aUdpReceiver : * mut otUdpReceiver ) -> otError ; } extern "C" { # [ doc = " This function sends a UDP message without socket." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance     A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aMessage      A pointer to a message without UDP header." ] # [ doc = " @param[in]  aMessageInfo  A pointer to a message info associated with @p aMessage." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE     Successfully enqueued the message into an output interface." ] # [ doc = " @retval OT_ERROR_NO_BUFS  Insufficient available buffer to add the IPv6 headers." ] # [ doc = "" ] pub fn otUdpSendDatagram ( aInstance : * mut otInstance , aMessage : * mut otMessage , aMessageInfo : * mut otMessageInfo ) -> otError ; } # [ doc = " This callback allows OpenThread to inform the application of a received UDP message." ] # [ doc = "" ] pub type otUdpReceive = :: std :: option :: Option < unsafe extern "C" fn ( aContext : * mut :: std :: os :: raw :: c_void , aMessage : * mut otMessage , aMessageInfo : * const otMessageInfo ) > ; # [ doc = " This structure represents a UDP socket." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otUdpSocket { # [ doc = "< The local IPv6 socket address." ] pub mSockName : otSockAddr , # [ doc = "< The peer IPv6 socket address." ] pub mPeerName : otSockAddr , # [ doc = "< A function pointer to the application callback." ] pub mHandler : otUdpReceive , # [ doc = "< A pointer to application-specific context." ] pub mContext : * mut :: std :: os :: raw :: c_void , # [ doc = "< A handle to platform's UDP" ] pub mHandle : * mut :: std :: os :: raw :: c_void , # [ doc = "< A pointer to the next UDP socket (internal use only)." ] pub mNext : * mut otUdpSocket , } # [ test ] fn bindgen_test_layout_otUdpSocket ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otUdpSocket > ( ) , 72usize , concat ! ( "Size of: " , stringify ! ( otUdpSocket ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otUdpSocket > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otUdpSocket ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otUdpSocket > ( ) ) ) . mSockName as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otUdpSocket ) , "::" , stringify ! ( mSockName ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otUdpSocket > ( ) ) ) . mPeerName as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( otUdpSocket ) , "::" , stringify ! ( mPeerName ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otUdpSocket > ( ) ) ) . mHandler as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( otUdpSocket ) , "::" , stringify ! ( mHandler ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otUdpSocket > ( ) ) ) . mContext as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( otUdpSocket ) , "::" , stringify ! ( mContext ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otUdpSocket > ( ) ) ) . mHandle as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( otUdpSocket ) , "::" , stringify ! ( mHandle ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otUdpSocket > ( ) ) ) . mNext as * const _ as usize } , 64usize , concat ! ( "Offset of field: " , stringify ! ( otUdpSocket ) , "::" , stringify ! ( mNext ) ) ) ; } extern "C" { # [ doc = " Allocate a new message buffer for sending a UDP message." ] # [ doc = "" ] # [ doc = " @note If @p aSettings is 'NULL', the link layer security is enabled and the message priority is set to" ] # [ doc = " OT_MESSAGE_PRIORITY_NORMAL by default." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aSettings  A pointer to the message settings or NULL to set default settings." ] # [ doc = "" ] # [ doc = " @returns A pointer to the message buffer or NULL if no message buffers are available or parameters are invalid." ] # [ doc = "" ] # [ doc = " @sa otMessageFree" ] # [ doc = "" ] pub fn otUdpNewMessage ( aInstance : * mut otInstance , aSettings : * const otMessageSettings ) -> * mut otMessage ; } extern "C" { # [ doc = " Open a UDP/IPv6 socket." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aSocket    A pointer to a UDP socket structure." ] # [ doc = " @param[in]  aCallback  A pointer to the application callback function." ] # [ doc = " @param[in]  aContext   A pointer to application-specific context." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE    Successfully opened the socket." ] # [ doc = " @retval OT_ERROR_FAILED  Failed to open the socket." ] # [ doc = "" ] # [ doc = " @sa otUdpNewMessage" ] # [ doc = " @sa otUdpClose" ] # [ doc = " @sa otUdpBind" ] # [ doc = " @sa otUdpConnect" ] # [ doc = " @sa otUdpSend" ] # [ doc = "" ] pub fn otUdpOpen ( aInstance : * mut otInstance , aSocket : * mut otUdpSocket , aCallback : otUdpReceive , aContext : * mut :: std :: os :: raw :: c_void ) -> otError ; } extern "C" { # [ doc = " Close a UDP/IPv6 socket." ] # [ doc = "" ] # [ doc = " @param[in]  aSocket  A pointer to a UDP socket structure." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE  Successfully closed the socket." ] # [ doc = "" ] # [ doc = " @sa otUdpNewMessage" ] # [ doc = " @sa otUdpOpen" ] # [ doc = " @sa otUdpBind" ] # [ doc = " @sa otUdpConnect" ] # [ doc = " @sa otUdpSend" ] # [ doc = "" ] pub fn otUdpClose ( aSocket : * mut otUdpSocket ) -> otError ; } extern "C" { # [ doc = " Bind a UDP/IPv6 socket." ] # [ doc = "" ] # [ doc = " @param[in]  aSocket    A pointer to a UDP socket structure." ] # [ doc = " @param[in]  aSockName  A pointer to an IPv6 socket address structure." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE  Bind operation was successful." ] # [ doc = "" ] # [ doc = " @sa otUdpNewMessage" ] # [ doc = " @sa otUdpOpen" ] # [ doc = " @sa otUdpConnect" ] # [ doc = " @sa otUdpClose" ] # [ doc = " @sa otUdpSend" ] # [ doc = "" ] pub fn otUdpBind ( aSocket : * mut otUdpSocket , aSockName : * mut otSockAddr ) -> otError ; } extern "C" { # [ doc = " Connect a UDP/IPv6 socket." ] # [ doc = "" ] # [ doc = " @param[in]  aSocket    A pointer to a UDP socket structure." ] # [ doc = " @param[in]  aSockName  A pointer to an IPv6 socket address structure." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE  Connect operation was successful." ] # [ doc = "" ] # [ doc = " @sa otUdpNewMessage" ] # [ doc = " @sa otUdpOpen" ] # [ doc = " @sa otUdpBind" ] # [ doc = " @sa otUdpClose" ] # [ doc = " @sa otUdpSend" ] # [ doc = "" ] pub fn otUdpConnect ( aSocket : * mut otUdpSocket , aSockName : * mut otSockAddr ) -> otError ; } extern "C" { # [ doc = " Send a UDP/IPv6 message." ] # [ doc = "" ] # [ doc = " @param[in]  aSocket       A pointer to a UDP socket structure." ] # [ doc = " @param[in]  aMessage      A pointer to a message buffer." ] # [ doc = " @param[in]  aMessageInfo  A pointer to a message info structure." ] # [ doc = "" ] # [ doc = " If the return value is OT_ERROR_NONE, OpenThread takes ownership of @p aMessage, and the caller should no longer" ] # [ doc = " reference @p aMessage. If the return value is not OT_ERROR_NONE, the caller retains ownership of @p aMessage," ] # [ doc = " including freeing @p aMessage if the message buffer is no longer needed." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE            The message is successfully scheduled for sending." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS    Invalid arguments are given." ] # [ doc = "" ] # [ doc = " @sa otUdpNewMessage" ] # [ doc = " @sa otUdpOpen" ] # [ doc = " @sa otUdpClose" ] # [ doc = " @sa otUdpBind" ] # [ doc = " @sa otUdpConnect" ] # [ doc = " @sa otUdpSend" ] # [ doc = "" ] pub fn otUdpSend ( aSocket : * mut otUdpSocket , aMessage : * mut otMessage , aMessageInfo : * const otMessageInfo ) -> otError ; } # [ doc = " This function pointer delivers the UDP packet to host and host should send the packet through its own network stack." ] # [ doc = "" ] # [ doc = " @param[in]  aMessage   A pointer to the UDP Message." ] # [ doc = " @param[in]  aPeerPort  The destination UDP port." ] # [ doc = " @param[in]  aPeerAddr  A pointer to the destination IPv6 address." ] # [ doc = " @param[in]  aSockPort  The source UDP port." ] # [ doc = " @param[in]  aContext   A pointer to application-specific context." ] # [ doc = "" ] pub type otUdpForwarder = :: std :: option :: Option < unsafe extern "C" fn ( aMessage : * mut otMessage , aPeerPort : u16 , aPeerAddr : * mut otIp6Address , aSockPort : u16 , aContext : * mut :: std :: os :: raw :: c_void ) > ; extern "C" { # [ doc = " Set UDP forward callback to deliver UDP packets to host." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance            A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aForwarder           A pointer to a function called to forward UDP packet to host." ] # [ doc = " @param[in]  aContext             A pointer to application-specific context." ] # [ doc = "" ] pub fn otUdpForwardSetForwarder ( aInstance : * mut otInstance , aForwarder : otUdpForwarder , aContext : * mut :: std :: os :: raw :: c_void ) ; } extern "C" { # [ doc = " Handle a UDP packet received from host." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance            A pointer to an OpenThread instance." ] # [ doc = " @param[in]  aMessage             A pointer to the UDP Message." ] # [ doc = " @param[in]  aPeerPort            The source UDP port." ] # [ doc = " @param[in]  aPeerAddr            A pointer to the source address." ] # [ doc = " @param[in]  aSockPort            The destination UDP port." ] # [ doc = "" ] # [ doc = " @warning No matter the call success or fail, the message is freed." ] # [ doc = "" ] pub fn otUdpForwardReceive ( aInstance : * mut otInstance , aMessage : * mut otMessage , aPeerPort : u16 , aPeerAddr : * const otIp6Address , aSockPort : u16 ) ; } extern "C" { # [ doc = " This function gets the existing UDP Sockets." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance            A pointer to an OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to the first UDP Socket." ] # [ doc = "" ] pub fn otUdpGetSockets ( aInstance : * mut otInstance ) -> * mut otUdpSocket ; } extern "C" { # [ doc = " Set the alarm to fire at @p aDt milliseconds after @p aT0." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aT0        The reference time." ] # [ doc = " @param[in] aDt        The time delay in milliseconds from @p aT0." ] pub fn otPlatAlarmMilliStartAt ( aInstance : * mut otInstance , aT0 : u32 , aDt : u32 ) ; } extern "C" { # [ doc = " Stop the alarm." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] pub fn otPlatAlarmMilliStop ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " Get the current time." ] # [ doc = "" ] # [ doc = " @returns The current time in milliseconds." ] pub fn otPlatAlarmMilliGetNow ( ) -> u32 ; } extern "C" { # [ doc = " Signal that the alarm has fired." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] pub fn otPlatAlarmMilliFired ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " Signal diagnostics module that the alarm has fired." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] pub fn otPlatDiagAlarmFired ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " Set the alarm to fire at @p aDt microseconds after @p aT0." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  The OpenThread instance structure." ] # [ doc = " @param[in]  aT0        The reference time." ] # [ doc = " @param[in]  aDt        The time delay in microseconds from @p aT0." ] # [ doc = "" ] pub fn otPlatAlarmMicroStartAt ( aInstance : * mut otInstance , aT0 : u32 , aDt : u32 ) ; } extern "C" { # [ doc = " Stop the alarm." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] pub fn otPlatAlarmMicroStop ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " Get the current time." ] # [ doc = "" ] # [ doc = " @returns  The current time in microseconds." ] # [ doc = "" ] pub fn otPlatAlarmMicroGetNow ( ) -> u32 ; } extern "C" { # [ doc = " Signal that the alarm has fired." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] pub fn otPlatAlarmMicroFired ( aInstance : * mut otInstance ) ; } # [ doc = " The size of the Bluetooth Device Address [bytes]." ] pub const OT_BLE_ADDRESS_LENGTH : _bindgen_ty_8 = 6 ; # [ doc = " Time slot duration on PHY layer in microseconds (0.625ms)." ] pub const OT_BLE_TIMESLOT_UNIT : _bindgen_ty_8 = 625 ; # [ doc = " Unit used to calculate connection interval (1.25ms)" ] pub const OT_BLE_CONN_INTERVAL_UNIT : _bindgen_ty_8 = 1250 ; # [ doc = " Minimum allowed connection interval in OT_BLE_CONN_INTERVAL_UNIT units (7.5ms)." ] # [ doc = " See v4.2 [Vol 2, Part E] page 946" ] pub const OT_BLE_CONN_INTERVAL_MIN : _bindgen_ty_8 = 6 ; # [ doc = " Maximum allowed connection interval in OT_BLE_CONN_INTERVAL_UNIT units (4s)." ] # [ doc = " See v4.2 [Vol 2, Part E] page 946" ] pub const OT_BLE_CONN_INTERVAL_MAX : _bindgen_ty_8 = 3200 ; # [ doc = " Maximum allowed slave latency in units of connection events." ] # [ doc = " See v4.2 [Vol 2, Part E] page 946" ] pub const OT_BLE_CONN_SLAVE_LATENCY_MAX : _bindgen_ty_8 = 499 ; # [ doc = " Minimum allowed connection timeout in units of 10ms (100ms)." ] # [ doc = " See v4.2 [Vol 2, Part E] page 946" ] pub const OT_BLE_CONN_SUPERVISOR_TIMEOUT_MIN : _bindgen_ty_8 = 10 ; # [ doc = " Maximum allowed connection timeout (32s)." ] # [ doc = " See v4.2 [Vol 2, Part E] page 946" ] pub const OT_BLE_CONN_SUPERVISOR_TIMEOUT_MAX : _bindgen_ty_8 = 3200 ; # [ doc = " Unit used to calculate connection supervisor timeout (10ms)." ] pub const OT_BLE_CONN_SUPERVISOR_UNIT : _bindgen_ty_8 = 10000 ; # [ doc = " Maximum length of the device name characteristic [bytes]." ] pub const OT_BLE_DEV_NAME_MAX_LENGTH : _bindgen_ty_8 = 248 ; # [ doc = " Maximum length of advertising data [bytes]." ] pub const OT_BLE_ADV_DATA_MAX_LENGTH : _bindgen_ty_8 = 31 ; # [ doc = " Maximum length of scan response data [bytes]." ] pub const OT_BLE_SCAN_RESPONSE_MAX_LENGTH : _bindgen_ty_8 = 31 ; # [ doc = " Minimum allowed interval for advertising packet in OT_BLE_ADV_INTERVAL_UNIT units (20ms)." ] pub const OT_BLE_ADV_INTERVAL_MIN : _bindgen_ty_8 = 32 ; # [ doc = " Maximum allowed interval for advertising packet in OT_BLE_ADV_INTERVAL_UNIT units (10.24s)." ] pub const OT_BLE_ADV_INTERVAL_MAX : _bindgen_ty_8 = 16384 ; # [ doc = " Unit used to calculate interval duration (0.625ms)." ] pub const OT_BLE_ADV_INTERVAL_UNIT : _bindgen_ty_8 = 625 ; # [ doc = " Minimum allowed scan interval (2.5ms)." ] pub const OT_BLE_SCAN_INTERVAL_MIN : _bindgen_ty_8 = 4 ; # [ doc = " Maximum allowed scan interval (10.24s)." ] pub const OT_BLE_SCAN_INTERVAL_MAX : _bindgen_ty_8 = 16384 ; # [ doc = " Unit used to calculate scan interval duration (0.625ms)." ] pub const OT_BLE_SCAN_INTERVAL_UNIT : _bindgen_ty_8 = 625 ; # [ doc = " Minimum allowed scan window in OT_BLE_TIMESLOT_UNIT units (2.5ms)." ] pub const OT_BLE_SCAN_WINDOW_MIN : _bindgen_ty_8 = 4 ; # [ doc = " Maximum allowed scan window in OT_BLE_TIMESLOT_UNIT units (10.24s)." ] pub const OT_BLE_SCAN_WINDOW_MAX : _bindgen_ty_8 = 16384 ; # [ doc = " Unit used to calculate scan window duration (0.625ms)." ] pub const OT_BLE_SCAN_WINDOW_UNIT : _bindgen_ty_8 = 625 ; # [ doc = " BLE HCI code for remote user terminated connection." ] pub const OT_BLE_HCI_REMOTE_USER_TERMINATED : _bindgen_ty_8 = 19 ; # [ doc = " Value of invalid/unknown handle." ] pub const OT_BLE_INVALID_HANDLE : _bindgen_ty_8 = 0 ; # [ doc = " Maximum size of BLE Characteristic [bytes]." ] pub const OT_BLE_CHARACTERISTIC_MAX_LENGTH : _bindgen_ty_8 = 512 ; # [ doc = " Maximum value of ATT_MTU [bytes]." ] pub const OT_BLE_ATT_MTU_MAX : _bindgen_ty_8 = 511 ; # [ doc = " Length of full BLE UUID in bytes." ] pub const OT_BLE_UUID_LENGTH : _bindgen_ty_8 = 16 ; # [ doc = " Uuid of Client Configuration Characteristic Descriptor." ] pub const OT_BLE_UUID_CCCD : _bindgen_ty_8 = 10498 ; # [ doc = " @addtogroup plat-ble" ] # [ doc = "" ] # [ doc = " @brief" ] # [ doc = "   This module includes the platform abstraction for BLE Host communication." ] # [ doc = "   The platform needs to implement Bluetooth LE 4.2 or higher." ] # [ doc = "" ] # [ doc = " @{" ] # [ doc = "" ] pub type _bindgen_ty_8 = u32 ; # [ doc = " This structure represents BLE Device Address." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otPlatBleDeviceAddr { # [ doc = "< Bluetooth device address type." ] pub mAddrType : u8 , # [ doc = "< An 48-bit address of Bluetooth device in LSB format." ] pub mAddr : [ u8 ; 6usize ] , } # [ test ] fn bindgen_test_layout_otPlatBleDeviceAddr ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otPlatBleDeviceAddr > ( ) , 7usize , concat ! ( "Size of: " , stringify ! ( otPlatBleDeviceAddr ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otPlatBleDeviceAddr > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( otPlatBleDeviceAddr ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleDeviceAddr > ( ) ) ) . mAddrType as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleDeviceAddr ) , "::" , stringify ! ( mAddrType ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleDeviceAddr > ( ) ) ) . mAddr as * const _ as usize } , 1usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleDeviceAddr ) , "::" , stringify ! ( mAddr ) ) ) ; } # [ doc = " This structure represents BLE connection parameters." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otPlatBleGapConnParams { # [ doc = " Preferred minimum connection interval in OT_BLE_TIMESLOT_UNIT units." ] # [ doc = " Shall be in OT_BLE_CONN_INTERVAL_MIN and OT_BLE_CONN_INTERVAL_MAX range." ] pub mConnMinInterval : u16 , # [ doc = " Preferred maximum connection interval in OT_BLE_TIMESLOT_UNIT units." ] # [ doc = " Shall be in OT_BLE_CONN_INTERVAL_MIN and OT_BLE_CONN_INTERVAL_MAX range." ] pub mConnMaxInterval : u16 , # [ doc = " Slave Latency in number of connection events." ] # [ doc = " Shall not exceed OT_BLE_CONN_SLAVE_LATENCY_MAX value." ] pub mConnSlaveLatency : u16 , # [ doc = " Defines connection timeout parameter in OT_BLE_CONN_SUPERVISOR_UNIT units. Shall be in" ] # [ doc = " OT_BLE_CONN_SUPERVISOR_TIMEOUT_MIN and OT_BLE_CONN_SUPERVISOR_TIMEOUT_MIN range." ] pub mConnSupervisionTimeout : u16 , } # [ test ] fn bindgen_test_layout_otPlatBleGapConnParams ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otPlatBleGapConnParams > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( otPlatBleGapConnParams ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otPlatBleGapConnParams > ( ) , 2usize , concat ! ( "Alignment of " , stringify ! ( otPlatBleGapConnParams ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleGapConnParams > ( ) ) ) . mConnMinInterval as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleGapConnParams ) , "::" , stringify ! ( mConnMinInterval ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleGapConnParams > ( ) ) ) . mConnMaxInterval as * const _ as usize } , 2usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleGapConnParams ) , "::" , stringify ! ( mConnMaxInterval ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleGapConnParams > ( ) ) ) . mConnSlaveLatency as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleGapConnParams ) , "::" , stringify ! ( mConnSlaveLatency ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleGapConnParams > ( ) ) ) . mConnSupervisionTimeout as * const _ as usize } , 6usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleGapConnParams ) , "::" , stringify ! ( mConnSupervisionTimeout ) ) ) ; } # [ doc = "< UUID uninitialized value." ] pub const otPlatBleUuidType_OT_BLE_UUID_TYPE_NONE : otPlatBleUuidType = 0 ; # [ doc = "< UUID represented by 16-bit value." ] pub const otPlatBleUuidType_OT_BLE_UUID_TYPE_16 : otPlatBleUuidType = 1 ; # [ doc = "< UUID represented by 32-bit value." ] pub const otPlatBleUuidType_OT_BLE_UUID_TYPE_32 : otPlatBleUuidType = 2 ; # [ doc = "< UUID represented by 128-bit value." ] pub const otPlatBleUuidType_OT_BLE_UUID_TYPE_128 : otPlatBleUuidType = 3 ; # [ doc = " This enumeration represents BLE UUID value." ] # [ doc = "" ] pub type otPlatBleUuidType = u32 ; # [ doc = " This structure represents BLE UUID value." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub union otPlatBleUuidValue { # [ doc = "< A pointer to 128-bit UUID value." ] pub mUuid128 : * mut u8 , # [ doc = "< A 32-bit UUID value." ] pub mUuid32 : u32 , # [ doc = "< A 16-bit UUID value." ] pub mUuid16 : u16 , _bindgen_union_align : u64 , } # [ test ] fn bindgen_test_layout_otPlatBleUuidValue ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otPlatBleUuidValue > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( otPlatBleUuidValue ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otPlatBleUuidValue > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otPlatBleUuidValue ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleUuidValue > ( ) ) ) . mUuid128 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleUuidValue ) , "::" , stringify ! ( mUuid128 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleUuidValue > ( ) ) ) . mUuid32 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleUuidValue ) , "::" , stringify ! ( mUuid32 ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleUuidValue > ( ) ) ) . mUuid16 as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleUuidValue ) , "::" , stringify ! ( mUuid16 ) ) ) ; } # [ doc = " This structure represents BLE UUID." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otPlatBleUuid { # [ doc = "< A type of UUID in @p mValue." ] pub mType : otPlatBleUuidType , # [ doc = "< A value of UUID." ] pub mValue : otPlatBleUuidValue , } # [ test ] fn bindgen_test_layout_otPlatBleUuid ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otPlatBleUuid > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( otPlatBleUuid ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otPlatBleUuid > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otPlatBleUuid ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleUuid > ( ) ) ) . mType as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleUuid ) , "::" , stringify ! ( mType ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleUuid > ( ) ) ) . mValue as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleUuid ) , "::" , stringify ! ( mValue ) ) ) ; } # [ doc = " This structure represents GATT Characteristic." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otPlatBleGattCharacteristic { # [ doc = "< [in]  A UUID value of a characteristic." ] pub mUuid : otPlatBleUuid , # [ doc = "< [out] Characteristic value handle." ] pub mHandleValue : u16 , # [ doc = "< [out] CCCD handle or OT_BLE_INVALID_HANDLE if CCCD is not present." ] pub mHandleCccd : u16 , # [ doc = "< [in]  Characteristic properties." ] pub mProperties : u8 , } # [ test ] fn bindgen_test_layout_otPlatBleGattCharacteristic ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otPlatBleGattCharacteristic > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( otPlatBleGattCharacteristic ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otPlatBleGattCharacteristic > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otPlatBleGattCharacteristic ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleGattCharacteristic > ( ) ) ) . mUuid as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleGattCharacteristic ) , "::" , stringify ! ( mUuid ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleGattCharacteristic > ( ) ) ) . mHandleValue as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleGattCharacteristic ) , "::" , stringify ! ( mHandleValue ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleGattCharacteristic > ( ) ) ) . mHandleCccd as * const _ as usize } , 18usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleGattCharacteristic ) , "::" , stringify ! ( mHandleCccd ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleGattCharacteristic > ( ) ) ) . mProperties as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleGattCharacteristic ) , "::" , stringify ! ( mProperties ) ) ) ; } # [ doc = " This structure represents GATT Descriptor." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otPlatBleGattDescriptor { # [ doc = "< A UUID value of descriptor." ] pub mUuid : otPlatBleUuid , # [ doc = "< Descriptor handle." ] pub mHandle : u16 , } # [ test ] fn bindgen_test_layout_otPlatBleGattDescriptor ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otPlatBleGattDescriptor > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( otPlatBleGattDescriptor ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otPlatBleGattDescriptor > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otPlatBleGattDescriptor ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleGattDescriptor > ( ) ) ) . mUuid as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleGattDescriptor ) , "::" , stringify ! ( mUuid ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleGattDescriptor > ( ) ) ) . mHandle as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleGattDescriptor ) , "::" , stringify ! ( mHandle ) ) ) ; } # [ doc = " Registration descriptor for a GATT service." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct otPlatBleGattService { # [ doc = " Pointer to service UUID; use BLE_UUIDxx_DECLARE macros to declare" ] # [ doc = " proper UUID; NULL if there are no more characteristics in the service." ] pub mUuid : otPlatBleUuid , # [ doc = " Handle of service; written to by stack after call to" ] # [ doc = " otPlatBleGattServerServicesRegister." ] pub mHandle : u16 , # [ doc = " Array of characteristic definitions corresponding to characteristics" ] # [ doc = " belonging to this service." ] pub mCharacteristics : * mut otPlatBleGattCharacteristic , } # [ test ] fn bindgen_test_layout_otPlatBleGattService ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otPlatBleGattService > ( ) , 32usize , concat ! ( "Size of: " , stringify ! ( otPlatBleGattService ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otPlatBleGattService > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otPlatBleGattService ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleGattService > ( ) ) ) . mUuid as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleGattService ) , "::" , stringify ! ( mUuid ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleGattService > ( ) ) ) . mHandle as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleGattService ) , "::" , stringify ! ( mHandle ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otPlatBleGattService > ( ) ) ) . mCharacteristics as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( otPlatBleGattService ) , "::" , stringify ! ( mCharacteristics ) ) ) ; } # [ doc = " This structure represents an BLE packet." ] # [ doc = "" ] # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct otBleRadioPacket { # [ doc = "< The value of an attribute" ] pub mValue : * mut u8 , # [ doc = "< Length of the @p mValue." ] pub mLength : u16 , # [ doc = "< Transmit/receive power in dBm." ] pub mPower : i8 , } # [ test ] fn bindgen_test_layout_otBleRadioPacket ( ) { assert_eq ! ( :: std :: mem :: size_of :: < otBleRadioPacket > ( ) , 16usize , concat ! ( "Size of: " , stringify ! ( otBleRadioPacket ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < otBleRadioPacket > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( otBleRadioPacket ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBleRadioPacket > ( ) ) ) . mValue as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( otBleRadioPacket ) , "::" , stringify ! ( mValue ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBleRadioPacket > ( ) ) ) . mLength as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( otBleRadioPacket ) , "::" , stringify ! ( mLength ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < otBleRadioPacket > ( ) ) ) . mPower as * const _ as usize } , 10usize , concat ! ( "Offset of field: " , stringify ! ( otBleRadioPacket ) , "::" , stringify ! ( mPower ) ) ) ; } # [ doc = "< Connection successful." ] pub const otPlatBleL2capError_OT_BLE_L2C_ERROR_NONE : otPlatBleL2capError = 0 ; # [ doc = "< Connection refused – LE_PSM not supported." ] pub const otPlatBleL2capError_OT_BLE_L2C_ERROR_INVALID_PSM : otPlatBleL2capError = 2 ; # [ doc = "< Connection refused – no resources available." ] pub const otPlatBleL2capError_OT_BLE_L2C_ERROR_NO_MEM : otPlatBleL2capError = 4 ; # [ doc = "< Connection refused – unacceptable parameters." ] pub const otPlatBleL2capError_OT_BLE_L2C_ERROR_INVALID_PARAMS : otPlatBleL2capError = 11 ; # [ doc = " The enum indicates the outcome of the L2CAP connection request procedure." ] # [ doc = " See Bluetooth v5.0 | Vol 3, Part A, 4.23, Table 4.20." ] pub type otPlatBleL2capError = u32 ; extern "C" { # [ doc = " Enable the Bluetooth Low Energy radio." ] # [ doc = "" ] # [ doc = " @note BLE Device should use the highest ATT_MTU supported that does not" ] # [ doc = " exceed OT_BLE_ATT_MTU_MAX octets." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE         Successfully enabled." ] # [ doc = " @retval ::OT_ERROR_FAILED       The BLE radio could not be enabled." ] pub fn otPlatBleEnable ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " Disable the Bluetooth Low Energy radio." ] # [ doc = "" ] # [ doc = " When disabled, the BLE stack will flush event queues and not generate new" ] # [ doc = " events. The BLE peripheral is turned off or put into a low power sleep" ] # [ doc = " state. Any dynamic memory used by the stack should be released," ] # [ doc = " but static memory may remain reserved." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE        Successfully transitioned to disabled." ] # [ doc = " @retval ::OT_ERROR_FAILED      The BLE radio could not be disabled." ] pub fn otPlatBleDisable ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " Reset the Bluetooth Low Energy subsystem." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE        Successfully reset." ] # [ doc = " @retval ::OT_ERROR_FAILED      The BLE stack could not be reset." ] pub fn otPlatBleReset ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " Check whether Bluetooth Low Energy radio is enabled or not." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @retval ::true   Bluetooth Low Energy radio is enabled." ] # [ doc = " @retval ::false  Bluetooth Low Energy radio is disabled." ] pub fn otPlatBleIsEnabled ( aInstance : * mut otInstance ) -> bool ; } extern "C" { # [ doc = " Callback sent when Bluetooth Low Energy is ready after being enabled." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] pub fn otPlatBleOnEnabled ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " Gets Bluetooth Device Address." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  The OpenThread instance structure." ] # [ doc = " @param[out] aAddress   The pointer to Bluetooth Device Address." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE          Request has been successfully done." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS  Invalid parameters has been supplied." ] pub fn otPlatBleGapAddressGet ( aInstance : * mut otInstance , aAddress : * mut otPlatBleDeviceAddr ) -> otError ; } extern "C" { # [ doc = " Sets Bluetooth Device Address." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aAddress    The pointer to Bluetooth Device Address." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE          Request has been successfully done." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS  Invalid parameters has been supplied." ] pub fn otPlatBleGapAddressSet ( aInstance : * mut otInstance , aAddress : * const otPlatBleDeviceAddr ) -> otError ; } extern "C" { # [ doc = " Sets BLE device name and appearance that is visible as GATT Based service." ] # [ doc = "" ] # [ doc = " The BLE Host stack should set the security mode 1, level 1 (no security) for" ] # [ doc = " those characteristics." ] # [ doc = "" ] # [ doc = " @param[in] aInstance    The OpenThread instance structure." ] # [ doc = " @param[in] aDeviceName  A pointer to device name string (null terminated)." ] # [ doc = "                         Shall not exceed OT_BLE_DEV_NAME_MAX_LENGTH." ] # [ doc = " @param[in] aAppearance  The value of appearance characteristic." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE          Connection parameters have been" ] # [ doc = "                                  successfully set." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS  Invalid parameters has been supplied." ] pub fn otPlatBleGapServiceSet ( aInstance : * mut otInstance , aDeviceName : * const :: std :: os :: raw :: c_char , aAppearance : u16 ) -> otError ; } extern "C" { # [ doc = " Sets desired BLE Connection Parameters." ] # [ doc = "" ] # [ doc = " @param[in] aInstance    The OpenThread instance structure." ] # [ doc = " @param[in] aConnParams  A pointer to connection parameters structure." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE          Connection parameters have been" ] # [ doc = "                                  successfully set." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS  Invalid connection parameters have been" ] # [ doc = "                                  supplied." ] pub fn otPlatBleGapConnParamsSet ( aInstance : * mut otInstance , aConnParams : * const otPlatBleGapConnParams ) -> otError ; } extern "C" { # [ doc = " Sets BLE Advertising packet content." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for BLE Peripheral role." ] # [ doc = "" ] # [ doc = " @param[in] aInstance       The OpenThread instance structure." ] # [ doc = " @param[in] aAdvData        A pointer to advertising data content in raw format." ] # [ doc = " @param[in] aAdvDataLength  The size of advertising data." ] # [ doc = "                            Shall not exceed OT_BLE_ADV_DATA_MAX_LENGTH." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE          Advertising data has been successfully set." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS  Invalid advertising data has been supplied." ] pub fn otPlatBleGapAdvDataSet ( aInstance : * mut otInstance , aAdvData : * const u8 , aAdvDataLength : u8 ) -> otError ; } extern "C" { # [ doc = " Sets BLE Scan Response packet content." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for BLE Peripheral role." ] # [ doc = "" ] # [ doc = " @param[in] aInstance            The OpenThread instance structure." ] # [ doc = " @param[in] aScanResponse        A pointer to scan response data in raw format." ] # [ doc = " @param[in] aScanResponseLength  The size of scan response data." ] # [ doc = "                                 Shall not exceed OT_BLE_SCAN_RESPONSE_MAX_LENGTH." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE         Scan response data has been successfully set." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS Invalid scan response data has been supplied." ] pub fn otPlatBleGapScanResponseSet ( aInstance : * mut otInstance , aScanResponse : * const u8 , aScanResponseLength : u8 ) -> otError ; } extern "C" { # [ doc = " Starts BLE Advertising procedure." ] # [ doc = "" ] # [ doc = " The BLE device shall use undirected advertising with no filter applied." ] # [ doc = " A single BLE Advertising packet must be sent on all advertising" ] # [ doc = " channels (37, 38 and 39)." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for BLE Peripheral role." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aInterval  The interval between subsequent advertising packets" ] # [ doc = "                       in OT_BLE_ADV_INTERVAL_UNIT units." ] # [ doc = "                       Shall be within OT_BLE_ADV_INTERVAL_MIN and" ] # [ doc = "                       OT_BLE_ADV_INTERVAL_MAX range." ] # [ doc = " @param[in] aType      The advertisement properties as a bitmask:" ] # [ doc = "                       whether it is connectable | scannable." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           Advertising procedure has been started." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS   Invalid interval value has been supplied." ] pub fn otPlatBleGapAdvStart ( aInstance : * mut otInstance , aInterval : u16 , aType : u8 ) -> otError ; } extern "C" { # [ doc = " Stops BLE Advertising procedure." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for BLE Peripheral role." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           Advertising procedure has been stopped." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state." ] pub fn otPlatBleGapAdvStop ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that BLE Device has" ] # [ doc = " been connected." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance     The OpenThread instance structure." ] # [ doc = " @param[in]  aConnectionId The identifier of the open connection." ] # [ doc = "" ] pub fn otPlatBleGapOnConnected ( aInstance : * mut otInstance , aConnectionId : u16 ) ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that the BLE Device" ] # [ doc = " has been disconnected." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance     The OpenThread instance structure." ] # [ doc = " @param[in]  aConnectionId The identifier of the closed connection." ] # [ doc = "" ] pub fn otPlatBleGapOnDisconnected ( aInstance : * mut otInstance , aConnectionId : u16 ) ; } extern "C" { # [ doc = " Starts BLE Scanning procedure." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for BLE Central role." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aInterval  The scanning interval in OT_BLE_SCAN_INTERVAL_UNIT" ] # [ doc = "                       units. Shall be in OT_BLE_SCAN_INTERVAL_MIN and" ] # [ doc = "                       OT_BLE_SCAN_INTERVAL_MAX range." ] # [ doc = " @param[in] aWindow    The scanning window in OT_BLE_SCAN_WINDOW_UNIT units." ] # [ doc = "                       Shall be in OT_BLE_SCAN_WINDOW_MIN and OT_BLE_SCAN_WINDOW_MAX" ] # [ doc = "                       range." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           Scanning procedure has been started." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS   Invalid interval or window value has been" ] # [ doc = "                                   supplied." ] pub fn otPlatBleGapScanStart ( aInstance : * mut otInstance , aInterval : u16 , aWindow : u16 ) -> otError ; } extern "C" { # [ doc = " Stops BLE Scanning procedure." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for BLE Central role." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           Scanning procedure has been stopped." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state." ] pub fn otPlatBleGapScanStop ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that an advertisement" ] # [ doc = " packet has been received." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  The OpenThread instance structure." ] # [ doc = " @param[in]  aAddress   An address of the advertising device." ] # [ doc = " @param[in]  aPacket    A pointer to the received packet." ] # [ doc = "" ] pub fn otPlatBleGapOnAdvReceived ( aInstance : * mut otInstance , aAddress : * mut otPlatBleDeviceAddr , aPacket : * mut otBleRadioPacket ) ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that a scan response packet has been received." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  The OpenThread instance structure." ] # [ doc = " @param[in]  aAddress   An address of the advertising device." ] # [ doc = " @param[in]  aPacket    A pointer to the received packet." ] # [ doc = "" ] pub fn otPlatBleGapOnScanRespReceived ( aInstance : * mut otInstance , aAddress : * mut otPlatBleDeviceAddr , aPacket : * mut otBleRadioPacket ) ; } extern "C" { # [ doc = " Starts BLE Connection procedure." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for BLE Central role." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aAddress   An address of the advertising device." ] # [ doc = " @param[in] aInterval  The scanning interval in OT_BLE_SCAN_INTERVAL_UNIT units. Shall be in" ] # [ doc = "                       OT_BLE_SCAN_INTERVAL_MIN and OT_BLE_SCAN_INTERVAL_MAX range." ] # [ doc = " @param[in] aWindow    The scanning window in OT_BLE_SCAN_WINDOW_UNIT units. Shall be in" ] # [ doc = "                       OT_BLE_SCAN_WINDOW_MIN and OT_BLE_SCAN_WINDOW_MAX range." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           Connection procedure has been started." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS   Invalid address, interval or window value has been supplied." ] pub fn otPlatBleGapConnect ( aInstance : * mut otInstance , aAddress : * mut otPlatBleDeviceAddr , aInterval : u16 , aWindow : u16 ) -> otError ; } extern "C" { # [ doc = " Disconnects BLE connection." ] # [ doc = "" ] # [ doc = " The BLE device shall indicate the OT_BLE_HCI_REMOTE_USER_TERMINATED HCI code reason." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           Disconnection procedure has been started." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state." ] pub fn otPlatBleGapDisconnect ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " Registers vendor specific UUID Base." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  The OpenThread instance structure." ] # [ doc = " @param[in]  aUuid      A pointer to vendor specific 128-bit UUID Base." ] # [ doc = "" ] pub fn otPlatBleGattVendorUuidRegister ( aInstance : * mut otInstance , aUuid : * const otPlatBleUuid ) -> otError ; } extern "C" { # [ doc = " Reads currently use value of ATT_MTU." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance  The OpenThread instance structure." ] # [ doc = " @param[out]  aMtu       A pointer contains current ATT_MTU value." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE     ATT_MTU value has been placed in @p aMtu." ] # [ doc = " @retval ::OT_ERROR_FAILED   BLE Device cannot determine its ATT_MTU." ] pub fn otPlatBleGattMtuGet ( aInstance : * mut otInstance , aMtu : * mut u16 ) -> otError ; } extern "C" { # [ doc = " Sends ATT Read Request." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Client." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aHandle    The handle of the attribute to be read." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           ATT Write Request has been sent." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS   Invalid handle value has been supplied." ] # [ doc = " @retval ::OT_ERROR_NO_BUFS        No available internal buffer found." ] pub fn otPlatBleGattClientRead ( aInstance : * mut otInstance , aHandle : u16 ) -> otError ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that ATT Read Response" ] # [ doc = " packet has been received." ] # [ doc = "" ] # [ doc = " This method is called only if @p otPlatBleGattClientRead was previously requested." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Client." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aPacket    A pointer to the packet contains read value." ] # [ doc = "" ] pub fn otPlatBleGattClientOnReadResponse ( aInstance : * mut otInstance , aPacket : * mut otBleRadioPacket ) ; } extern "C" { # [ doc = " Sends ATT Write Request." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Client." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aHandle    The handle of the attribute to be written." ] # [ doc = " @param[in] aPacket    A pointer to the packet contains value to be" ] # [ doc = "                       written to the attribute." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           ATT Write Request has been sent." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS   Invalid handle value, data or data length has been supplied." ] # [ doc = " @retval ::OT_ERROR_NO_BUFS        No available internal buffer found." ] pub fn otPlatBleGattClientWrite ( aInstance : * mut otInstance , aHandle : u16 , aPacket : * mut otBleRadioPacket ) -> otError ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that ATT Write Response" ] # [ doc = " packet has been received." ] # [ doc = "" ] # [ doc = " This method is called only if @p otPlatBleGattClientWrite was previously requested." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Client." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aHandle    The handle on which ATT Write Response has been sent." ] # [ doc = "" ] pub fn otPlatBleGattClientOnWriteResponse ( aInstance : * mut otInstance , aHandle : u16 ) ; } extern "C" { # [ doc = " Subscribes for characteristic indications." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Client." ] # [ doc = "" ] # [ doc = " @param[in] aInstance    The OpenThread instance structure." ] # [ doc = " @param[in] aHandle      The handle of the attribute to be written." ] # [ doc = " @param[in] aSubscribing True if subscribing, otherwise unsubscribing." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           Subscription has been sent." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS   Invalid handle value, data or data length has been supplied." ] # [ doc = " @retval ::OT_ERROR_NO_BUFS        No available internal buffer found." ] pub fn otPlatBleGattClientSubscribeRequest ( aInstance : * mut otInstance , aHandle : u16 , aSubscribing : bool ) -> otError ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that subscribe response" ] # [ doc = " has been received." ] # [ doc = "" ] # [ doc = " This method is called only if @p otPlatBleGattClienSubscribe was previously requested." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Client." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aHandle    The handle on which ATT Write Response has been sent." ] # [ doc = "" ] pub fn otPlatBleGattClientOnSubscribeResponse ( aInstance : * mut otInstance , aHandle : u16 ) ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that an ATT Handle Value" ] # [ doc = " Indication has been received." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Client." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aHandle    The handle on which ATT Handle Value Indication has been sent." ] # [ doc = " @param[in] aPacket    A pointer to the packet contains indicated value." ] # [ doc = "" ] pub fn otPlatBleGattClientOnIndication ( aInstance : * mut otInstance , aHandle : u16 , aPacket : * mut otBleRadioPacket ) ; } extern "C" { # [ doc = " Performs GATT Primary Service Discovery of all services available." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Client." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           Service Discovery procedure has been started." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS   Invalid service UUID has been provided." ] # [ doc = " @retval ::OT_ERROR_NO_BUFS        No available internal buffer found." ] pub fn otPlatBleGattClientServicesDiscover ( aInstance : * mut otInstance ) -> otError ; } extern "C" { # [ doc = " Performs GATT Primary Service Discovery by UUID procedure of specific service." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Client." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aUuid      The UUID of a service to be registered." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           Service Discovery procedure has been started." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS   Invalid service UUID has been provided." ] # [ doc = " @retval ::OT_ERROR_NO_BUFS        No available internal buffer found." ] pub fn otPlatBleGattClientServiceDiscover ( aInstance : * mut otInstance , aUuid : * const otPlatBleUuid ) -> otError ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that the next entry" ] # [ doc = " from GATT Primary Service Discovery has been found." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Client." ] # [ doc = "" ] # [ doc = " @param[in] aInstance     The OpenThread instance structure." ] # [ doc = " @param[in] aStartHandle  The start handle of a service." ] # [ doc = " @param[in] aEndHandle    The end handle of a service." ] # [ doc = " @param[in] aServiceUuid  The Uuid16 for the service entry." ] # [ doc = " @param[in] aError        The value of OT_ERROR_NONE indicates that service has been found" ] # [ doc = "                          and structure @p aStartHandle and @p aEndHandle contain valid handles." ] # [ doc = "                          OT_ERROR_NOT_FOUND error should be set if service has not been found." ] # [ doc = "                          Otherwise error indicates the reason of failure is used." ] # [ doc = "" ] pub fn otPlatBleGattClientOnServiceDiscovered ( aInstance : * mut otInstance , aStartHandle : u16 , aEndHandle : u16 , aServiceUuid : u16 , aError : otError ) ; } extern "C" { # [ doc = " Performs GATT Characteristic Discovery of a service." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Client." ] # [ doc = "" ] # [ doc = " @param[in] aInstance     The OpenThread instance structure." ] # [ doc = " @param[in] aStartHandle  The start handle of a service." ] # [ doc = " @param[in] aEndHandle    The end handle of a service." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           Characteristic Discovery procedure has been started." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS   Invalid start or end handle has been provided." ] # [ doc = " @retval ::OT_ERROR_NO_BUFS        No available internal buffer found." ] pub fn otPlatBleGattClientCharacteristicsDiscover ( aInstance : * mut otInstance , aStartHandle : u16 , aEndHandle : u16 ) -> otError ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that GATT Characteristic" ] # [ doc = " Discovery of a service has been done." ] # [ doc = "" ] # [ doc = " In case of success, all elements inside @p aChars should have a valid mHandleValue value." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Client." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aChars     A pointer to discovered characteristic list." ] # [ doc = " @param[in] aCount     Number of characteristics in @p aChar list." ] # [ doc = " @param[in] aError     The value of OT_ERROR_NONE indicates that at least one characteristic" ] # [ doc = "                       has been found and the total number of them is stored in @p aCount." ] # [ doc = "                       OT_ERROR_NOT_FOUND error should be set if no charactertistics are found." ] # [ doc = "                       Otherwise error indicates the reason of failure is used." ] # [ doc = "" ] pub fn otPlatBleGattClientOnCharacteristicsDiscoverDone ( aInstance : * mut otInstance , aChars : * mut otPlatBleGattCharacteristic , aCount : u16 , aError : otError ) ; } extern "C" { # [ doc = " Performs GATT Descriptor Discovery." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Client." ] # [ doc = "" ] # [ doc = " @param[in] aInstance     The OpenThread instance structure." ] # [ doc = " @param[in] aStartHandle  The start handle." ] # [ doc = " @param[in] aEndHandle    The end handle." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           Descriptor Discovery procedure has been started." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS   Invalid start or end handle has been provided." ] # [ doc = " @retval ::OT_ERROR_NO_BUFS        No available internal buffer found." ] pub fn otPlatBleGattClientDescriptorsDiscover ( aInstance : * mut otInstance , aStartHandle : u16 , aEndHandle : u16 ) -> otError ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that GATT Descriptor" ] # [ doc = " Discovery has been done." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Client." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aDescs     A pointer to discovered descriptor list." ] # [ doc = " @param[in] aCount     Number of descriptors in @p aDescs list." ] # [ doc = " @param[in] aError     The value of OT_ERROR_NONE indicates that at least one descriptor" ] # [ doc = "                       has been found and the total number of them is stored in @p aCount." ] # [ doc = "                       OT_ERROR_NOT_FOUND error should be set if no descriptors are found." ] # [ doc = "                       Otherwise error indicates the reason of failure is used." ] # [ doc = "" ] pub fn otPlatBleGattClientOnDescriptorsDiscoverDone ( aInstance : * mut otInstance , aDescs : * mut otPlatBleGattDescriptor , aCount : u16 , aError : otError ) ; } extern "C" { # [ doc = " Sends Exchange MTU Request." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Client." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aMtu       A value of GATT Client receive MTU size." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           Exchange MTU Request has been sent." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS   Invalid aMtu has been provided." ] # [ doc = " @retval ::OT_ERROR_NO_BUFS        No available internal buffer found." ] pub fn otPlatBleGattClientMtuExchangeRequest ( aInstance : * mut otInstance , aMtu : u16 ) -> otError ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that Exchange MTU" ] # [ doc = " Response has been received." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Client." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aMtu       Attribute server receive MTU size." ] # [ doc = " @param[in] aError     The value of OT_ERROR_NONE indicates that valid" ] # [ doc = "                       Exchange MTU Response has been received. Otherwise error" ] # [ doc = "                       indicates the reason of failure is used." ] # [ doc = "" ] pub fn otPlatBleGattClientOnMtuExchangeResponse ( aInstance : * mut otInstance , aMtu : u16 , aError : otError ) ; } extern "C" { # [ doc = " Registers a list of GATT Services and their enclosed Characteristics." ] # [ doc = " The generated handles will be written back into this structure when the" ] # [ doc = " BLE stack is enabled." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Server." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance  The OpenThread instance structure." ] # [ doc = " @param[in]   aServices  Null terminated array of service structures to register." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           Service has been successfully registered." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS   Invalid service UUID has been provided." ] # [ doc = " @retval ::OT_ERROR_NO_BUFS        No available internal buffer found." ] pub fn otPlatBleGattServerServicesRegister ( aInstance : * mut otInstance , aServices : * mut otPlatBleGattService ) -> otError ; } extern "C" { # [ doc = " Sends ATT Handle Value Indication." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Server." ] # [ doc = "" ] # [ doc = " @param[in] aInstance   The OpenThread instance structure." ] # [ doc = " @param[in] aHandle     The handle of the attribute to be indicated." ] # [ doc = " @param[in] aPacket     A pointer to the packet contains value to be indicated." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           ATT Handle Value Indication has been sent." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS   Invalid handle value, data or data length has been supplied." ] # [ doc = " @retval ::OT_ERROR_NO_BUFS        No available internal buffer found." ] pub fn otPlatBleGattServerIndicate ( aInstance : * mut otInstance , aHandle : u16 , aPacket : * mut otBleRadioPacket ) -> otError ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that an ATT Handle" ] # [ doc = " Value Confirmation has been received." ] # [ doc = "" ] # [ doc = " This method is called only if @p otPlatBleGattServerIndicate was previously requested." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Server." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aHandle    The handle on which ATT Handle Value Confirmation has been sent." ] # [ doc = "" ] pub fn otPlatBleGattServerOnIndicationConfirmation ( aInstance : * mut otInstance , aHandle : u16 ) ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that an ATT Write Request" ] # [ doc = " packet has been received." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Server." ] # [ doc = "" ] # [ doc = " @param[in] aInstance   The OpenThread instance structure." ] # [ doc = " @param[in] aHandle     The handle of the attribute to be written." ] # [ doc = " @param[in] aPacket     A pointer to the packet contains value to be written to the attribute." ] # [ doc = "" ] pub fn otPlatBleGattServerOnWriteRequest ( aInstance : * mut otInstance , aHandle : u16 , aPacket : * mut otBleRadioPacket ) ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that an ATT Read Request" ] # [ doc = " packet has been received." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Server." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  The OpenThread instance structure." ] # [ doc = " @param[in]  aHandle    The handle of the attribute to be read." ] # [ doc = " @param[out] aPacket    A pointer to the packet to be filled with pointers to attribute data to be read." ] # [ doc = "" ] pub fn otPlatBleGattServerOnReadRequest ( aInstance : * mut otInstance , aHandle : u16 , aPacket : * mut otBleRadioPacket ) ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that an ATT Subscription" ] # [ doc = " Request packet has been received." ] # [ doc = "" ] # [ doc = " @note This function shall be used only for GATT Server." ] # [ doc = "" ] # [ doc = " @param[in] aInstance    The OpenThread instance structure." ] # [ doc = " @param[in] aHandle      The handle of the attribute to be written." ] # [ doc = " @param[in] aSubscribing True if subscribing, otherwise unsubscribing." ] # [ doc = "" ] pub fn otPlatBleGattServerOnSubscribeRequest ( aInstance : * mut otInstance , aHandle : u16 , aSubscribing : bool ) ; } extern "C" { # [ doc = " Sends LE Credit Based Connection Request." ] # [ doc = "" ] # [ doc = " @note Platform layer is responsible for credits management and segmentation (MPS)." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  The OpenThread instance structure." ] # [ doc = " @param[in]  aPsm       The value of LE Protocol/Service Multiplexer." ] # [ doc = " @param[in]  aMtu       The value specifies the maximum SDU size (in octets) that the L2CAP" ] # [ doc = "                        layer entity sending the LE Credit Based Connection Request can receive" ] # [ doc = "                        on this channel." ] # [ doc = " @param[out] aCid       The source CID represents a channel endpoint on the device." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           LE Credit Based Connection Request has been sent." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state e.g. not in the GAP connection." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS   Invalid parameters has been supplied." ] # [ doc = " @retval ::OT_ERROR_NO_BUFS        No available internal buffer found." ] # [ doc = "" ] pub fn otPlatBleL2capConnectionRequest ( aInstance : * mut otInstance , aPsm : u16 , aMtu : u16 , aCid : * mut u16 ) -> otError ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that an LE Credit Based Connection" ] # [ doc = " Request packet has been received." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  The OpenThread instance structure." ] # [ doc = " @param[in]  aPsm       The value of LE Protocol/Service Multiplexer." ] # [ doc = " @param[in]  aMtu       The value specifies the maximum SDU size (in octets) that the L2CAP" ] # [ doc = "                        layer entity sending the LE Credit Based Connection Request can receive" ] # [ doc = "                        on this channel." ] # [ doc = " @param[in]  aPeerCid   The CID represents a channel endpoint on the peer device." ] # [ doc = "" ] pub fn otPlatBleL2capOnConnectionRequest ( aInstance : * mut otInstance , aPsm : u16 , aMtu : u16 , aPeerCid : u16 ) ; } extern "C" { # [ doc = " Sends LE Credit Based Connection Response." ] # [ doc = "" ] # [ doc = " @note Platform layer is responsible for credits management and segmentation (MPS)." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  The OpenThread instance structure." ] # [ doc = " @param[in]  aError     The error value indicates the outcome of the connection request." ] # [ doc = " @param[in]  aMtu       The value specifies the maximum SDU size (in octets) that the L2CAP" ] # [ doc = "                        layer entity sending the LE Credit Based Connection Response can receive" ] # [ doc = "                        on this channel." ] # [ doc = " @param[out] aCid       The source CID represents a channel endpoint on the device. If @p aResult" ] # [ doc = "                        value is different from @p OT_BLE_L2C_ERROR_NONE, this variable is" ] # [ doc = "                        unused and should be set to NULL." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           LE Credit Based Connection Response has been sent." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state e.g. not in the GAP connection." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS   Invalid parameters has been supplied." ] # [ doc = " @retval ::OT_ERROR_NO_BUFS        No available internal buffer found." ] # [ doc = "" ] pub fn otPlatBleL2capConnectionResponse ( aInstance : * mut otInstance , aError : otPlatBleL2capError , aMtu : u16 , aCid : * mut u16 ) -> otError ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that an LE Credit Based Connection" ] # [ doc = " Response packet has been received." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  The OpenThread instance structure." ] # [ doc = " @param[in]  aError     The error value indicates the outcome of the connection request." ] # [ doc = " @param[in]  aMtu       The value specifies the maximum SDU size (in octets) that the L2CAP" ] # [ doc = "                        layer entity sending the LE Credit Based Connection Response can receive" ] # [ doc = "                        on this channel." ] # [ doc = " @param[in]  aPeerCid   The CID represents a channel endpoint on the peer device." ] # [ doc = "" ] pub fn otPlatBleL2capOnConnectionResponse ( aInstance : * mut otInstance , aError : otPlatBleL2capError , aMtu : u16 , aPeerCid : u16 ) ; } extern "C" { # [ doc = " Sends an SDU on an L2CAP channel." ] # [ doc = "" ] # [ doc = " @note Platform layer is responsible for credits management and segmentation (MPS)." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aLocalCid  The local channel endpoint ID value." ] # [ doc = " @param[in] aPeerCid   The peer channel endpoint ID value." ] # [ doc = " @param[in] aPacket    A pointer to the packet containing SDU." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           LE Credit Based Connection Request has been sent." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state e.g. not in the GAP connection." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS   Invalid parameters has been supplied." ] # [ doc = " @retval ::OT_ERROR_NO_BUFS        No available internal buffer found." ] # [ doc = "" ] pub fn otPlatBleL2capSduSend ( aInstance : * mut otInstance , aLocalCid : u16 , aPeerCid : u16 , aPacket : * mut otBleRadioPacket ) -> otError ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that an L2CAP SDU has been received." ] # [ doc = "" ] # [ doc = " @note Platform layer is responsible for credits management and segmentation (MPS)." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aLocalCid  The local channel endpoint ID value." ] # [ doc = " @param[in] aPeerCid   The peer channel endpoint ID value." ] # [ doc = " @param[in] aPacket    A pointer to the packet containing SDU." ] # [ doc = "" ] pub fn otPlatBleL2capOnSduReceived ( aInstance : * mut otInstance , aLocalCid : u16 , aPeerCid : u16 , aPacket : * mut otBleRadioPacket ) ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that an L2CAP SDU has been sent." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] pub fn otPlatBleL2capOnSduSent ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " Sends an L2CAP Disconnection Request." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aLocalCid  The local channel endpoint ID value." ] # [ doc = " @param[in] aPeerCid   The peer channel endpoint ID value." ] # [ doc = "" ] # [ doc = " @retval ::OT_ERROR_NONE           L2CAP Disconnection Request has been sent." ] # [ doc = " @retval ::OT_ERROR_INVALID_STATE  BLE Device is in invalid state e.g. not in the GAP connection." ] # [ doc = " @retval ::OT_ERROR_INVALID_ARGS   Invalid parameters has been supplied." ] # [ doc = " @retval ::OT_ERROR_NO_BUFS        No available internal buffer found." ] # [ doc = "" ] pub fn otPlatBleL2capDisconnect ( aInstance : * mut otInstance , aLocalCid : u16 , aPeerCid : u16 ) -> otError ; } extern "C" { # [ doc = " The BLE driver calls this method to notify OpenThread that an L2CAP Disconnection Request has been" ] # [ doc = " received." ] # [ doc = "" ] # [ doc = " @note Platform layer is responsible to response with L2CAP Disconnection Response internally." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = " @param[in] aLocalCid  The local channel endpoint ID value." ] # [ doc = " @param[in] aPeerCid   The peer channel endpoint ID value." ] # [ doc = "" ] pub fn otPlatBleL2capOnDisconnect ( aInstance : * mut otInstance , aLocalCid : u16 , aPeerCid : u16 ) ; } extern "C" { # [ doc = " Standard printf() to the debug uart with no log decoration." ] # [ doc = "" ] # [ doc = " @param[in]   fmt   printf formatter text" ] # [ doc = "" ] # [ doc = " This is a debug convenience function that is not intended to be" ] # [ doc = " used in anything other then \"debug scenarios\" by a developer." ] # [ doc = "" ] # [ doc = " lf -> cr/lf mapping is automatically handled via otPlatDebugUart_putchar()" ] # [ doc = "" ] # [ doc = " @sa otPlatDebugUart_vprintf() for limitations" ] # [ doc = "" ] # [ doc = " This is a WEAK symbol that can easily be overridden as needed." ] pub fn otPlatDebugUart_printf ( fmt : * const :: std :: os :: raw :: c_char , ... ) ; } extern "C" { # [ doc = " Standard vprintf() to the debug uart, with no log decoration." ] # [ doc = "" ] # [ doc = " @param[in]   fmt   printf formatter text" ] # [ doc = " @param[in]   ap    va_list value for print parameters." ] # [ doc = "" ] # [ doc = " Implementation limitation: this formats the text into" ] # [ doc = " a purposely small text buffer on the stack, thus long" ] # [ doc = " messages may be truncated." ] # [ doc = "" ] # [ doc = " This is a WEAK symbol that can easily be overridden as needed." ] # [ doc = "" ] # [ doc = " For example, some platforms might override this via a non-WEAK" ] # [ doc = " symbol because the platform provides a UART_vprintf() like" ] # [ doc = " function that can handle an arbitrary length output." ] pub fn otPlatDebugUart_vprintf ( fmt : * const :: std :: os :: raw :: c_char , ap : * mut __va_list_tag ) ; } extern "C" { # [ doc = " Platform specific write single byte to Debug Uart" ] # [ doc = " This should not perform CR/LF mapping." ] # [ doc = "" ] # [ doc = " This function MUST be implemented by the platform" ] # [ doc = "" ] # [ doc = " @param[in] c   what to transmit" ] pub fn otPlatDebugUart_putchar_raw ( c : :: std :: os :: raw :: c_int ) ; } extern "C" { # [ doc = " Poll/test debug uart if a key has been pressed." ] # [ doc = " It would be common to a stub function that returns 0." ] # [ doc = "" ] # [ doc = " This function MUST be implemented by the platform" ] # [ doc = "" ] # [ doc = " @retval zero - nothing ready" ] # [ doc = " @retval nonzero - otPlatDebugUart_getc() will succeed." ] pub fn otPlatDebugUart_kbhit ( ) -> :: std :: os :: raw :: c_int ; } extern "C" { # [ doc = " Poll/Read a byte from the debug uart" ] # [ doc = "" ] # [ doc = " This function MUST be implemented by the platform" ] # [ doc = "" ] # [ doc = " @retval (negative) no data available, see otPlatDebugUart_kbhit()" ] # [ doc = " @retval (0x00..0x0ff) data byte value" ] # [ doc = "" ] pub fn otPlatDebugUart_getc ( ) -> :: std :: os :: raw :: c_int ; } extern "C" { # [ doc = " Write byte to the uart, expand cr/lf as need." ] # [ doc = "" ] # [ doc = " A WEAK default implementation is provided" ] # [ doc = " that can be overridden as needed." ] # [ doc = "" ] # [ doc = " @param[in] c   the byte to transmit" ] pub fn otPlatDebugUart_putchar ( c : :: std :: os :: raw :: c_int ) ; } extern "C" { # [ doc = " identical to \"man 3 puts\" - terminates with lf" ] # [ doc = " Which is then mapped to cr/lf as required" ] # [ doc = "" ] # [ doc = " A WEAK default implementation is provided" ] # [ doc = " that can be overridden as needed." ] # [ doc = "" ] # [ doc = " @param[in]   s   the string to print with a lf at the end" ] pub fn otPlatDebugUart_puts ( s : * const :: std :: os :: raw :: c_char ) ; } extern "C" { # [ doc = " Write N bytes to the UART, mapping cr/lf" ] # [ doc = "" ] # [ doc = " @param[in]  pBytes   pointer to bytes to transmit." ] # [ doc = " @param[in]  nBytes   how many bytes to transmit." ] pub fn otPlatDebugUart_write_bytes ( pBytes : * const u8 , nBytes : :: std :: os :: raw :: c_int ) ; } extern "C" { # [ doc = " puts() without a terminal newline." ] # [ doc = " see: \"man 3 puts\", without a adding a terminal lf" ] # [ doc = "" ] # [ doc = " @param[in]  s       the string to print without a lf at the end" ] # [ doc = "" ] # [ doc = " Note, the terminal \"lf\" mapped to cr/lf via" ] # [ doc = " the function otPlatDebugUart_putchar()" ] pub fn otPlatDebugUart_puts_no_nl ( s : * const :: std :: os :: raw :: c_char ) ; } extern "C" { # [ doc = " Some platforms (simulation) can log to a file." ] # [ doc = "" ] # [ doc = " @returns OT_ERROR_NONE" ] # [ doc = " @returns OT_ERROR_FAILED" ] # [ doc = "" ] # [ doc = " Platforms that desire this MUST provide an implementation." ] # [ doc = "" ] pub fn otPlatDebugUart_logfile ( filename : * const :: std :: os :: raw :: c_char ) -> otError ; } extern "C" { # [ doc = " This function processes a factory diagnostics command line." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance       The OpenThread instance for current request." ] # [ doc = " @param[in]   aArgsLength     The number of arguments in @p aArgs." ] # [ doc = " @param[in]   aArgs           The arguments of diagnostics command line." ] # [ doc = " @param[out]  aOutput         The diagnostics execution result." ] # [ doc = " @param[in]   aOutputMaxLen   The output buffer size." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_INVALID_ARGS       The command is supported but invalid arguments provided." ] # [ doc = " @retval  OT_ERROR_NONE               The command is successfully process." ] # [ doc = " @retval  OT_ERROR_INVALID_COMMAND    The command is not valid or not supported." ] # [ doc = "" ] pub fn otPlatDiagProcess ( aInstance : * mut otInstance , aArgsLength : u8 , aArgs : * mut * mut :: std :: os :: raw :: c_char , aOutput : * mut :: std :: os :: raw :: c_char , aOutputMaxLen : size_t ) -> otError ; } extern "C" { # [ doc = " This function enables/disables the factory diagnostics mode." ] # [ doc = "" ] # [ doc = " @param[in]  aMode  TRUE to enable diagnostics mode, FALSE otherwise." ] # [ doc = "" ] pub fn otPlatDiagModeSet ( aMode : bool ) ; } extern "C" { # [ doc = " This function indicates whether or not factory diagnostics mode is enabled." ] # [ doc = "" ] # [ doc = " @returns TRUE if factory diagnostics mode is enabled, FALSE otherwise." ] # [ doc = "" ] pub fn otPlatDiagModeGet ( ) -> bool ; } extern "C" { # [ doc = " This function sets the channel to use for factory diagnostics." ] # [ doc = "" ] # [ doc = " @param[in]  aChannel  The channel value." ] # [ doc = "" ] pub fn otPlatDiagChannelSet ( aChannel : u8 ) ; } extern "C" { # [ doc = " This function sets the transmit power to use for factory diagnostics." ] # [ doc = "" ] # [ doc = " @param[in]  aTxPower  The transmit power value." ] # [ doc = "" ] pub fn otPlatDiagTxPowerSet ( aTxPower : i8 ) ; } extern "C" { # [ doc = " This function processes the received radio frame." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance   The OpenThread instance for current request." ] # [ doc = " @param[in]   aFrame      The received radio frame." ] # [ doc = " @param[in]   aError      The received radio frame status." ] # [ doc = "" ] pub fn otPlatDiagRadioReceived ( aInstance : * mut otInstance , aFrame : * mut otRadioFrame , aError : otError ) ; } extern "C" { # [ doc = " This function processes the alarm event." ] # [ doc = "" ] # [ doc = " @param[in]   aInstance   The OpenThread instance for current request." ] # [ doc = "" ] pub fn otPlatDiagAlarmCallback ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " Fill buffer with entropy." ] # [ doc = "" ] # [ doc = " This function MUST be implemented using a true random number generator (TRNG)." ] # [ doc = "" ] # [ doc = " @param[out]  aOutput              A pointer to where the true random values are placed.  Must not be NULL." ] # [ doc = " @param[in]   aOutputLength        Size of @p aBuffer." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE          Successfully filled @p aBuffer with true random values." ] # [ doc = " @retval OT_ERROR_FAILED        Failed to fill @p aBuffer with true random values." ] # [ doc = " @retval OT_ERROR_INVALID_ARGS  @p aBuffer was set to NULL." ] # [ doc = "" ] pub fn otPlatEntropyGet ( aOutput : * mut u8 , aOutputLength : u16 ) -> otError ; } extern "C" { # [ doc = " This function initializes the flash driver." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] pub fn otPlatFlashInit ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " This function gets the size of the swap space." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] # [ doc = " @returns The size of the swap space in bytes." ] # [ doc = "" ] pub fn otPlatFlashGetSwapSize ( aInstance : * mut otInstance ) -> u32 ; } extern "C" { # [ doc = " This function erases the swap space indicated by @p aSwapIndex." ] # [ doc = "" ] # [ doc = " @param[in] aInstance   The OpenThread instance structure." ] # [ doc = " @param[in] aSwapIndex  A value in [0, 1] that indicates the swap space." ] # [ doc = "" ] pub fn otPlatFlashErase ( aInstance : * mut otInstance , aSwapIndex : u8 ) ; } extern "C" { # [ doc = " This function reads @p aSize bytes into @p aData." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   The OpenThread instance structure." ] # [ doc = " @param[in]  aSwapIndex  A value in [0, 1] that indicates the swap space." ] # [ doc = " @param[in]  aOffset     A byte offset within the swap space." ] # [ doc = " @param[out] aData       A pointer to the data buffer for reading." ] # [ doc = " @param[in]  aSize       Number of bytes to read." ] # [ doc = "" ] pub fn otPlatFlashRead ( aInstance : * mut otInstance , aSwapIndex : u8 , aOffset : u32 , aData : * mut :: std :: os :: raw :: c_void , aSize : u32 ) ; } extern "C" { # [ doc = " This function writes @p aSize bytes from @p aData." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance   The OpenThread instance structure." ] # [ doc = " @param[in]  aSwapIndex  A value in [0, 1] that indicates the swap space." ] # [ doc = " @param[in]  aOffset     A byte offset within the swap space." ] # [ doc = " @param[out] aData       A pointer to the data to write." ] # [ doc = " @param[in]  aSize       Number of bytes to write." ] # [ doc = "" ] # [ doc = "" ] pub fn otPlatFlashWrite ( aInstance : * mut otInstance , aSwapIndex : u8 , aOffset : u32 , aData : * const :: std :: os :: raw :: c_void , aSize : u32 ) ; } extern "C" { # [ doc = " Initialize the platform implemented message pool." ] # [ doc = "" ] # [ doc = " @param[in] aInstance            A pointer to the OpenThread instance." ] # [ doc = " @param[in] aMinNumFreeBuffers   An uint16 containing the minimum number of free buffers desired by OpenThread." ] # [ doc = " @param[in] aBufferSize          The size in bytes of a Buffer object." ] # [ doc = "" ] pub fn otPlatMessagePoolInit ( aInstance : * mut otInstance , aMinNumFreeBuffers : u16 , aBufferSize : size_t ) ; } extern "C" { # [ doc = " Allocate a buffer from the platform managed buffer pool." ] # [ doc = "" ] # [ doc = " @param[in] aInstance            A pointer to the OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns A pointer to the Buffer or NULL if no Buffers are available." ] # [ doc = "" ] pub fn otPlatMessagePoolNew ( aInstance : * mut otInstance ) -> * mut otMessage ; } extern "C" { # [ doc = " This function is used to free a Buffer back to the platform managed buffer pool." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to the OpenThread instance." ] # [ doc = " @param[in]  aBuffer    The Buffer to free." ] # [ doc = "" ] pub fn otPlatMessagePoolFree ( aInstance : * mut otInstance , aBuffer : * mut otMessage ) ; } extern "C" { # [ doc = " Get the number of free buffers." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance  A pointer to the OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The number of buffers currently free and available to OpenThread." ] # [ doc = "" ] pub fn otPlatMessagePoolNumFreeBuffers ( aInstance : * mut otInstance ) -> u16 ; } extern "C" { # [ doc = " Dynamically allocates new memory. On platforms that support it, should just redirect to calloc. For" ] # [ doc = " those that don't support calloc, should support the same functionality:" ] # [ doc = "" ] # [ doc = "   \"The calloc() function contiguously allocates enough space for count objects that are size bytes of" ] # [ doc = "   memory each and returns a pointer to the allocated memory. The allocated memory is filled with bytes" ] # [ doc = "   of value zero.\"" ] # [ doc = "" ] # [ doc = " This function is available and can ONLY be used only when support for multiple OpenThread instances is enabled." ] # [ doc = "" ] # [ doc = " @param[in] aNum   The number of blocks to allocate" ] # [ doc = " @param[in] aSize  The size of each block to allocate" ] # [ doc = "" ] # [ doc = " @retval void*  The pointer to the front of the memory allocated" ] # [ doc = " @retval NULL   Failed to allocate the memory requested." ] pub fn otPlatCAlloc ( aNum : size_t , aSize : size_t ) -> * mut :: std :: os :: raw :: c_void ; } extern "C" { # [ doc = " Frees memory that was dynamically allocated." ] # [ doc = "" ] # [ doc = " This function is available and can ONLY be used only when support for multiple OpenThread instances is enabled." ] # [ doc = "" ] # [ doc = " @param[in] aPtr  A pointer the memory blocks to free. The pointer may be NULL." ] pub fn otPlatFree ( aPtr : * mut :: std :: os :: raw :: c_void ) ; } extern "C" { # [ doc = " This function performs a software reset on the platform, if supported." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] pub fn otPlatReset ( aInstance : * mut otInstance ) ; } pub const otPlatResetReason_OT_PLAT_RESET_REASON_POWER_ON : otPlatResetReason = 0 ; pub const otPlatResetReason_OT_PLAT_RESET_REASON_EXTERNAL : otPlatResetReason = 1 ; pub const otPlatResetReason_OT_PLAT_RESET_REASON_SOFTWARE : otPlatResetReason = 2 ; pub const otPlatResetReason_OT_PLAT_RESET_REASON_FAULT : otPlatResetReason = 3 ; pub const otPlatResetReason_OT_PLAT_RESET_REASON_CRASH : otPlatResetReason = 4 ; pub const otPlatResetReason_OT_PLAT_RESET_REASON_ASSERT : otPlatResetReason = 5 ; pub const otPlatResetReason_OT_PLAT_RESET_REASON_OTHER : otPlatResetReason = 6 ; pub const otPlatResetReason_OT_PLAT_RESET_REASON_UNKNOWN : otPlatResetReason = 7 ; pub const otPlatResetReason_OT_PLAT_RESET_REASON_WATCHDOG : otPlatResetReason = 8 ; pub const otPlatResetReason_OT_PLAT_RESET_REASON_COUNT : otPlatResetReason = 9 ; # [ doc = " Enumeration of possible reset reason codes." ] # [ doc = "" ] # [ doc = " These are in the same order as the Spinel reset reason codes." ] # [ doc = "" ] pub type otPlatResetReason = u32 ; extern "C" { # [ doc = " This function returns the reason for the last platform reset." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "" ] pub fn otPlatGetResetReason ( aInstance : * mut otInstance ) -> otPlatResetReason ; } extern "C" { # [ doc = " This function provides a platform specific implementation for assert." ] # [ doc = "" ] # [ doc = " @param[in] aFilename    The name of the file where the assert occurred." ] # [ doc = " @param[in] aLineNumber  The line number in the file where the assert occurred." ] # [ doc = "" ] pub fn otPlatAssertFail ( aFilename : * const :: std :: os :: raw :: c_char , aLineNumber : :: std :: os :: raw :: c_int ) ; } extern "C" { # [ doc = " This function performs a platform specific operation to wake the host MCU." ] # [ doc = " This is used only for NCP configurations." ] # [ doc = "" ] pub fn otPlatWakeHost ( ) ; } # [ doc = " NCP's MCU stays on and active all the time." ] # [ doc = "" ] # [ doc = " When the NCP's desired power state is set to `ON`, host can send messages to NCP without requiring any \"poke\" or" ] # [ doc = " external triggers." ] # [ doc = "" ] # [ doc = " @note The `ON` power state only determines the MCU's power mode and is not related to radio's state." ] # [ doc = "" ] pub const otPlatMcuPowerState_OT_PLAT_MCU_POWER_STATE_ON : otPlatMcuPowerState = 0 ; # [ doc = " NCP's MCU can enter low-power (energy-saving) state." ] # [ doc = "" ] # [ doc = " When the NCP's desired power state is set to `LOW_POWER`, host is expected to \"poke\" the NCP (e.g., an external" ] # [ doc = " trigger like an interrupt) before it can communicate with the NCP (send a message to the NCP). The \"poke\"" ] # [ doc = " mechanism is determined by the platform code (based on NCP's interface to the host)." ] # [ doc = "" ] # [ doc = " While power state is set to `LOW_POWER`, NCP can still (at any time) send messages to host. Note that receiving" ] # [ doc = " a message from the NCP does NOT indicate that the NCP's power state has changed, i.e., host is expected to" ] # [ doc = " continue to \"poke\" when it wants to talk to the NCP until the power state is explicitly changed (by a successful" ] # [ doc = " call to `otPlatSetMcuPowerState()` changing the state to `ON`)." ] # [ doc = "" ] # [ doc = " @note The `LOW_POWER` power state only determines the MCU's power mode and is not related to radio's state" ] # [ doc = " (radio is managed by OpenThread core and device role, e.g., device being sleepy or not." ] # [ doc = "" ] pub const otPlatMcuPowerState_OT_PLAT_MCU_POWER_STATE_LOW_POWER : otPlatMcuPowerState = 1 ; # [ doc = " NCP is fully off." ] # [ doc = "" ] # [ doc = " An NCP hardware reset (via a RESET pin) is required to bring the NCP back to `SPINEL_MCU_POWER_STATE_ON`." ] # [ doc = " RAM is not retained after reset." ] # [ doc = "" ] pub const otPlatMcuPowerState_OT_PLAT_MCU_POWER_STATE_OFF : otPlatMcuPowerState = 2 ; # [ doc = " Enumeration of micro-controller's power states." ] # [ doc = "" ] # [ doc = " These values are used for NCP configuration when `OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL` is enabled." ] # [ doc = "" ] # [ doc = " The power state specifies the desired power state of NCP's micro-controller (MCU) when the underlying platform's" ] # [ doc = " operating system enters idle mode (i.e., all active tasks/events are processed and the MCU can potentially enter a" ] # [ doc = " energy-saving power state)." ] # [ doc = "" ] # [ doc = " The power state primarily determines how the host should interact with the NCP and whether the host needs an" ] # [ doc = " external trigger (a \"poke\") to NCP before it can communicate with the NCP or not." ] # [ doc = "" ] # [ doc = " After a reset, the MCU power state MUST be `OT_PLAT_POWER_STATE_ON`." ] # [ doc = "" ] pub type otPlatMcuPowerState = u32 ; extern "C" { # [ doc = " This function sets the desired MCU power state." ] # [ doc = "" ] # [ doc = " This is only applicable and used for NCP configuration when `OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL`" ] # [ doc = " is enabled." ] # [ doc = "" ] # [ doc = " @param[in] aInstance      A pointer to OpenThread instance." ] # [ doc = " @param[in] aState         The new MCU power state." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE     The power state updated successfully." ] # [ doc = " @retval OT_ERROR_FAILED   The given MCU power state is not supported by the platform." ] # [ doc = "" ] pub fn otPlatSetMcuPowerState ( aInstance : * mut otInstance , aState : otPlatMcuPowerState ) -> otError ; } extern "C" { # [ doc = " This function gets the current desired MCU power state." ] # [ doc = "" ] # [ doc = " This is only applicable and used for NCP configuration when `OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL`" ] # [ doc = " is enabled." ] # [ doc = "" ] # [ doc = " After a reset, the power state MUST return `OT_PLAT_POWER_STATE_ON`. During operation, power state SHOULD only" ] # [ doc = " change through an explicit successful call to `otPlatSetMcuPowerState()`." ] # [ doc = "" ] # [ doc = " @param[in] aInstance  A pointer to OpenThread instance." ] # [ doc = "" ] # [ doc = " @returns The current power state." ] # [ doc = "" ] pub fn otPlatGetMcuPowerState ( aInstance : * mut otInstance ) -> otPlatMcuPowerState ; } extern "C" { # [ doc = " This function exports status information to OTNS." ] # [ doc = "" ] # [ doc = " The status information is represented by a null-terminated string with format recognizable by OTNS." ] # [ doc = " Each call to `otPlatOtnsStatus` can send multiple statuses, separated by ';', e.x. \"parid=577fbc37;lrid=5\"." ] # [ doc = " Each status contains key and value separated by '='." ] # [ doc = " Status value can be further separated into multiple fields using ','," ] # [ doc = " e.x. \"ping_request=fdde:ad00:beef:0:459e:d7b4:b65e:5480,4,112000\"." ] # [ doc = "" ] # [ doc = " New statuses should follow these conventions." ] # [ doc = "" ] # [ doc = " Currently, OTNS only supports virtual time simulation." ] # [ doc = "" ] # [ doc = " @param[in]  aStatus  The status string." ] # [ doc = "" ] pub fn otPlatOtnsStatus ( aStatus : * const :: std :: os :: raw :: c_char ) ; } extern "C" { # [ doc = " Performs any initialization for the settings subsystem, if necessary." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance The OpenThread instance structure." ] # [ doc = "" ] pub fn otPlatSettingsInit ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " Performs any de-initialization for the settings subsystem, if necessary." ] # [ doc = "" ] # [ doc = " @param[in]  aInstance The OpenThread instance structure." ] # [ doc = "" ] pub fn otPlatSettingsDeinit ( aInstance : * mut otInstance ) ; } extern "C" { # [ doc = " Fetches the value of a setting" ] # [ doc = "** This function fetches the value of the setting identified" ] # [ doc = "*  by aKey and write it to the memory pointed to by aValue." ] # [ doc = "*  It then writes the length to the integer pointed to by" ] # [ doc = "*  aValueLength. The initial value of aValueLength is the" ] # [ doc = "*  maximum number of bytes to be written to aValue." ] # [ doc = "*" ] # [ doc = "*  This function can be used to check for the existence of" ] # [ doc = "*  a key without fetching the value by setting aValue and" ] # [ doc = "*  aValueLength to NULL. You can also check the length of" ] # [ doc = "*  the setting without fetching it by setting only aValue" ] # [ doc = "*  to NULL." ] # [ doc = "*" ] # [ doc = "*  Note that the underlying storage implementation is not" ] # [ doc = "*  required to maintain the order of settings with multiple" ] # [ doc = "*  values. The order of such values MAY change after ANY" ] # [ doc = "*  write operation to the store." ] # [ doc = "*" ] # [ doc = "*  @param[in]     aInstance     The OpenThread instance structure." ] # [ doc = "*  @param[in]     aKey          The key associated with the requested setting." ] # [ doc = "*  @param[in]     aIndex        The index of the specific item to get." ] # [ doc = "*  @param[out]    aValue        A pointer to where the value of the setting should be written. May be set to NULL if" ] # [ doc = "*                               just testing for the presence or length of a setting." ] # [ doc = "*  @param[inout]  aValueLength  A pointer to the length of the value. When called, this pointer should point to an" ] # [ doc = "*                               integer containing the maximum value size that can be written to aValue. At return," ] # [ doc = "*                               the actual length of the setting is written. This may be set to NULL if performing" ] # [ doc = "*                               a presence check." ] # [ doc = "*" ] # [ doc = "*  @retval OT_ERROR_NONE             The given setting was found and fetched successfully." ] # [ doc = "*  @retval OT_ERROR_NOT_FOUND        The given setting was not found in the setting store." ] # [ doc = "*  @retval OT_ERROR_NOT_IMPLEMENTED  This function is not implemented on this platform." ] # [ doc = "*/" ] pub fn otPlatSettingsGet ( aInstance : * mut otInstance , aKey : u16 , aIndex : :: std :: os :: raw :: c_int , aValue : * mut u8 , aValueLength : * mut u16 ) -> otError ; } extern "C" { # [ doc = " Sets or replaces the value of a setting" ] # [ doc = "** This function sets or replaces the value of a setting" ] # [ doc = "*  identified by aKey. If there was more than one" ] # [ doc = "*  value previously associated with aKey, then they are" ] # [ doc = "*  all deleted and replaced with this single entry." ] # [ doc = "*" ] # [ doc = "*  Calling this function successfully may cause unrelated" ] # [ doc = "*  settings with multiple values to be reordered." ] # [ doc = "*" ] # [ doc = "*  @param[in]  aInstance     The OpenThread instance structure." ] # [ doc = "*  @param[in]  aKey          The key associated with the setting to change." ] # [ doc = "*  @param[in]  aValue        A pointer to where the new value of the setting should be read from. MUST NOT be NULL if" ] # [ doc = "*                            aValueLength is non-zero." ] # [ doc = "*  @param[in]  aValueLength  The length of the data pointed to by aValue. May be zero." ] # [ doc = "*" ] # [ doc = "*  @retval OT_ERROR_NONE             The given setting was changed or staged." ] # [ doc = "*  @retval OT_ERROR_NOT_IMPLEMENTED  This function is not implemented on this platform." ] # [ doc = "*  @retval OT_ERROR_NO_BUFS          No space remaining to store the given setting." ] # [ doc = "*/" ] pub fn otPlatSettingsSet ( aInstance : * mut otInstance , aKey : u16 , aValue : * const u8 , aValueLength : u16 ) -> otError ; } extern "C" { # [ doc = " Adds a value to a setting" ] # [ doc = "** This function adds the value to a setting" ] # [ doc = "*  identified by aKey, without replacing any existing" ] # [ doc = "*  values." ] # [ doc = "*" ] # [ doc = "*  Note that the underlying implementation is not required" ] # [ doc = "*  to maintain the order of the items associated with a" ] # [ doc = "*  specific key. The added value may be added to the end," ] # [ doc = "*  the beginning, or even somewhere in the middle. The order" ] # [ doc = "*  of any pre-existing values may also change." ] # [ doc = "*" ] # [ doc = "*  Calling this function successfully may cause unrelated" ] # [ doc = "*  settings with multiple values to be reordered." ] # [ doc = "*" ] # [ doc = "* @param[in]  aInstance     The OpenThread instance structure." ] # [ doc = "* @param[in]  aKey          The key associated with the setting to change." ] # [ doc = "* @param[in]  aValue        A pointer to where the new value of the setting should be read from. MUST NOT be NULL" ] # [ doc = "*                           if aValueLength is non-zero." ] # [ doc = "* @param[in]  aValueLength  The length of the data pointed to by aValue. May be zero." ] # [ doc = "*" ] # [ doc = "* @retval OT_ERROR_NONE             The given setting was added or staged to be added." ] # [ doc = "* @retval OT_ERROR_NOT_IMPLEMENTED  This function is not implemented on this platform." ] # [ doc = "* @retval OT_ERROR_NO_BUFS          No space remaining to store the given setting." ] # [ doc = "*/" ] pub fn otPlatSettingsAdd ( aInstance : * mut otInstance , aKey : u16 , aValue : * const u8 , aValueLength : u16 ) -> otError ; } extern "C" { # [ doc = " Removes a setting from the setting store" ] # [ doc = "** This function deletes a specific value from the" ] # [ doc = "*  setting identified by aKey from the settings store." ] # [ doc = "*" ] # [ doc = "*  Note that the underlying implementation is not required" ] # [ doc = "*  to maintain the order of the items associated with a" ] # [ doc = "*  specific key." ] # [ doc = "*" ] # [ doc = "*  @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "*  @param[in] aKey       The key associated with the requested setting." ] # [ doc = "*  @param[in] aIndex     The index of the value to be removed. If set to -1, all values for this aKey will be removed." ] # [ doc = "*" ] # [ doc = "*  @retval OT_ERROR_NONE             The given key and index was found and removed successfully." ] # [ doc = "*  @retval OT_ERROR_NOT_FOUND        The given key or index was not found in the setting store." ] # [ doc = "*  @retval OT_ERROR_NOT_IMPLEMENTED  This function is not implemented on this platform." ] # [ doc = "*/" ] pub fn otPlatSettingsDelete ( aInstance : * mut otInstance , aKey : u16 , aIndex : :: std :: os :: raw :: c_int ) -> otError ; } extern "C" { # [ doc = " Removes all settings from the setting store" ] # [ doc = "** This function deletes all settings from the settings" ] # [ doc = "*  store, resetting it to its initial factory state." ] # [ doc = "*" ] # [ doc = "*  @param[in] aInstance  The OpenThread instance structure." ] # [ doc = "*/" ] pub fn otPlatSettingsWipe ( aInstance : * mut otInstance ) ; } # [ doc = " Indicates that a SPI transaction has completed with the given length. The data written to the slave has been written" ] # [ doc = " to the pointer indicated by the `aInputBuf` argument to the previous call to `otPlatSpiSlavePrepareTransaction()`." ] # [ doc = "" ] # [ doc = " Once this function is called, `otPlatSpiSlavePrepareTransaction()` is invalid and must be called again for the next" ] # [ doc = " transaction to be valid." ] # [ doc = "" ] # [ doc = " Note that this function is always called at the end of a transaction, even if `otPlatSpiSlavePrepareTransaction()`" ] # [ doc = " has not yet been called. In such cases, `aOutputBufLen` and `aInputBufLen` will be zero." ] # [ doc = "" ] # [ doc = " This callback can be called from ISR context. The return value from this function indicates if any further" ] # [ doc = " processing is required. If `TRUE` is returned the platform spi-slave driver implementation must invoke the" ] # [ doc = " transaction process callback (`aProcessCallback` set in `otPlatSpiSlaveEnable()`) which unlike this callback must be" ] # [ doc = " called from the same OS context that any other OpenThread API/callback is called." ] # [ doc = "" ] # [ doc = " @param[in] aContext           Context pointer passed into `otPlatSpiSlaveEnable()`." ] # [ doc = " @param[in] aOutputBuf         Value of `aOutputBuf` from last call to `otPlatSpiSlavePrepareTransaction()`." ] # [ doc = " @param[in] aOutputBufLen      Value of `aOutputBufLen` from last call to `otPlatSpiSlavePrepareTransaction()`." ] # [ doc = " @param[in] aInputBuf          Value of aInputBuf from last call to `otPlatSpiSlavePrepareTransaction()`." ] # [ doc = " @param[in] aInputBufLen       Value of aInputBufLen from last call to `otPlatSpiSlavePrepareTransaction()`" ] # [ doc = " @param[in] aTransactionLength Length of the completed transaction, in bytes." ] # [ doc = "" ] # [ doc = " @returns  TRUE if after this call returns the platform should invoke the process callback `aProcessCallback`," ] # [ doc = "           FALSE if there is nothing to process and no need to invoke the process callback." ] pub type otPlatSpiSlaveTransactionCompleteCallback = :: std :: option :: Option < unsafe extern "C" fn ( aContext : * mut :: std :: os :: raw :: c_void , aOutputBuf : * mut u8 , aOutputBufLen : u16 , aInputBuf : * mut u8 , aInputBufLen : u16 , aTransactionLength : u16 ) -> bool > ; # [ doc = " Invoked after a transaction complete callback is called and returns `TRUE` to do any further processing required." ] # [ doc = " Unlike `otPlatSpiSlaveTransactionCompleteCallback` which can be called from any OS context (e.g., ISR), this" ] # [ doc = " callback MUST be called from the same OS context as any other OpenThread API/callback." ] # [ doc = "" ] # [ doc = " @param[in] aContext           Context pointer passed into `otPlatSpiSlaveEnable()`." ] # [ doc = "" ] pub type otPlatSpiSlaveTransactionProcessCallback = :: std :: option :: Option < unsafe extern "C" fn ( aContext : * mut :: std :: os :: raw :: c_void ) > ; extern "C" { # [ doc = " Initialize the SPI slave interface." ] # [ doc = "" ] # [ doc = " Note that SPI slave is not fully ready until a transaction is prepared using `otPlatSPISlavePrepareTransaction()`." ] # [ doc = "" ] # [ doc = " If `otPlatSPISlavePrepareTransaction() is not called before the master begins a transaction, the resulting SPI" ] # [ doc = " transaction will send all `0xFF` bytes and discard all received bytes." ] # [ doc = "" ] # [ doc = " @param[in] aCompleteCallback  Pointer to transaction complete callback." ] # [ doc = " @param[in] aProcessCallback   Pointer to process callback." ] # [ doc = " @param[in] aContext           Context pointer to be passed to callbacks." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE     Successfully enabled the SPI Slave interface." ] # [ doc = " @retval OT_ERROR_ALREADY  SPI Slave interface is already enabled." ] # [ doc = " @retval OT_ERROR_FAILED   Failed to enable the SPI Slave interface." ] # [ doc = "" ] pub fn otPlatSpiSlaveEnable ( aCompleteCallback : otPlatSpiSlaveTransactionCompleteCallback , aProcessCallback : otPlatSpiSlaveTransactionProcessCallback , aContext : * mut :: std :: os :: raw :: c_void ) -> otError ; } extern "C" { # [ doc = " Shutdown and disable the SPI slave interface." ] pub fn otPlatSpiSlaveDisable ( ) ; } extern "C" { # [ doc = " Prepare data for the next SPI transaction. Data pointers MUST remain valid until the transaction complete callback" ] # [ doc = " is called by the SPI slave driver, or until after the next call to `otPlatSpiSlavePrepareTransaction()`." ] # [ doc = "" ] # [ doc = " This function may be called more than once before the SPI master initiates the transaction. Each *successful* call" ] # [ doc = " to this function will cause the previous values from earlier calls to be discarded." ] # [ doc = "" ] # [ doc = " Not calling this function after a completed transaction is the same as if this function was previously called with" ] # [ doc = " both buffer lengths set to zero and `aRequestTransactionFlag` set to `false`." ] # [ doc = "" ] # [ doc = " Once `aOutputBufLen` bytes of `aOutputBuf` has been clocked out, the MISO pin shall be set high until the master" ] # [ doc = " finishes the SPI transaction. This is the functional equivalent of padding the end of `aOutputBuf` with `0xFF` bytes" ] # [ doc = " out to the length of the transaction." ] # [ doc = "" ] # [ doc = " Once `aInputBufLen` bytes of aInputBuf have been clocked in from MOSI, all subsequent values from the MOSI pin are" ] # [ doc = " ignored until the SPI master finishes the transaction." ] # [ doc = "" ] # [ doc = " Note that even if `aInputBufLen` or `aOutputBufLen` (or both) are exhausted before the SPI master finishes a" ] # [ doc = " transaction, the ongoing size of the transaction must still be kept track of to be passed to the transaction" ] # [ doc = " complete callback. For example, if `aInputBufLen` is equal to 10 and `aOutputBufLen` equal to 20 and the SPI master" ] # [ doc = " clocks out 30 bytes, the value 30 is passed to the transaction complete callback." ] # [ doc = "" ] # [ doc = " If a `NULL` pointer is passed in as `aOutputBuf` or `aInputBuf` it means that that buffer pointer should not change" ] # [ doc = " from its previous/current value. In this case, the corresponding length argument should be ignored. For example," ] # [ doc = " `otPlatSpiSlavePrepareTransaction(NULL, 0, aInputBuf, aInputLen, false)` changes the input buffer pointer and its" ] # [ doc = " length but keeps the output buffer pointer same as before." ] # [ doc = "" ] # [ doc = " Any call to this function while a transaction is in progress will cause all of the arguments to be ignored and the" ] # [ doc = " return value to be `OT_ERROR_BUSY`." ] # [ doc = "" ] # [ doc = " @param[in] aOutputBuf              Data to be written to MISO pin" ] # [ doc = " @param[in] aOutputBufLen           Size of the output buffer, in bytes" ] # [ doc = " @param[in] aInputBuf               Data to be read from MOSI pin" ] # [ doc = " @param[in] aInputBufLen            Size of the input buffer, in bytes" ] # [ doc = " @param[in] aRequestTransactionFlag Set to true if host interrupt should be set" ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE           Transaction was successfully prepared." ] # [ doc = " @retval OT_ERROR_BUSY           A transaction is currently in progress." ] # [ doc = " @retval OT_ERROR_INVALID_STATE  otPlatSpiSlaveEnable() hasn't been called." ] # [ doc = "" ] pub fn otPlatSpiSlavePrepareTransaction ( aOutputBuf : * mut u8 , aOutputBufLen : u16 , aInputBuf : * mut u8 , aInputBufLen : u16 , aRequestTransactionFlag : bool ) -> otError ; } extern "C" { # [ doc = " Get the current time (64bits width)." ] # [ doc = "" ] # [ doc = " @returns The current time in microseconds." ] # [ doc = "" ] pub fn otPlatTimeGet ( ) -> u64 ; } extern "C" { # [ doc = " Get the device's XTAL accuracy." ] # [ doc = "" ] # [ doc = " @returns The device's XTAL accuracy, in ppm." ] # [ doc = "" ] pub fn otPlatTimeGetXtalAccuracy ( ) -> u16 ; } extern "C" { # [ doc = " Enable the UART." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE    Successfully enabled the UART." ] # [ doc = " @retval OT_ERROR_FAILED  Failed to enabled the UART." ] # [ doc = "" ] pub fn otPlatUartEnable ( ) -> otError ; } extern "C" { # [ doc = " Disable the UART." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE    Successfully disabled the UART." ] # [ doc = " @retval OT_ERROR_FAILED  Failed to disable the UART." ] # [ doc = "" ] pub fn otPlatUartDisable ( ) -> otError ; } extern "C" { # [ doc = " Send bytes over the UART." ] # [ doc = "" ] # [ doc = " @param[in] aBuf        A pointer to the data buffer." ] # [ doc = " @param[in] aBufLength  Number of bytes to transmit." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE    Successfully started transmission." ] # [ doc = " @retval OT_ERROR_FAILED  Failed to start the transmission." ] # [ doc = "" ] pub fn otPlatUartSend ( aBuf : * const u8 , aBufLength : u16 ) -> otError ; } extern "C" { # [ doc = " Flush the outgoing transmit buffer and wait for the data to be sent." ] # [ doc = " This is called when the CLI UART interface has a full buffer but still" ] # [ doc = " wishes to send more data." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NONE                Flush succeeded, we can proceed to write more" ] # [ doc = "                                      data to the buffer." ] # [ doc = "" ] # [ doc = " @retval OT_ERROR_NOT_IMPLEMENTED     Driver does not support synchronous flush." ] # [ doc = " @retval OT_ERROR_INVALID_STATE       Driver has no data to flush." ] pub fn otPlatUartFlush ( ) -> otError ; } extern "C" { # [ doc = " The UART driver calls this method to notify OpenThread that the requested bytes have been sent." ] # [ doc = "" ] pub fn otPlatUartSendDone ( ) ; } extern "C" { # [ doc = " The UART driver calls this method to notify OpenThread that bytes have been received." ] # [ doc = "" ] # [ doc = " @param[in]  aBuf        A pointer to the received bytes." ] # [ doc = " @param[in]  aBufLength  The number of bytes received." ] # [ doc = "" ] pub fn otPlatUartReceived ( aBuf : * const u8 , aBufLength : u16 ) ; } extern "C" { # [ doc = " This function initializes the UDP socket by platform." ] # [ doc = "" ] # [ doc = " @param[in]   aUdpSocket  A pointer to the UDP socket." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE   Successfully initialized UDP socket by platform." ] # [ doc = " @retval  OT_ERROR_FAILED Failed to initialize UDP Socket." ] # [ doc = "" ] pub fn otPlatUdpSocket ( aUdpSocket : * mut otUdpSocket ) -> otError ; } extern "C" { # [ doc = " This function closes the UDP socket by platform." ] # [ doc = "" ] # [ doc = " @param[in]   aUdpSocket  A pointer to the UDP socket." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE   Successfully closed UDP socket by platform." ] # [ doc = " @retval  OT_ERROR_FAILED Failed to close UDP Socket." ] # [ doc = "" ] pub fn otPlatUdpClose ( aUdpSocket : * mut otUdpSocket ) -> otError ; } extern "C" { # [ doc = " This function binds the UDP socket by platform." ] # [ doc = "" ] # [ doc = " @param[in]   aUdpSocket  A pointer to the UDP socket." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE   Successfully binded UDP socket by platform." ] # [ doc = " @retval  OT_ERROR_FAILED Failed to bind UDP socket." ] # [ doc = "" ] pub fn otPlatUdpBind ( aUdpSocket : * mut otUdpSocket ) -> otError ; } extern "C" { # [ doc = " This function connects UDP socket by platform." ] # [ doc = "" ] # [ doc = " @param[in]   aUdpSocket  A pointer to the UDP socket." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE   Successfully connected by platform." ] # [ doc = " @retval  OT_ERROR_FAILED Failed to connect UDP socket." ] # [ doc = "" ] pub fn otPlatUdpConnect ( aUdpSocket : * mut otUdpSocket ) -> otError ; } extern "C" { # [ doc = " This function sends UDP payload by platform." ] # [ doc = "" ] # [ doc = " @param[in]   aUdpSocket      A pointer to the UDP socket." ] # [ doc = " @param[in]   aMessage        A pointer to the message to send." ] # [ doc = " @param[in]   aMessageInfo    A pointer to the message info associated with @p aMessage." ] # [ doc = "" ] # [ doc = " @retval  OT_ERROR_NONE   Successfully sent by platform, and @p aMessage is freed." ] # [ doc = " @retval  OT_ERROR_FAILED Failed to binded UDP socket." ] # [ doc = "" ] pub fn otPlatUdpSend ( aUdpSocket : * mut otUdpSocket , aMessage : * mut otMessage , aMessageInfo : * const otMessageInfo ) -> otError ; } pub type __builtin_va_list = [ __va_list_tag ; 1usize ] ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct __va_list_tag { pub gp_offset : :: std :: os :: raw :: c_uint , pub fp_offset : :: std :: os :: raw :: c_uint , pub overflow_arg_area : * mut :: std :: os :: raw :: c_void , pub reg_save_area : * mut :: std :: os :: raw :: c_void , } # [ test ] fn bindgen_test_layout___va_list_tag ( ) { assert_eq ! ( :: std :: mem :: size_of :: < __va_list_tag > ( ) , 24usize , concat ! ( "Size of: " , stringify ! ( __va_list_tag ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < __va_list_tag > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( __va_list_tag ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < __va_list_tag > ( ) ) ) . gp_offset as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( __va_list_tag ) , "::" , stringify ! ( gp_offset ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < __va_list_tag > ( ) ) ) . fp_offset as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( __va_list_tag ) , "::" , stringify ! ( fp_offset ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < __va_list_tag > ( ) ) ) . overflow_arg_area as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( __va_list_tag ) , "::" , stringify ! ( overflow_arg_area ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < __va_list_tag > ( ) ) ) . reg_save_area as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( __va_list_tag ) , "::" , stringify ! ( reg_save_area ) ) ) ; }