openTRI 0.1
|
Data Structures | |
struct | triNetConfig |
Connection config. More... | |
Macros | |
#define | TRI_SOCKET_TCP SOCK_STREAM |
Stream socket. | |
#define | TRI_SOCKET_UDP SOCK_DGRAM |
Datagram socket. | |
#define | TRI_LOCAL_IP 0 |
Local IP ie. | |
#define | TRI_REAL_IP 1 |
'Real' IP | |
#define | TRI_MAX_CLIENTS 256 |
Maximum clients that can connect to a server. | |
Typedefs | |
typedef int | triSocket |
A socket. | |
typedef fd_set | triSocketSet |
A socket set (group) | |
Functions | |
triBool | triNetInit () |
Initialise the wifi. | |
triUInt | triNetGetConfigs (triNetConfig *configs, triUInt count) |
Get the connection configs. | |
triBool | triNetSwitchStatus () |
Get the status of the wlan switch. | |
triBool | triNetConnect (triNetConfig *config) |
Connect to an access point. | |
triVoid | triNetDisconnect () |
Disconnect from an access point. | |
triBool | triNetIsConnected () |
Check connected to an access point. | |
triBool | triNetGetLocalIp (char *buffer) |
Get local IP. | |
triChar * | triNetResolveHost (triChar *hostname) |
Resolve a host name to an IP. | |
triSocket | triNetSocketCreate (void) |
Create a socket. | |
triSocket | triNetSocketAccept (triSocket socket) |
Accept a new connection. | |
triBool | triNetSocketBind (triSocket socket, triU16 port) |
Bind a socket to an address/port. | |
triBool | triNetSocketListen (triSocket socket, triUInt maxConnections) |
Listen on a socket for incoming connections. | |
triBool | triNetSocketConnect (triSocket socket, char *ip, triU16 port) |
Connect using a socket. | |
triSInt | triNetSocketSend (triSocket socket, const char *data, triSInt length) |
Send data using a socket. | |
triSInt | triNetSocketReceive (triSocket socket, char *data) |
Receive data using a socket. | |
triVoid | triNetSocketClose (triSocket socket) |
Close a socket. | |
triVoid | triNetSocketSetClear (triSocketSet *set) |
Clear a socket set. | |
triVoid | triNetSocketSetAdd (triSocket socket, triSocketSet *set) |
Add a socket to a socket set. | |
triVoid | triNetSocketSetRemove (triSocket socket, triSocketSet *set) |
Remove a socket from a socket set. | |
triBool | triNetSocketSetIsMember (triSocket socket, triSocketSet *set) |
Check for socket updates within a set. | |
triSInt | triNetSocketSelect (triUInt maxSockets, triSocketSet *set) |
Remove a socket from a socket set. | |
triVoid | triNetGetUrl (triChar *url, triChar *response) |
Save web 'item' (page/file etc) | |
#define TRI_LOCAL_IP 0 |
Local IP ie.
192.168.x.x
triBool triNetInit | ( | ) |
Initialise the wifi.
triUInt triNetGetConfigs | ( | triNetConfig * | configs, |
triUInt | count ) |
Get the connection configs.
configs | - An array of triNetConfig |
count | - Size of the array |
triBool triNetSwitchStatus | ( | ) |
Get the status of the wlan switch.
triBool triNetConnect | ( | triNetConfig * | config | ) |
Connect to an access point.
config | - The connection config to connect to |
triBool triNetIsConnected | ( | ) |
Check connected to an access point.
triBool triNetGetLocalIp | ( | char * | buffer | ) |
Get local IP.
triChar * triNetResolveHost | ( | triChar * | hostname | ) |
Resolve a host name to an IP.
hostname | The host to resolve |
triSocket triNetSocketCreate | ( | void | ) |
Create a socket.
Accept a new connection.
socket | The socket to accept on |
triBool triNetSocketBind | ( | triSocket | socket, |
triU16 | port ) |
Bind a socket to an address/port.
socket | - A valid triSocket |
port | - The port |
triBool triNetSocketListen | ( | triSocket | socket, |
triUInt | maxConnections ) |
Listen on a socket for incoming connections.
socket | - A valid triSocket |
maxConnections | - Number of connections allowed on the incoming queue |
triBool triNetSocketConnect | ( | triSocket | socket, |
char * | ip, | ||
triU16 | port ) |
Connect using a socket.
socket | - A valid triSocket |
triSInt triNetSocketSend | ( | triSocket | socket, |
const char * | data, | ||
triSInt | length ) |
Send data using a socket.
socket | - A valid triSocket |
data | - The data to send |
triSInt triNetSocketReceive | ( | triSocket | socket, |
char * | data ) |
Receive data using a socket.
socket | - A valid triSocket |
data | - The buffer for the received data to go |
triVoid triNetSocketClose | ( | triSocket | socket | ) |
Close a socket.
socket | The socket to close |
triVoid triNetSocketSetClear | ( | triSocketSet * | set | ) |
Clear a socket set.
set | The socket set to clear |
triVoid triNetSocketSetAdd | ( | triSocket | socket, |
triSocketSet * | set ) |
Add a socket to a socket set.
socket | The socket to add |
set | The set to add the socket to |
triVoid triNetSocketSetRemove | ( | triSocket | socket, |
triSocketSet * | set ) |
Remove a socket from a socket set.
socket | The socket to remove |
set | The set to remove the socket from |
triBool triNetSocketSetIsMember | ( | triSocket | socket, |
triSocketSet * | set ) |
Check for socket updates within a set.
socket | The socket to check |
set | The set to check within |
triSInt triNetSocketSelect | ( | triUInt | maxSockets, |
triSocketSet * | set ) |
Remove a socket from a socket set.
socket | The socket to remove |
set | The set to remove the socket from |
triVoid triNetGetUrl | ( | triChar * | url, |
triChar * | response ) |
Save web 'item' (page/file etc)
url | - URL to connect to |
response | - Buffer to save the response to |