space -> tabs and switch from a void* buffer to a struct of the right size

This commit is contained in:
LiquidFenrir 2019-07-23 00:11:44 +02:00
parent b305b1e12b
commit 1483c03d7b
2 changed files with 27 additions and 22 deletions

View File

@ -6,16 +6,21 @@
/// Wifi security modes. /// Wifi security modes.
typedef enum { typedef enum {
AC_OPEN = 0, ///< Open authentication. AC_OPEN = 0, ///< Open authentication.
AC_WEP_40BIT = 1, ///< WEP 40-bit authentication. AC_WEP_40BIT = 1, ///< WEP 40-bit authentication.
AC_WEP_104BIT = 2, ///< WEP 104-bit authentication. AC_WEP_104BIT = 2, ///< WEP 104-bit authentication.
AC_WEP_128BIT = 3, ///< WEP 128-bit authentication. AC_WEP_128BIT = 3, ///< WEP 128-bit authentication.
AC_WPA_TKIP = 4, ///< WPA TKIP authentication. AC_WPA_TKIP = 4, ///< WPA TKIP authentication.
AC_WPA2_TKIP = 5, ///< WPA2 TKIP authentication. AC_WPA2_TKIP = 5, ///< WPA2 TKIP authentication.
AC_WPA_AES = 6, ///< WPA AES authentication. AC_WPA_AES = 6, ///< WPA AES authentication.
AC_WPA2_AES = 7, ///< WPA2 AES authentication. AC_WPA2_AES = 7, ///< WPA2 AES authentication.
} acSecurityMode; } acSecurityMode;
/// Struct to contain the data for connecting to a Wifi network from a stored slot.
typedef struct {
u8 reserved[0x200];
} acuConfig;
/// Initializes AC. /// Initializes AC.
Result acInit(void); Result acInit(void);
@ -93,33 +98,33 @@ Result ACU_GetLastDetailErrorCode(u32* errorCode);
/** /**
* @brief Prepares a buffer to hold the configuration data to start a connection. * @brief Prepares a buffer to hold the configuration data to start a connection.
* @param config Pointer to a buffer of size at least 0x200 to contain the data. * @param config Pointer to an acuConfig struct to contain the data.
*/ */
Result ACU_CreateDefaultConfig(void* config); Result ACU_CreateDefaultConfig(acuConfig* config);
/** /**
* @brief Sets something that makes the connection reliable. * @brief Sets something that makes the connection reliable.
* @param config Pointer to a buffer of size at least 0x200 used with ACU_CreateDefaultConfig previously. * @param config Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.
* @param area Always 2 ? * @param area Always 2 ?
*/ */
Result ACU_SetNetworkArea(void* config, u8 area); Result ACU_SetNetworkArea(acuConfig* config, u8 area);
/** /**
* @brief Sets the slot to use when connecting. * @brief Sets the slot to use when connecting.
* @param config Pointer to a buffer of size at least 0x200 used with ACU_CreateDefaultConfig previously. * @param config Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.
* @param type Allowed slots flag. 1 for slot 1, 2 for slot 2, 4 for slot 3. * @param type Allowed slots flag. 1 for slot 1, 2 for slot 2, 4 for slot 3.
*/ */
Result ACU_SetAllowApType(void* config, u8 type); Result ACU_SetAllowApType(acuConfig* config, u8 type);
/** /**
* @brief Sets something that makes the connection reliable. * @brief Sets something that makes the connection reliable.
* @param config Pointer to a buffer of size at least 0x200 used with ACU_CreateDefaultConfig previously. * @param config Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.
*/ */
Result ACU_SetRequestEulaVersion(void* config); Result ACU_SetRequestEulaVersion(acuConfig* config);
/** /**
* @brief Starts the connection procedure. * @brief Starts the connection procedure.
* @param config Pointer to a buffer of size at least 0x200 used with ACU_CreateDefaultConfig previously. * @param config Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.
* @param connectionHandle Handle created with svcCreateEvent to wait on until the connection succeeds or fails. * @param connectionHandle Handle created with svcCreateEvent to wait on until the connection succeeds or fails.
*/ */
Result ACU_ConnectAsync(const void* config, Handle connectionHandle); Result ACU_ConnectAsync(const acuConfig* config, Handle connectionHandle);

View File

@ -198,7 +198,7 @@ Result ACU_GetLastDetailErrorCode(u32* errorCode)
return (Result)cmdbuf[1]; return (Result)cmdbuf[1];
} }
Result ACU_CreateDefaultConfig(void* config) Result ACU_CreateDefaultConfig(acuConfig* config)
{ {
Result ret=0; Result ret=0;
u32 *cmdbuf = getThreadCommandBuffer(); u32 *cmdbuf = getThreadCommandBuffer();
@ -213,7 +213,7 @@ Result ACU_CreateDefaultConfig(void* config)
return (Result)cmdbuf[1]; return (Result)cmdbuf[1];
} }
Result ACU_SetNetworkArea(void* config, u8 area) Result ACU_SetNetworkArea(acuConfig* config, u8 area)
{ {
Result ret=0; Result ret=0;
u32 *cmdbuf = getThreadCommandBuffer(); u32 *cmdbuf = getThreadCommandBuffer();
@ -231,7 +231,7 @@ Result ACU_SetNetworkArea(void* config, u8 area)
return (Result)cmdbuf[1]; return (Result)cmdbuf[1];
} }
Result ACU_SetAllowApType(void* config, u8 type) Result ACU_SetAllowApType(acuConfig* config, u8 type)
{ {
Result ret=0; Result ret=0;
u32 *cmdbuf = getThreadCommandBuffer(); u32 *cmdbuf = getThreadCommandBuffer();
@ -249,7 +249,7 @@ Result ACU_SetAllowApType(void* config, u8 type)
return (Result)cmdbuf[1]; return (Result)cmdbuf[1];
} }
Result ACU_SetRequestEulaVersion(void* config) Result ACU_SetRequestEulaVersion(acuConfig* config)
{ {
Result ret=0; Result ret=0;
u32 *cmdbuf = getThreadCommandBuffer(); u32 *cmdbuf = getThreadCommandBuffer();
@ -268,7 +268,7 @@ Result ACU_SetRequestEulaVersion(void* config)
return (Result)cmdbuf[1]; return (Result)cmdbuf[1];
} }
Result ACU_ConnectAsync(const void* config, Handle connectionHandle) Result ACU_ConnectAsync(const acuConfig* config, Handle connectionHandle)
{ {
Result ret=0; Result ret=0;
u32 *cmdbuf = getThreadCommandBuffer(); u32 *cmdbuf = getThreadCommandBuffer();