forked from AravisProject/aravis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharvdevice.h
183 lines (149 loc) · 9.35 KB
/
arvdevice.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/* Aravis - Digital camera library
*
* Copyright © 2009-2022 Emmanuel Pacaud
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
* Author: Emmanuel Pacaud <[email protected]>
*/
#ifndef ARV_DEVICE_H
#define ARV_DEVICE_H
#if !defined (ARV_H_INSIDE) && !defined (ARAVIS_COMPILATION)
#error "Only <arv.h> can be included directly."
#endif
#include <arvapi.h>
#include <arvgcenums.h>
#include <arvtypes.h>
#include <arvstream.h>
#include <arvchunkparser.h>
G_BEGIN_DECLS
#define ARV_DEVICE_ERROR arv_device_error_quark()
ARV_API GQuark arv_device_error_quark (void);
/**
* ArvDeviceError:
* @ARV_DEVICE_ERROR_WRONG_FEATURE: Wrong feature type
* @ARV_DEVICE_ERROR_FEATURE_NOT_FOUND: Feature node not found
* @ARV_DEVICE_ERROR_NOT_CONNECTED: Device is not connected
* @ARV_DEVICE_ERROR_PROTOCOL_ERROR: Protocol error
* @ARV_DEVICE_ERROR_TRANSFER_ERROR: Transfer error
* @ARV_DEVICE_ERROR_TIMEOUT: Timeout detected
* @ARV_DEVICE_ERROR_NOT_FOUND: Device not found
* @ARV_DEVICE_ERROR_INVALID_PARAMETER: Invalid construction parameter
* @ARV_DEVICE_ERROR_GENICAM_NOT_FOUND: Missing Genicam data
* @ARV_DEVICE_ERROR_NO_STREAM_CHANNEL: No stream channel found
* @ARV_DEVICE_ERROR_NOT_CONTROLLER: Controller privilege required
* @ARV_DEVICE_ERROR_UNKNOWN: Unknown error
*/
typedef enum {
ARV_DEVICE_ERROR_WRONG_FEATURE,
ARV_DEVICE_ERROR_FEATURE_NOT_FOUND,
ARV_DEVICE_ERROR_NOT_CONNECTED,
ARV_DEVICE_ERROR_PROTOCOL_ERROR,
ARV_DEVICE_ERROR_TRANSFER_ERROR,
ARV_DEVICE_ERROR_TIMEOUT,
ARV_DEVICE_ERROR_NOT_FOUND,
ARV_DEVICE_ERROR_INVALID_PARAMETER,
ARV_DEVICE_ERROR_GENICAM_NOT_FOUND,
ARV_DEVICE_ERROR_NO_STREAM_CHANNEL,
ARV_DEVICE_ERROR_STREAM_ERROR,
ARV_DEVICE_ERROR_NOT_CONTROLLER,
ARV_DEVICE_ERROR_UNKNOWN,
ARV_DEVICE_ERROR_PROTOCOL_ERROR_NOT_IMPLEMENTED,
ARV_DEVICE_ERROR_PROTOCOL_ERROR_INVALID_PARAMETER,
ARV_DEVICE_ERROR_PROTOCOL_ERROR_INVALID_ADDRESS,
ARV_DEVICE_ERROR_PROTOCOL_ERROR_WRITE_PROTECT,
ARV_DEVICE_ERROR_PROTOCOL_ERROR_BAD_ALIGNMENT,
ARV_DEVICE_ERROR_PROTOCOL_ERROR_ACCESS_DENIED,
ARV_DEVICE_ERROR_PROTOCOL_ERROR_BUSY
} ArvDeviceError;
#define ARV_TYPE_DEVICE (arv_device_get_type ())
ARV_API G_DECLARE_DERIVABLE_TYPE (ArvDevice, arv_device, ARV, DEVICE, GObject)
struct _ArvDeviceClass {
GObjectClass parent_class;
ArvStream * (*create_stream) (ArvDevice *device, ArvStreamCallback callback, void *user_data, GDestroyNotify destroy, GError **error);
const char * (*get_genicam_xml) (ArvDevice *device, size_t *size);
ArvGc * (*get_genicam) (ArvDevice *device);
gboolean (*read_memory) (ArvDevice *device, guint64 address, guint32 size, void *buffer, GError **error);
gboolean (*write_memory) (ArvDevice *device, guint64 address, guint32 size, const void *buffer, GError **error);
gboolean (*read_register) (ArvDevice *device, guint64 address, guint32 *value, GError **error);
gboolean (*write_register) (ArvDevice *device, guint64 address, guint32 value, GError **error);
#if ARAVIS_HAS_EVENT
gboolean (*read_event_data) (ArvDevice *device, int event_id, guint64 address, guint32 size,
void *buffer, GError **error);
#endif
/* signals */
void (*control_lost) (ArvDevice *device);
#if ARAVIS_HAS_EVENT
void (*device_event) (ArvDevice *device);
#endif
/* Padding for future expansion */
gpointer padding[10];
};
ARV_API ArvStream * arv_device_create_stream (ArvDevice *device, ArvStreamCallback callback, void *user_data, GError **error);
ARV_API ArvStream * arv_device_create_stream_full (ArvDevice *device, ArvStreamCallback callback, void *user_data, GDestroyNotify destroy, GError **error);
ARV_API gboolean arv_device_start_acquisition (ArvDevice *device, GError **error);
ARV_API gboolean arv_device_stop_acquisition (ArvDevice *device, GError **error);
ARV_API gboolean arv_device_read_memory (ArvDevice *device, guint64 address, guint32 size, void *buffer, GError **error);
ARV_API gboolean arv_device_write_memory (ArvDevice *device, guint64 address, guint32 size, const void *buffer, GError **error);
ARV_API gboolean arv_device_read_register (ArvDevice *device, guint64 address, guint32 *value, GError **error);
ARV_API gboolean arv_device_write_register (ArvDevice *device, guint64 address, guint32 value, GError **error);
#if ARAVIS_HAS_EVENT
ARV_API gboolean arv_device_read_event_data (ArvDevice *device, int event_id,
guint64 address, guint32 size, void *buffer,
GError **error);
#endif
ARV_API const char * arv_device_get_genicam_xml (ArvDevice *device, size_t *size);
ARV_API ArvGc * arv_device_get_genicam (ArvDevice *device);
ARV_API gboolean arv_device_is_feature_available (ArvDevice *device, const char *feature, GError **error);
ARV_API gboolean arv_device_is_feature_implemented (ArvDevice *device, const char *feature, GError **error);
ARV_API ArvGcNode * arv_device_get_feature (ArvDevice *device, const char *feature);
ARV_API ArvGcAccessMode arv_device_get_feature_access_mode (ArvDevice *device, const char *feature);
ARV_API ArvGcRepresentation arv_device_get_feature_representation (ArvDevice *device, const char *feature);
ARV_API ArvChunkParser *arv_device_create_chunk_parser (ArvDevice *device);
ARV_API gboolean arv_device_execute_command (ArvDevice *device, const char *feature, GError **error);
ARV_API void arv_device_get_feature_value (ArvDevice *device, const char *feature, GValue *value, GError **error);
ARV_API void arv_device_set_feature_value (ArvDevice *device, const char *feature, const GValue *value, GError **error);
ARV_API void arv_device_set_boolean_feature_value (ArvDevice *device, const char *feature, gboolean value, GError **error);
ARV_API gboolean arv_device_get_boolean_feature_value (ArvDevice *device, const char *feature, GError **error);
ARV_API void arv_device_get_boolean_feature_value_gi (ArvDevice *device, const char *feature, gboolean *value, GError **error);
ARV_API void arv_device_set_string_feature_value (ArvDevice *device, const char *feature, const char *value, GError **error);
ARV_API const char * arv_device_get_string_feature_value (ArvDevice *device, const char *feature, GError **error);
ARV_API void arv_device_set_integer_feature_value (ArvDevice *device, const char *feature, gint64 value, GError **error);
ARV_API gint64 arv_device_get_integer_feature_value (ArvDevice *device, const char *feature, GError **error);
ARV_API void arv_device_get_integer_feature_bounds (ArvDevice *device, const char *feature, gint64 *min, gint64 *max, GError **error);
ARV_API gint64 arv_device_get_integer_feature_increment(ArvDevice *device, const char *feature, GError **error);
ARV_API void arv_device_set_float_feature_value (ArvDevice *device, const char *feature, double value, GError **error);
ARV_API double arv_device_get_float_feature_value (ArvDevice *device, const char *feature, GError **error);
ARV_API void arv_device_get_float_feature_bounds (ArvDevice *device, const char *feature, double *min, double *max, GError **error);
ARV_API double arv_device_get_float_feature_increment (ArvDevice *device, const char *feature, GError **error);
ARV_API void arv_device_set_register_feature_value (ArvDevice *device, const char *feature, guint64 length,
void* value, GError **error);
ARV_API void * arv_device_dup_register_feature_value (ArvDevice *device, const char *feature, guint64 *length,
GError **error);
ARV_API gint64 * arv_device_dup_available_enumeration_feature_values (ArvDevice *device, const char *feature,
guint *n_values, GError **error);
ARV_API const char ** arv_device_dup_available_enumeration_feature_values_as_strings (ArvDevice *device, const char *feature,
guint *n_values, GError **error);
ARV_API const char ** arv_device_dup_available_enumeration_feature_values_as_display_names (ArvDevice *device, const char *feature,
guint *n_values, GError **error);
ARV_API gboolean arv_device_is_enumeration_entry_available (ArvDevice *device, const char *feature,
const char *entry, GError **error);
ARV_API gboolean arv_device_set_features_from_string (ArvDevice *device, const char *string, GError **error);
ARV_API void arv_device_set_register_cache_policy (ArvDevice *device, ArvRegisterCachePolicy policy);
ARV_API void arv_device_set_range_check_policy (ArvDevice *device, ArvRangeCheckPolicy policy);
ARV_API void arv_device_set_access_check_policy (ArvDevice *device, ArvAccessCheckPolicy policy);
G_END_DECLS
#endif