Building Controls Virtual Test Bed
bcvtb.c
Go to the documentation of this file.
1 #include "bcvtb.h"
2 
3 int establishModelicaClient(const char *const docname){
4  return establishclientsocket(docname);
5 }
6 
7 
9  int flaWri, int *flaRea,
10  double simTimWri,
11  double* dblValWri, size_t nDblWri,
12  double* simTimRea,
13  double* dblValRea, size_t nDblRea){
14  return exchangedoubleswithsocket(&sockfd,
15  &flaWri, flaRea,
16  &nDblWri,
17  &nDblRea,
18  &simTimWri,
19  dblValWri,
20  simTimRea,
21  dblValRea);
22 }
23 
25  const int flaWri = 1;
26  sendclientmessage(&sockfd, &flaWri);
27  return closeipc(&sockfd);
28 }
function sockfd
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.
int closeModelicaClient(int sockfd)
Closes the inter process communication socket.
Definition: bcvtb.c:24
Methods for interfacing Modelica as a client to the BCVTB using BSD sockets.
int establishclientsocket(const char *const docname)
Establishes a connection to the socket.
int sendclientmessage(const int *sockfd, const int *flaWri)
Writes a message flag to the socket stream.
end Get return values from pointers flaRea
int closeipc(int *sockfd)
Closes the inter process communication socket.
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.
Definition: bcvtb.c:8
int establishModelicaClient(const char *const docname)
Establishes a connection to the socket.
Definition: bcvtb.c:3