My Project
programmer's documentation
Enumerations | Functions
cs_control.h File Reference
#include "cs_defs.h"
#include "cs_time_step.h"
Include dependency graph for cs_control.h:

Go to the source code of this file.

Enumerations

enum  cs_control_comm_type_t { CS_CONTROL_COMM_TYPE_SOCKET, CS_CONTROL_COMM_TYPE_NULL }
 

Functions

void cs_control_finalize (void)
 Finalize controller structures. More...
 
void cs_control_check_file (void)
 Check the presence of a control file and deal with the interactive control. More...
 
void cs_control_comm_initialize (const char *port_name, const char *key, cs_control_comm_type_t type)
 Establish a connection to a client. More...
 
void cs_control_comm_finalize (void)
 Finalize a connection to a client. More...
 
void cs_control_comm_write (const void *rec, size_t size, size_t count)
 Write a record to a client. More...
 
void cs_control_comm_read (void *rec, size_t size, size_t count)
 Read a record from a client. More...
 
size_t cs_control_comm_read_to_queue (void)
 Read data from a client into a command queue. More...
 

Enumeration Type Documentation

◆ cs_control_comm_type_t

Enumerator
CS_CONTROL_COMM_TYPE_SOCKET 
CS_CONTROL_COMM_TYPE_NULL 

Function Documentation

◆ cs_control_check_file()

void cs_control_check_file ( void  )

Check the presence of a control file and deal with the interactive control.

◆ cs_control_comm_finalize()

void cs_control_comm_finalize ( void  )

Finalize a connection to a client.

◆ cs_control_comm_initialize()

void cs_control_comm_initialize ( const char *  port_name,
const char *  key,
cs_control_comm_type_t  type 
)

Establish a connection to a client.

Parameters
[in]port_namename of server port (host:port for IP sockets)
[in]keykey for authentification
[in]typecommunication type

◆ cs_control_comm_read()

void cs_control_comm_read ( void *  rec,
size_t  size,
size_t  count 
)

Read a record from a client.

Parameters
[out]recpointer to data to read
[in]sizesize of each data element, in bytes
[in]countnumber of data elements

◆ cs_control_comm_read_to_queue()

size_t cs_control_comm_read_to_queue ( void  )

Read data from a client into a command queue.

The function updates a pointer (view) to the data.

Returns
number of useable elements read (i.e. elements before the last separator)

◆ cs_control_comm_write()

void cs_control_comm_write ( const void *  rec,
size_t  size,
size_t  count 
)

Write a record to a client.

Parameters
[in]recpointer to data to write
[in]sizesize of each data element, in bytes
[in]countnumber of data elements

◆ cs_control_finalize()

void cs_control_finalize ( void  )

Finalize controller structures.