|
DSWifi
|
ARM9 header of DSWifi. More...
#include <netinet/in.h>#include <stdbool.h>#include <stdint.h>#include <stddef.h>#include <nds/ndstypes.h>#include <dswifi_common.h>#include <dswifi_version.h>Macros | |
| #define | INIT_ONLY (0 << 0) |
| Init library only, don't try to connect to AP. | |
| #define | WFC_CONNECT (1 << 0) |
| Init library and try to connect to firmware AP. | |
| #define | WIFI_ATTEMPT_DSI_MODE (1 << 3) |
| Try to initialize DSWiFi in DSi mode. | |
| #define | WIFI_DISABLE_LED (1 << 1) |
| Don't let the library control the LED blinking. | |
| #define | WIFI_DS_MODE_ONLY (0 << 3) |
| Initialize DSWiFi in DS mode, even in DSi consoles. Local multiplayer mode is supported. | |
| #define | WIFI_ENABLE_LED (0 << 1) |
| Allow the library to control how the LED blinks (DS and DS Lite only). | |
| #define | WIFI_INTERNET_AND_LOCAL (0 << 2) |
| Initialize both internet and local multiplayer modes. | |
| #define | WIFI_LOCAL_ONLY (1 << 2) |
| Only initialize local multiplayer mode. | |
Typedefs | |
| typedef void(* | WifiFromClientPacketHandler) (Wifi_MPPacketType, int, int, int) |
| Handler of WiFI packets received on the host from a client. | |
| typedef void(* | WifiFromHostPacketHandler) (Wifi_MPPacketType, int, int) |
| Handler of WiFI packets received on a client from the host. | |
| typedef void(* | WifiPacketHandler) (int, int) |
| Handler of RAW packets received in this console. | |
Enumerations | |
| enum | WIFI_ASSOCSTATUS { ASSOCSTATUS_DISCONNECTED , ASSOCSTATUS_SEARCHING , ASSOCSTATUS_AUTHENTICATING , ASSOCSTATUS_ASSOCIATING , ASSOCSTATUS_ACQUIRINGDHCP , ASSOCSTATUS_ASSOCIATED , ASSOCSTATUS_CANNOTCONNECT } |
| Returned by Wifi_AssocStatus() after calling Wifi_ConnectAP() More... | |
| enum | Wifi_MPPacketType { WIFI_MPTYPE_INVALID = -1 , WIFI_MPTYPE_CMD = 0 , WIFI_MPTYPE_REPLY = 1 , WIFI_MPTYPE_DATA = 2 } |
| Possible types of packets received by multiplayer handlers. More... | |
| enum | WIFI_RETURN { WIFI_RETURN_OK = 0 , WIFI_RETURN_LOCKFAILED = 1 , WIFI_RETURN_ERROR = 2 , WIFI_RETURN_PARAMERROR = 3 } |
| Error codes for Wifi_GetAPData() More... | |
| enum | WIFIGETDATA { WIFIGETDATA_MACADDRESS , WIFIGETDATA_NUMWFCAPS , WIFIGETDATA_RSSI , MAX_WIFIGETDATA } |
| User code uses members of the WIFIGETDATA structure in calling Wifi_GetData() to retreive miscellaneous odd information. More... | |
Functions | |
| int | Wifi_AssocStatus (void) |
| Returns information about the status of connection to an AP. | |
| void | Wifi_AutoConnect (void) |
| Connect to an Access Point specified by the WFC data in the firmware. | |
| int | Wifi_BeaconStart (const char *ssid, u32 game_id) |
| Sends a beacon frame to the ARM7 to be used in multiplayer host mode. | |
| int | Wifi_CheckInit (void) |
| Used to determine if the library has been initialized. | |
| int | Wifi_ConnectAP (Wifi_AccessPoint *apdata, int wepmode, int wepkeyid, unsigned char *wepkey) |
| Connect to an Access Point. | |
| int | Wifi_ConnectOpenAP (Wifi_AccessPoint *apdata) |
| Connect to an AP without encryption (and NDS multiplayer hosts). | |
| int | Wifi_ConnectSecureAP (Wifi_AccessPoint *apdata, const void *key, size_t key_len) |
| Connect to an Access Point. | |
| bool | Wifi_Deinit (void) |
| Stops the WiFi library. | |
| void | Wifi_DisableWifi (void) |
| Instructs the ARM7 to disengage wireless and stop receiving or transmitting. | |
| int | Wifi_DisconnectAP (void) |
| Disassociate from the Access Point. | |
| void | Wifi_EnableWifi (void) |
| Instructs the ARM7 to go into a basic "active" mode. | |
| int | Wifi_FindMatchingAP (int numaps, Wifi_AccessPoint *apdata, Wifi_AccessPoint *match_dest) |
| Determines whether various APs exist in the local area. | |
| int | Wifi_GetAPData (int apnum, Wifi_AccessPoint *apdata) |
| Grabs data from internal structures for user code (always succeeds). | |
| int | Wifi_GetData (int datatype, int bufferlen, unsigned char *buffer) |
| Retrieve an arbitrary or misc. piece of data from the WiFi hardware. | |
| u32 | Wifi_GetIP (void) |
| It returns the current IP address of the DS. | |
| struct in_addr | Wifi_GetIPInfo (struct in_addr *pGateway, struct in_addr *pSnmask, struct in_addr *pDns1, struct in_addr *pDns2) |
| Returns IP information. | |
| bool | Wifi_GetIPv6 (struct in6_addr *addr) |
| It returns an array of 4 u32 values with the current IPv6 address of the DS. | |
| int | Wifi_GetNumAP (void) |
| Returns the current number of APs that are known and tracked internally. | |
| u32 | Wifi_GetStats (int statnum) |
| Retreive an element of the WiFi statistics gathered. | |
| void | Wifi_IdleMode (void) |
| Sets the WiFI hardware in "active" mode. | |
| bool | Wifi_InitDefault (unsigned int flags) |
| Initializes WiFi library. | |
| void | Wifi_InternetMode (void) |
| Sets the WiFI hardware in Internet mode. | |
| bool | Wifi_LibraryModeReady (void) |
| Checks whether a library mode change has finished or not. | |
| void | Wifi_MultiplayerAllowNewClients (bool allow) |
| Allows or disallows new clients to connect to this console acting as host. | |
| int | Wifi_MultiplayerClientMode (size_t client_packet_size) |
| Sets the WiFI hardware in mulitplayer client mode. | |
| int | Wifi_MultiplayerClientReplyTxFrame (const void *data_src, size_t data_size) |
| Prepares a multiplayer client reply frame to be sent. | |
| int | Wifi_MultiplayerClientToHostDataTxFrame (const void *data_src, size_t data_size) |
| Sends a data frame to the host. | |
| void | Wifi_MultiplayerFromClientSetPacketHandler (WifiFromClientPacketHandler func) |
| Set a handler on a host console for packets received from clients. | |
| void | Wifi_MultiplayerFromHostSetPacketHandler (WifiFromHostPacketHandler func) |
| Set a handler on a client console for packets received from the host. | |
| u16 | Wifi_MultiplayerGetClientMask (void) |
| Returns a mask where each bit represents an connected client. | |
| int | Wifi_MultiplayerGetClients (int max_clients, Wifi_ConnectedClient *client_data) |
| Get information of clients connected to a multiplayer host. | |
| int | Wifi_MultiplayerGetNumClients (void) |
| Get the number of clients connected to this DS acting as a multiplayer host. | |
| int | Wifi_MultiplayerHostCmdTxFrame (const void *data_src, size_t data_size) |
| Sends a multiplayer host frame. | |
| int | Wifi_MultiplayerHostMode (int max_clients, size_t host_packet_size, size_t client_packet_size) |
| Sets the WiFI hardware in mulitplayer host mode. | |
| void | Wifi_MultiplayerHostName (const void *buffer, u8 len) |
| Set the name and name length fields in beacon packets. | |
| int | Wifi_MultiplayerHostToClientDataTxFrame (int aid, const void *data_src, size_t data_size) |
| Sends a data frame to the client with the specified association ID. | |
| void | Wifi_MultiplayerKickClientByAID (int association_id) |
| Kick the client with the provided AID from the host. | |
| void | Wifi_RawSetPacketHandler (WifiPacketHandler wphfunc) |
| Set a handler to process all raw incoming packets. | |
| int | Wifi_RawTxFrame (size_t data_size, u16 rate, const void *data_src) |
| Send a raw 802.11 frame at a specified rate. | |
| void | Wifi_RxRawReadPacket (u32 address, u32 size, void *dst) |
| Allows user code to read a packet from inside a WifiPacketHandler function. | |
| const void * | Wifi_RxRawReadPacketPointer (u32 address) |
| Returns a pointer to read a packet from inside a WifiPacketHandler function. | |
| void | Wifi_ScanMode (void) |
| Makes the ARM7 go into scan mode and list Internet APs. | |
| void | Wifi_ScanModeFilter (Wifi_APScanFlags flags) |
| Makes the ARM7 go into scan mode, filterint out the requested device types. | |
| void | Wifi_SetChannel (int channel) |
| If the WiFi system is not connected or connecting to an access point, instruct the chipset to change channel. | |
| void | Wifi_SetIP (u32 IPaddr, u32 gateway, u32 subnetmask, u32 dns1, u32 dns2) |
| Set the DS's IP address and other IP configuration information. | |
| void | Wifi_SetPromiscuousMode (int enable) |
| Allows the DS to enter or leave a "promsicuous" mode. | |
ARM9 header of DSWifi.