pa_wifi_ap.h

1 #ifndef PA_WIFI_AP_H
2 #define PA_WIFI_AP_H
3 // -------------------------------------------------------------------------------------------------
4 /**
5  *
6  *
7  * Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
8  *
9  */
10 // -------------------------------------------------------------------------------------------------
11 #include "legato.h"
12 #include "interfaces.h"
13 
14 //--------------------------------------------------------------------------------------------------
15 /**
16  * Event Handler for PA Wifi Access Point changes
17  *
18  * @param event
19  * Handles the PA wifi events.
20  * Two events are directly generated from the PA
21  * LE_WIFIAP_EVENT_CONNECTED,
22  * LE_WIFIAP_EVENT_DISCONNECTED,
23  * @param contextPtr
24  */
25 //--------------------------------------------------------------------------------------------------
26 typedef void (*pa_wifiAp_NewEventHandlerFunc_t)
27 (
28  le_wifiAp_Event_t event,
29  void* contextPtr
30 );
31 
32 //--------------------------------------------------------------------------------------------------
33 /**
34  * Add handler function for PA EVENT 'le_wifiAp_Event_t'
35  *
36  * This event provide information on PA Wifi Ap event changes.
37  */
38 //--------------------------------------------------------------------------------------------------
39 LE_SHARED le_result_t pa_wifiAp_AddEventHandler
40 (
41  pa_wifiAp_NewEventHandlerFunc_t handlerPtr,
42  ///< [IN]
43 
44  void* contextPtr
45  ///< [IN]
46 );
47 
48 //--------------------------------------------------------------------------------------------------
49 /**
50  * This function must be called to initialize the PA WIFI Access Point.
51  *
52  * @return LE_OK The function succeed.
53  */
54 //--------------------------------------------------------------------------------------------------
55 LE_SHARED le_result_t pa_wifiAp_Init
56 (
57  void
58 );
59 
60 //--------------------------------------------------------------------------------------------------
61 /**
62  * This function must be called to release the PA WIFI Module.
63  *
64  * @return LE_OK The function succeed.
65  */
66 //--------------------------------------------------------------------------------------------------
67 LE_SHARED le_result_t pa_wifiAp_Release
68 (
69  void
70 );
71 
72 //--------------------------------------------------------------------------------------------------
73 /**
74  * This function starts the WIFI Access Point.
75  * Note that all settings, if to be used, such as security, username, password must set prior to
76  * starting the Access Point.
77  *
78  * @return LE_FAULT The function failed.
79  * @return LE_OK The function succeeded.
80  *
81  */
82 //--------------------------------------------------------------------------------------------------
83 le_result_t pa_wifiAp_Start
84 (
85  void
86 );
87 
88 //--------------------------------------------------------------------------------------------------
89 /**
90  * This function stops the WIFI Access Point.
91  *
92  * @return LE_FAULT The function failed.
93  * @return LE_OK The function succeeded.
94  *
95  */
96 //--------------------------------------------------------------------------------------------------
97 le_result_t pa_wifiAp_Stop
98 (
99  void
100 );
101 
102 //--------------------------------------------------------------------------------------------------
103 /**
104  * Set the Security protocol to use.
105  * Default value is SECURITY_WPA2.
106  * @note that the SSID does not have to be human readable ASCII values, but often has.
107  *
108  * @return LE_BAD_PARAMETER Some parameter is invalid.
109  * @return LE_OK Function succeeded.
110  */
111 //--------------------------------------------------------------------------------------------------
112 le_result_t pa_wifiAp_SetSecurityProtocol
113 (
114  le_wifiAp_SecurityProtocol_t securityProtocol
115  ///< [IN]
116  ///< The security protocol to use.
117 );
118 
119 //--------------------------------------------------------------------------------------------------
120 /**
121  * Set the Service set identification (SSID) of the AccessPoint
122  * Default value is "LEGATO Access Point"
123  * @note that the SSID does not have to be human readable ASCII values, but often has.
124  *
125  * @return LE_BAD_PARAMETER Some parameter is invalid.
126  * @return LE_OK Function succeeded.
127  */
128 //--------------------------------------------------------------------------------------------------
129 le_result_t pa_wifiAp_SetSsid
130 (
131  const uint8_t* ssidPtr,
132  ///< [IN]
133  ///< The SSID to set as a octet array.
134 
135  size_t ssidNumElements
136  ///< [IN]
137 );
138 
139 //--------------------------------------------------------------------------------------------------
140 /**
141  * Set the passphrase used to generate the PSK.
142  * Default value is "ChangeThisPassword".
143  *
144  * @note the difference between le_wifiAp_SetPreSharedKey() and this function
145  *
146  * @return LE_BAD_PARAMETER Parameter is invalid.
147  * @return LE_OK Function succeeded.
148  *
149  */
150 //--------------------------------------------------------------------------------------------------
151 le_result_t pa_wifiAp_SetPassPhrase
152 (
153  const char* passphrase
154  ///< [IN]
155  ///< pass-phrase for PSK
156 );
157 
158 //--------------------------------------------------------------------------------------------------
159 /**
160  * Set the Pre Shared Key, PSK.
161  * There is no default value, since le_wifiAp_SetPassPhrase is used as default.
162  * @note the difference between le_wifiAp_SetPassPhrase() and this function
163  *
164  * @return LE_BAD_PARAMETER Parameter is invalid.
165  * @return LE_OK Function succeeded.
166  *
167  */
168 //--------------------------------------------------------------------------------------------------
169 le_result_t pa_wifiAp_SetPreSharedKey
170 (
171  const char* preSharedKey
172  ///< [IN]
173  ///< PSK. Note the difference between PSK and Pass Phrase.
174 );
175 
176 //--------------------------------------------------------------------------------------------------
177 /**
178  * Set if the Access Point should announce it's presence.
179  * Default value is TRUE.
180  * If the value is set to FALSE, the Access Point will be hidden.
181  *
182  * @return LE_OK Function succeeded.
183  *
184  */
185 //--------------------------------------------------------------------------------------------------
186 le_result_t pa_wifiAp_SetDiscoverable
187 (
188  bool discoverable
189  ///< [IN]
190  ///< If TRUE the Acces Point will annonce it's SSID, else it's hidden.
191 );
192 
193 //--------------------------------------------------------------------------------------------------
194 /**
195  * Set which Wifi Channel to use.
196  * Default value is 1.
197  * Some legal restrictions for values 12 - 14 might apply for your region.
198  *
199  * @return LE_OUT_OF_RANGE Requested channel number is out of range.
200  * @return LE_OK Function succeeded.
201  *
202  */
203 //--------------------------------------------------------------------------------------------------
204 le_result_t pa_wifiAp_SetChannel
205 (
206  int8_t channelNumber
207  ///< [IN]
208  ///< the channel number must be between 1 and 14.
209 );
210 
211 //--------------------------------------------------------------------------------------------------
212 /**
213  * Set the maximum number of clients allowed to be connected to WiFi Access Point.
214  * Default value is 10.
215  *
216  * @return LE_OUT_OF_RANGE Requested number of users exceeds the capabilities of the Access Point.
217  * @return LE_OK Function succeeded.
218  *
219  */
220 //--------------------------------------------------------------------------------------------------
221 le_result_t pa_wifiAp_SetMaxNumberClients
222 (
223  int maxNumberClients
224  ///< [IN]
225  ///< the maximum number of clients (1-255).
226 );
227 
228 //--------------------------------------------------------------------------------------------------
229 /**
230  * Defines the IP adresses range for the host AP.
231  *
232  * @return LE_BAD_PARAMETER At least, one of the given IP addresses is invalid.
233  * @return LE_FAULT A system call has failed.
234  * @return LE_OK Function succeeded.
235  *
236  */
237 //--------------------------------------------------------------------------------------------------
238 le_result_t pa_wifiAp_SetIpRange
239 (
240  const char *ip_ap,
241  ///< [IN]
242  ///< the IP address of the Access Point.
243  const char *ip_start,
244  ///< [IN]
245  ///< the start IP address of the Access Point.
246  const char *ip_stop
247  ///< [IN]
248  ///< the stop IP address of the Access Point.
249 );
250 #endif // PA_WIFI_AP_H
#define LE_SHARED
Definition: le_basics.h:240
le_result_t
Definition: le_basics.h:35
le_wifiAp_Event_t
Definition: le_wifiAp_interface.h:160
le_wifiAp_SecurityProtocol_t
Definition: le_wifiAp_interface.h:176