DSWifi
|
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_RETURN { WIFI_RETURN_OK = 0 , WIFI_RETURN_LOCKFAILED = 1 , WIFI_RETURN_ERROR = 2 , WIFI_RETURN_PARAMERROR = 3 } |
Error codes for Wifi_GetAPData() 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_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. | |
int | Wifi_DisconnectAP (void) |
Disassociate from the Access Point. | |
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_GetNumAP (void) |
Returns the current number of APs that are known and tracked internally. | |
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. | |
enum WIFI_ASSOCSTATUS |
Returned by Wifi_AssocStatus() after calling Wifi_ConnectAP()
Enumerator | |
---|---|
ASSOCSTATUS_DISCONNECTED | Not trying to connect. |
ASSOCSTATUS_SEARCHING | Data given does not completely specify an AP, looking for AP that matches the data. |
ASSOCSTATUS_AUTHENTICATING | Connecting... |
ASSOCSTATUS_ASSOCIATING | Connecting... |
ASSOCSTATUS_ACQUIRINGDHCP | Connected to AP, but getting IP data from DHCP. This will finish when we have an IPv4 or IPv6 address, it doesn't wait for both to be available. Normally the IPv4 address is available first. Use Wifi_GetIPv6() to verify if you have an IPv6 address or not. |
ASSOCSTATUS_ASSOCIATED | Connected! (COMPLETE if Wifi_ConnectAP was called to start) |
ASSOCSTATUS_CANNOTCONNECT | Error in connecting... (COMPLETE if Wifi_ConnectAP was called to start) |
enum WIFI_RETURN |
Error codes for Wifi_GetAPData()
int Wifi_AssocStatus | ( | void | ) |
Returns information about the status of connection to an AP.
Continue polling this function until you receive ASSOCSTATUS_CONNECTED or ASSOCSTATUS_CANNOTCONNECT.
int Wifi_ConnectAP | ( | Wifi_AccessPoint * | apdata, |
int | wepmode, | ||
int | wepkeyid, | ||
unsigned char * | wepkey | ||
) |
Connect to an Access Point.
apdata | Basic data about the AP. The user must fill either the bssid field or the ssid and ssid_len fields. Other fields are ignored. |
wepmode | Indicates whether WEP is used, and what kind (WEPMODES). Use WEPMODE_NONE if WEP isn't required. |
wepkeyid | Indicates which WEP key ID to use for transmitting (Unused, set it to 0). |
wepkey | The WEP key, to be used in all 4 key slots. For WEPMODE_40BIT it is a 5 byte long array. For WEPMODE_128BIT it is a 13 byte long array. |
int Wifi_ConnectOpenAP | ( | Wifi_AccessPoint * | apdata | ) |
Connect to an AP without encryption (and NDS multiplayer hosts).
apdata | Basic data about the AP. The user must fill either the bssid field or the ssid and ssid_len fields. Other fields are ignored. |
int Wifi_ConnectSecureAP | ( | Wifi_AccessPoint * | apdata, |
const void * | key, | ||
size_t | key_len | ||
) |
Connect to an Access Point.
apdata | Basic data about the AP. The user must fill either the bssid field or the ssid and ssid_len fields. Other fields are ignored. |
key | The key to be used. For WEP networks it must be 5, 13 or 16 bytes long. For WPA networks it must be at most 64 bytes long. For open networks use NULL. |
key_len | The size of the key in bytes. For open networks use 0. |
int Wifi_DisconnectAP | ( | void | ) |
Disassociate from the Access Point.
int Wifi_FindMatchingAP | ( | int | numaps, |
Wifi_AccessPoint * | apdata, | ||
Wifi_AccessPoint * | match_dest | ||
) |
Determines whether various APs exist in the local area.
You provide a list of APs, and it will return the index of the first one in the list that can be found in the internal list of APs that have been found by the console.
The APs in the "apdata" list must contain a BSSID or SSID. If neither are provided, the AP will be ignored.
numaps | Number of records in the list. |
apdata | Pointer to an array of structures with information about the APs to find. |
match_dest | OPTIONAL pointer to a record to receive the matching AP record. |
int Wifi_GetAPData | ( | int | apnum, |
Wifi_AccessPoint * | apdata | ||
) |
Grabs data from internal structures for user code (always succeeds).
apnum | The 0-based index of the access point record to fetch. |
apdata | Pointer to the location to store the retrieved data. |
int Wifi_GetNumAP | ( | void | ) |
Returns the current number of APs that are known and tracked internally.
void Wifi_ScanMode | ( | void | ) |
Makes the ARM7 go into scan mode and list Internet APs.
The ARM7 periodically rotates through the channels to pick up and record information from beacons given off by APs.
When in DSWIFI_INTERNET mode, this function will scan looking for Internet APs. It will list all detecetd APs, whether they are compatible with a DS or not (because of using WPA, for example). However, NDS devices acting as hosts are excluded.
When in DSWIFI_MULTIPLAYER_CLIENT, this function will scan looking for other NDS consoles acting as multiplayer hosts. It will filter out all devices that aren't NDS devices acting as multiplayer hosts (only devices that include Nintendo vendor information in their beacon packets are added to the list).
void Wifi_ScanModeFilter | ( | Wifi_APScanFlags | flags | ) |
Makes the ARM7 go into scan mode, filterint out the requested device types.
The ARM7 periodically rotates through the channels to pick up and record information from beacons given off by APs.
flags | Types of devices to include to the list of scanned devices. |