Wi-Fi Driver

The Wi-Fi driver is used to control Wi-Fi peripherals.

Data Structures

ATMO_WIFI_ConnectionStatus_t

Member Name Type
connectivity ATMO_WIFI_ConnectivityStatus_t
disconnectReason ATMO_WIFI_DisconnectReason_t
ipType ATMO_WIFI_IpType_t
ipAddress uint8_t
macAddress uint8_t

ATMO_WIFI_Config_t

Member Name Type
ssid const char *
password const char *
mode ATMO_WIFI_Mode_t

Type Definitions

Name Definition Description
ATMO_WIFI_DriverInstance_t typedef struct ATMO_WIFI_DriverInstance_t ATMO_WIFI_DriverInstance_t  

Enumerations

enum ATMO_WIFI_Status_t

Name Value
ATMO_WIFI_Status_Success 0x00u
ATMO_WIFI_Status_Fail 0x01u
ATMO_WIFI_Status_Initialized 0x02u
ATMO_WIFI_Status_Invalid 0x03u
ATMO_WIFI_Status_NotSupported 0x04u
ATMO_WIFI_Status_Unspecified 0x05u

enum ATMO_WIFI_DisconnectReason_t

Name Value
ATMO_WIFI_DISC_REASON_UNSPECIFIED 1
ATMO_WIFI_DISC_REASON_AUTH_EXPIRE 2
ATMO_WIFI_DISC_REASON_AUTH_LEAVE 3
ATMO_WIFI_DISC_REASON_ASSOC_EXPIRE 4
ATMO_WIFI_DISC_REASON_ASSOC_TOOMANY 5
ATMO_WIFI_DISC_REASON_NOT_AUTHED 6
ATMO_WIFI_DISC_REASON_NOT_ASSOCED 7
ATMO_WIFI_DISC_REASON_ASSOC_LEAVE 8
ATMO_WIFI_DISC_REASON_ASSOC_NOT_AUTHED 9
ATMO_WIFI_DISC_REASON_DISASSOC_PWRCAP_BAD 10
ATMO_WIFI_DISC_REASON_DISASSOC_SUPCHAN_BAD 11
ATMO_WIFI_DISC_REASON_IE_INVALID 13
ATMO_WIFI_DISC_REASON_MIC_FAILURE 14
ATMO_WIFI_DISC_REASON_4WAY_HANDSHAKE_TIMEOUT 15
ATMO_WIFI_DISC_REASON_GROUP_KEY_UPDATE_TIMEOUT 16
ATMO_WIFI_DISC_REASON_IE_IN_4WAY_DIFFERS 17
ATMO_WIFI_DISC_REASON_GROUP_CIPHER_INVALID 18
ATMO_WIFI_DISC_REASON_PAIRWISE_CIPHER_INVALID 19
ATMO_WIFI_DISC_REASON_AKMP_INVALID 20
ATMO_WIFI_DISC_REASON_UNSUPP_RSN_IE_VERSION 21
ATMO_WIFI_DISC_REASON_INVALID_RSN_IE_CAP 22
ATMO_WIFI_DISC_REASON_802_1X_AUTH_FAILED 23
ATMO_WIFI_DISC_REASON_CIPHER_SUITE_REJECTED 24
ATMO_WIFI_DISC_REASON_BEACON_TIMEOUT 200
ATMO_WIFI_DISC_REASON_NO_AP_FOUND 201
ATMO_WIFI_DISC_REASON_AUTH_FAIL 202
ATMO_WIFI_DISC_REASON_ASSOC_FAIL 203
ATMO_WIFI_DISC_REASON_HANDSHAKE_TIMEOUT 204

enum ATMO_WIFI_Mode_t

Name Value
ATMO_WIFI_MODE_AP  
ATMO_WIFI_MODE_STA  
ATMO_WIFI_MODE_AP_STA  

enum ATMO_WIFI_Event_t

Name Value Description
ATMO_WIFI_CONNECTED 0 Connected to access point in STA mode, or client connected in AP mode.
ATMO_WIFI_DISCONNECTED   Disconnected from access point in STA mode, or client disconnected in AP mode.
ATMO_WIFI_NUM_EVENTS    

enum ATMO_WIFI_ConnectivityStatus_t

