le_wifiAp_common.h

Go to the documentation of this file.
1 
2 /*
3  * ====================== WARNING ======================
4  *
5  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
6  * DO NOT MODIFY IN ANY WAY.
7  *
8  * ====================== WARNING ======================
9  */
10 /**
11  * @file le_wifiAp_common.h
12  *
13  * Type definitions for le_wifiAp.
14  *
15  */
16 #ifndef LE_WIFIAP_COMMON_H_INCLUDE_GUARD
17 #define LE_WIFIAP_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 // Interface specific includes
23 #include "le_wifiDefs_common.h"
24 
25 #define IFGEN_LE_WIFIAP_PROTOCOL_ID "36c307882cc1b538442afcf212938aee"
26 #define IFGEN_LE_WIFIAP_MSG_SIZE 77
27 /** @addtogroup le_wifiAp
28  * @{ **/
29 
30 
31 //--------------------------------------------------------------------------------------------------
32 /**
33  * WiFi Access Point Events.
34  */
35 //--------------------------------------------------------------------------------------------------
36 typedef enum
37 {
39  ///< Client connected to WiFi Access Point.
41  ///< Client disconnected from WiFi Access Point.
42 }
44 
45 
46 //--------------------------------------------------------------------------------------------------
47 /**
48  * WiFi Access Point Security levels.
49  */
50 //--------------------------------------------------------------------------------------------------
51 typedef enum
52 {
54  ///< WiFi Access Point is open and has no password.
56  ///< WiFi Access Point has WPA2 activated.
57 }
59 
60 
61 //--------------------------------------------------------------------------------------------------
62 /**
63  * IEEE 802.11 standards Bit Mask
64  */
65 //--------------------------------------------------------------------------------------------------/// IEEE 802.11a (5 GHz) Bit Mask.
66 #define LE_WIFIAP_BITMASK_IEEE_STD_A 0x1/// IEEE 802.11b (2.4 GHz) Bit Mask.
67 #define LE_WIFIAP_BITMASK_IEEE_STD_B 0x2/// IEEE 802.11g (2.4 GHz) Bit Mask.
68 #define LE_WIFIAP_BITMASK_IEEE_STD_G 0x4/// IEEE 802.11ad (60 GHz) Bit Mask.
69 #define LE_WIFIAP_BITMASK_IEEE_STD_AD 0x8/// IEEE 802.11d Bit Mask. This advertises the country code.
70 #define LE_WIFIAP_BITMASK_IEEE_STD_D 0x10/// IEEE 802.11h Bit Mask. This enables radar detection.
71 #define LE_WIFIAP_BITMASK_IEEE_STD_H 0x20/// IEEE 802.11n (HT) Bit Mask.
72 #define LE_WIFIAP_BITMASK_IEEE_STD_N 0x40/// IEEE 802.11ac (VHT) Bit Mask.
73 #define LE_WIFIAP_BITMASK_IEEE_STD_AC 0x80/// IEEE 802.11ax (HE) Bit Mask.
74 #define LE_WIFIAP_BITMASK_IEEE_STD_AX 0x100/// IEEE 802.11w Bit Mask.
75 #define LE_WIFIAP_BITMASK_IEEE_STD_W 0x200
76 typedef uint32_t le_wifiAp_IeeeStdBitMask_t;
77 
78 
79 //--------------------------------------------------------------------------------------------------
80 /**
81  * Reference type used by Add/Remove functions for EVENT 'le_wifiAp_NewEvent'
82  */
83 //--------------------------------------------------------------------------------------------------
84 typedef struct le_wifiAp_NewEventHandler* le_wifiAp_NewEventHandlerRef_t;
85 
86 
87 //--------------------------------------------------------------------------------------------------
88 /**
89  * Handler for WiFi Access Point changes
90  */
91 //--------------------------------------------------------------------------------------------------
92 typedef void (*le_wifiAp_EventHandlerFunc_t)
93 (
94  le_wifiAp_Event_t event,
95  ///< Handles the wifi events
96  void* contextPtr
97  ///<
98 );
99 
100 
101 //--------------------------------------------------------------------------------------------------
102 /**
103  * Get if this client bound locally.
104  */
105 //--------------------------------------------------------------------------------------------------
106 LE_SHARED bool ifgen_le_wifiAp_HasLocalBinding
107 (
108  void
109 );
110 
111 
112 //--------------------------------------------------------------------------------------------------
113 /**
114  * Init data that is common across all threads
115  */
116 //--------------------------------------------------------------------------------------------------
117 LE_SHARED void ifgen_le_wifiAp_InitCommonData
118 (
119  void
120 );
121 
122 
123 //--------------------------------------------------------------------------------------------------
124 /**
125  * Perform common initialization and open a session
126  */
127 //--------------------------------------------------------------------------------------------------
128 LE_SHARED le_result_t ifgen_le_wifiAp_OpenSession
129 (
130  le_msg_SessionRef_t _ifgen_sessionRef,
131  bool isBlocking
132 );
133 
134 //--------------------------------------------------------------------------------------------------
135 /**
136  * Add handler function for EVENT 'le_wifiAp_NewEvent'
137  *
138  * These events provide information on WiFi Access Point
139  *
140  */
141 //--------------------------------------------------------------------------------------------------
142 LE_SHARED le_wifiAp_NewEventHandlerRef_t ifgen_le_wifiAp_AddNewEventHandler
143 (
144  le_msg_SessionRef_t _ifgen_sessionRef,
145  le_wifiAp_EventHandlerFunc_t handlerPtr,
146  ///< [IN]
147  void* contextPtr
148  ///< [IN]
149 );
150 
151 //--------------------------------------------------------------------------------------------------
152 /**
153  * Remove handler function for EVENT 'le_wifiAp_NewEvent'
154  */
155 //--------------------------------------------------------------------------------------------------
156 LE_SHARED void ifgen_le_wifiAp_RemoveNewEventHandler
157 (
158  le_msg_SessionRef_t _ifgen_sessionRef,
160  ///< [IN]
161 );
162 
163 //--------------------------------------------------------------------------------------------------
164 /**
165  * This function starts the WIFI Access Point.
166  * @note that all settings, if to be used, such as security, username, password must set prior to
167  * starting the Access Point.
168  *
169  * @return
170  * - LE_FAULT if the function failed.
171  * - LE_OK if the function succeeded.
172  *
173  */
174 //--------------------------------------------------------------------------------------------------
175 LE_SHARED le_result_t ifgen_le_wifiAp_Start
176 (
177  le_msg_SessionRef_t _ifgen_sessionRef
178 );
179 
180 //--------------------------------------------------------------------------------------------------
181 /**
182  * This function stops the WIFI Access Point.
183  *
184  * @return
185  * - LE_FAULT if the function failed.
186  * - LE_OK if the function succeeded.
187  *
188  */
189 //--------------------------------------------------------------------------------------------------
190 LE_SHARED le_result_t ifgen_le_wifiAp_Stop
191 (
192  le_msg_SessionRef_t _ifgen_sessionRef
193 );
194 
195 //--------------------------------------------------------------------------------------------------
196 /**
197  * Set the Service set identification (SSID) of the AccessPoint
198  * Default value is "LEGATO Access Point"
199  * @note that the SSID does not have to be human readable ASCII values, but often has.
200  *
201  * @return
202  * - LE_BAD_PARAMETER if some parameter is invalid.
203  * - LE_OK if the function succeeded.
204  */
205 //--------------------------------------------------------------------------------------------------
206 LE_SHARED le_result_t ifgen_le_wifiAp_SetSsid
207 (
208  le_msg_SessionRef_t _ifgen_sessionRef,
209  const uint8_t* ssidPtr,
210  ///< [IN] The SSID to set as a octet array.
211  size_t ssidSize
212  ///< [IN]
213 );
214 
215 //--------------------------------------------------------------------------------------------------
216 /**
217  * Set the Security protocol to use.
218  * Default value is SECURITY_WPA2.
219  * @note that the SSID does not have to be human readable ASCII values, but often has.
220  *
221  * @return
222  * - LE_BAD_PARAMETER if some parameter is invalid.
223  * - LE_OK if the function succeeded.
224  */
225 //--------------------------------------------------------------------------------------------------
226 LE_SHARED le_result_t ifgen_le_wifiAp_SetSecurityProtocol
227 (
228  le_msg_SessionRef_t _ifgen_sessionRef,
229  le_wifiAp_SecurityProtocol_t securityProtocol
230  ///< [IN] The security protocol to use.
231 );
232 
233 //--------------------------------------------------------------------------------------------------
234 /**
235  * Set the passphrase used to generate the PSK.
236  *
237  * @note If the PSK is to be set directly, please use le_wifiAp_SetPreSharedKey()
238  *
239  * @return
240  * - LE_BAD_PARAMETER if parameter is invalid.
241  * - LE_OK if the function succeeded.
242  *
243  */
244 //--------------------------------------------------------------------------------------------------
245 LE_SHARED le_result_t ifgen_le_wifiAp_SetPassPhrase
246 (
247  le_msg_SessionRef_t _ifgen_sessionRef,
248  const char* LE_NONNULL passPhrase
249  ///< [IN] pass-phrase for PSK
250 );
251 
252 //--------------------------------------------------------------------------------------------------
253 /**
254  * Set the Pre Shared Key, PSK.
255  * There is no default value, since le_wifiAp_SetPassPhrase is used as default.
256  * @note the difference between le_wifiAp_SetPassPhrase() and this function
257  *
258  * @return
259  * - LE_BAD_PARAMETER if parameter is invalid.
260  * - LE_OK if the function succeeded.
261  *
262  */
263 //--------------------------------------------------------------------------------------------------
264 LE_SHARED le_result_t ifgen_le_wifiAp_SetPreSharedKey
265 (
266  le_msg_SessionRef_t _ifgen_sessionRef,
267  const char* LE_NONNULL preSharedKey
268  ///< [IN] PSK. Note the difference between PSK and Pass Phrase.
269 );
270 
271 //--------------------------------------------------------------------------------------------------
272 /**
273  * Set if the Access Point should announce its presence.
274  * Default value is TRUE.
275  * If the value is set to FALSE, the Access Point will be hidden.
276  *
277  * @return LE_OK if the function succeeded.
278  *
279  */
280 //--------------------------------------------------------------------------------------------------
281 LE_SHARED le_result_t ifgen_le_wifiAp_SetDiscoverable
282 (
283  le_msg_SessionRef_t _ifgen_sessionRef,
284  bool discoverable
285  ///< [IN] If TRUE the Access Point shows up on scans, else it is hidden.
286 );
287 
288 //--------------------------------------------------------------------------------------------------
289 /**
290  * Set which IEEE standard to use.
291  * Default hardware mode is IEEE 802.11g.
292  *
293  * @return
294  * - LE_BAD_PARAMETER if invalid IEEE standard is set.
295  * - LE_OK if the function succeeded.
296  *
297  */
298 //--------------------------------------------------------------------------------------------------
299 LE_SHARED le_result_t ifgen_le_wifiAp_SetIeeeStandard
300 (
301  le_msg_SessionRef_t _ifgen_sessionRef,
302  le_wifiAp_IeeeStdBitMask_t stdMask
303  ///< [IN] Bit mask for the IEEE standard.
304 );
305 
306 //--------------------------------------------------------------------------------------------------
307 /**
308  * Get which IEEE standard was set.
309  * Default hardware mode is IEEE 802.11g.
310  *
311  * @return
312  * - LE_FAULT if the function failed.
313  * - LE_OK if the function succeeded.
314  *
315  */
316 //--------------------------------------------------------------------------------------------------
317 LE_SHARED le_result_t ifgen_le_wifiAp_GetIeeeStandard
318 (
319  le_msg_SessionRef_t _ifgen_sessionRef,
320  le_wifiAp_IeeeStdBitMask_t* stdMaskPtrPtr
321  ///< [OUT] Bit mask for the IEEE standard.
322 );
323 
324 //--------------------------------------------------------------------------------------------------
325 /**
326  * Set which WiFi Channel to use.
327  * Default value is 7.
328  * Some legal restrictions might apply for your region.
329  * The channel number must be between 1 and 14 for IEEE 802.11b/g.
330  * The channel number must be between 7 and 196 for IEEE 802.11a.
331  * The channel number must be between 1 and 6 for IEEE 802.11ad.
332  * @return
333  * - LE_OUT_OF_RANGE if requested channel number is out of range.
334  * - LE_OK if the function succeeded.
335  *
336  */
337 //--------------------------------------------------------------------------------------------------
338 LE_SHARED le_result_t ifgen_le_wifiAp_SetChannel
339 (
340  le_msg_SessionRef_t _ifgen_sessionRef,
341  uint16_t channelNumber
342  ///< [IN] the channel number.
343 );
344 
345 //--------------------------------------------------------------------------------------------------
346 /**
347  * Set what country code to use for regulatory domain.
348  * ISO/IEC 3166-1 Alpha-2 code is used.
349  * Default country code is US.
350  * @return
351  * - LE_FAULT if the function failed.
352  * - LE_OK if the function succeeded.
353  *
354  */
355 //--------------------------------------------------------------------------------------------------
356 LE_SHARED le_result_t ifgen_le_wifiAp_SetCountryCode
357 (
358  le_msg_SessionRef_t _ifgen_sessionRef,
359  const char* LE_NONNULL countryCode
360  ///< [IN] the country code.
361 );
362 
363 //--------------------------------------------------------------------------------------------------
364 /**
365  * Set number of maximally allowed clients to connect to the Access Point at the same time.
366  *
367  * @return
368  * - LE_OUT_OF_RANGE if requested number of users exceeds the capabilities of the Access Point.
369  * - LE_OK if the function succeeded.
370  *
371  */
372 //--------------------------------------------------------------------------------------------------
373 LE_SHARED le_result_t ifgen_le_wifiAp_SetMaxNumberOfClients
374 (
375  le_msg_SessionRef_t _ifgen_sessionRef,
376  int8_t maxNumberOfClient
377  ///< [IN] the maximum number of clients
378 );
379 
380 //--------------------------------------------------------------------------------------------------
381 /**
382  * Defines the IP adresses range for the host AP.
383  *
384  * @return
385  * - LE_BAD_PARAMETER if at least one of the given IP addresses is invalid.
386  * - LE_FAULT if a system call failed.
387  * - LE_OK if the function succeeded.
388  *
389  */
390 //--------------------------------------------------------------------------------------------------
391 LE_SHARED le_result_t ifgen_le_wifiAp_SetIpRange
392 (
393  le_msg_SessionRef_t _ifgen_sessionRef,
394  const char* LE_NONNULL ipAp,
395  ///< [IN] the IP address of the Access Point.
396  const char* LE_NONNULL ipStart,
397  ///< [IN] the start IP address of the Access Point.
398  const char* LE_NONNULL ipStop
399  ///< [IN] the stop IP address of the Access Point.
400 );
401 /** @} **/
402 #endif // LE_WIFIAP_COMMON_H_INCLUDE_GUARD
le_wifiAp_Event_t
Definition: le_wifiAp_common.h:36
WiFi Access Point has WPA2 activated.
Definition: le_wifiAp_common.h:55
void(* le_wifiAp_EventHandlerFunc_t)(le_wifiAp_Event_t event, void *contextPtr)
Definition: le_wifiAp_common.h:93
#define LE_SHARED
Definition: le_basics.h:287
le_wifiAp_SecurityProtocol_t
Definition: le_wifiAp_common.h:51
le_result_t
Definition: le_basics.h:46
struct le_wifiAp_NewEventHandler * le_wifiAp_NewEventHandlerRef_t
Definition: le_wifiAp_common.h:84
WiFi Access Point is open and has no password.
Definition: le_wifiAp_common.h:53
Client disconnected from WiFi Access Point.
Definition: le_wifiAp_common.h:40
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860
Client connected to WiFi Access Point.
Definition: le_wifiAp_common.h:38