Networking Functions - FlagBrew/PKSM-Scripts GitHub Wiki
char* net_ip();
Returns the IP address of your 3DS as a string
- This string SHOULD NOT be freed
int net_udp_recv(char* buffer, int size, int* received);
int net_tcp_recv(char* buffer, int size, int* received);
Receives data (such as pkx, WC, etc.) sent from a client running on another device
char* buffer
: pointer to an existingchar
Array to hold the data being receivedint size
: expected number of bytesint* received
: pointer to an existingint
variable to hold the number of received bytes- returns
0
if data was successfully received (scripts will need to check the validity of the received data themselves)
int net_tcp_send(char* ip, int port, char* buffer, int size);
Sends data to a compatible client on another device
char* ip
: IP address of device to send data toint port
: port on device to send data tochar* buffer
: data to sendint size
: size of data being sent, in bytes- returns
0
if successful
int fetch_web_content(char** out, int* outSize, char* url);
Performs an HTTP GET request
char** out
:*out
is set to a pointer to the downloaded data on success.*out
must be manually freed. Set to NULL on error.int* outSize
:*outSize
is set to the size of the data stored in*out
char* url
: URL from which to download the data- return value: negative for cURL errors, otherwise the HTTP response code
Added after v8.0.3