ac.h File Reference

AC service. More...

`#include <3ds/types.h>`

Go to the source code of this file.

## Data Structures

struct | acuConfig
| Struct to contain the data for connecting to a Wifi network from a stored slot. More...

## Enumerations

enum | acSecurityMode { AC_OPEN = 0 , AC_WEP_40BIT = 1 , AC_WEP_104BIT = 2 , AC_WEP_128BIT = 3 , AC_WPA_TKIP = 4 , AC_WPA2_TKIP = 5 , AC_WPA_AES = 6 , AC_WPA2_AES = 7 }
| Wifi security modes. More...
enum | { AC_AP_TYPE_NONE = 0 , AC_AP_TYPE_SLOT1 = BIT(1) , AC_AP_TYPE_SLOT2 = BIT(2) , AC_AP_TYPE_SLOT3 = BIT(3) , AC_AP_TYPE_ALL = 0x7FFFFFFF }
| Wifi access point types (bitfield). More...

## Functions

Result | acInit (void)
| Initializes AC.
void | acExit (void)
| Exits AC.
Handle * | acGetSessionHandle (void)
| Gets the current AC session handle.
Result | acWaitInternetConnection (void)
| Waits for the system to connect to the internet.
Result | ACU_GetWifiStatus (u32 *out)
| Describes the access point the console is currently connected to with AC_AP_TYPE_* flags. More...
Result | ACU_GetStatus (u32 *out)
| Gets the connected Wifi status. More...
Result | ACU_GetSecurityMode (acSecurityMode *mode)
| Gets the connected Wifi security mode. More...
Result | ACU_GetSSID (char *SSID)
| Gets the connected Wifi SSID. More...
Result | ACU_GetSSIDLength (u32 *out)
| Gets the connected Wifi SSID length. More...
Result | ACU_GetProxyEnable (bool *enable)
| Determines whether proxy is enabled for the connected network. More...
Result | ACU_GetProxyPort (u32 *out)
| Gets the connected network's proxy port. More...
Result | ACU_GetProxyUserName (char *username)
| Gets the connected network's proxy username. More...
Result | ACU_GetProxyPassword (char *password)
| Gets the connected network's proxy password. More...
Result | ACU_GetLastErrorCode (u32 *errorCode)
| Gets the last error to occur during a connection. More...
Result | ACU_GetLastDetailErrorCode (u32 *errorCode)
| Gets the last detailed error to occur during a connection. More...
Result | ACU_CreateDefaultConfig (acuConfig *config)
| Prepares a buffer to hold the configuration data to start a connection. More...
Result | ACU_SetNetworkArea (acuConfig *config, u8 area)
| Sets something that makes the connection reliable. More...
Result | ACU_SetAllowApType (acuConfig *config, u8 type)
| Sets the slot to use when connecting. More...
Result | ACU_SetRequestEulaVersion (acuConfig *config)
| Sets something that makes the connection reliable. More...
Result | ACU_ConnectAsync (const acuConfig *config, Handle connectionHandle)
| Starts the connection procedure. More...
Result | ACI_LoadNetworkSetting (u32 slot)
| Selects the WiFi configuration slot for further ac:i operations. More...
Result | ACI_GetNetworkWirelessEssidSecuritySsid (void *ssid)
| Fetches the SSID of the previously selected WiFi configuration slot. More...

## Detailed Description

AC service.

## Enumeration Type Documentation

## anonymous enum

anonymous enum

Wifi access point types (bitfield).

Enumerator
AC_AP_TYPE_NONE | No access point/none allowed.
AC_AP_TYPE_SLOT1 | Slot 1 in System Settings.
AC_AP_TYPE_SLOT2 | Slot 2 in System Settings.
AC_AP_TYPE_SLOT3 | Slot 3 in System Settings.
AC_AP_TYPE_ALL | All access point types allowed.

## acSecurityMode

enum acSecurityMode

Wifi security modes.

Enumerator
AC_OPEN | Open authentication.
AC_WEP_40BIT | WEP 40-bit authentication.
AC_WEP_104BIT | WEP 104-bit authentication.
AC_WEP_128BIT | WEP 128-bit authentication.
AC_WPA_TKIP | WPA TKIP authentication.
AC_WPA2_TKIP | WPA2 TKIP authentication.
AC_WPA_AES | WPA AES authentication.
AC_WPA2_AES | WPA2 AES authentication.

## Function Documentation

## ACI_GetNetworkWirelessEssidSecuritySsid()

Result ACI_GetNetworkWirelessEssidSecuritySsid | ( | void * | ssid | ) |

