Building Controls Virtual Test Bed
matlabSocket.h
Go to the documentation of this file.
1 #ifndef _MATLABSOCKET_H_
24 #define _MATLABSOCKET_H_
25 
26 #include "defines.h"
27 
35 int establishclientsocket(const char *const docname);
36 
45 int sendclienterror(const int *sockfd, const int *flaWri);
46 
62 int exchangedoubleswithsocket(const int *sockfd,
63  const int *flaWri, int *flaRea,
64  const int *nDblWri,
65  int *nDblRea,
66  double *simTimWri,
67  double dblValWri[],
68  double *simTimRea,
69  double dblValRea[]);
70 
76 int closeipc(int* sockfd);
77 
78 #endif /* _MATLABSOCKET_H_ */
79 
80 /*
81 ********************************************************************
82 Copyright Notice
83 ----------------
84 
85 Building Controls Virtual Test Bed (BCVTB) Copyright (c) 2008, The
86 Regents of the University of California, through Lawrence Berkeley
87 National Laboratory (subject to receipt of any required approvals from
88 the U.S. Dept. of Energy). All rights reserved.
89 
90 If you have questions about your rights to use or distribute this
91 software, please contact Berkeley Lab's Technology Transfer Department
92 at TTD@lbl.gov
93 
94 NOTICE. This software was developed under partial funding from the U.S.
95 Department of Energy. As such, the U.S. Government has been granted for
96 itself and others acting on its behalf a paid-up, nonexclusive,
97 irrevocable, worldwide license in the Software to reproduce, prepare
98 derivative works, and perform publicly and display publicly. Beginning
99 five (5) years after the date permission to assert copyright is obtained
100 from the U.S. Department of Energy, and subject to any subsequent five
101 (5) year renewals, the U.S. Government is granted for itself and others
102 acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide
103 license in the Software to reproduce, prepare derivative works,
104 distribute copies to the public, perform publicly and display publicly,
105 and to permit others to do so.
106 
107 
108 Modified BSD License agreement
109 ------------------------------
110 
111 Building Controls Virtual Test Bed (BCVTB) Copyright (c) 2008, The
112 Regents of the University of California, through Lawrence Berkeley
113 National Laboratory (subject to receipt of any required approvals from
114 the U.S. Dept. of Energy). All rights reserved.
115 
116 Redistribution and use in source and binary forms, with or without
117 modification, are permitted provided that the following conditions are met:
118 
119  1. Redistributions of source code must retain the above copyright
120  notice, this list of conditions and the following disclaimer.
121  2. Redistributions in binary form must reproduce the above copyright
122  notice, this list of conditions and the following disclaimer in
123  the documentation and/or other materials provided with the
124  distribution.
125  3. Neither the name of the University of California, Lawrence
126  Berkeley National Laboratory, U.S. Dept. of Energy nor the names
127  of its contributors may be used to endorse or promote products
128  derived from this software without specific prior written permission.
129 
130 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
131 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
132 TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
133 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
134 OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
135 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
136 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
137 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
138 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
139 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
140 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
141 
142 You are under no obligation whatsoever to provide any bug fixes,
143 patches, or upgrades to the features, functionality or performance of
144 the source code ("Enhancements") to anyone; however, if you choose to
145 make your Enhancements available either publicly, or directly to
146 Lawrence Berkeley National Laboratory, without imposing a separate
147 written license agreement for such Enhancements, then you hereby grant
148 the following license: a non-exclusive, royalty-free perpetual license
149 to install, use, modify, prepare derivative works, incorporate into
150 other computer software, distribute, and sublicense such enhancements or
151 derivative works thereof, in binary and source code form.
152 
153 ********************************************************************
154 */
function sockfd
int establishclientsocket(const char *const docname)
Establishes a connection to the socket.
int closeipc(int *sockfd)
Closes the inter process communication socket.
Define statements used by the BCVTB C methods.
end Get return values from pointers flaRea
int sendclienterror(const int *sockfd, const int *flaWri)
Writes an error flag to the socket stream.
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.