3
* Photonfocus API data types
5
* These are datatypes that have to be exported to the API.
7
* WARNING: Changes in these data structures may affect
8
* API binary compatibility. If this is the case, the major library
9
* version number must be increased.
12
#ifndef PFTYPES_H_INCLUDED_260872
13
#define PFTYPES_H_INCLUDED_260872
15
#define TOKEN unsigned long
19
#define MAX_CAMERAS 32
21
/** Invalid token value. When returned from pfProperty_ParseName(),
22
* a property of that name was not found. Note that pfDevice_GetRoot()
23
* may return the same value as INVALID_TOKEN, which is normal. */
24
#define INVALID_TOKEN 0
33
PF_ROOT, ///< ROOT NODE TYPE
34
PF_INT, ///< A 32 bit signed integer
35
PF_FLOAT, ///< A 4 byte float, single precision
36
PF_BOOL, ///< A boolean value (1: true, 0: false)
37
PF_MODE, ///< A mode value. Only the values in the choice are valid.
38
PF_REGISTER, ///< A register value (direct register export)
39
PF_STRING, ///< A string value (constant or fixed lengh, 0 terminated)
40
PF_BUFFER, ///< A buffer value. The length is specified in the len field.
42
PF_STRUCT, ///< A struct value containing other properties
43
PF_ARRAY, ///< An array value, containing a struct or property
45
PF_COMMAND, ///< A command
46
PF_EVENT ///< An event node.
52
* These flags are queried via pfProperty_GetFlags().
54
* All other bits are reserved for internal purposes.
58
#define F_PRIVATE 0x02 ///< Property is private
59
#define F_BIG 0x04 ///< Big endian, if Register node
60
#define F_RW 0x00 ///< Readable/Writeable
61
#define F_RO 0x10 ///< Readonly
62
#define F_WO 0x20 ///< Writeonly
63
#define F_INACTIVE 0x40 ///< Property is currently inactive
66
/** Run time information data type.
68
* This contains a value union and a type field
70
* A PFValue is to be initialized as follows:
72
\code v.type = <type>; v.value.<valuefield> = <value> \endcode
74
* For example, see macros #SET_FLOAT, etc.
76
* In case of a string or buffer value, it is important to know that
77
* the data buffer is not owned by the property structure, i.e. the
78
* PFValue only serves as a descriptor and no value copying actually
80
* Therefore, the programmer has to distinguish between two cases
81
* before querying a property via pfDevice_GetProperty()
83
* \li The property is static (fixed length): The caller does not have to
84
* worry about pointer initialization of the PFValue before calling
85
* pfDevice_GetProperty()
86
* \li The property is dynamic (read/write) and the caller *must*
87
* initialize the value buffer.
89
* For a dynamic string, the initialization would look as follows:
100
pfDevice_GetProperty(d, property, &v);
104
* Note that in this example, the (zero terminated) string has a maximum
107
* If there was not enough space reserved for the property buffer,
108
* an error #PFERR_PROPERTY_SIZE_MATCH is returned from pfGetProperty()
110
* Data type checking is performed when setting properties.
116
long i; ///< Union: Integer value
117
float f; ///< Union: Float value
118
void *p; ///< Union: Generic Pointer value
120
PropertyType type; ///< Value Type
121
int len; ///< length of array, if type is a buffer
127
* Initialize float PFValue */
128
#define SET_FLOAT(v, f) v.type = PF_FLOAT; v.value.f = f
132
* Initialize integer PFValue */
133
#define SET_INT(v, i) v.type = PF_INT; v.value.f = i
138
* Initialize string PFValue */
139
#define SET_STRING(v, s, l) v.type = PF_STRING; v.value.p = (void *) s; \
146
* Property callback function for recursive node walker.
147
* See source code for detailed information.
149
* \param t The current node token
151
* \return 1: success, continue walking
155
typedef int (PropCallback)(TOKEN t);
158
* Feedback function pointer definition
160
* See pfSetFeedback() in pfcam.h
163
typedef int (*FeedbackFuncP)(int i);
165
#endif // PFTYPES_H_INCLUDED_260872