le_wifiClient_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_wifiClient_common.h
12  *
13  * Type definitions for le_wifiClient.
14  *
15  */
16 #ifndef LE_WIFICLIENT_COMMON_H_INCLUDE_GUARD
17 #define LE_WIFICLIENT_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_WIFICLIENT_PROTOCOL_ID "a713f6367be6dea80d90761fcf566c28"
26 #define IFGEN_LE_WIFICLIENT_MSG_SIZE 252
27 /** @addtogroup le_wifiClient
28  * @{ **/
29 
30 
31 //--------------------------------------------------------------------------------------------------
32 /**
33  * Value for no signal strength.
34  */
35 //--------------------------------------------------------------------------------------------------
36 #define LE_WIFICLIENT_NO_SIGNAL_STRENGTH 32767
37 
38 //--------------------------------------------------------------------------------------------------
39 /**
40  * Reference type for AccessPoint that is returned by the WiFi Scan.
41  */
42 //--------------------------------------------------------------------------------------------------
43 typedef struct le_wifiClient_AccessPoint* le_wifiClient_AccessPointRef_t;
44 
45 
46 //--------------------------------------------------------------------------------------------------
47 /**
48  * WiFi Client Events.
49  */
50 //--------------------------------------------------------------------------------------------------
51 typedef enum
52 {
54  ///< WiFi Client Connected
56  ///< WiFi Client Disconnected
58  ///< WiFi Scan result for available Access Points available
60  ///< WiFi Scan failed
61 }
63 
64 
65 //--------------------------------------------------------------------------------------------------
66 /**
67  * WiFi Client disconnect cause type enum.
68  */
69 //--------------------------------------------------------------------------------------------------
70 typedef enum
71 {
73  ///< Default value, could be connected
75  ///< WiFi Client request to disconnect
77  ///< WiFi card is detached
79  ///< WiFi driver has been removed
81  ///< Beacon loss due to poor SINR
83  ///< Disconnected by AP
84 }
86 
87 
88 //--------------------------------------------------------------------------------------------------
89 /**
90  * WiFi Client Security Protocol for connection
91  */
92 //--------------------------------------------------------------------------------------------------
93 typedef enum
94 {
96  ///< no security.
98  ///< Using WEP.
100  ///< Using WPA
102  ///< Using WPA2
104  ///< Using WPA Enterprise
106  ///< Using WPA2 Enterprise
107 }
109 
110 
111 //--------------------------------------------------------------------------------------------------
112 /**
113  * Reference type used by Add/Remove functions for EVENT 'le_wifiClient_NewEvent'
114  */
115 //--------------------------------------------------------------------------------------------------
116 typedef struct le_wifiClient_NewEventHandler* le_wifiClient_NewEventHandlerRef_t;
117 
118 
119 //--------------------------------------------------------------------------------------------------
120 /**
121  * WiFi event indication structure. The disconnectionCause only applies to event EVENT_DISCONNECTED.
122  */
123 //--------------------------------------------------------------------------------------------------
124 typedef struct
125 {
126  le_wifiClient_Event_t event;
127  le_wifiClient_DisconnectionCause_t disconnectionCause;
128  char ifName[31 + 1];
129  char apBssid[18 + 1];
130 }
132 
133 
134 //--------------------------------------------------------------------------------------------------
135 /**
136  * Reference type used by Add/Remove functions for EVENT 'le_wifiClient_ConnectionEvent'
137  */
138 //--------------------------------------------------------------------------------------------------
139 typedef struct le_wifiClient_ConnectionEventHandler* le_wifiClient_ConnectionEventHandlerRef_t;
140 
141 
142 //--------------------------------------------------------------------------------------------------
143 /**
144  * Handler for WiFi Client changes
145  * @deprecated le_wifiClient_AddNewEventHandler() will be removed in near future.
146  * It is replaced by le_wifiClient_AddConnectionEventHandler().
147  */
148 //--------------------------------------------------------------------------------------------------
150 (
151  le_wifiClient_Event_t event,
152  ///< Handles the wifi events
153  void* contextPtr
154  ///<
155 );
156 
157 //--------------------------------------------------------------------------------------------------
158 /**
159  * Handler for WiFi Client connection changes
160  */
161 //--------------------------------------------------------------------------------------------------
163 (
164  const le_wifiClient_EventInd_t * LE_NONNULL wifiEventIndPtr,
165  ///< EventInd Reference.
166  void* contextPtr
167  ///<
168 );
169 
170 
171 //--------------------------------------------------------------------------------------------------
172 /**
173  * Get if this client bound locally.
174  */
175 //--------------------------------------------------------------------------------------------------
176 LE_SHARED bool ifgen_le_wifiClient_HasLocalBinding
177 (
178  void
179 );
180 
181 
182 //--------------------------------------------------------------------------------------------------
183 /**
184  * Init data that is common across all threads
185  */
186 //--------------------------------------------------------------------------------------------------
187 LE_SHARED void ifgen_le_wifiClient_InitCommonData
188 (
189  void
190 );
191 
192 
193 //--------------------------------------------------------------------------------------------------
194 /**
195  * Perform common initialization and open a session
196  */
197 //--------------------------------------------------------------------------------------------------
198 LE_SHARED le_result_t ifgen_le_wifiClient_OpenSession
199 (
200  le_msg_SessionRef_t _ifgen_sessionRef,
201  bool isBlocking
202 );
203 
204 //--------------------------------------------------------------------------------------------------
205 /**
206  * Add handler function for EVENT 'le_wifiClient_NewEvent'
207  *
208  * This event provide information on WiFi Client event changes.
209  * NewEvent will be deprecated.
210  *
211  */
212 //--------------------------------------------------------------------------------------------------
213 LE_SHARED le_wifiClient_NewEventHandlerRef_t ifgen_le_wifiClient_AddNewEventHandler
214 (
215  le_msg_SessionRef_t _ifgen_sessionRef,
217  ///< [IN]
218  void* contextPtr
219  ///< [IN]
220 );
221 
222 //--------------------------------------------------------------------------------------------------
223 /**
224  * Remove handler function for EVENT 'le_wifiClient_NewEvent'
225  */
226 //--------------------------------------------------------------------------------------------------
227 LE_SHARED void ifgen_le_wifiClient_RemoveNewEventHandler
228 (
229  le_msg_SessionRef_t _ifgen_sessionRef,
231  ///< [IN]
232 );
233 
234 //--------------------------------------------------------------------------------------------------
235 /**
236  * Add handler function for EVENT 'le_wifiClient_ConnectionEvent'
237  *
238  * This event provide information on WiFi Client connection event changes.
239  *
240  */
241 //--------------------------------------------------------------------------------------------------
242 LE_SHARED le_wifiClient_ConnectionEventHandlerRef_t ifgen_le_wifiClient_AddConnectionEventHandler
243 (
244  le_msg_SessionRef_t _ifgen_sessionRef,
246  ///< [IN]
247  void* contextPtr
248  ///< [IN]
249 );
250 
251 //--------------------------------------------------------------------------------------------------
252 /**
253  * Remove handler function for EVENT 'le_wifiClient_ConnectionEvent'
254  */
255 //--------------------------------------------------------------------------------------------------
256 LE_SHARED void ifgen_le_wifiClient_RemoveConnectionEventHandler
257 (
258  le_msg_SessionRef_t _ifgen_sessionRef,
260  ///< [IN]
261 );
262 
263 //--------------------------------------------------------------------------------------------------
264 /**
265  * Start the WIFI device.
266  *
267  * @return
268  * - LE_OK Function succeeded.
269  * - LE_FAULT Function failed.
270  * - LE_BUSY The WIFI device is already started.
271  */
272 //--------------------------------------------------------------------------------------------------
273 LE_SHARED le_result_t ifgen_le_wifiClient_Start
274 (
275  le_msg_SessionRef_t _ifgen_sessionRef
276 );
277 
278 //--------------------------------------------------------------------------------------------------
279 /**
280  * Stop the WIFI device.
281  *
282  * @return
283  * - LE_OK Function succeeded.
284  * - LE_FAULT Function failed.
285  * - LE_DUPLICATE The WIFI device is already stopped.
286  */
287 //--------------------------------------------------------------------------------------------------
288 LE_SHARED le_result_t ifgen_le_wifiClient_Stop
289 (
290  le_msg_SessionRef_t _ifgen_sessionRef
291 );
292 
293 //--------------------------------------------------------------------------------------------------
294 /**
295  * Start Scanning for WiFi Access points
296  * Will result in event LE_WIFICLIENT_EVENT_SCAN_DONE when the scan results are available.
297  *
298  * @return
299  * - LE_OK Function succeeded.
300  * - LE_FAULT Function failed.
301  * - LE_BUSY Scan already running.
302  */
303 //--------------------------------------------------------------------------------------------------
304 LE_SHARED le_result_t ifgen_le_wifiClient_Scan
305 (
306  le_msg_SessionRef_t _ifgen_sessionRef
307 );
308 
309 //--------------------------------------------------------------------------------------------------
310 /**
311  * Get the first WiFi Access Point found.
312  *
313  * @return
314  * - WiFi Access Point reference if ok.
315  * - NULL If no Access Point reference available.
316  */
317 //--------------------------------------------------------------------------------------------------
318 LE_SHARED le_wifiClient_AccessPointRef_t ifgen_le_wifiClient_GetFirstAccessPoint
319 (
320  le_msg_SessionRef_t _ifgen_sessionRef
321 );
322 
323 //--------------------------------------------------------------------------------------------------
324 /**
325  * Get the next WiFi Access Point.
326  * Will return the Access Points in the order of found.
327  * This function must be called in the same context as the GetFirstAccessPoint
328  *
329  * @return
330  * - WiFi Access Point reference if ok.
331  * - NULL If no Access Point reference available.
332  */
333 //--------------------------------------------------------------------------------------------------
334 LE_SHARED le_wifiClient_AccessPointRef_t ifgen_le_wifiClient_GetNextAccessPoint
335 (
336  le_msg_SessionRef_t _ifgen_sessionRef
337 );
338 
339 //--------------------------------------------------------------------------------------------------
340 /**
341  * Get the signal strength of the AccessPoint
342  *
343  * @return
344  * - Signal strength in dBm. Example -30 = -30dBm
345  * - If no signal available it will return LE_WIFICLIENT_NO_SIGNAL_STRENGTH
346  *
347  * @note The function returns the signal strength as reported at the time of the scan.
348  */
349 //--------------------------------------------------------------------------------------------------
350 LE_SHARED int16_t ifgen_le_wifiClient_GetSignalStrength
351 (
352  le_msg_SessionRef_t _ifgen_sessionRef,
353  le_wifiClient_AccessPointRef_t accessPointRef
354  ///< [IN] WiFi Access Point reference.
355 );
356 
357 //--------------------------------------------------------------------------------------------------
358 /**
359  * Get the Basic Service set identifier (BSSID) of the AccessPoint
360  *
361  * @return
362  * LE_OK Function succeeded.
363  * LE_FAULT Function failed.
364  * LE_BAD_PARAMETER Invalid parameter.
365  * LE_OVERFLOW bssid buffer is too small to contain the BSSID.
366  */
367 //--------------------------------------------------------------------------------------------------
368 LE_SHARED le_result_t ifgen_le_wifiClient_GetBssid
369 (
370  le_msg_SessionRef_t _ifgen_sessionRef,
371  le_wifiClient_AccessPointRef_t accessPointRef,
372  ///< [IN] WiFi Access Point reference.
373  char* bssid,
374  ///< [OUT] The BSSID
375  size_t bssidSize
376  ///< [IN]
377 );
378 
379 //--------------------------------------------------------------------------------------------------
380 /**
381  * Get the Service set identification (SSID) of the AccessPoint
382  *
383  * @return
384  * LE_OK Function succeeded.
385  * LE_FAULT Function failed.
386  * LE_BAD_PARAMETER Invalid parameter.
387  * LE_OVERFLOW ssid buffer is too small to contain the SSID.
388  *
389  * @note The SSID does not have to be human readable ASCII values, but often is.
390  */
391 //--------------------------------------------------------------------------------------------------
392 LE_SHARED le_result_t ifgen_le_wifiClient_GetSsid
393 (
394  le_msg_SessionRef_t _ifgen_sessionRef,
395  le_wifiClient_AccessPointRef_t accessPointRef,
396  ///< [IN] WiFi Access Point reference.
397  uint8_t* ssidPtr,
398  ///< [OUT] The SSID returned as a octet array.
399  size_t* ssidSizePtr
400  ///< [INOUT]
401 );
402 
403 //--------------------------------------------------------------------------------------------------
404 /**
405  * Get the currently selected connection to be established
406  *
407  * @return
408  * - LE_OK upon successful retrieval of the selected SSID to be connected
409  * - LE_FAULT upon failure to retrieve it
410  */
411 //--------------------------------------------------------------------------------------------------
412 LE_SHARED void ifgen_le_wifiClient_GetCurrentConnection
413 (
414  le_msg_SessionRef_t _ifgen_sessionRef,
416  ///< [OUT] currently selected connection's AP reference
417 );
418 
419 //--------------------------------------------------------------------------------------------------
420 /**
421  * Set the passphrase used to generate the PSK.
422  *
423  * @return
424  * - LE_OK Function succeeded.
425  * - LE_FAULT Function failed.
426  * - LE_BAD_PARAMETER Invalid parameter.
427  *
428  * @note The difference between le_wifiClient_SetPreSharedKey() and this function
429  */
430 //--------------------------------------------------------------------------------------------------
431 LE_SHARED le_result_t ifgen_le_wifiClient_SetPassphrase
432 (
433  le_msg_SessionRef_t _ifgen_sessionRef,
434  le_wifiClient_AccessPointRef_t accessPointRef,
435  ///< [IN] WiFi Access Point reference.
436  const char* LE_NONNULL PassPhrase
437  ///< [IN] pass-phrase for PSK
438 );
439 
440 //--------------------------------------------------------------------------------------------------
441 /**
442  * Set the Pre Shared Key, PSK.
443  *
444  * @return
445  * - LE_OK Function succeeded.
446  * - LE_FAULT Function failed.
447  * - LE_BAD_PARAMETER Invalid parameter.
448  *
449  * @note This is one way to authenticate against the access point. The other one is provided by the
450  * le_wifiClient_SetPassPhrase() function. Both ways are exclusive and are effective only when used
451  * with WPA-personal authentication.
452  */
453 //--------------------------------------------------------------------------------------------------
454 LE_SHARED le_result_t ifgen_le_wifiClient_SetPreSharedKey
455 (
456  le_msg_SessionRef_t _ifgen_sessionRef,
457  le_wifiClient_AccessPointRef_t accessPointRef,
458  ///< [IN] WiFi Access Point reference.
459  const char* LE_NONNULL PreSharedKey
460  ///< [IN] PSK. Note the difference between PSK and
461  ///< Pass Phrase.
462 );
463 
464 //--------------------------------------------------------------------------------------------------
465 /**
466  * Set the security protocol for connection
467  *
468  * @return
469  * - LE_OK Function succeeded.
470  * - LE_FAULT Function failed.
471  * - LE_BAD_PARAMETER Invalid parameter.
472  */
473 //--------------------------------------------------------------------------------------------------
474 LE_SHARED le_result_t ifgen_le_wifiClient_SetSecurityProtocol
475 (
476  le_msg_SessionRef_t _ifgen_sessionRef,
477  le_wifiClient_AccessPointRef_t accessPointRef,
478  ///< [IN] WiFi Access Point reference.
479  le_wifiClient_SecurityProtocol_t securityProtocol
480  ///< [IN] Security Mode
481 );
482 
483 //--------------------------------------------------------------------------------------------------
484 /**
485  * WPA-Enterprise requires a username and password to authenticate.
486  * This function sets these parameters.
487  *
488  * @return
489  * - LE_OK Function succeeded.
490  * - LE_FAULT Function failed.
491  * - LE_BAD_PARAMETER Invalid parameter.
492  */
493 //--------------------------------------------------------------------------------------------------
494 LE_SHARED le_result_t ifgen_le_wifiClient_SetUserCredentials
495 (
496  le_msg_SessionRef_t _ifgen_sessionRef,
497  le_wifiClient_AccessPointRef_t accessPointRef,
498  ///< [IN] WiFi Access Point reference.
499  const char* LE_NONNULL userName,
500  ///< [IN] UserName used for WPA-Enterprise.
501  const char* LE_NONNULL password
502  ///< [IN] Password used for WPA-Enterprise.
503 );
504 
505 //--------------------------------------------------------------------------------------------------
506 /**
507  * Set the WEP key (WEP)
508  *
509  * @return
510  * - LE_OK Function succeeded.
511  * - LE_FAULT Function failed.
512  */
513 //--------------------------------------------------------------------------------------------------
514 LE_SHARED le_result_t ifgen_le_wifiClient_SetWepKey
515 (
516  le_msg_SessionRef_t _ifgen_sessionRef,
517  le_wifiClient_AccessPointRef_t accessPointRef,
518  ///< [IN] WiFi Access Point reference.
519  const char* LE_NONNULL wepKey
520  ///< [IN] The WEP key
521 );
522 
523 //--------------------------------------------------------------------------------------------------
524 /**
525  * This function specifies whether the target Access Point is hiding its presence from clients or
526  * not. When an Access Point is hidden, it cannot be discovered by a scan process.
527  *
528  * @return
529  * - LE_OK Function succeeded.
530  * - LE_BAD_PARAMETER Invalid parameter.
531  *
532  * @note By default, this attribute is not set which means that the client is unable to connect to
533  * a hidden access point. When enabled, the client will be able to connect to the access point
534  * whether it is hidden or not.
535  */
536 //--------------------------------------------------------------------------------------------------
537 LE_SHARED le_result_t ifgen_le_wifiClient_SetHiddenNetworkAttribute
538 (
539  le_msg_SessionRef_t _ifgen_sessionRef,
540  le_wifiClient_AccessPointRef_t accessPointRef,
541  ///< [IN] WiFi Access Point reference.
542  bool hidden
543  ///< [IN] If TRUE, the WIFI client will be able to connect to a hidden access point.
544 );
545 
546 //--------------------------------------------------------------------------------------------------
547 /**
548  * This function creates a reference to an Access Point given its SSID.
549  * If an Access Point is hidden, it will not show up in the scan. So, its SSID must be known
550  * in advance in order to create a reference.
551  *
552  * @return
553  * - AccessPoint reference to the current Access Point.
554  *
555  * @note This function fails if called while scan is running.
556  */
557 //--------------------------------------------------------------------------------------------------
558 LE_SHARED le_wifiClient_AccessPointRef_t ifgen_le_wifiClient_Create
559 (
560  le_msg_SessionRef_t _ifgen_sessionRef,
561  const uint8_t* SsidPtr,
562  ///< [IN] The SSID as a octet array.
563  size_t SsidSize
564  ///< [IN]
565 );
566 
567 //--------------------------------------------------------------------------------------------------
568 /**
569  * Deletes an accessPointRef.
570  *
571  * @return
572  * - LE_OK Function succeeded.
573  * - LE_BAD_PARAMETER Invalid parameter.
574  * - LE_BUSY Function called during scan.
575  *
576  * @note The handle becomes invalid after it has been deleted.
577  */
578 //--------------------------------------------------------------------------------------------------
579 LE_SHARED le_result_t ifgen_le_wifiClient_Delete
580 (
581  le_msg_SessionRef_t _ifgen_sessionRef,
582  le_wifiClient_AccessPointRef_t accessPointRef
583  ///< [IN] WiFi Access Point reference.
584 );
585 
586 //--------------------------------------------------------------------------------------------------
587 /**
588  * Connect to the WiFi Access Point.
589  * All authentication must be set prior to calling this function.
590  *
591  * @return
592  * - LE_OK Function succeeded.
593  * - LE_BAD_PARAMETER Invalid parameter.
594  *
595  * @note For PSK credentials see le_wifiClient_SetPassphrase() or le_wifiClient_SetPreSharedKey() .
596  * @note For WPA-Enterprise credentials see le_wifiClient_SetUserCredentials()
597  */
598 //--------------------------------------------------------------------------------------------------
599 LE_SHARED le_result_t ifgen_le_wifiClient_Connect
600 (
601  le_msg_SessionRef_t _ifgen_sessionRef,
602  le_wifiClient_AccessPointRef_t accessPointRef
603  ///< [IN] WiFi Access Point reference.
604 );
605 
606 //--------------------------------------------------------------------------------------------------
607 /**
608  * Disconnect from the current connected WiFi Access Point.
609  *
610  * @return
611  * - LE_OK Function succeeded.
612  * - LE_FAULT Function failed.
613  */
614 //--------------------------------------------------------------------------------------------------
615 LE_SHARED le_result_t ifgen_le_wifiClient_Disconnect
616 (
617  le_msg_SessionRef_t _ifgen_sessionRef
618 );
619 
620 //--------------------------------------------------------------------------------------------------
621 /**
622  * Load the given SSID's configurations as it is selected as the connection to be established,
623  * after creating for it an AP reference
624  *
625  * @return
626  * - LE_OK Function succeeded.
627  * - LE_FAULT Function failed.
628  * - LE_BAD_PARAMETER Invalid parameter.
629  */
630 //--------------------------------------------------------------------------------------------------
631 LE_SHARED le_result_t ifgen_le_wifiClient_LoadSsid
632 (
633  le_msg_SessionRef_t _ifgen_sessionRef,
634  const uint8_t* ssidPtr,
635  ///< [IN] SSID which configs are to be installed
636  size_t ssidSize,
637  ///< [IN]
639  ///< [OUT] reference to be created
640 );
641 
642 //--------------------------------------------------------------------------------------------------
643 /**
644  * Configure the given SSID to use WEP and the given WEP key in the respective input argument.
645  * The WEP key is a mandatory input to be provided.
646  *
647  * @return
648  * - LE_OK Succeeded to configure the givwn WEP key for the given SSID.
649  * - LE_FAULT Failed to configure.
650  * - LE_BAD_PARAMETER Invalid parameter.
651  */
652 //--------------------------------------------------------------------------------------------------
653 LE_SHARED le_result_t ifgen_le_wifiClient_ConfigureWep
654 (
655  le_msg_SessionRef_t _ifgen_sessionRef,
656  const uint8_t* ssidPtr,
657  ///< [IN] SSID which configs are to be installed
658  size_t ssidSize,
659  ///< [IN]
660  const uint8_t* wepKeyPtr,
661  ///< [IN] WEP key used for this SSID
662  size_t wepKeySize
663  ///< [IN]
664 );
665 
666 //--------------------------------------------------------------------------------------------------
667 /**
668  * Configure the given SSID to use PSK and the given pass-phrase or pre-shared key in the
669  * respective input arguments. The protocol input is mandatory and has to be set to either
670  * LE_WIFICLIENT_SECURITY_WPA_PSK_PERSONAL or LE_WIFICLIENT_SECURITY_WPA2_PSK_PERSONAL.
671  * Besides, it's mandatory to have at least one of the pass-phrase and pre-shared key supplied. If
672  * both are provided as input, the pass-phrase has precedence and will be used. But it fails to
673  * authenticate, a second attempt using the provided pre-shared key will not be done.
674  *
675  * @return
676  * - LE_OK Succeeded to configure the given pass-phrase or pre-shared key for the given
677  * SSID.
678  * - LE_FAULT Failed to configure.
679  * - LE_BAD_PARAMETER Invalid parameter.
680  */
681 //--------------------------------------------------------------------------------------------------
682 LE_SHARED le_result_t ifgen_le_wifiClient_ConfigurePsk
683 (
684  le_msg_SessionRef_t _ifgen_sessionRef,
685  const uint8_t* ssidPtr,
686  ///< [IN] SSID which configs are to be installed
687  size_t ssidSize,
688  ///< [IN]
690  ///< [IN] security protocol WPA-PSK or WPA2-PSK
691  const uint8_t* passPhrasePtr,
692  ///< [IN] pass-phrase used for this SSID
693  size_t passPhraseSize,
694  ///< [IN]
695  const uint8_t* pskPtr,
696  ///< [IN] pre-shared key used for this SSID
697  size_t pskSize
698  ///< [IN]
699 );
700 
701 //--------------------------------------------------------------------------------------------------
702 /**
703  * Configure the given SSID to use EAP and the given EAP username and password in the respective
704  * input arguments. The protocol input is mandatory and has to be set to either
705  * LE_WIFICLIENT_SECURITY_WPA_EAP_PEAP0_ENTERPRISE or
706  * LE_WIFICLIENT_SECURITY_WPA2_EAP_PEAP0_ENTERPRISE. Besides, both the username and password inputs
707  * are mandatory.
708  *
709  * @return
710  * - LE_OK Succeeded to configure the given EAP username and password for the given
711  * SSID.
712  * - LE_FAULT Failed to configure.
713  * - LE_BAD_PARAMETER Invalid parameter.
714  */
715 //--------------------------------------------------------------------------------------------------
716 LE_SHARED le_result_t ifgen_le_wifiClient_ConfigureEap
717 (
718  le_msg_SessionRef_t _ifgen_sessionRef,
719  const uint8_t* ssidPtr,
720  ///< [IN] SSID which configs are to be installed
721  size_t ssidSize,
722  ///< [IN]
724  ///< [IN] security protocol WPA-EAP or WPA2-EAP
725  const uint8_t* usernamePtr,
726  ///< [IN] EAP username used for this SSID
727  size_t usernameSize,
728  ///< [IN]
729  const uint8_t* passwordPtr,
730  ///< [IN] EAP password used for this SSID
731  size_t passwordSize
732  ///< [IN]
733 );
734 
735 //--------------------------------------------------------------------------------------------------
736 /**
737  * Remove and clear Wifi's security configurations to use with the given SSID from the config tree
738  * and secured store. This includes the security protocol and all the username, password,
739  * passphrase, pre-shared key, key, etc., previously configured via le_wifiClient_Configure APIs for
740  * WEP, PSK and EAP.
741  *
742  * @return
743  * - LE_OK upon success to deconfigure the given SSID's configured user credentials;
744  * LE_FAULT otherwise
745  */
746 //--------------------------------------------------------------------------------------------------
747 LE_SHARED le_result_t ifgen_le_wifiClient_RemoveSsidSecurityConfigs
748 (
749  le_msg_SessionRef_t _ifgen_sessionRef,
750  const uint8_t* ssidPtr,
751  ///< [IN] SSID which user credentials to be deconfigured
752  size_t ssidSize
753  ///< [IN]
754 );
755 
756 //--------------------------------------------------------------------------------------------------
757 /**
758  * Get the signal strength from the Access Point which is currently connecting.
759  * signalStrength in dBm. Example -30 = -30dBm.
760  * If no signal is available, signalStrength will return LE_WIFICLIENT_NO_SIGNAL_STRENGTH.
761  *
762  * @return
763  * - LE_OK The function succeeded.
764  * - LE_FAULT The function failed.
765  *
766  * @note The function returns the signal strength as reported at the time of the scan.
767  */
768 //--------------------------------------------------------------------------------------------------
769 LE_SHARED le_result_t ifgen_le_wifiClient_GetCurrentSignalStrength
770 (
771  le_msg_SessionRef_t _ifgen_sessionRef,
772  int16_t* signalStrengthPtr
773  ///< [OUT] WiFi signal strength.
774 );
775 
776 //--------------------------------------------------------------------------------------------------
777 /**
778  * Get the RX data from the Access Point, RX data is in bytes. Example 1024 = 1024 bytes
779  *
780  * @return
781  * - LE_OK The function succeeded.
782  * - LE_FAULT The function failed.
783  *
784  * @note The function returns the RX data following by "iw wlan0 link" command.
785  */
786 //--------------------------------------------------------------------------------------------------
787 LE_SHARED le_result_t ifgen_le_wifiClient_GetRxData
788 (
789  le_msg_SessionRef_t _ifgen_sessionRef,
790  uint64_t* rxDataPtr
791  ///< [OUT] WiFi bytes of data received.
792 );
793 
794 //--------------------------------------------------------------------------------------------------
795 /**
796  * Get the TX data from the Access Point, TX data is in bytes. Example 1024 = 1024 bytes
797  *
798  * @return
799  * - LE_OK The function succeeded.
800  * - LE_FAULT The function failed.
801  *
802  * @note The function returns the TX data following by "iw wlan0 link" command.
803  */
804 //--------------------------------------------------------------------------------------------------
805 LE_SHARED le_result_t ifgen_le_wifiClient_GetTxData
806 (
807  le_msg_SessionRef_t _ifgen_sessionRef,
808  uint64_t* txDataPtr
809  ///< [OUT] WiFi bytes of data transmitted.
810 );
811 /** @} **/
812 #endif // LE_WIFICLIENT_COMMON_H_INCLUDE_GUARD
#define LE_SHARED
Definition: le_basics.h:300
le_result_t
Definition: le_basics.h:46
WiFi Scan result for available Access Points available.
Definition: le_wifiClient_common.h:57
void(* le_wifiClient_ConnectionEventHandlerFunc_t)(const le_wifiClient_EventInd_t *LE_NONNULL wifiEventIndPtr, void *contextPtr)
Definition: le_wifiClient_common.h:163
Disconnected by AP.
Definition: le_wifiClient_common.h:82
WiFi Client request to disconnect.
Definition: le_wifiClient_common.h:74
Using WPA Enterprise.
Definition: le_wifiClient_common.h:103
WiFi driver has been removed.
Definition: le_wifiClient_common.h:78
WiFi Client Connected.
Definition: le_wifiClient_common.h:53
Using WPA2 Enterprise.
Definition: le_wifiClient_common.h:105
Using WPA2.
Definition: le_wifiClient_common.h:101
struct le_wifiClient_ConnectionEventHandler * le_wifiClient_ConnectionEventHandlerRef_t
Definition: le_wifiClient_common.h:139
le_wifiClient_DisconnectionCause_t
Definition: le_wifiClient_common.h:70
no security.
Definition: le_wifiClient_common.h:95
Default value, could be connected.
Definition: le_wifiClient_common.h:72
void(* le_wifiClient_NewEventHandlerFunc_t)(le_wifiClient_Event_t event, void *contextPtr)
Definition: le_wifiClient_common.h:150
le_wifiClient_Event_t
Definition: le_wifiClient_common.h:51
struct le_wifiClient_NewEventHandler * le_wifiClient_NewEventHandlerRef_t
Definition: le_wifiClient_common.h:116
struct le_wifiClient_AccessPoint * le_wifiClient_AccessPointRef_t
Definition: le_wifiClient_common.h:43
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860
WiFi Client Disconnected.
Definition: le_wifiClient_common.h:55
Using WEP.
Definition: le_wifiClient_common.h:97
le_wifiClient_SecurityProtocol_t
Definition: le_wifiClient_common.h:93
WiFi Scan failed.
Definition: le_wifiClient_common.h:59
Beacon loss due to poor SINR.
Definition: le_wifiClient_common.h:80
Using WPA.
Definition: le_wifiClient_common.h:99
Definition: le_wifiClient_common.h:124
WiFi card is detached.
Definition: le_wifiClient_common.h:76