DSWifi
Loading...
Searching...
No Matches
Enumerations | Functions
Scan and connect to access points.

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_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.
 

Detailed Description

Enumeration Type Documentation

◆ 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.

ASSOCSTATUS_ASSOCIATED 

Connected! (COMPLETE if Wifi_ConnectAP was called to start)

ASSOCSTATUS_CANNOTCONNECT 

Error in connecting... (COMPLETE if Wifi_ConnectAP was called to start)

◆ WIFI_RETURN

Error codes for Wifi_GetAPData()

Enumerator
WIFI_RETURN_OK 

Everything went ok.

WIFI_RETURN_LOCKFAILED 

The spinlock attempt failed (it wasn't retried cause that could lock both cpus- retry again after a delay.

WIFI_RETURN_ERROR 

There was an error in attempting to complete the requested task.

WIFI_RETURN_PARAMERROR 

There was an error in the parameters passed to the function.

Function Documentation

◆ Wifi_AssocStatus()

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.

Returns
A value from the WIFI_ASSOCSTATUS enum.

◆ Wifi_ConnectAP()

int Wifi_ConnectAP ( Wifi_AccessPoint apdata,
int  wepmode,
int  wepkeyid,
unsigned char *  wepkey 
)

Connect to an Access Point.

Parameters
apdataBasic data about the AP.
wepmodeIndicates whether WEP is used, and what kind (WEPMODES). Use WEPMODE_NONE if WEP isn't required.
wepkeyidIndicates which WEP key ID to use for transmitting (normally 0).
wepkeyThe 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.
Returns
0 for ok, -1 for error with input data.

◆ Wifi_ConnectOpenAP()

int Wifi_ConnectOpenAP ( Wifi_AccessPoint apdata)

Connect to an AP without encryption (and NDS multiplayer hosts).

Parameters
apdataBasic data about the AP.
Returns
0 for ok, -1 for error with input data.

◆ Wifi_DisconnectAP()

int Wifi_DisconnectAP ( void  )

Disassociate from the Access Point.

Returns
It returns 0 on success.

◆ Wifi_FindMatchingAP()

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 are being tracked.

Parameters
numapsNumber of records in the list.
apdataPointer to an array of structures with information about the APs to find.
match_destOPTIONAL pointer to a record to receive the matching AP record.
Returns
-1 for none found, or a positive/zero integer index into the array

◆ Wifi_GetAPData()

int Wifi_GetAPData ( int  apnum,
Wifi_AccessPoint apdata 
)

Grabs data from internal structures for user code (always succeeds).

Parameters
apnumThe 0-based index of the access point record to fetch.
apdataPointer to the location to store the retrieved data.
Returns
WIFI_RETURN enumeration value.

◆ Wifi_GetNumAP()

int Wifi_GetNumAP ( void  )

Returns the current number of APs that are known and tracked internally.

Returns
The number of APs.

◆ Wifi_ScanMode()

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).

◆ Wifi_ScanModeFilter()

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.

Parameters
flagsTypes of devices to include to the list of scanned devices.