LogUtilities 1.5.1
A small compiled library for C logging and configuration utility functions.
Loading...
Searching...
No Matches
Network Configuration functions

Functions for initializing and accessing network connection information.
More...

Data Structures

struct  ConnectionData
 Data structure related to connection IP and port addresses. More...
 

Enumerations

enum  Connection {
  CONN_RENDER_SERVER_CURSOR = 0 , CONN_RENDER_SERVER_TARGET = 1 , CONN_SERVER_CONTROLLER_PARAMETER = 2 , CONN_SERVER_CONTROLLER_COMMAND = 3 ,
  CONN_REWARDER_CONTROLLER_COMMAND = 4 , CONN_SERVER_PLEXON_CURSOR = 5 , CONN_SERVER_CONTROLLER_TARGET = 6 , CONN_CONTROLLER_SERVER_REQUEST = 7 ,
  CONN_RENDER_SERVER_PARAMETER = 8 , CONN_RENDER_SERVER_SOUND = 9 , CONN_CONTROLLER_SERVER_PARAMETER = 10 , CONN_CONTROLLER_SERVER_STATE = 11 ,
  CONN_SERVER_CONTROLLER_CALIBRATION = 12 , CONN_CONTROLLER_SERVER_CALIBRATION = 13
}
 Enumeration of state transitions. More...
 

Functions

uint16_t getPort (const ConnectionData *network, Connection conn)
 Get the port number corresponding to the desired connection.
 
void initConnectionData (ConnectionData *network)
 Initialize a ConnectionData structure.
 

Detailed Description

Functions for initializing and accessing network connection information.

These functions and data structures are included in the LogUtilities library because it's easiest to define the actual IP address and port values using a .yaml configuration file.

Enumeration Type Documentation

◆ Connection

enum Connection

Enumeration of state transitions.

Enumerations are named using the following convention:

CONN_<CLIENT>_<SERVER>_<PORT>

Where the _ delimited names indicate:

  • CLIENT: The device with the "client" socket.
  • SERVER: The device with the "server" socket.
  • PORT: The name indicating which numeric port is used on each device.
Enumerator
CONN_RENDER_SERVER_CURSOR 

Destination port for cursor messages from state server on rendering device.

CONN_RENDER_SERVER_TARGET 

Destination port for target messages from state server on rendering device.

CONN_SERVER_CONTROLLER_PARAMETER 

Destination port for parameter messages on state server device.

CONN_SERVER_CONTROLLER_COMMAND 

Destination port for command messages from controller on state server device.

CONN_REWARDER_CONTROLLER_COMMAND 

Destination port for command messages from controller on reward delivery device.

CONN_SERVER_PLEXON_CURSOR 

Destination port for cursor messages from plexon server on state server device.

CONN_SERVER_CONTROLLER_TARGET 

Destination port for target messages from controller on state server device.

CONN_CONTROLLER_SERVER_REQUEST 

Destination port for request messages from state server on controller device.

CONN_RENDER_SERVER_PARAMETER 

Destination port for parameter messages from state server on rendering device.

CONN_RENDER_SERVER_SOUND 

Destination port for sound messages from state server on rendering device.

CONN_CONTROLLER_SERVER_PARAMETER 

Destination port for parameter messages from state server to controller.

CONN_CONTROLLER_SERVER_STATE 

Destination port for state messages from state server to controller.

CONN_SERVER_CONTROLLER_CALIBRATION 

Destination port for calibration messages to the state server from the controller.

CONN_CONTROLLER_SERVER_CALIBRATION 

Destination port for calibration messages to the controller from the state server.

Function Documentation

◆ getPort()

uint16_t getPort ( const ConnectionData * network,
Connection conn )

Get the port number corresponding to the desired connection.

Parameters
networkPointer to ConnectionData struct with network address and port information.
connEnumerated connection identifier.
Returns
The integer value of the port corresponding with the connection identifier.

◆ initConnectionData()

void initConnectionData ( ConnectionData * network)

Initialize a ConnectionData structure.

Parameters
networkPointer to ConnectionData structure.

< IP address of device running the controller UI.

< IP address of the Plexon host computer.

< IP address of device rendering the task.

< IP address of device issuing rewards on the task.

< IP address of device running the state server.