NightFox’s Lib
Macros | Functions | Variables
nf_wifi.h File Reference

Basic WiFi helpers. More...

#include <nds.h>
#include <dswifi9.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

Macros

#define NF_MAX_INCOMMING_PENDING   1
 Maxmimum number of connection requests in the queue.
 
#define NF_WIFI_BUFFER_SIZE   256
 Size of communications buffer.
 

Functions

bool NF_WiFiConnectDefaultAp (void)
 Try to connect to the default access point in the DS user configuration. More...
 
void NF_WiFiDisconnectAp (void)
 Disconnect from the access point and shutdown WiFi.
 
bool NF_WIFI_CreateUdpSender (const char *address, u16 port)
 Creates a socket in client mode using UDP. More...
 
bool NF_WIFI_CreateUdpListener (u16 port)
 Creates a socket in server mode using UDP. More...
 
bool NF_WIFI_UdpSend (const char *data)
 Sends a text string over the currenty open UDP socket. More...
 
s32 NF_WIFI_UdpListen (u32 timeout)
 Listens to data from the currently open socket. More...
 

Variables

struct in_addr NF_IP
 Current IP address.
 
struct in_addr NF_GATEWAY
 Current gateway.
 
struct in_addr NF_MASK
 Current netmask.
 
struct in_addr NF_DNS1
 Current DNS 1.
 
struct in_addr NF_DNS2
 Current DNS 2.
 
s32 NF_SOCKET
 Server socket ID.
 
s32 NF_CONNECTED
 Connection result.
 
int NF_SINSIZE
 Size of struct .SIN.
 
s32 NF_BYTES_RECIEVED
 Received bytes.
 
struct sockaddr_in NF_SA_SERVER
 Server socket address.
 
struct sockaddr_in NF_SA_CLIENT
 Client socket address.
 
char NF_SEND_BUFFER [NF_WIFI_BUFFER_SIZE]
 Send buffer.
 
char NF_RECV_BUFFER [NF_WIFI_BUFFER_SIZE]
 Reception buffer.
 
bool NF_WIFI_IS_SERVER
 This is set to true if this console is in server mode, false in client mode.
 
s32 NF_MAXFD
 Maximum number of sockets to examine by select().
 
fd_set NF_READFDS
 Struct to save data used by select() sockets.
 
struct timeval NF_TIMEOUT
 Current timeout in microseconds.
 

Detailed Description

Basic WiFi helpers.