Name Value
ATMO_WIFI_CONNECTIVITY_CONNECTED  
ATMO_WIFI_CONNECTIVITY_CONNECTING  
ATMO_WIFI_CONNECTIVITY_DISCONNECTED  
ATMO_WIFI_CONNECTIVITY_AP_ACTIVE  

enum ATMO_WIFI_IpType_t

Name Value
ATMO_WIFI_IPV4  
ATMO_WIFI_IPV6  

Functions

ATMO_Status_t ATMO_WIFI_AddDriverInstance(const ATMO_WIFI_DriverInstance_t *driverInstance, ATMO_DriverInstanceData_t *driverInstanceData, ATMO_DriverInstanceHandle_t *instanceNumber)

Add an instance of a driver for Wi-Fi into the Wi-Fi driver handler.

Parameter Direction Type
instanceNumber N/A ATMO_DriverInstanceHandle_t *
driverInstanceData N/A ATMO_DriverInstanceData_t *
driverInstance N/A const ATMO_WIFI_DriverInstance_t *
Return Type
ATMO_Status_t

ATMO_WIFI_Status_t ATMO_WIFI_Init(ATMO_DriverInstanceHandle_t instance)

Initalize the Wi-Fi driver.

Parameter Direction Type
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_WIFI_Status_t

ATMO_WIFI_Status_t ATMO_WIFI_DeInit(ATMO_DriverInstanceHandle_t instance)

De-initialize the Wi-Fi driver.

Parameter Direction Type
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_WIFI_Status_t

ATMO_WIFI_Status_t ATMO_WIFI_SetEnabled(ATMO_DriverInstanceHandle_t instance, bool enabled)

Set the Wi-Fi driver to enabled or disabled.

Parameter Direction Type
enabled in bool
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_WIFI_Status_t

ATMO_WIFI_Status_t ATMO_WIFI_GetEnabled(ATMO_DriverInstanceHandle_t instance, bool *enabled)

Get the Wi-Fi driver’s enabled or disabled status.

Parameter Direction Type
enabled out bool *
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_WIFI_Status_t

ATMO_WIFI_Status_t ATMO_WIFI_SetConfiguration(ATMO_DriverInstanceHandle_t instance, const ATMO_WIFI_Config_t *config)

Set the Wi-Fi configuration.

Parameter Direction Type
config in const ATMO_WIFI_Config_t *
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_WIFI_Status_t

ATMO_WIFI_Status_t ATMO_WIFI_Start(ATMO_DriverInstanceHandle_t instance)

Start Wi-Fi in chosen mode.

Parameter Direction Type
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_WIFI_Status_t

ATMO_WIFI_Status_t ATMO_WIFI_Stop(ATMO_DriverInstanceHandle_t instance)

Stop Wi-Fi in chosen mode.

Parameter Direction Type
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_WIFI_Status_t

ATMO_WIFI_Status_t ATMO_WIFI_GetIpAddress(ATMO_DriverInstanceHandle_t instance, char *ipBuf, uint32_t bufLen)

Get the current IP address. This routine is only applicable if set to STA mode.

Parameter Direction Type
bufLen in uint32_t
ipBuf out char *
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_WIFI_Status_t

ATMO_WIFI_Status_t ATMO_WIFI_RegisterCallback(ATMO_DriverInstanceHandle_t instance, ATMO_WIFI_Event_t event, ATMO_Callback_t cb)

Register callback to execute on a Wi-Fi event.

Parameter Direction Type
cb in ATMO_Callback_t
event in ATMO_WIFI_Event_t
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_WIFI_Status_t

ATMO_WIFI_Status_t ATMO_WIFI_RegisterAbility(ATMO_DriverInstanceHandle_t instance, ATMO_WIFI_Event_t event, unsigned int abilityHandle)

Register an ability to execute on a Wi-Fi event.

Parameter Direction Type
abilityHandle in unsigned int
event in ATMO_WIFI_Event_t
instance in ATMO_DriverInstanceHandle_t
Return Type
ATMO_WIFI_Status_t

ATMO_WIFI_Status_t ATMO_WIFI_GetStatus(ATMO_DriverInstanceHandle_t instance, ATMO_WIFI_ConnectionStatus_t *status)

Get connectivity status for the Wi-Fi subdriver.

Parameter Direction Type
status N/A ATMO_WIFI_ConnectionStatus_t *
instance N/A ATMO_DriverInstanceHandle_t
Return Type
ATMO_WIFI_Status_t