KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
access.h
Go to the documentation of this file.
1 /*
2  * KM3NeT CLB v2 Firmware
3  * ----------------------
4  *
5  * Copyright 2013 KM3NeT Collaboration
6  *
7  * All Rights Reserved.
8  *
9  *
10  * File : access.h
11  * Created : 26 feb. 2014
12  * Author : Vincent van Beveren
13  */
14 
15 #ifndef ACCESS_H_
16 #define ACCESS_H_
17 
18 /**
19  * @file
20  *
21  * @ingroup pv
22  *
23  * Access provides 'introspective' access to process variables.
24  *
25  * There are two sets of functions. Functions which just take pointers to buffers, and functions
26  * which accept DataBuffers.
27  *
28  * Access to virtual variables is transparent.
29  */
30 
31 #include "util/databuffer.h"
32 #include "pv/varid.h"
33 
34 /**
35  * Variable to lock or unlock writing of configuration variables.
36  *
37  * When attempting to write a configuration variable and illegal state will be returned.
38  */
39 extern bool xsLockConfig;
40 
41 /**
42  * Returns whether or not the specified variable exists.
43  *
44  * @param varID The variable ID
45  *
46  * @retval true It exists
47  * @retval false Its not known to the embedded software
48  */
49 bool xsVarExists(int varID);
50 
51 /**
52  * Reads variable into target buffer from variable structure.
53  *
54  * @param varID The variable to read
55  * @param target The target buffer to fill
56  * @param size The size of the buffer.
57  * @retval true Success
58  * @retval false Failure, check err module for more information.
59  */
60 bool xsRead(int varID, void * target, int size);
61 
62 /**
63  * Writes variable from target buffer into variable structure.
64  *
65  * @param varID The variable to read
66  * @param target The target buffer to fill
67  * @param size The size of the buffer.
68  * @retval true Success
69  * @retval false Failure, check err module for more information.
70  */
71 bool xsWrite(int varID, void * source, int size);
72 
73 /**
74  * Reads variable into target data buffer from variable structure.
75  *
76  * @param varID The variable to read
77  * @param target The target data buffer to fill
78  *
79  * @retval true Success
80  * @retval false Failure, check err module for more information.
81  */
82 bool xsReadDB(int varID, DataBuffer * target);
83 
84 
85 /**
86  * Writes variable from target data buffer into variable structure.
87  *
88  * @param varID The variable to read
89  * @param target The target data buffer to fill
90  *
91  * @retval true Success
92  * @retval false Failure, check err module for more information.
93  */
94 bool xsWriteDB(int varID, DataBuffer * source);
95 
96 
97 #endif /* ACCESS_H_ */
bool xsWrite(int varID, void *source, int size)
Writes variable from target buffer into variable structure.
Definition: access.c:78
bool xsWriteDB(int varID, DataBuffer *source)
Writes variable from target data buffer into variable structure.
Definition: access.c:218
bool xsVarExists(int varID)
Returns whether or not the specified variable exists.
Definition: access.c:139
Defines a DataBuffer structure.
Definition: databuffer.h:45
bool xsLockConfig
Variable to lock or unlock writing of configuration variables.
DataBuffer reads and writes data into a buffer in the same format as defined in the data Java DataOut...
bool xsReadDB(int varID, DataBuffer *target)
Reads variable into target data buffer from variable structure.
Definition: access.c:149
bool xsRead(int varID, void *target, int size)
Reads variable into target buffer from variable structure.
Definition: access.c:60
Defines the variable ID format.