WPILibC++
2019.1.1-beta-2-2-gf54c0f7
|
Functions | |
void | NT_SetNetworkIdentity (NT_Inst inst, const char *name, size_t name_len) |
Set the network identity of this node. More... | |
unsigned int | NT_GetNetworkMode (NT_Inst inst) |
Get the current network mode. More... | |
void | NT_StartServer (NT_Inst inst, const char *persist_filename, const char *listen_address, unsigned int port) |
Starts a server using the specified filename, listening address, and port. More... | |
void | NT_StopServer (NT_Inst inst) |
Stops the server if it is running. More... | |
void | NT_StartClientNone (NT_Inst inst) |
Starts a client. More... | |
void | NT_StartClient (NT_Inst inst, const char *server_name, unsigned int port) |
Starts a client using the specified server and port. More... | |
void | NT_StartClientMulti (NT_Inst inst, size_t count, const char **server_names, const unsigned int *ports) |
Starts a client using the specified (server, port) combinations. More... | |
void | NT_StartClientTeam (NT_Inst inst, unsigned int team, unsigned int port) |
Starts a client using commonly known robot addresses for the specified team. More... | |
void | NT_StopClient (NT_Inst inst) |
Stops the client if it is running. More... | |
void | NT_SetServer (NT_Inst inst, const char *server_name, unsigned int port) |
Sets server address and port for client (without restarting client). More... | |
void | NT_SetServerMulti (NT_Inst inst, size_t count, const char **server_names, const unsigned int *ports) |
Sets server addresses for client (without restarting client). More... | |
void | NT_SetServerTeam (NT_Inst inst, unsigned int team, unsigned int port) |
Sets server addresses and port for client (without restarting client). More... | |
void | NT_StartDSClient (NT_Inst inst, unsigned int port) |
Starts requesting server address from Driver Station. More... | |
void | NT_StopDSClient (NT_Inst inst) |
Stops requesting server address from Driver Station. More... | |
void | NT_SetUpdateRate (NT_Inst inst, double interval) |
Set the periodic update rate. More... | |
void | NT_Flush (NT_Inst inst) |
Flush Entries. More... | |
struct NT_ConnectionInfo * | NT_GetConnections (NT_Inst inst, size_t *count) |
Get information on the currently established network connections. More... | |
NT_Bool | NT_IsConnected (NT_Inst inst) |
Return whether or not the instance is connected to another node. More... | |
void NT_Flush | ( | NT_Inst | inst | ) |
Flush Entries.
Forces an immediate flush of all local entry changes to network. Normally this is done on a regularly scheduled interval (see NT_SetUpdateRate()).
Note: flushes are rate limited to avoid excessive network traffic. If the time between calls is too short, the flush will occur after the minimum time elapses (rather than immediately).
inst | instance handle |
struct NT_ConnectionInfo* NT_GetConnections | ( | NT_Inst | inst, |
size_t * | count | ||
) |
Get information on the currently established network connections.
If operating as a client, this will return either zero or one values.
inst | instance handle |
count | returns the number of elements in the array |
It is the caller's responsibility to free the array. The NT_DisposeConnectionInfoArray function is useful for this purpose.
unsigned int NT_GetNetworkMode | ( | NT_Inst | inst | ) |
Get the current network mode.
inst | instance handle |
NT_Bool NT_IsConnected | ( | NT_Inst | inst | ) |
Return whether or not the instance is connected to another node.
inst | instance handle |
void NT_SetNetworkIdentity | ( | NT_Inst | inst, |
const char * | name, | ||
size_t | name_len | ||
) |
Set the network identity of this node.
This is the name used during the initial connection handshake, and is visible through NT_ConnectionInfo on the remote node.
inst | instance handle |
name | identity to advertise |
name_len | length of name in bytes |
void NT_SetServer | ( | NT_Inst | inst, |
const char * | server_name, | ||
unsigned int | port | ||
) |
Sets server address and port for client (without restarting client).
inst | instance handle |
server_name | server name (UTF-8 string, null terminated) |
port | port to communicate over |
void NT_SetServerMulti | ( | NT_Inst | inst, |
size_t | count, | ||
const char ** | server_names, | ||
const unsigned int * | ports | ||
) |
Sets server addresses for client (without restarting client).
The client will attempt to connect to each server in round robin fashion.
inst | instance handle |
count | length of the server_names and ports arrays |
server_names | array of server names (each a UTF-8 string, null terminated) |
ports | array of ports to communicate over (one for each server) |
void NT_SetServerTeam | ( | NT_Inst | inst, |
unsigned int | team, | ||
unsigned int | port | ||
) |
Sets server addresses and port for client (without restarting client).
Connects using commonly known robot addresses for the specified team.
inst | instance handle |
team | team number |
port | port to communicate over |
void NT_SetUpdateRate | ( | NT_Inst | inst, |
double | interval | ||
) |
Set the periodic update rate.
Sets how frequently updates are sent to other nodes over the network.
inst | instance handle |
interval | update interval in seconds (range 0.01 to 1.0) |
void NT_StartClient | ( | NT_Inst | inst, |
const char * | server_name, | ||
unsigned int | port | ||
) |
Starts a client using the specified server and port.
inst | instance handle |
server_name | server name (UTF-8 string, null terminated) |
port | port to communicate over |
void NT_StartClientMulti | ( | NT_Inst | inst, |
size_t | count, | ||
const char ** | server_names, | ||
const unsigned int * | ports | ||
) |
Starts a client using the specified (server, port) combinations.
The client will attempt to connect to each server in round robin fashion.
inst | instance handle |
count | length of the server_names and ports arrays |
server_names | array of server names (each a UTF-8 string, null terminated) |
ports | array of ports to communicate over (one for each server) |
void NT_StartClientNone | ( | NT_Inst | inst | ) |
Starts a client.
Use NT_SetServer to set the server name and port.
inst | instance handle |
void NT_StartClientTeam | ( | NT_Inst | inst, |
unsigned int | team, | ||
unsigned int | port | ||
) |
Starts a client using commonly known robot addresses for the specified team.
inst | instance handle |
team | team number |
port | port to communicate over |
void NT_StartDSClient | ( | NT_Inst | inst, |
unsigned int | port | ||
) |
Starts requesting server address from Driver Station.
This connects to the Driver Station running on localhost to obtain the server IP address.
inst | instance handle |
port | server port to use in combination with IP from DS |
void NT_StartServer | ( | NT_Inst | inst, |
const char * | persist_filename, | ||
const char * | listen_address, | ||
unsigned int | port | ||
) |
Starts a server using the specified filename, listening address, and port.
inst | instance handle |
persist_filename | the name of the persist file to use (UTF-8 string, null terminated) |
listen_address | the address to listen on, or null to listen on any address. (UTF-8 string, null terminated) |
port | port to communicate over. |
void NT_StopClient | ( | NT_Inst | inst | ) |
Stops the client if it is running.
inst | instance handle |
void NT_StopDSClient | ( | NT_Inst | inst | ) |
Stops requesting server address from Driver Station.
inst | instance handle |
void NT_StopServer | ( | NT_Inst | inst | ) |
Stops the server if it is running.
inst | instance handle |