Module that handles network and online features.
More...
|
void | Network::init (void) |
| Initialize network system.
|
|
void | Network::term (void) |
| Terminate network system.
|
|
void | Network::initFTP (void) |
| Initialize debug FTP.
|
|
void | Network::termFTP (void) |
| Terminate debug FTP.
|
|
string | Network::getIPAdddress (void) |
| Get console IP address.
|
|
string | Network::getMacAdddress (void) |
| Get console Mac address.
|
|
bool | Network::isWifiEnabled (void) |
| Check if WiFi is available.
|
|
int | Network::getWifiLevel (void) |
| Get WiFi strength level.
|
|
void | Network::downloadFile (string url, string file, string useragent, HTTPMethod method, string postdata) |
| Download a file via HTTP protocol (synchronous).
|
|
void | Network::downloadFileAsync (string url, string file, string useragent, HTTPMethod method, string postdata) |
| Download a file via HTTP protocol (asynchronous).
|
|
string | Network::requestString (string url, string useragent, HTTPMethod method, string postdata) |
| Get an HTTP request result (synchronous).
|
|
void | Network::requestStringAsync (string url, string useragent, HTTPMethod method, string postdata) |
| Get an HTTP request result (asynchronous).
|
|
Module that handles network and online features.
◆ HTTPMethod
HTTP methods.
Enumerator |
---|
GET_METHOD | GET method.
|
POST_METHOD | POST method.
|
HEAD_METHOD | HEAD method.
|
OPTIONS_METHOD | OPTIONS method.
|
PUT_METHOD | PUT method.
|
DELETE_METHOD | DELETE method.
|
TRACE_METHOD | TRACE method.
|
CONNECT_METHOD | CONNECT method.
|
◆ init()
void Network::init |
( |
void |
| ) |
|
Initialize network system.
- Usage example:
Definition luaNetwork.cpp:21
void init(void)
Initialize network system.
◆ term()
void Network::term |
( |
void |
| ) |
|
Terminate network system.
- Usage example:
void term(void)
Terminate network system.
◆ initFTP()
void Network::initFTP |
( |
void |
| ) |
|
Initialize debug FTP.
- Usage example:
void initFTP(void)
Initialize debug FTP.
◆ termFTP()
void Network::termFTP |
( |
void |
| ) |
|
Terminate debug FTP.
- Usage example:
void termFTP(void)
Terminate debug FTP.
◆ getIPAdddress()
string Network::getIPAdddress |
( |
void |
| ) |
|
Get console IP address.
- Usage example:
- Returns
- The IP Address of the console.
◆ getMacAdddress()
string Network::getMacAdddress |
( |
void |
| ) |
|
Get console Mac address.
- Usage example:
- Returns
- The Mac Address of the console.
◆ isWifiEnabled()
bool Network::isWifiEnabled |
( |
void |
| ) |
|
Check if WiFi is available.
- Usage example:
end
bool isWifiEnabled(void)
Check if WiFi is available.
void downloadFile(string url, string file, string useragent, HTTPMethod method, string postdata)
Download a file via HTTP protocol (synchronous).
- Returns
- true if available, false otherwise.
◆ getWifiLevel()
int Network::getWifiLevel |
( |
void |
| ) |
|
Get WiFi strength level.
- Usage example:
int getWifiLevel(void)
Get WiFi strength level.
- Returns
- The WiFi strength level percentage.
◆ downloadFile()
void Network::downloadFile |
( |
string |
url, |
|
|
string |
file, |
|
|
string |
useragent, |
|
|
HTTPMethod |
method, |
|
|
string |
postdata |
|
) |
| |
Download a file via HTTP protocol (synchronous).
- Usage example:
- Parameters
-
url | - The url from where to download the file. |
file | - Filename where to save the downloaded file. |
useragent | - Custom useragent to use (optional). |
method | - Method to use to perform the HTTP request (optional). |
postdata | - POST data to send with the HTTP request (optional). |
- Note
- postdata will work only with method set to POST_METHOD.
-
If not specified, GET_METHOD is used as default.
◆ downloadFileAsync()
void Network::downloadFileAsync |
( |
string |
url, |
|
|
string |
file, |
|
|
string |
useragent, |
|
|
HTTPMethod |
method, |
|
|
string |
postdata |
|
) |
| |
Download a file via HTTP protocol (asynchronous).
- Usage example:
void downloadFileAsync(string url, string file, string useragent, HTTPMethod method, string postdata)
Download a file via HTTP protocol (asynchronous).
- Parameters
-
url | - The url from where to download the file. |
file | - Filename where to save the downloaded file. |
useragent | - Custom useragent to use (optional). |
method | - Method to use to perform the HTTP request (optional). |
postdata | - POST data to send with the HTTP request (optional). |
- Note
- postdata will work only with method set to POST_METHOD.
-
If not specified, GET_METHOD is used as default.
◆ requestString()
string Network::requestString |
( |
string |
url, |
|
|
string |
useragent, |
|
|
HTTPMethod |
method, |
|
|
string |
postdata |
|
) |
| |
Get an HTTP request result (synchronous).
- Usage example:
string requestString(string url, string useragent, HTTPMethod method, string postdata)
Get an HTTP request result (synchronous).
- Parameters
-
url | - The url where to send the HTTP request. |
useragent | - Custom useragent to use (optional). |
method | - Method to use to perform the HTTP request (optional). |
postdata | - POST data to send with the HTTP request (optional). |
- Returns
- The HTTP request result.
- Note
- postdata will work only with method set to POST_METHOD.
-
If not specified, GET_METHOD is used as default.
◆ requestStringAsync()
void Network::requestStringAsync |
( |
string |
url, |
|
|
string |
useragent, |
|
|
HTTPMethod |
method, |
|
|
string |
postdata |
|
) |
| |
Get an HTTP request result (asynchronous).
- Usage example:
void requestStringAsync(string url, string useragent, HTTPMethod method, string postdata)
Get an HTTP request result (asynchronous).
- Parameters
-
url | - The url where to send the HTTP request. |
useragent | - Custom useragent to use (optional). |
method | - Method to use to perform the HTTP request (optional). |
postdata | - POST data to send with the HTTP request (optional). |
- Note
- postdata will work only with method set to POST_METHOD.
-
If not specified, GET_METHOD is used as default.