FreeRTOS
aws_wifi.h
Go to the documentation of this file.
1 /*
2  * FreeRTOS
3  * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of
6  * this software and associated documentation files (the "Software"), to deal in
7  * the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9  * the Software, and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  *
22  * http://aws.amazon.com/freertos
23  * http://www.FreeRTOS.org
24  */
25 
26 
32 #ifndef _AWS_WIFI_H_
33 #define _AWS_WIFI_H_
34 
35 #include <stdint.h>
36 
37 /* FreeRTOS include for BaseType_t. */
38 #include "portmacro.h"
39 
40 /* Wi-Fi configuration includes. */
41 #include "aws_wifi_config.h"
42 
48 typedef enum
49 {
55 
59 typedef enum
60 {
67 
73 typedef enum
74 {
80 
86 typedef enum
87 {
92 } WIFIPMMode_t;
93 
97 typedef struct
98 {
99  const char * pcSSID;
100  uint8_t ucSSIDLength;
101  const char * pcPassword;
104  int8_t cChannel;
106 
116 typedef struct
117 {
118  char cSSID[ wificonfigMAX_SSID_LEN + 1 ];
119  uint8_t ucBSSID[ wificonfigMAX_BSSID_LEN ];
121  int8_t cRSSI;
122  int8_t cChannel;
123  uint8_t ucHidden;
125 
133 typedef struct
134 {
135  char cSSID[ wificonfigMAX_SSID_LEN + 1 ];
136  uint8_t ucSSIDLength;
137  uint8_t ucBSSID[ wificonfigMAX_BSSID_LEN ];
138  char cPassword[ wificonfigMAX_PASSPHRASE_LEN + 1 ];
142 
151 WIFIReturnCode_t WIFI_On( void );
152 
161 WIFIReturnCode_t WIFI_Off( void );
162 
192 WIFIReturnCode_t WIFI_ConnectAP( const WIFINetworkParams_t * const pxNetworkParams );
193 
203 
212 
230 
249 
272 WIFIReturnCode_t WIFI_NetworkAdd( const WIFINetworkProfile_t * const pxNetworkProfile,
273  uint16_t * pusIndex );
274 
275 
301  uint16_t usIndex );
302 
324 WIFIReturnCode_t WIFI_NetworkDelete( uint16_t usIndex );
325 
335 WIFIReturnCode_t WIFI_Ping( uint8_t * pucIPAddr,
336  uint16_t usCount,
337  uint32_t ulIntervalMS );
338 
352 WIFIReturnCode_t WIFI_GetIP( uint8_t * pucIPAddr );
353 
367 WIFIReturnCode_t WIFI_GetMAC( uint8_t * pucMac );
368 
383 WIFIReturnCode_t WIFI_GetHostIP( char * pcHost,
384  uint8_t * pucIPAddr );
385 
403  uint8_t ucNumNetworks );
404 
413 
422 
439 WIFIReturnCode_t WIFI_ConfigureAP( const WIFINetworkParams_t * const pxNetworkParams );
440 
453  const void * pvOptionValue );
454 
465  void * pvOptionValue );
466 
467 
473 BaseType_t WIFI_IsConnected( void );
474 
475 #endif /* _AWS_WIFI_H_ */
Wi-Fi scan results.
Definition: aws_wifi.h:116
WIFISecurity_t xSecurity
Definition: aws_wifi.h:140
WIFIReturnCode_t WIFI_GetMAC(uint8_t *pucMac)
Retrieves the Wi-Fi interface&#39;s MAC address.
WIFIPMMode_t
Wi-Fi device power management modes.
Definition: aws_wifi.h:86
WIFIReturnCode_t WIFI_StopAP(void)
Stop SoftAP mode.
const char * pcSSID
Definition: aws_wifi.h:99
WIFISecurity_t xSecurity
Definition: aws_wifi.h:120
WIFIReturnCode_t WIFI_SetMode(WIFIDeviceMode_t xDeviceMode)
Sets the Wi-Fi mode.
Parameters passed to the WIFI_ConnectAP API for connection.
Definition: aws_wifi.h:97
BaseType_t WIFI_IsConnected(void)
Check if the Wi-Fi is connected.
WIFIReturnCode_t WIFI_ConnectAP(const WIFINetworkParams_t *const pxNetworkParams)
Connects to the Wi-Fi Access Point (AP) specified in the input.
uint8_t ucHidden
Definition: aws_wifi.h:123
const char * pcPassword
Definition: aws_wifi.h:101
WIFIReturnCode_t WIFI_StartAP(void)
Start SoftAP mode.
WIFIReturnCode_t WIFI_GetPMMode(WIFIPMMode_t *pxPMModeType, void *pvOptionValue)
Get the Wi-Fi power management mode.
uint8_t ucSSIDLength
Definition: aws_wifi.h:136
WIFIReturnCode_t WIFI_ConfigureAP(const WIFINetworkParams_t *const pxNetworkParams)
Configure SoftAP.
WIFIReturnCode_t WIFI_Off(void)
Turns off Wi-Fi.
WIFIReturnCode_t WIFI_Disconnect(void)
Disconnects from the currently connected Access Point.
WIFIReturnCode_t WIFI_NetworkDelete(uint16_t usIndex)
Delete a Wi-Fi Network profile.
WIFIReturnCode_t WIFI_Reset(void)
Resets the Wi-Fi Module.
WIFIDeviceMode_t
Wi-Fi device modes.
Definition: aws_wifi.h:73
WIFIReturnCode_t WIFI_GetMode(WIFIDeviceMode_t *pxDeviceMode)
Gets the Wi-Fi mode.
uint8_t ucSSIDLength
Definition: aws_wifi.h:100
WIFIReturnCode_t WIFI_On(void)
Turns on Wi-Fi.
WIFIReturnCode_t
Return code denoting API status.
Definition: aws_wifi.h:48
Wi-Fi network parameters passed to the WIFI_NetworkAdd API.
Definition: aws_wifi.h:133
WIFIReturnCode_t WIFI_Ping(uint8_t *pucIPAddr, uint16_t usCount, uint32_t ulIntervalMS)
Ping an IP address in the network.
int8_t cChannel
Definition: aws_wifi.h:122
WIFIReturnCode_t WIFI_Scan(WIFIScanResult_t *pxBuffer, uint8_t ucNumNetworks)
Perform a Wi-Fi network Scan.
uint8_t ucPasswordLength
Definition: aws_wifi.h:102
WIFIReturnCode_t WIFI_GetIP(uint8_t *pucIPAddr)
Retrieves the Wi-Fi interface&#39;s IP address.
WIFISecurity_t
Wi-Fi Security types.
Definition: aws_wifi.h:59
WIFIReturnCode_t WIFI_NetworkAdd(const WIFINetworkProfile_t *const pxNetworkProfile, uint16_t *pusIndex)
Add a Wi-Fi Network profile.
uint8_t ucPasswordLength
Definition: aws_wifi.h:139
WIFIReturnCode_t WIFI_GetHostIP(char *pcHost, uint8_t *pucIPAddr)
Retrieves the host IP address from a host name using DNS.
WIFISecurity_t xSecurity
Definition: aws_wifi.h:103
WIFIReturnCode_t WIFI_NetworkGet(WIFINetworkProfile_t *pxNetworkProfile, uint16_t usIndex)
Get a Wi-Fi network profile.
WIFIReturnCode_t WIFI_SetPMMode(WIFIPMMode_t xPMModeType, const void *pvOptionValue)
Set the Wi-Fi power management mode.