Building Controls Virtual Test Bed
bcvtb.c File Reference
#include "bcvtb.h"
Include dependency graph for bcvtb.c:

Go to the source code of this file.

Functions

int establishModelicaClient (const char *const docname)
 Establishes a connection to the socket. More...
 
int exchangeModelicaClient (int sockfd, int flaWri, int *flaRea, double simTimWri, double *dblValWri, size_t nDblWri, double *simTimRea, double *dblValRea, size_t nDblRea)
 Exchanges data with the socket. More...
 
int closeModelicaClient (int sockfd)
 Closes the inter process communication socket. More...
 

Function Documentation

int closeModelicaClient ( int  sockfd)

Closes the inter process communication socket.

Parameters
sockfdSocket file descripter.
Returns
The return value of the close function.

Definition at line 24 of file bcvtb.c.

References closeipc(), and sendclientmessage().

int establishModelicaClient ( const char *const  docname)

Establishes a connection to the socket.

This method establishes the client socket.

Parameters
docnameName of xml file that contains the socket information.
Returns
The socket file descripter, or a negative value if an error occured.

Definition at line 3 of file bcvtb.c.

References establishclientsocket().

int exchangeModelicaClient ( int  sockfd,
int  flaWri,
int *  flaRea,
double  simTimWri,
double *  dblValWri,
size_t  nDblWri,
double *  simTimRea,
double *  dblValRea,
size_t  nDblRea 
)

Exchanges data with the socket.

Clients can call this method to exchange data through the socket.

Parameters
sockfdSocket file descripter
flaWriCommunication flag to write to the socket stream.
flaReaCommunication flag read from the socket stream.
simTimWriCurrent simulation time in seconds to write.
dblValWriDouble values to write.
nDblWriNumber of double values to write.
intValWriInteger values to write.
nIntWriNumber of integer values to write.
boolValWriBoolean values to write.
nBooWriNumber of boolean values to write.
simTimReaCurrent simulation time in seconds read from socket.
dblValReaDouble values read from socket.
nDblReaNumber of double values to read.
intValReaInteger values read from socket.
nIntReaNumber of integer values to read.
booValReaBoolean values read from socket.
nBooReaNumber of boolean values to read.
See Also
int establishclientsocket(uint16_t *portNo)
Returns
The exit value of send or read, or a negative value if an error occured.

Definition at line 8 of file bcvtb.c.

References exchangedoubleswithsocket().