Building Controls Virtual Test Bed
|
Go to the source code of this file.
Functions | |
int | getsocketportnumber (const char *const docname) |
Gets the port number for the BSD socket communication. More... | |
int | getmainversionnumber () |
Returns the main version number. More... | |
int | establishclientsocket (const char *const docname) |
Establishes a connection to the socket. More... | |
int | sendclientmessage (const int *sockfd, const int *flaWri) |
Writes a message flag to the socket stream. More... | |
int | sendclienterror (const int *sockfd, const int *flaWri) |
Writes an error flag to the socket stream. More... | |
int | exchangedoubleswithsocket (const int *sockfd, const int *flaWri, int *flaRea, const int *nDblWri, int *nDblRea, double *simTimWri, double dblValWri[], double *simTimRea, double dblValRea[]) |
Exchanges data with the socket. More... | |
int | closeipc (int *sockfd) |
Closes the inter process communication socket. More... | |
int closeipc | ( | int * | sockfd | ) |
Closes the inter process communication socket.
sockfd | Socket file descripter. |
sockfd | Socket file descripter. |
close
function. Definition at line 1193 of file util/utilSocket.c.
int establishclientsocket | ( | const char *const | docname | ) |
Establishes a connection to the socket.
This method establishes the client socket.
docname | Name of xml file that contains the socket information. |
This method establishes the client socket.
docname | Name of xml file that contains the socket information. |
Definition at line 468 of file util/utilSocket.c.
int exchangedoubleswithsocket | ( | const int * | sockfd, |
const int * | flaWri, | ||
int * | flaRea, | ||
const int * | nDblWri, | ||
int * | nDblRea, | ||
double * | simTimWri, | ||
double | dblValWri[], | ||
double * | simTimRea, | ||
double | dblValRea[] | ||
) |
Exchanges data with the socket.
Clients can call this method to exchange data through the socket.
sockfd | Socket file descripter |
flaWri | Communication flag to write to the socket stream. |
flaRea | Communication flag read from the socket stream. |
nDblWri | Number of double values to write. |
nDblRea | Number of double values to read. |
simTimWri | Current simulation time in seconds to write. |
dblValWri | Double values to write. |
simTimRea | Current simulation time in seconds read from socket. |
dblValRea | Double values read from socket. |
send
or read
, or a negative value if an error occured. Definition at line 1119 of file util/utilSocket.c.
int getmainversionnumber | ( | ) |
Returns the main version number.
This method returns the version number. A negative return value is used in a dummy dll to check in EnergyPlus whether the BCVTB has been installed.
Returns the main version number.
Returns the main version number of the client.
This method returns the version number of the client. A negative return value is used in a dummy dll to check in EnergyPlus whether the BCVTB has been installed.
Returns the main version number.
Returns the main version number of the client.
This method returns the version number. A negative return value is used in a dummy dll to check in EnergyPlus whether the BCVTB has been installed.
Definition at line 443 of file util/utilSocket.c.
References MAINVERSION.
int getsocketportnumber | ( | const char *const | docname | ) |
Gets the port number for the BSD socket communication.
This method parses the xml file for the socket number.
docname | Name of xml file. |
This method parses the xml file for the socket number.
docname | Name of xml file. |
Definition at line 413 of file util/utilSocket.c.
References BUFFER_LENGTH, f1, fprintf(), getxmlvalue(), i, and retVal.
Referenced by establishclientsocket().
int sendclienterror | ( | const int * | sockfd, |
const int * | flaWri | ||
) |
Writes an error flag to the socket stream.
This method should be used by clients if they experience an error and need to terminate the socket connection.
sendclientmessage
insteadsockfd | Socket file descripter |
flaWri | should be set to a negative value. |
Definition at line 155 of file dummy/utilSocket.h.
References sendclientmessage().
int sendclientmessage | ( | const int * | sockfd, |
const int * | flaWri | ||
) |
Writes a message flag to the socket stream.
This method should be used by clients if they need to send a flag to the BCVTB.
The flag flaWri is defined as follows: +1: simulation reached end time. -1: simulation terminates due to an (unspecified) error. -10: simulation terminates due to error during initialization. -20: simulation terminates due to error during time integration.
sockfd | Socket file descripter |
flaWri | Flag to be sent to the BCVTB |
This method should be used by clients if they need to send a flag to the BCVTB.
The flag flaWri is defined as follows: +1: simulation reached end time. -1: simulation terminates due to an (unspecified) error. -10: simulation terminates due to error during initialization. -20: simulation terminates due to error during time integration.
sendclientmessage
insteadsockfd | Socket file descripter |
flaWri | Flag to be sent to the BCVTB |
Definition at line 785 of file util/utilSocket.c.
References f1, fprintf(), readbufferfromsocket(), REQUIRED_READ_LENGTH, retVal, and writetosocket().
Referenced by closeModelicaClient(), main(), and sendclienterror().