3a2fcdad3ceecb4f3cd083686fdc0b7653b198c1
[mardrone] / mardrone / ARDrone_SDK_Version_1_8_20110726 / ARDroneLib / VP_SDK / VP_Com / elinux / vp_com_wlc.h
1 #ifndef _VP_COM_WLC_H_
2 #define _VP_COM_WLC_H_
3
4 #include <VP_Os/vp_os_types.h>
5 #include <wlioctl.h>
6
7
8 // Begin a call sequence
9 int32_t vp_wlc_begin(const char* itfname);
10
11 // End a call sequence
12 int32_t vp_wlc_end(void);
13
14 #define VP_WLC_BEGIN(itfname) vp_wlc_begin(itfname); {
15 #define VP_WLC_END            } vp_wlc_end();
16
17 // Takes the driver out of the UP state. 
18 // Be aware that the DOWN state, resets all driver calibration states.
19 // To take the driver out of the UP state and keep any run time calibration information,
20 // use the wlc_out.
21 int32_t vp_wlc_down(void);
22
23 // Enables the driver after a WLC_DOWN or WLC_OUT command.
24 int32_t vp_wlc_up(void);
25
26
27 // Gets the driver's magic id 
28 int32_t vp_wlc_get_magic(void);
29
30 // Sets the default BSS channel. For IEEE 802.11b and
31 // IEEE 802.11g solutions, valid channels are generally 1­14.
32 // Note that the exact valid channel setting is dictated by the
33 // current country setting.
34 int32_t vp_wlc_set_channel(int32_t channel);
35
36 // Returns the pointer to a channel_info_t structure.
37 channel_info_t* vp_wlc_get_channel(int32_t* channel);
38
39
40 // Sets the IEEE 802.11d country string. The input parameter can 
41 // either be the full name of the country (CHINA), or a two-
42 // character abbreviation (CN).
43 int32_t vp_wlc_set_country(const char* country);
44
45 // Returns the current IEEE 802.11d country string used by the driver.
46 // The return value is always 4 bytes long.
47 const char* vp_wlc_get_country(void);
48
49
50 // Returns the current instant power of the chip.
51 int32_t vp_wlc_get_instant_power(uint32_t *power);
52
53 // Sets the current instant power of the chip.
54 int32_t vp_wlc_set_instant_power(uint32_t power);
55
56
57 // Radio states
58 typedef enum
59 {
60   VP_WLC_RADIO_ENABLE  = 0x10000,
61   VP_WLC_RADIO_DISABLE = 0x10001
62 } VP_WLC_RADIO_STATE;
63
64 // Sets the software radio state.
65 int32_t vp_wlc_set_radio(VP_WLC_RADIO_STATE state);
66
67 // Returns the radio state.
68 // -1 = Error
69 int32_t vp_wlc_get_radio(void);
70
71
72 typedef enum
73 {
74   VP_WLC_ADHOC           = 0,
75   VP_WLC_INFRASTRUCTURE  = 1
76 } VP_WLC_INFRA_MODE;
77
78 // Pass 0 to disable infrastructure mode; Pass 1 to enable it.
79 int32_t vp_wlc_set_infrastructure(VP_WLC_INFRA_MODE value);
80
81 // Returns 1 if in infrastructure mode; 0 otherwise or -1 if error.
82 int32_t vp_wlc_get_infrastructure(void);
83
84
85 typedef enum
86 {
87   VP_WLC_AUTH_OPEN   = 0,
88   VP_WLC_AUTH_SHARED = 1
89 } VP_WLC_AUTH_MODE;
90
91 // Sets the authentication mode
92 int32_t vp_wlc_set_authentication(VP_WLC_AUTH_MODE mode);
93
94 // Returns the authentication mode
95 int32_t vp_wlc_get_authentication(void);
96
97
98 // Sets the ssid
99 int32_t vp_wlc_set_ssid(const char* ssid);
100
101 // Returns the current SSID. Note that after an SSID has been set, 
102 // the BSS is created. The BSS is with the rate, channel, and other
103 // settings in their current state. This function should be called only
104 // after all other parameters have been set.
105 wlc_ssid_t* vp_wlc_get_ssid(void);
106
107
108 // Returns the bssid
109 int32_t vp_wlc_get_bssid(bdaddr_t* bssid);
110
111
112 // Sets the wireless security mode to be used.
113 // Possible values are
114 //    WEP_ENABLED
115 //    TKIP_ENABLED
116 //    AES_ENABLED
117 int32_t vp_wlc_set_security_mode(int32_t wsec);
118
119 // Returns a value containing a bit vector representing which
120 // wireless security modes are currently enabled
121 int32_t vp_wlc_get_security_mode(void);
122
123
124 // Inserts a security key
125 int32_t vp_wlc_set_wep128_key(const char* wep_key);
126
127 // Sets the mode of the MAC list
128 // Possible values are
129 //  WLC_MACMODE_DISABLED
130 //  WLC_MACMODE_DENY
131 //  WLC_MACMODE_ALLOW
132 int32_t vp_wlc_set_mac_mode(int32_t mode);
133
134 // Returns the mac mode
135 int32_t vp_wlc_get_mac_mode(void);
136
137 /// Roaming
138
139 // Enables roaming
140 int32_t vp_wlc_enable_roaming(void);
141
142 // Disables roaming
143 int32_t vp_wlc_disable_roaming(void);
144
145 // Returns true if roaming is enable. 0 otherwise.
146 bool_t vp_wlc_roaming_enable(void);
147
148
149 // Begins a scan sequence
150 int32_t vp_wlc_scan(void);
151
152 // Gets the result of a previously launched scan
153 wl_scan_results_t* vp_wlc_get_scan_results(void);
154
155 #endif // _VP_COM_WLC_H_