bl602_sdk/
wifi.rs

1/* automatically generated by rust-bindgen 0.58.1 */
2
3use
4super::*;
5
6#[repr(C)]
7#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
8pub struct __BindgenBitfieldUnit<Storage> {
9    storage: Storage,
10}
11impl<Storage> __BindgenBitfieldUnit<Storage> {
12    #[inline]
13    pub const fn new(storage: Storage) -> Self {
14        Self { storage }
15    }
16}
17impl<Storage> __BindgenBitfieldUnit<Storage>
18where
19    Storage: AsRef<[u8]> + AsMut<[u8]>,
20{
21    #[inline]
22    pub fn get_bit(&self, index: usize) -> bool {
23        debug_assert!(index / 8 < self.storage.as_ref().len());
24        let byte_index = index / 8;
25        let byte = self.storage.as_ref()[byte_index];
26        let bit_index = if cfg!(target_endian = "big") {
27            7 - (index % 8)
28        } else {
29            index % 8
30        };
31        let mask = 1 << bit_index;
32        byte & mask == mask
33    }
34    #[inline]
35    pub fn set_bit(&mut self, index: usize, val: bool) {
36        debug_assert!(index / 8 < self.storage.as_ref().len());
37        let byte_index = index / 8;
38        let byte = &mut self.storage.as_mut()[byte_index];
39        let bit_index = if cfg!(target_endian = "big") {
40            7 - (index % 8)
41        } else {
42            index % 8
43        };
44        let mask = 1 << bit_index;
45        if val {
46            *byte |= mask;
47        } else {
48            *byte &= !mask;
49        }
50    }
51    #[inline]
52    pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
53        debug_assert!(bit_width <= 64);
54        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
55        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
56        let mut val = 0;
57        for i in 0..(bit_width as usize) {
58            if self.get_bit(i + bit_offset) {
59                let index = if cfg!(target_endian = "big") {
60                    bit_width as usize - 1 - i
61                } else {
62                    i
63                };
64                val |= 1 << index;
65            }
66        }
67        val
68    }
69    #[inline]
70    pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
71        debug_assert!(bit_width <= 64);
72        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
73        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
74        for i in 0..(bit_width as usize) {
75            let mask = 1 << i;
76            let val_bit_is_set = val & mask == mask;
77            let index = if cfg!(target_endian = "big") {
78                bit_width as usize - 1 - i
79            } else {
80                i
81            };
82            self.set_bit(index + bit_offset, val_bit_is_set);
83        }
84    }
85}
86#[repr(C)]
87#[derive(Default)]
88pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
89impl<T> __IncompleteArrayField<T> {
90    #[inline]
91    pub const fn new() -> Self {
92        __IncompleteArrayField(::core::marker::PhantomData, [])
93    }
94    #[inline]
95    pub fn as_ptr(&self) -> *const T {
96        self as *const _ as *const T
97    }
98    #[inline]
99    pub fn as_mut_ptr(&mut self) -> *mut T {
100        self as *mut _ as *mut T
101    }
102    #[inline]
103    pub unsafe fn as_slice(&self, len: usize) -> &[T] {
104        ::core::slice::from_raw_parts(self.as_ptr(), len)
105    }
106    #[inline]
107    pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
108        ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
109    }
110}
111impl<T> ::core::fmt::Debug for __IncompleteArrayField<T> {
112    fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
113        fmt.write_str("__IncompleteArrayField")
114    }
115}
116pub const WIFI_MGMR_SCAN_ITEMS_MAX: u32 = 50;
117pub const WIFI_MGMR_PROFILES_MAX: u32 = 2;
118pub const WIFI_MGMR_MQ_MSG_SIZE: u32 = 224;
119pub const WIFI_MGMR_MQ_MSG_COUNT: u32 = 10;
120pub const WIFI_MGMR_CONNECT_IND_STAT_INFO_TYPE_IND_CONNECTION: u32 = 1;
121pub const WIFI_MGMR_CONNECT_IND_STAT_INFO_TYPE_IND_DISCONNECTION: u32 = 2;
122pub const WIFI_MGMR_PENDING_TASK_SCAN_BIT: u32 = 1;
123pub const WIFI_MGMR_FEATURES_SCAN_SAVE_HIDDEN_SSID: u32 = 1;
124pub const WIFI_MGMR_CONFIG_SCAN_ITEM_TIMEOUT: u32 = 15000;
125pub type size_t = ::cty::c_ulong;
126pub type __int8_t = ::cty::c_schar;
127pub type __uint8_t = ::cty::c_uchar;
128pub type __uint16_t = ::cty::c_ushort;
129pub type __int32_t = ::cty::c_int;
130pub type __uint32_t = ::cty::c_uint;
131pub type TaskFunction_t = ::core::option::Option<unsafe extern "C" fn(arg1: *mut ::cty::c_void)>;
132pub type UBaseType_t = u32;
133pub type TickType_t = u32;
134#[repr(C)]
135#[derive(Copy, Clone)]
136pub struct xSTATIC_LIST_ITEM {
137    pub xDummy2: TickType_t,
138    pub pvDummy3: [*mut ::cty::c_void; 4usize],
139}
140impl Default for xSTATIC_LIST_ITEM {
141    fn default() -> Self {
142        unsafe { ::core::mem::zeroed() }
143    }
144}
145pub type StaticListItem_t = xSTATIC_LIST_ITEM;
146#[repr(C)]
147#[derive(Copy, Clone)]
148pub struct xSTATIC_TIMER {
149    pub pvDummy1: *mut ::cty::c_void,
150    pub xDummy2: StaticListItem_t,
151    pub xDummy3: TickType_t,
152    pub pvDummy5: *mut ::cty::c_void,
153    pub pvDummy6: TaskFunction_t,
154    pub uxDummy7: UBaseType_t,
155    pub ucDummy8: u8,
156}
157impl Default for xSTATIC_TIMER {
158    fn default() -> Self {
159        unsafe { ::core::mem::zeroed() }
160    }
161}
162pub type StaticTimer_t = xSTATIC_TIMER;
163#[repr(C)]
164#[derive(Copy, Clone)]
165pub struct xSTATIC_STREAM_BUFFER {
166    pub uxDummy1: [size_t; 4usize],
167    pub pvDummy2: [*mut ::cty::c_void; 3usize],
168    pub ucDummy3: u8,
169    pub uxDummy4: UBaseType_t,
170}
171impl Default for xSTATIC_STREAM_BUFFER {
172    fn default() -> Self {
173        unsafe { ::core::mem::zeroed() }
174    }
175}
176pub type StaticStreamBuffer_t = xSTATIC_STREAM_BUFFER;
177pub type StaticMessageBuffer_t = StaticStreamBuffer_t;
178#[safe_wrap(_)] extern "C" {
179    pub fn hal_wifi_start_firmware_task() -> ::cty::c_int;
180}
181pub type u8_t = u8;
182pub type s8_t = i8;
183pub type u16_t = u16;
184pub type u32_t = u32;
185pub type err_t = s8_t;
186#[doc = " This is the aligned version of ip4_addr_t,"]
187#[doc = "used as local variable, on the stack, etc."]
188#[repr(C)]
189#[derive(Default, Copy, Clone)]
190pub struct ip4_addr {
191    pub addr: u32_t,
192}
193#[doc = " ip4_addr_t uses a struct for convenience only, so that the same defines can"]
194#[doc = " operate both on ip4_addr_t as well as on ip4_addr_p_t."]
195pub type ip4_addr_t = ip4_addr;
196pub type ip_addr_t = ip4_addr_t;
197#[doc = " Main packet buffer struct"]
198#[repr(C)]
199#[derive(Copy, Clone)]
200pub struct pbuf {
201    #[doc = " next pbuf in singly linked pbuf chain"]
202    pub next: *mut pbuf,
203    #[doc = " pointer to the actual data in the buffer"]
204    pub payload: *mut ::cty::c_void,
205    #[doc = " total length of this buffer and all next buffers in chain"]
206    #[doc = " belonging to the same packet."]
207    #[doc = ""]
208    #[doc = " For non-queue packet chains this is the invariant:"]
209    #[doc = " p->tot_len == p->len + (p->next? p->next->tot_len: 0)"]
210    pub tot_len: u16_t,
211    #[doc = " length of this buffer"]
212    pub len: u16_t,
213    #[doc = " a bit field indicating pbuf type and allocation sources"]
214    #[doc = "(see PBUF_TYPE_FLAG_*, PBUF_ALLOC_FLAG_* and PBUF_TYPE_ALLOC_SRC_MASK)"]
215    pub type_internal: u8_t,
216    #[doc = " misc flags"]
217    pub flags: u8_t,
218    #[doc = " the reference count always equals the number of pointers"]
219    #[doc = " that refer to this pbuf. This can be pointers from an application,"]
220    #[doc = " the stack itself, or pbuf->next pointers from a chain."]
221    pub ref_: u8_t,
222    #[doc = " For incoming packets, this contains the input netif's index"]
223    pub if_idx: u8_t,
224}
225impl Default for pbuf {
226    fn default() -> Self {
227        unsafe { ::core::mem::zeroed() }
228    }
229}
230#[doc = " Delete a filter entry"]
231pub const netif_mac_filter_action_NETIF_DEL_MAC_FILTER: netif_mac_filter_action = 0;
232#[doc = " Add a filter entry"]
233pub const netif_mac_filter_action_NETIF_ADD_MAC_FILTER: netif_mac_filter_action = 1;
234#[doc = " MAC Filter Actions, these are passed to a netif's igmp_mac_filter or"]
235#[doc = " mld_mac_filter callback function."]
236pub type netif_mac_filter_action = ::cty::c_uint;
237#[doc = " Function prototype for netif->input functions. This function is saved as 'input'"]
238#[doc = " callback function in the netif struct. Call it when a packet has been received."]
239#[doc = ""]
240#[doc = " @param p The received packet, copied into a pbuf"]
241#[doc = " @param inp The netif which received the packet"]
242#[doc = " Return: ERR_OK if the packet was handled"]
243#[doc = "         != ERR_OK is the packet was NOT handled, in this case, the caller has"]
244#[doc = "                   to free the pbuf"]
245pub type netif_input_fn =
246    ::core::option::Option<unsafe extern "C" fn(p: *mut pbuf, inp: *mut netif) -> err_t>;
247#[doc = " Function prototype for netif->output functions. Called by lwIP when a packet"]
248#[doc = " shall be sent. For ethernet netif, set this to 'etharp_output' and set"]
249#[doc = " 'linkoutput'."]
250#[doc = ""]
251#[doc = " @param netif The netif which shall send a packet"]
252#[doc = " @param p The packet to send (p->payload points to IP header)"]
253#[doc = " @param ipaddr The IP address to which the packet shall be sent"]
254pub type netif_output_fn = ::core::option::Option<
255    unsafe extern "C" fn(netif: *mut netif, p: *mut pbuf, ipaddr: *const ip4_addr_t) -> err_t,
256>;
257#[doc = " Function prototype for netif->linkoutput functions. Only used for ethernet"]
258#[doc = " netifs. This function is called by ARP when a packet shall be sent."]
259#[doc = ""]
260#[doc = " @param netif The netif which shall send a packet"]
261#[doc = " @param p The packet to send (raw ethernet packet)"]
262pub type netif_linkoutput_fn =
263    ::core::option::Option<unsafe extern "C" fn(netif: *mut netif, p: *mut pbuf) -> err_t>;
264#[doc = " Function prototype for netif status- or link-callback functions."]
265pub type netif_status_callback_fn = ::core::option::Option<unsafe extern "C" fn(netif: *mut netif)>;
266#[doc = " Function prototype for netif igmp_mac_filter functions"]
267pub type netif_igmp_mac_filter_fn = ::core::option::Option<
268    unsafe extern "C" fn(
269        netif: *mut netif,
270        group: *const ip4_addr_t,
271        action: netif_mac_filter_action,
272    ) -> err_t,
273>;
274#[doc = " Generic data structure used for all lwIP network interfaces."]
275#[doc = "  The following fields should be filled in by the initialization"]
276#[doc = "  function for the device driver: hwaddr_len, hwaddr[], mtu, flags"]
277#[repr(C)]
278#[derive(Copy, Clone)]
279pub struct netif {
280    #[doc = " pointer to next in linked list"]
281    pub next: *mut netif,
282    #[doc = " IP address configuration in network byte order"]
283    pub ip_addr: ip_addr_t,
284    pub netmask: ip_addr_t,
285    pub gw: ip_addr_t,
286    #[doc = " This function is called by the network device driver"]
287    #[doc = "  to pass a packet up the TCP/IP stack."]
288    pub input: netif_input_fn,
289    #[doc = " This function is called by the IP module when it wants"]
290    #[doc = "  to send a packet on the interface. This function typically"]
291    #[doc = "  first resolves the hardware address, then sends the packet."]
292    #[doc = "  For ethernet physical layer, this is usually etharp_output()"]
293    pub output: netif_output_fn,
294    #[doc = " This function is called by ethernet_output() when it wants"]
295    #[doc = "  to send a packet on the interface. This function outputs"]
296    #[doc = "  the pbuf as-is on the link medium."]
297    pub linkoutput: netif_linkoutput_fn,
298    #[doc = " This function is called when the netif state is set to up or down"]
299    pub status_callback: netif_status_callback_fn,
300    #[doc = " This function is called when the netif link is set to up or down"]
301    pub link_callback: netif_status_callback_fn,
302    #[doc = " This field can be set by the device driver and could point"]
303    #[doc = "  to state information for the device."]
304    pub state: *mut ::cty::c_void,
305    pub client_data: [*mut ::cty::c_void; 3usize],
306    pub hostname: *const ::cty::c_char,
307    #[doc = " maximum transfer unit (in bytes)"]
308    pub mtu: u16_t,
309    #[doc = " link level hardware address of this interface"]
310    pub hwaddr: [u8_t; 6usize],
311    #[doc = " number of bytes used in hwaddr"]
312    pub hwaddr_len: u8_t,
313    #[doc = " flags (@see @ref netif_flags)"]
314    pub flags: u8_t,
315    #[doc = " descriptive abbreviation"]
316    pub name: [::cty::c_char; 2usize],
317    #[doc = " number of this interface. Used for @ref if_api and @ref netifapi_netif,"]
318    #[doc = " as well as for IPv6 zones"]
319    pub num: u8_t,
320    #[doc = " Number of Router Solicitation messages that remain to be sent."]
321    pub rs_count: u8_t,
322    #[doc = " This function could be called to add or delete an entry in the multicast"]
323    #[doc = "filter table of the ethernet MAC."]
324    pub igmp_mac_filter: netif_igmp_mac_filter_fn,
325}
326impl Default for netif {
327    fn default() -> Self {
328        unsafe { ::core::mem::zeroed() }
329    }
330}
331#[repr(C)]
332#[derive(Default, Copy, Clone)]
333pub struct wifi_mgmr_ap_item {
334    pub ssid: [::cty::c_char; 32usize],
335    pub ssid_tail: [::cty::c_char; 1usize],
336    pub ssid_len: u32,
337    pub bssid: [u8; 6usize],
338    pub channel: u8,
339    pub auth: u8,
340    pub rssi: i8,
341}
342pub type wifi_mgmr_ap_item_t = wifi_mgmr_ap_item;
343#[repr(C)]
344#[derive(Copy, Clone)]
345pub struct wifi_mgmr_sta_connect_ind_stat_info {
346    pub status_code: u16,
347    pub type_ind: u8,
348    pub ssid: [::cty::c_char; 32usize],
349    pub psk: [::cty::c_char; 65usize],
350    pub pmk: [::cty::c_char; 64usize],
351    pub bssid: [u8; 6usize],
352    pub chan_freq: u16,
353    pub chan_band: u8,
354}
355impl Default for wifi_mgmr_sta_connect_ind_stat_info {
356    fn default() -> Self {
357        unsafe { ::core::mem::zeroed() }
358    }
359}
360pub type wifi_mgmr_sta_connect_ind_stat_info_t = wifi_mgmr_sta_connect_ind_stat_info;
361#[repr(C)]
362#[derive(Default, Copy, Clone)]
363pub struct wifi_sta_basic_info {
364    pub sta_idx: u8,
365    pub is_used: u8,
366    pub sta_mac: [u8; 6usize],
367    pub tsfhi: u32,
368    pub tsflo: u32,
369    pub rssi: ::cty::c_int,
370    pub data_rate: u8,
371}
372pub type wifi_sta_basic_info_t = wifi_sta_basic_info;
373pub type wifi_interface_t = *mut ::cty::c_void;
374pub type sniffer_cb_t = ::core::option::Option<
375    unsafe extern "C" fn(env: *mut ::cty::c_void, pkt: *mut u8, len: ::cty::c_int),
376>;
377pub type scan_item_cb_t = ::core::option::Option<
378    unsafe extern "C" fn(
379        env: *mut wifi_mgmr_ap_item_t,
380        param1: *mut u32,
381        item: *mut wifi_mgmr_ap_item_t,
382    ),
383>;
384pub type scan_complete_cb_t = ::core::option::Option<
385    unsafe extern "C" fn(data: *mut ::cty::c_void, param: *mut ::cty::c_void),
386>;
387pub const WIFI_STATE_ENUM_LIST_WIFI_STATE_UNKNOWN: WIFI_STATE_ENUM_LIST = 0;
388pub const WIFI_STATE_ENUM_LIST_WIFI_STATE_IDLE: WIFI_STATE_ENUM_LIST = 1;
389pub const WIFI_STATE_ENUM_LIST_WIFI_STATE_CONNECTING: WIFI_STATE_ENUM_LIST = 2;
390pub const WIFI_STATE_ENUM_LIST_WIFI_STATE_CONNECTED_IP_GETTING: WIFI_STATE_ENUM_LIST = 3;
391pub const WIFI_STATE_ENUM_LIST_WIFI_STATE_CONNECTED_IP_GOT: WIFI_STATE_ENUM_LIST = 4;
392pub const WIFI_STATE_ENUM_LIST_WIFI_STATE_DISCONNECT: WIFI_STATE_ENUM_LIST = 5;
393pub const WIFI_STATE_ENUM_LIST_WIFI_STATE_WITH_AP_IDLE: WIFI_STATE_ENUM_LIST = 17;
394pub const WIFI_STATE_ENUM_LIST_WIFI_STATE_WITH_AP_CONNECTING: WIFI_STATE_ENUM_LIST = 18;
395pub const WIFI_STATE_ENUM_LIST_WIFI_STATE_WITH_AP_CONNECTED_IP_GETTING: WIFI_STATE_ENUM_LIST = 19;
396pub const WIFI_STATE_ENUM_LIST_WIFI_STATE_WITH_AP_CONNECTED_IP_GOT: WIFI_STATE_ENUM_LIST = 20;
397pub const WIFI_STATE_ENUM_LIST_WIFI_STATE_WITH_AP_DISCONNECT: WIFI_STATE_ENUM_LIST = 21;
398pub const WIFI_STATE_ENUM_LIST_WIFI_STATE_IFDOWN: WIFI_STATE_ENUM_LIST = 6;
399pub const WIFI_STATE_ENUM_LIST_WIFI_STATE_SNIFFER: WIFI_STATE_ENUM_LIST = 7;
400pub const WIFI_STATE_ENUM_LIST_WIFI_STATE_PSK_ERROR: WIFI_STATE_ENUM_LIST = 8;
401pub const WIFI_STATE_ENUM_LIST_WIFI_STATE_NO_AP_FOUND: WIFI_STATE_ENUM_LIST = 9;
402pub type WIFI_STATE_ENUM_LIST = ::cty::c_uint;
403pub const WIFI_SCAN_DONE_EVENT_TYPE_WIFI_SCAN_DONE_EVENT_OK: WIFI_SCAN_DONE_EVENT_TYPE = 0;
404pub const WIFI_SCAN_DONE_EVENT_TYPE_WIFI_SCAN_DONE_EVENT_BUSY: WIFI_SCAN_DONE_EVENT_TYPE = 1;
405pub type WIFI_SCAN_DONE_EVENT_TYPE = ::cty::c_uint;
406#[repr(C)]
407#[derive(Default, Copy, Clone)]
408pub struct wifi_conf {
409    pub country_code: [::cty::c_char; 3usize],
410    pub channel_nums: ::cty::c_int,
411}
412pub type wifi_conf_t = wifi_conf;
413#[safe_wrap(_)] extern "C" {
414    pub fn wifi_mgmr_psk_cal(
415        password: *mut ::cty::c_char,
416        ssid: *mut ::cty::c_char,
417        ssid_len: ::cty::c_int,
418        output: *mut ::cty::c_char,
419    ) -> ::cty::c_int;
420}
421#[safe_wrap(_)] extern "C" {
422    pub fn wifi_mgmr_drv_init(conf: *mut wifi_conf_t) -> ::cty::c_int;
423}
424#[safe_wrap(_)] extern "C" {
425    pub fn wifi_mgmr_init() -> ::cty::c_int;
426}
427#[safe_wrap(_)] extern "C" {
428    pub fn wifi_mgmr_start();
429}
430#[safe_wrap(_)] extern "C" {
431    pub fn wifi_mgmr_start_background(conf: *mut wifi_conf_t);
432}
433#[safe_wrap(_)] extern "C" {
434    pub fn wifi_mgmr_get_wifi_channel_conf(wifi_chan_conf: *mut wifi_conf_t);
435}
436#[safe_wrap(_)] extern "C" {
437    pub fn wifi_mgmr_sta_enable() -> wifi_interface_t;
438}
439#[safe_wrap(_)] extern "C" {
440    pub fn wifi_mgmr_sta_disable(interface: *mut wifi_interface_t) -> ::cty::c_int;
441}
442#[safe_wrap(_)] extern "C" {
443    pub fn wifi_mgmr_sta_mac_set(mac: *mut u8) -> ::cty::c_int;
444}
445#[safe_wrap(_)] extern "C" {
446    pub fn wifi_mgmr_sta_mac_get(mac: *mut u8) -> ::cty::c_int;
447}
448#[safe_wrap(_)] extern "C" {
449    pub fn wifi_mgmr_sta_ip_get(ip: *mut u32, gw: *mut u32, mask: *mut u32) -> ::cty::c_int;
450}
451#[safe_wrap(_)] extern "C" {
452    pub fn wifi_mgmr_sta_ip_set(ip: u32, mask: u32, gw: u32, dns1: u32, dns2: u32) -> ::cty::c_int;
453}
454#[safe_wrap(_)] extern "C" {
455    pub fn wifi_mgmr_sta_dns_get(dns1: *mut u32, dns2: *mut u32) -> ::cty::c_int;
456}
457#[safe_wrap(_)] extern "C" {
458    pub fn wifi_mgmr_sta_ip_unset() -> ::cty::c_int;
459}
460#[safe_wrap(_)] extern "C" {
461    pub fn wifi_mgmr_sta_connect(
462        wifi_interface: *mut wifi_interface_t,
463        ssid: *mut ::cty::c_char,
464        psk: *mut ::cty::c_char,
465        pmk: *mut ::cty::c_char,
466        mac: *mut u8,
467        band: u8,
468        freq: u16,
469    ) -> ::cty::c_int;
470}
471#[safe_wrap(_)] extern "C" {
472    pub fn wifi_mgmr_sta_disconnect() -> ::cty::c_int;
473}
474#[safe_wrap(_)] extern "C" {
475    pub fn wifi_mgmr_sta_powersaving(ps: ::cty::c_int) -> ::cty::c_int;
476}
477#[safe_wrap(_)] extern "C" {
478    pub fn wifi_mgmr_sta_autoconnect_enable() -> ::cty::c_int;
479}
480#[safe_wrap(_)] extern "C" {
481    pub fn wifi_mgmr_sta_autoconnect_disable() -> ::cty::c_int;
482}
483#[safe_wrap(_)] extern "C" {
484    pub fn wifi_mgmr_sta_ssid_set(ssid: *mut ::cty::c_char);
485}
486#[safe_wrap(_)] extern "C" {
487    pub fn wifi_mgmr_sta_psk_set(psk: *mut ::cty::c_char);
488}
489#[safe_wrap(_)] extern "C" {
490    pub fn wifi_mgmr_sta_connect_ind_stat_get(
491        wifi_mgmr_ind_stat: *mut wifi_mgmr_sta_connect_ind_stat_info_t,
492    );
493}
494#[safe_wrap(_)] extern "C" {
495    pub fn wifi_mgmr_ap_enable() -> wifi_interface_t;
496}
497#[safe_wrap(_)] extern "C" {
498    pub fn wifi_mgmr_ap_mac_set(mac: *mut u8) -> ::cty::c_int;
499}
500#[safe_wrap(_)] extern "C" {
501    pub fn wifi_mgmr_ap_mac_get(mac: *mut u8) -> ::cty::c_int;
502}
503#[safe_wrap(_)] extern "C" {
504    pub fn wifi_mgmr_ap_ip_get(ip: *mut u32, gw: *mut u32, mask: *mut u32) -> ::cty::c_int;
505}
506#[safe_wrap(_)] extern "C" {
507    pub fn wifi_mgmr_ap_stop(interface: *mut wifi_interface_t) -> ::cty::c_int;
508}
509#[safe_wrap(_)] extern "C" {
510    pub fn wifi_mgmr_ap_start(
511        interface: *mut wifi_interface_t,
512        ssid: *mut ::cty::c_char,
513        hidden_ssid: ::cty::c_int,
514        passwd: *mut ::cty::c_char,
515        channel: ::cty::c_int,
516    ) -> ::cty::c_int;
517}
518#[safe_wrap(_)] extern "C" {
519    pub fn wifi_mgmr_ap_sta_cnt_get(sta_cnt: *mut u8) -> ::cty::c_int;
520}
521#[safe_wrap(_)] extern "C" {
522    pub fn wifi_mgmr_ap_sta_info_get(sta_info: *mut wifi_sta_basic_info, idx: u8) -> ::cty::c_int;
523}
524#[safe_wrap(_)] extern "C" {
525    pub fn wifi_mgmr_ap_sta_delete(sta_idx: u8) -> ::cty::c_int;
526}
527#[safe_wrap(_)] extern "C" {
528    pub fn wifi_mgmr_ap_set_gateway(gateway: *mut ::cty::c_char) -> ::cty::c_int;
529}
530#[safe_wrap(_)] extern "C" {
531    pub fn wifi_mgmr_sniffer_enable() -> ::cty::c_int;
532}
533#[safe_wrap(_)] extern "C" {
534    pub fn wifi_mgmr_sniffer_disable() -> ::cty::c_int;
535}
536#[safe_wrap(_)] extern "C" {
537    pub fn wifi_mgmr_rate_config(config: u16) -> ::cty::c_int;
538}
539#[safe_wrap(_)] extern "C" {
540    pub fn wifi_mgmr_conf_max_sta(max_sta_supported: u8) -> ::cty::c_int;
541}
542#[safe_wrap(_)] extern "C" {
543    pub fn wifi_mgmr_sniffer_register(env: *mut ::cty::c_void, cb: sniffer_cb_t) -> ::cty::c_int;
544}
545#[safe_wrap(_)] extern "C" {
546    pub fn wifi_mgmr_sniffer_unregister(env: *mut ::cty::c_void) -> ::cty::c_int;
547}
548#[safe_wrap(_)] extern "C" {
549    pub fn wifi_mgmr_state_get(state: *mut ::cty::c_int) -> ::cty::c_int;
550}
551#[safe_wrap(_)] extern "C" {
552    pub fn wifi_mgmr_status_code_get(s_code: *mut ::cty::c_int) -> ::cty::c_int;
553}
554#[safe_wrap(_)] extern "C" {
555    pub fn wifi_mgmr_rssi_get(rssi: *mut ::cty::c_int) -> ::cty::c_int;
556}
557#[safe_wrap(_)] extern "C" {
558    pub fn wifi_mgmr_channel_get(channel: *mut ::cty::c_int) -> ::cty::c_int;
559}
560#[safe_wrap(_)] extern "C" {
561    pub fn wifi_mgmr_channel_set(channel: ::cty::c_int, use_40Mhz: ::cty::c_int) -> ::cty::c_int;
562}
563#[safe_wrap(_)] extern "C" {
564    pub fn wifi_mgmr_all_ap_scan(
565        ap_ary: *mut *mut wifi_mgmr_ap_item_t,
566        num: *mut u32,
567    ) -> ::cty::c_int;
568}
569#[safe_wrap(_)] extern "C" {
570    pub fn wifi_mgmr_scan_filter_hidden_ssid(filter: ::cty::c_int) -> ::cty::c_int;
571}
572#[safe_wrap(_)] extern "C" {
573    pub fn wifi_mgmr_scan(data: *mut ::cty::c_void, cb: scan_complete_cb_t) -> ::cty::c_int;
574}
575#[safe_wrap(_)] extern "C" {
576    pub fn wifi_mgmr_cfg_req(
577        ops: u32,
578        task: u32,
579        element: u32,
580        type_: u32,
581        length: u32,
582        buf: *mut u32,
583    ) -> ::cty::c_int;
584}
585#[safe_wrap(_)] extern "C" {
586    pub fn wifi_mgmr_scan_complete_callback() -> ::cty::c_int;
587}
588#[safe_wrap(_)] extern "C" {
589    pub fn wifi_mgmr_cli_scanlist() -> ::cty::c_int;
590}
591#[safe_wrap(_)] extern "C" {
592    pub fn wifi_mgmr_cli_init() -> ::cty::c_int;
593}
594#[safe_wrap(_)] extern "C" {
595    pub fn wifi_mgmr_scan_ap(
596        ssid: *mut ::cty::c_char,
597        item: *mut wifi_mgmr_ap_item_t,
598    ) -> ::cty::c_int;
599}
600#[safe_wrap(_)] extern "C" {
601    pub fn wifi_mgmr_scan_ap_all(
602        env: *mut wifi_mgmr_ap_item_t,
603        param1: *mut u32,
604        cb: scan_item_cb_t,
605    ) -> ::cty::c_int;
606}
607#[safe_wrap(_)] extern "C" {
608    pub fn wifi_mgmr_raw_80211_send(pkt: *mut u8, len: ::cty::c_int) -> ::cty::c_int;
609}
610#[safe_wrap(_)] extern "C" {
611    pub fn wifi_mgmr_set_country_code(country_code: *mut ::cty::c_char) -> ::cty::c_int;
612}
613#[safe_wrap(_)] extern "C" {
614    pub fn wifi_mgmr_ext_dump_needed() -> ::cty::c_int;
615}
616#[safe_wrap(_)] extern "C" {
617    pub fn wifi_mgmr_status_code_str(status_code: u16) -> *const ::cty::c_char;
618}
619#[doc = " \\brief Event"]
620#[doc = ""]
621#[doc = " Events trigger transitions from a state to another. Event types are defined"]
622#[doc = " by the user. Any event may optionally contain a \\ref #event::data"]
623#[doc = " \"payload\"."]
624#[doc = ""]
625#[doc = " \\sa state"]
626#[doc = " \\sa transition"]
627#[repr(C)]
628#[derive(Copy, Clone)]
629pub struct event {
630    #[doc = " \\brief Type of event. Defined by user."]
631    pub type_: ::cty::c_int,
632    #[doc = " \\brief Event payload."]
633    #[doc = ""]
634    #[doc = " How this is used is entirely up to the user. This data"]
635    #[doc = " is always passed together with #type in order to make it possible to"]
636    #[doc = " always cast the data correctly."]
637    pub data: *mut ::cty::c_void,
638}
639impl Default for event {
640    fn default() -> Self {
641        unsafe { ::core::mem::zeroed() }
642    }
643}
644#[doc = " \\brief Transition between a state and another state"]
645#[doc = ""]
646#[doc = " All states that are not final must have at least one transition. The"]
647#[doc = " transition may be guarded or not. Transitions are triggered by events. If"]
648#[doc = " a state has more than one transition with the same type of event (and the"]
649#[doc = " same condition), the first transition in the array will be run. An"]
650#[doc = " unconditional transition placed last in the transition array of a state can"]
651#[doc = " act as a \"catch-all\". A transition may optionally run an #action, which"]
652#[doc = " will have the triggering event passed to it as an argument, along with the"]
653#[doc = " current and new states' \\ref state::data \"data\"."]
654#[doc = ""]
655#[doc = " It is perfectly valid for a transition to return to the state it belongs"]
656#[doc = " to. Such a transition will not call the state's \\ref state::entryAction"]
657#[doc = " \"entry action\" or \\ref state::exitAction \"exit action\". If there are no"]
658#[doc = " transitions for the current event, the state's parent will be handed the"]
659#[doc = " event."]
660#[doc = ""]
661#[doc = " ### Examples ###"]
662#[doc = " - An ungarded transition to a state with no action performed:"]
663#[doc = " ~~~{.c}"]
664#[doc = " {"]
665#[doc = "    .eventType = Event_timeout,"]
666#[doc = "    .condition = NULL,"]
667#[doc = "    .guard = NULL,"]
668#[doc = "    .action = NULL,"]
669#[doc = "    .nextState = &mainMenuState,"]
670#[doc = " },"]
671#[doc = " ~~~"]
672#[doc = " - A guarded transition executing an action"]
673#[doc = " ~~~{.c}"]
674#[doc = " {"]
675#[doc = "    .eventType = Event_keyboard,"]
676#[doc = "    .condition = NULL,"]
677#[doc = "    .guard = &ensureNumericInput,"]
678#[doc = "    .action = &addToBuffer,"]
679#[doc = "    .nextState = &awaitingInputState,"]
680#[doc = " },"]
681#[doc = " ~~~"]
682#[doc = " - A guarded transition using a condition"]
683#[doc = " ~~~{.c}"]
684#[doc = " {"]
685#[doc = "    .eventType = Event_mouse,"]
686#[doc = "    .condition = boxLimits,"]
687#[doc = "    .guard = &coordinatesWithinLimits,"]
688#[doc = " },"]
689#[doc = " ~~~"]
690#[doc = " By using \\ref #condition \"conditions\" a more general guard function can be"]
691#[doc = " used, operating on the supplied argument #condition. In this example,"]
692#[doc = " `coordinatesWithinLimits` checks whether the coordinates in the mouse event"]
693#[doc = " are within the limits of the \"box\"."]
694#[doc = ""]
695#[doc = " \\sa event"]
696#[doc = " \\sa state"]
697#[repr(C)]
698#[derive(Copy, Clone)]
699pub struct transition {
700    #[doc = " \\brief The event that will trigger this transition."]
701    pub eventType: ::cty::c_int,
702    #[doc = " \\brief Condition that event must fulfil"]
703    #[doc = ""]
704    #[doc = " This variable will be passed to the #guard (if #guard is non-NULL) and"]
705    #[doc = " may be used as a condition that the incoming event's data must fulfil in"]
706    #[doc = " order for the transition to be performed. By using this variable, the"]
707    #[doc = " number of #guard functions can be minimised by making them more general."]
708    pub condition: *mut ::cty::c_void,
709    #[doc = " \\brief Check if data passed with event fulfils a condition"]
710    #[doc = ""]
711    #[doc = " A transition may be conditional. If so, this function, if non-NULL, will"]
712    #[doc = " be called. Its first argument will be supplied with #condition, which"]
713    #[doc = " can be compared against the \\ref event::data \"payload\" in the #event."]
714    #[doc = " The user may choose to use this argument or not. Only if the result is"]
715    #[doc = " true, the transition will take place."]
716    #[doc = ""]
717    #[doc = " \\param condition event (data) to compare the incoming event against."]
718    #[doc = " \\param event the event passed to the state machine."]
719    #[doc = ""]
720    #[doc = " \\returns true if the event's data fulfils the condition, otherwise false."]
721    pub guard: ::core::option::Option<
722        unsafe extern "C" fn(condition: *mut ::cty::c_void, event: *mut event) -> bool,
723    >,
724    #[doc = " \\brief Function containing tasks to be performed during the transition"]
725    #[doc = ""]
726    #[doc = " The transition may optionally do some work in this function before"]
727    #[doc = " entering the next state. May be NULL."]
728    #[doc = ""]
729    #[doc = " \\param currentStateData the leaving state's \\ref state::data \"data\""]
730    #[doc = " \\param event the event passed to the state machine."]
731    #[doc = " \\param newStateData the new state's (the \\ref state::entryState"]
732    #[doc = " \"entryState\" of any (chain of) parent states, not the parent state"]
733    #[doc = " itself) \\ref state::data \"data\""]
734    pub action: ::core::option::Option<
735        unsafe extern "C" fn(
736            currentStateData: *mut ::cty::c_void,
737            event: *mut event,
738            newStateData: *mut ::cty::c_void,
739        ),
740    >,
741    #[doc = " \\brief The next state"]
742    #[doc = ""]
743    #[doc = " This must point to the next state that will be entered. It cannot be"]
744    #[doc = " NULL. If it is, the state machine will detect it and enter the \\ref"]
745    #[doc = " stateMachine::errorState \"error state\"."]
746    pub nextState: *const state,
747}
748impl Default for transition {
749    fn default() -> Self {
750        unsafe { ::core::mem::zeroed() }
751    }
752}
753#[doc = " \\brief State"]
754#[doc = ""]
755#[doc = " The current state in a state machine moves to a new state when one of the"]
756#[doc = " #transitions in the current state triggers on an event. An optional \\ref"]
757#[doc = " #exitAction \"exit action\" is called when the state is left, and an \\ref"]
758#[doc = " #entryAction \"entry action\" is called when the state machine enters a new"]
759#[doc = " state. If a state returns to itself, neither #exitAction nor #entryAction"]
760#[doc = " will be called. An optional \\ref transition::action \"transition action\" is"]
761#[doc = " called in either case."]
762#[doc = ""]
763#[doc = " States may be organised in a hierarchy by setting \\ref #parentState"]
764#[doc = " \"parent states\". When a group/parent state is entered, the state machine is"]
765#[doc = " redirected to the group state's \\ref #entryState \"entry state\" (if"]
766#[doc = " non-NULL). If an event does not trigger a transition in a state and if the"]
767#[doc = " state has a parent state, the event will be passed to the parent state."]
768#[doc = " This behaviour is repeated for all parents. Thus all children of a state"]
769#[doc = " have a set of common #transitions. A parent state's #entryAction will not"]
770#[doc = " be called if an event is passed on to a child state."]
771#[doc = ""]
772#[doc = " The following lists the different types of states that may be created, and"]
773#[doc = " how to create them:"]
774#[doc = ""]
775#[doc = " ### Normal state ###"]
776#[doc = " ~~~{.c}"]
777#[doc = " struct state normalState = {"]
778#[doc = "    .parentState = &groupState,"]
779#[doc = "    .entryState = NULL,"]
780#[doc = "    .transition = (struct transition[]){"]
781#[doc = "       { Event_keyboard, (void *)(intptr_t)'\\n', &compareKeyboardChar,"]
782#[doc = "          NULL, &msgReceivedState },"]
783#[doc = "    },"]
784#[doc = "    .numTransitions = 1,"]
785#[doc = "    .data = normalStateData,"]
786#[doc = "    .entryAction = &doSomething,"]
787#[doc = "    .exitAction = &cleanUp,"]
788#[doc = " };"]
789#[doc = " ~~~"]
790#[doc = " In this example, `normalState` is a child of `groupState`, but the"]
791#[doc = " #parentState value may also be NULL to indicate that it is not a child of"]
792#[doc = " any group state."]
793#[doc = ""]
794#[doc = " ### Group/parent state ###"]
795#[doc = " A state becomes a group/parent state when it is linked to by child states"]
796#[doc = " by using #parentState. No members in the group state need to be set in a"]
797#[doc = " particular way. A parent state may also have a parent."]
798#[doc = " ~~~{.c}"]
799#[doc = " struct state groupState = {"]
800#[doc = "    .entryState = &normalState,"]
801#[doc = "    .entryAction = NULL,"]
802#[doc = " ~~~"]
803#[doc = " If there are any transitions in the state machine that lead to a group"]
804#[doc = " state, it makes sense to define an entry state in the group. This can be"]
805#[doc = " done by using #entryState, but it is not mandatory. If the #entryState"]
806#[doc = " state has children, the chain of children will be traversed until a child"]
807#[doc = " with its #entryState set to NULL is found."]
808#[doc = ""]
809#[doc = " \\note If #entryState is defined for a group state, the group state's"]
810#[doc = " #entryAction will not be called (the state pointed to by #entryState (after"]
811#[doc = " following the chain of children), however, will have its #entryAction"]
812#[doc = " called)."]
813#[doc = ""]
814#[doc = " \\warning The state machine cannot detect cycles in parent chains and"]
815#[doc = " children chains. If such cycles are present, stateM_handleEvent() will"]
816#[doc = " never finish due to never-ending loops."]
817#[doc = ""]
818#[doc = " ### Final state ###"]
819#[doc = " A final state is a state that terminates the state machine. A state is"]
820#[doc = " considered as a final state if its #numTransitions is 0:"]
821#[doc = " ~~~{.c}"]
822#[doc = " struct state finalState = {"]
823#[doc = "    .transitions = NULL,"]
824#[doc = "    .numTransitions = 0,"]
825#[doc = " ~~~"]
826#[doc = " The error state used by the state machine to indicate errors should be a"]
827#[doc = " final state. Any calls to stateM_handleEvent() when the current state is a"]
828#[doc = " final state will return #stateM_noStateChange."]
829#[doc = ""]
830#[doc = " \\sa event"]
831#[doc = " \\sa transition"]
832#[repr(C)]
833#[derive(Copy, Clone)]
834pub struct state {
835    #[doc = " \\brief If the state has a parent state, this pointer must be non-NULL."]
836    pub parentState: *const state,
837    #[doc = " \\brief If this state is a parent state, this pointer may point to a"]
838    #[doc = " child state that serves as an entry point."]
839    pub entryState: *const state,
840    #[doc = " \\brief An array of transitions for the state."]
841    pub transitions: *mut transition,
842    #[doc = " \\brief Number of transitions in the #transitions array."]
843    pub numTransitions: size_t,
844    #[doc = " \\brief Data that will be available for the state in its #entryAction and"]
845    #[doc = " #exitAction, and in any \\ref transition::action \"transition action\""]
846    pub data: *mut ::cty::c_void,
847    #[doc = " \\brief This function is called whenever the state is being entered. May"]
848    #[doc = " be NULL."]
849    #[doc = ""]
850    #[doc = " \\note If a state returns to itself through a transition (either directly"]
851    #[doc = " or through a parent/group sate), its #entryAction will not be called."]
852    #[doc = ""]
853    #[doc = " \\note A group/parent state with its #entryState defined will not have"]
854    #[doc = " its #entryAction called."]
855    #[doc = ""]
856    #[doc = " \\param stateData the state's #data will be passed."]
857    #[doc = " \\param event the event that triggered the transition will be passed."]
858    pub entryAction: ::core::option::Option<
859        unsafe extern "C" fn(stateData: *mut ::cty::c_void, event: *mut event),
860    >,
861    #[doc = " \\brief This function is called whenever the state is being left. May be"]
862    #[doc = " NULL."]
863    #[doc = ""]
864    #[doc = " \\note If a state returns to itself through a transition (either directly"]
865    #[doc = " or through a parent/group sate), its #exitAction will not be called."]
866    #[doc = ""]
867    #[doc = " \\param stateData the state's #data will be passed."]
868    #[doc = " \\param event the event that triggered a transition will be passed."]
869    pub exitAction: ::core::option::Option<
870        unsafe extern "C" fn(stateData: *mut ::cty::c_void, event: *mut event),
871    >,
872}
873impl Default for state {
874    fn default() -> Self {
875        unsafe { ::core::mem::zeroed() }
876    }
877}
878#[doc = " \\brief State machine"]
879#[doc = ""]
880#[doc = " There is no need to manipulate the members directly."]
881#[repr(C)]
882#[derive(Copy, Clone)]
883pub struct stateMachine {
884    #[doc = " \\brief Pointer to the current state"]
885    pub currentState: *const state,
886    #[doc = " \\brief Pointer to previous state"]
887    #[doc = ""]
888    #[doc = " The previous state is stored for convenience in case the user needs to"]
889    #[doc = " keep track of previous states."]
890    pub previousState: *const state,
891    #[doc = " \\brief Pointer to a state that will be entered whenever an error occurs"]
892    #[doc = " in the state machine."]
893    #[doc = ""]
894    #[doc = " See #stateM_errorStateReached for when the state machine enters the"]
895    #[doc = " error state."]
896    pub errorState: *const state,
897}
898impl Default for stateMachine {
899    fn default() -> Self {
900        unsafe { ::core::mem::zeroed() }
901    }
902}
903pub type os_messagequeue_t = StaticMessageBuffer_t;
904pub type os_timer_t = StaticTimer_t;
905pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_APP_IDLE: WIFI_MGMR_EVENT = 0;
906pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_APP_CONNECT: WIFI_MGMR_EVENT = 1;
907pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_APP_SNIFFER: WIFI_MGMR_EVENT = 2;
908pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_APP_CONNECTED: WIFI_MGMR_EVENT = 3;
909pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_APP_IP_GOT: WIFI_MGMR_EVENT = 4;
910pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_APP_DISCONNECT: WIFI_MGMR_EVENT = 5;
911pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_APP_RECONNECT: WIFI_MGMR_EVENT = 6;
912pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_APP_PHY_UP: WIFI_MGMR_EVENT = 7;
913pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_APP_AP_START: WIFI_MGMR_EVENT = 8;
914pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_APP_AP_STOP: WIFI_MGMR_EVENT = 9;
915pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_APP_CONF_MAX_STA: WIFI_MGMR_EVENT = 10;
916pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_APP_RC_CONFIG: WIFI_MGMR_EVENT = 11;
917pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_APP_DENOISE: WIFI_MGMR_EVENT = 12;
918pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_APP_RELOAD_TSEN: WIFI_MGMR_EVENT = 13;
919pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_MAXAPP_MINIFW: WIFI_MGMR_EVENT = 14;
920pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_FW_DISCONNECT: WIFI_MGMR_EVENT = 15;
921pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_FW_POWERSAVING: WIFI_MGMR_EVENT = 16;
922pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_FW_CHANNEL_SET: WIFI_MGMR_EVENT = 17;
923pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_FW_SCAN: WIFI_MGMR_EVENT = 18;
924pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_FW_IND_DISCONNECT: WIFI_MGMR_EVENT = 19;
925pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_FW_IND_CONNECTED: WIFI_MGMR_EVENT = 20;
926pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_FW_DATA_RAW_SEND: WIFI_MGMR_EVENT = 21;
927pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_FW_CFG_REQ: WIFI_MGMR_EVENT = 22;
928pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_MAXFW_MINI_GLOBAL: WIFI_MGMR_EVENT = 23;
929pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_GLB_SCAN_IND_BEACON: WIFI_MGMR_EVENT = 24;
930pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_GLB_SCAN_IND_PROBE_RESP: WIFI_MGMR_EVENT = 25;
931pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_GLB_AP_IND_STA_NEW: WIFI_MGMR_EVENT = 26;
932pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_GLB_AP_IND_STA_DEL: WIFI_MGMR_EVENT = 27;
933pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_GLB_DISABLE_AUTORECONNECT: WIFI_MGMR_EVENT = 28;
934pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_GLB_ENABLE_AUTORECONNECT: WIFI_MGMR_EVENT = 29;
935pub const WIFI_MGMR_EVENT_WIFI_MGMR_EVENT_GLB_IP_UPDATE: WIFI_MGMR_EVENT = 30;
936pub type WIFI_MGMR_EVENT = ::cty::c_uint;
937pub use self::WIFI_MGMR_EVENT as WIFI_MGMR_EVENT_T;
938pub const WIFI_MGMR_CONNECTION_STATUS_WIFI_MGMR_CONNECTION_STATUS_IDLE:
939    WIFI_MGMR_CONNECTION_STATUS = 0;
940pub const WIFI_MGMR_CONNECTION_STATUS_WIFI_MGMR_CONNECTION_STATUS_CONNECTING:
941    WIFI_MGMR_CONNECTION_STATUS = 1;
942pub const WIFI_MGMR_CONNECTION_STATUS_WIFI_MGMR_CONNECTION_STATUS_CONNECTED_IP_YES:
943    WIFI_MGMR_CONNECTION_STATUS = 2;
944pub const WIFI_MGMR_CONNECTION_STATUS_WIFI_MGMR_CONNECTION_STATUS_CONNECTED_IP_NO:
945    WIFI_MGMR_CONNECTION_STATUS = 3;
946pub const WIFI_MGMR_CONNECTION_STATUS_WIFI_MGMR_CONNECTION_STATUS_DISCONNECTED:
947    WIFI_MGMR_CONNECTION_STATUS = 4;
948pub type WIFI_MGMR_CONNECTION_STATUS = ::cty::c_uint;
949pub use self::WIFI_MGMR_CONNECTION_STATUS as WIFI_MGMR_CONNECTION_STATUS_T;
950#[repr(C, packed)]
951pub struct wifi_mgmr_msg {
952    pub ev: WIFI_MGMR_EVENT_T,
953    pub data1: *mut ::cty::c_void,
954    pub data2: *mut ::cty::c_void,
955    pub len: u32,
956    pub data: __IncompleteArrayField<u8>,
957}
958impl Default for wifi_mgmr_msg {
959    fn default() -> Self {
960        unsafe { ::core::mem::zeroed() }
961    }
962}
963pub type wifi_mgmr_msg_t = wifi_mgmr_msg;
964#[repr(C, packed)]
965#[derive(Default)]
966pub struct wifi_mgmr_cfg_element_msg {
967    pub ops: u32,
968    pub task: u32,
969    pub element: u32,
970    pub type_: u32,
971    pub length: u32,
972    pub buf: __IncompleteArrayField<u32>,
973}
974pub type wifi_mgmr_cfg_element_msg_t = wifi_mgmr_cfg_element_msg;
975#[repr(C, packed)]
976#[derive(Copy, Clone)]
977pub struct wifi_mgmr_profile_msg {
978    pub ssid: [::cty::c_char; 32usize],
979    pub ssid_tail: [::cty::c_char; 1usize],
980    pub ssid_len: u32,
981    pub psk: [::cty::c_char; 64usize],
982    pub psk_tail: [::cty::c_char; 1usize],
983    pub pmk: [::cty::c_char; 64usize],
984    pub pmk_tail: [::cty::c_char; 1usize],
985    pub psk_len: u32,
986    pub pmk_len: u32,
987    pub mac: [u8; 6usize],
988    pub band: u8,
989    pub freq: u16,
990    pub dhcp_use: u8,
991}
992impl Default for wifi_mgmr_profile_msg {
993    fn default() -> Self {
994        unsafe { ::core::mem::zeroed() }
995    }
996}
997pub type wifi_mgmr_profile_msg_t = wifi_mgmr_profile_msg;
998#[repr(C, packed)]
999#[derive(Default, Copy, Clone)]
1000pub struct wifi_mgmr_ipgot_msg {
1001    pub ip: u32,
1002    pub mask: u32,
1003    pub gw: u32,
1004    pub dns1: u32,
1005    pub dns2: u32,
1006}
1007pub type wifi_mgmr_ipgot_msg_t = wifi_mgmr_ipgot_msg;
1008#[repr(C, packed)]
1009#[derive(Copy, Clone)]
1010pub struct wifi_mgmr_ap_msg {
1011    pub channel: i32,
1012    pub ssid: [::cty::c_char; 32usize],
1013    pub ssid_tail: [::cty::c_char; 1usize],
1014    pub hidden_ssid: u8,
1015    pub ssid_len: u32,
1016    pub psk: [::cty::c_char; 64usize],
1017    pub psk_tail: [::cty::c_char; 1usize],
1018    pub psk_len: u32,
1019}
1020impl Default for wifi_mgmr_ap_msg {
1021    fn default() -> Self {
1022        unsafe { ::core::mem::zeroed() }
1023    }
1024}
1025pub type wifi_mgmr_ap_msg_t = wifi_mgmr_ap_msg;
1026#[repr(C)]
1027#[derive(Copy, Clone)]
1028pub struct wifi_mgmr_profile {
1029    pub ssid: [::cty::c_char; 33usize],
1030    pub no_autoconnect: u8,
1031    pub ssid_len: u32,
1032    pub psk: [::cty::c_char; 65usize],
1033    pub psk_len: u32,
1034    pub pmk: [::cty::c_char; 65usize],
1035    pub pmk_len: u32,
1036    pub mac: [u8; 6usize],
1037    pub dhcp_use: u8,
1038    pub priority: u8,
1039    pub isActive: u8,
1040    pub isUsed: u8,
1041}
1042impl Default for wifi_mgmr_profile {
1043    fn default() -> Self {
1044        unsafe { ::core::mem::zeroed() }
1045    }
1046}
1047pub type wifi_mgmr_profile_t = wifi_mgmr_profile;
1048#[repr(C, packed)]
1049#[derive(Default, Copy, Clone)]
1050pub struct wifi_mgmr_cipher_t {
1051    pub _bitfield_align_1: [u8; 0],
1052    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
1053}
1054impl wifi_mgmr_cipher_t {
1055    #[inline]
1056    pub fn wep40(&self) -> u8 {
1057        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
1058    }
1059    #[inline]
1060    pub fn set_wep40(&mut self, val: u8) {
1061        unsafe {
1062            let val: u8 = ::core::mem::transmute(val);
1063            self._bitfield_1.set(0usize, 1u8, val as u64)
1064        }
1065    }
1066    #[inline]
1067    pub fn wep104(&self) -> u8 {
1068        unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
1069    }
1070    #[inline]
1071    pub fn set_wep104(&mut self, val: u8) {
1072        unsafe {
1073            let val: u8 = ::core::mem::transmute(val);
1074            self._bitfield_1.set(1usize, 1u8, val as u64)
1075        }
1076    }
1077    #[inline]
1078    pub fn tkip(&self) -> u8 {
1079        unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
1080    }
1081    #[inline]
1082    pub fn set_tkip(&mut self, val: u8) {
1083        unsafe {
1084            let val: u8 = ::core::mem::transmute(val);
1085            self._bitfield_1.set(2usize, 1u8, val as u64)
1086        }
1087    }
1088    #[inline]
1089    pub fn ccmp(&self) -> u8 {
1090        unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
1091    }
1092    #[inline]
1093    pub fn set_ccmp(&mut self, val: u8) {
1094        unsafe {
1095            let val: u8 = ::core::mem::transmute(val);
1096            self._bitfield_1.set(3usize, 1u8, val as u64)
1097        }
1098    }
1099    #[inline]
1100    pub fn rsvd(&self) -> u8 {
1101        unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
1102    }
1103    #[inline]
1104    pub fn set_rsvd(&mut self, val: u8) {
1105        unsafe {
1106            let val: u8 = ::core::mem::transmute(val);
1107            self._bitfield_1.set(4usize, 4u8, val as u64)
1108        }
1109    }
1110    #[inline]
1111    pub fn new_bitfield_1(
1112        wep40: u8,
1113        wep104: u8,
1114        tkip: u8,
1115        ccmp: u8,
1116        rsvd: u8,
1117    ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
1118        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
1119        __bindgen_bitfield_unit.set(0usize, 1u8, {
1120            let wep40: u8 = unsafe { ::core::mem::transmute(wep40) };
1121            wep40 as u64
1122        });
1123        __bindgen_bitfield_unit.set(1usize, 1u8, {
1124            let wep104: u8 = unsafe { ::core::mem::transmute(wep104) };
1125            wep104 as u64
1126        });
1127        __bindgen_bitfield_unit.set(2usize, 1u8, {
1128            let tkip: u8 = unsafe { ::core::mem::transmute(tkip) };
1129            tkip as u64
1130        });
1131        __bindgen_bitfield_unit.set(3usize, 1u8, {
1132            let ccmp: u8 = unsafe { ::core::mem::transmute(ccmp) };
1133            ccmp as u64
1134        });
1135        __bindgen_bitfield_unit.set(4usize, 4u8, {
1136            let rsvd: u8 = unsafe { ::core::mem::transmute(rsvd) };
1137            rsvd as u64
1138        });
1139        __bindgen_bitfield_unit
1140    }
1141}
1142#[repr(C)]
1143#[derive(Default, Copy, Clone)]
1144pub struct wifi_mgmr_scan_item {
1145    pub ssid: [::cty::c_char; 32usize],
1146    pub ssid_tail: [::cty::c_char; 1usize],
1147    pub ssid_len: u32,
1148    pub bssid: [u8; 6usize],
1149    pub channel: u8,
1150    pub rssi: i8,
1151    pub ppm_abs: i8,
1152    pub ppm_rel: i8,
1153    pub auth: u8,
1154    pub cipher: u8,
1155    pub is_used: u8,
1156    pub timestamp_lastseen: u32,
1157}
1158pub type wifi_mgmr_scan_item_t = wifi_mgmr_scan_item;
1159#[repr(C)]
1160#[derive(Copy, Clone)]
1161pub struct wlan_netif {
1162    pub mode: ::cty::c_int,
1163    pub vif_index: u8,
1164    pub mac: [u8; 6usize],
1165    pub ipv4: wlan_netif__bindgen_ty_1,
1166    pub netif: netif,
1167    pub __bindgen_anon_1: wlan_netif__bindgen_ty_2,
1168}
1169#[repr(C)]
1170#[derive(Default, Copy, Clone)]
1171pub struct wlan_netif__bindgen_ty_1 {
1172    pub ip: u32,
1173    pub mask: u32,
1174    pub gw: u32,
1175    pub dns1: u32,
1176    pub dns2: u32,
1177}
1178#[repr(C)]
1179#[derive(Copy, Clone)]
1180pub union wlan_netif__bindgen_ty_2 {
1181    pub sta: wlan_netif__bindgen_ty_2__bindgen_ty_1,
1182}
1183#[repr(C)]
1184#[derive(Default, Copy, Clone)]
1185pub struct wlan_netif__bindgen_ty_2__bindgen_ty_1 {
1186    pub rssi: i8,
1187}
1188impl Default for wlan_netif__bindgen_ty_2 {
1189    fn default() -> Self {
1190        unsafe { ::core::mem::zeroed() }
1191    }
1192}
1193impl Default for wlan_netif {
1194    fn default() -> Self {
1195        unsafe { ::core::mem::zeroed() }
1196    }
1197}
1198#[repr(C)]
1199#[derive(Copy, Clone)]
1200pub struct wifi_mgmr_connect_ind_stat_info {
1201    pub status_code: u16,
1202    pub type_ind: u8,
1203    pub ssid: [::cty::c_char; 32usize],
1204    pub psk: [::cty::c_char; 65usize],
1205    pub bssid: [u8; 6usize],
1206    pub chan_freq: u16,
1207    pub chan_band: u8,
1208}
1209impl Default for wifi_mgmr_connect_ind_stat_info {
1210    fn default() -> Self {
1211        unsafe { ::core::mem::zeroed() }
1212    }
1213}
1214pub type wifi_mgmr_connect_ind_stat_info_t = wifi_mgmr_connect_ind_stat_info;
1215#[repr(C)]
1216#[derive(Default, Copy, Clone)]
1217pub struct wifi_mgmr_sta_basic_info {
1218    pub sta_idx: u8,
1219    pub is_used: u8,
1220    pub sta_mac: [u8; 6usize],
1221    pub tsfhi: u32,
1222    pub tsflo: u32,
1223    pub rssi: ::cty::c_int,
1224    pub data_rate: u8,
1225}
1226pub type wifi_mgmr_sta_basic_info_t = wifi_mgmr_sta_basic_info;
1227#[repr(C)]
1228#[derive(Copy, Clone)]
1229pub struct wifi_mgmr {
1230    pub ready: u8,
1231    pub channel: ::cty::c_int,
1232    pub inf_ap_enabled: ::cty::c_int,
1233    pub wlan_sta: wlan_netif,
1234    pub wlan_ap: wlan_netif,
1235    pub status: WIFI_MGMR_CONNECTION_STATUS_T,
1236    pub profiles: [wifi_mgmr_profile_t; 2usize],
1237    pub profile_active_index: ::cty::c_int,
1238    pub scan_items: [wifi_mgmr_scan_item_t; 50usize],
1239    pub mq: os_messagequeue_t,
1240    pub mq_pool: [u8; 2240usize],
1241    pub m: stateMachine,
1242    pub timer: os_timer_t,
1243    pub wifi_mgmr_stat_info: wifi_mgmr_connect_ind_stat_info_t,
1244    pub country_code: [::cty::c_char; 3usize],
1245    pub disable_autoreconnect: u8,
1246    pub channel_nums: ::cty::c_int,
1247    pub pending_task: u32,
1248    pub features: u32,
1249    pub scan_item_timeout: ::cty::c_int,
1250}
1251impl Default for wifi_mgmr {
1252    fn default() -> Self {
1253        unsafe { ::core::mem::zeroed() }
1254    }
1255}
1256pub type wifi_mgmr_t = wifi_mgmr;
1257#[safe_wrap(_)] extern "C" {
1258    pub fn wifi_mgmr_event_notify(msg: *mut wifi_mgmr_msg_t) -> ::cty::c_int;
1259}
1260#[safe_wrap(_)] extern "C" {
1261    pub fn wifi_mgmr_state_get_internal(state: *mut ::cty::c_int) -> ::cty::c_int;
1262}
1263#[safe_wrap(_)] extern "C" {
1264    pub fn wifi_mgmr_status_code_clean_internal() -> ::cty::c_int;
1265}
1266#[safe_wrap(_)] extern "C" {
1267    pub fn wifi_mgmr_status_code_get_internal(s_code: *mut ::cty::c_int) -> ::cty::c_int;
1268}
1269#[safe_wrap(_)] extern "C" {
1270    pub fn wifi_mgmr_set_country_code_internal(country_code: *mut ::cty::c_char) -> ::cty::c_int;
1271}
1272#[safe_wrap(_)] extern "C" {
1273    pub fn wifi_mgmr_ap_sta_cnt_get_internal(sta_cnt: *mut u8) -> ::cty::c_int;
1274}
1275#[safe_wrap(_)] extern "C" {
1276    pub fn wifi_mgmr_ap_sta_info_get_internal(
1277        sta_info_internal: *mut wifi_mgmr_sta_basic_info_t,
1278        idx: u8,
1279    ) -> ::cty::c_int;
1280}
1281#[safe_wrap(_)] extern "C" {
1282    pub fn wifi_mgmr_ap_sta_delete_internal(sta_idx: u8) -> ::cty::c_int;
1283}
1284#[safe_wrap(_)] extern "C" {
1285    pub fn wifi_mgmr_scan_complete_notify() -> ::cty::c_int;
1286}
1287#[safe_wrap(_)] extern "C" {
1288    pub static mut wifiMgmr: wifi_mgmr_t;
1289}
1290#[safe_wrap(_)] extern "C" {
1291    pub fn wifi_mgmr_auth_to_str(auth: u8) -> *mut ::cty::c_char;
1292}
1293#[safe_wrap(_)] extern "C" {
1294    pub fn wifi_mgmr_cipher_to_str(cipher: u8) -> *mut ::cty::c_char;
1295}
1296#[safe_wrap(_)] extern "C" {
1297    pub fn wifi_mgmr_api_fw_tsen_reload() -> ::cty::c_int;
1298}
1299#[safe_wrap(_)] extern "C" {
1300    pub fn wifi_mgmr_scan_item_is_timeout(
1301        mgmr: *mut wifi_mgmr_t,
1302        item: *mut wifi_mgmr_scan_item_t,
1303    ) -> ::cty::c_int;
1304}