Fetches the SSID of the previously selected WiFi configuration slot.

Parameters

  [out] | ssid | Pointer to the output buffer of size 32B the SSID will be stored in.

## ACI_LoadNetworkSetting()

Result ACI_LoadNetworkSetting | ( | u32 | slot | ) |

Selects the WiFi configuration slot for further ac:i operations.

Parameters

  slot | WiFi slot (0, 1 or 2).

## ACU_ConnectAsync()

Result ACU_ConnectAsync | ( | const acuConfig * | config,
|  | Handle | connectionHandle
| ) |  |

Starts the connection procedure.

Parameters

  config | Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.
  connectionHandle | Handle created with svcCreateEvent to wait on until the connection succeeds or fails.

## ACU_CreateDefaultConfig()

Result ACU_CreateDefaultConfig | ( | acuConfig * | config | ) |

Prepares a buffer to hold the configuration data to start a connection.

Parameters

  config | Pointer to an acuConfig struct to contain the data.

## ACU_GetLastDetailErrorCode()

Result ACU_GetLastDetailErrorCode | ( | u32 * | errorCode | ) |

Gets the last detailed error to occur during a connection.

Parameters

  errorCode | Pointer to output the error code to.

## ACU_GetLastErrorCode()

Result ACU_GetLastErrorCode | ( | u32 * | errorCode | ) |

Gets the last error to occur during a connection.

Parameters

  errorCode | Pointer to output the error code to.

## ACU_GetProxyEnable()

Result ACU_GetProxyEnable | ( | bool * | enable | ) |

Determines whether proxy is enabled for the connected network.

Parameters

  enable | Pointer to output the proxy status to.

## ACU_GetProxyPassword()

Result ACU_GetProxyPassword | ( | char * | password | ) |

Gets the connected network's proxy password.

Parameters

  password | Pointer to output the proxy password to. (The size must be at least 0x20-bytes)

## ACU_GetProxyPort()

Result ACU_GetProxyPort | ( | u32 * | out | ) |

Gets the connected network's proxy port.

Parameters

  out | Pointer to output the proxy port to.

## ACU_GetProxyUserName()

Result ACU_GetProxyUserName | ( | char * | username | ) |

Gets the connected network's proxy username.

Parameters

  username | Pointer to output the proxy username to. (The size must be at least 0x20-bytes)

## ACU_GetSecurityMode()

Result ACU_GetSecurityMode | ( | acSecurityMode * | mode | ) |

Gets the connected Wifi security mode.

Parameters

  mode | Pointer to output the connected Wifi security mode to. (0 = Open Authentication, 1 = WEP 40-bit, 2 = WEP 104-bit, 3 = WEP 128-bit, 4 = WPA TKIP, 5 = WPA2 TKIP, 6 = WPA AES, 7 = WPA2 AES)

## ACU_GetSSID()

Result ACU_GetSSID | ( | char * | SSID | ) |

Gets the connected Wifi SSID.

Parameters

  SSID | Pointer to output the connected Wifi SSID to.

## ACU_GetSSIDLength()

Result ACU_GetSSIDLength | ( | u32 * | out | ) |

Gets the connected Wifi SSID length.

Parameters

  out | Pointer to output the connected Wifi SSID length to.

## ACU_GetStatus()

Result ACU_GetStatus | ( | u32 * | out | ) |

Gets the connected Wifi status.

Parameters

  out | Pointer to output the connected Wifi status to. (1 = not connected, 3 = connected)

## ACU_GetWifiStatus()

Result ACU_GetWifiStatus | ( | u32 * | out | ) |

Describes the access point the console is currently connected to with AC_AP_TYPE_* flags.

Parameters

  out | Pointer to output the combination of AC_AP_TYPE_* flags describing the AP to.

## ACU_SetAllowApType()

Result ACU_SetAllowApType | ( | acuConfig * | config,
|  | u8 | type
| ) |  |

Sets the slot to use when connecting.

Parameters

  config | Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.
  type | Allowed AP types bitmask, a combination of AC_AP_TYPE_* flags.

## ACU_SetNetworkArea()

Result ACU_SetNetworkArea | ( | acuConfig * | config,
|  | u8 | area
| ) |  |

Sets something that makes the connection reliable.

Parameters

  config | Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.
  area | Always 2 ?

## ACU_SetRequestEulaVersion()

Result ACU_SetRequestEulaVersion | ( | acuConfig * | config | ) |

Sets something that makes the connection reliable.

Parameters

  config | Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.