Time-of-Flight Library(ToF) 3.13.4
 
kea_camera.h
1#ifndef _CHRONOPTICS_TOF_KEA_CAMERA_H_
2#define _CHRONOPTICS_TOF_KEA_CAMERA_H_
3
4#include <chronoptics/tof/camera.h>
5#include <chronoptics/tof/processing_config.h>
6#include <chronoptics/tof/camera_config.h>
7#include <chronoptics/tof/gige_interface.h>
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13/** The main interface to the kea camera
14 */
15typedef struct tof_kea_camera* tof_kea_camera_t;
16
17/** Destruct tof_kea_camera */
18TOF_EXPORT void tof_kea_camera_delete(tof_kea_camera_t ptr);
19
20/** Construct the kea camera
21 * @param ptr Pointer to class
22 * @param processing_config The processing config
23 * @param serial The serial number of the camera to connect to, if the camera is
24 * available over both usb and gige it will be connected over usb. If an empty
25 * string is supplied the camera will connect to the first usb camera, if no usb
26 * camera is connected it will connect to the first gige camera that replies
27 * (this reply time is random, so you might connect to a different camera each
28 * time if you've got multiple cameras connected to your network). If no camera
29 * is found with the given serial number a nullptr and error is returned.
30 * @param error Pointer to error
31 * @return New object
32 */
33TOF_EXPORT tof_kea_camera_t tof_kea_camera_new(const tof_processing_config_t processing_config, const char* serial, tof_error_t *error);
34
35/** Construct the kea camera with a processing config generated by
36 * default_processing from the camera config
37 * @param ptr Pointer to class
38 * @param serial The serial number of the camera to connect to, if the camera is
39 * available over both usb and gige it will be connected over usb. If an empty
40 * string is supplied the camera will connect to the first usb camera, if no usb
41 * camera is connected it will connect to the first gige camera that replies
42 * (this reply time is random, so you might connect to a different camera each
43 * time if you've got multiple cameras connected to your network). If no camera
44 * is found with the given serial number a nullptr and error is returned.
45 * @param error Pointer to error
46 * @return New object
47 */
48TOF_EXPORT tof_kea_camera_t tof_kea_camera_new_simple(const char* serial, tof_error_t *error);
49
50/** Construct the kea camera with the given processing and camera config.
51 * @param ptr Pointer to class
52 * @param processing_config The processing config
53 * @param serial The serial number of the camera to connect to, if the camera is
54 * available over both usb and gige it will be connected over usb. If an empty
55 * string is supplied the camera will connect to the first usb camera, if no usb
56 * camera is connected it will connect to the first gige camera that replies
57 * (this reply time is random, so you might connect to a different camera each
58 * time if you've got multiple cameras connected to your network). If no camera
59 * is found with the given serial number a nullptr and error is returned.
60 * @param camera_config The camera config
61 * @param error Pointer to error
62 * @return New object
63 */
64TOF_EXPORT tof_kea_camera_t tof_kea_camera_new_both_configs(const tof_processing_config_t processing_config, const char* serial, const tof_camera_config_t camera_config, tof_error_t *error);
65
66/** Check whether this kea camera can do on camera processing
67 * @param ptr Pointer to class
68 * @param error Pointer to error
69 * @return On camera processing capable
70 */
71TOF_EXPORT bool tof_kea_camera_on_camera_processing_capable(const tof_kea_camera_t ptr, tof_error_t *error);
72
73/** Get on camera processing
74 * @param ptr Pointer to class
75 * @param error Pointer to error
76 * @return True on camera processing, false on host processing
77 */
78TOF_EXPORT bool tof_kea_camera_get_on_camera_processing(const tof_kea_camera_t ptr, tof_error_t *error);
79
80/** Set on camera processing
81 * @param ptr Pointer to class
82 * @param on_camera_processing True on camera processing, false on host
83 * processing
84 * @param error Pointer to error
85 */
86TOF_EXPORT void tof_kea_camera_set_on_camera_processing(tof_kea_camera_t ptr, bool on_camera_processing, tof_error_t *error);
87
88/** Get delay between network packets
89 * @param ptr Pointer to class
90 * @param error Pointer to error
91 * @return The delay, depending on the camera software it is in nanoseconds or
92 * in cpu instruction
93 */
94TOF_EXPORT uint32_t tof_kea_camera_get_delay(const tof_kea_camera_t ptr, tof_error_t *error);
95
96/** Set delay between network packets
97 * @param ptr Pointer to class
98 * @param delay The delay, depending on the camera software it is in nanoseconds
99 * or in cpu instruction
100 * @param error Pointer to error
101 */
102TOF_EXPORT void tof_kea_camera_set_delay(tof_kea_camera_t ptr, uint32_t delay, tof_error_t *error);
103
104/** Get maximum size of each network packet transmitted
105 * @param ptr Pointer to class
106 * @param error Pointer to error
107 * @return Packet size in bytes
108 */
109TOF_EXPORT uint16_t tof_kea_camera_get_packet_size(const tof_kea_camera_t ptr, tof_error_t *error);
110
111/** Set maximum size of each network packet transmitted
112 * @param ptr Pointer to class
113 * @param size Packet size in bytes
114 * @param error Pointer to error
115 */
116TOF_EXPORT void tof_kea_camera_set_packet_size(tof_kea_camera_t ptr, uint16_t size, tof_error_t *error);
117
118/** Set the camera config
119 * @param ptr Pointer to class
120 * @param camera_config Camera config
121 * @param error Pointer to error
122 */
123TOF_EXPORT void tof_kea_camera_set_camera_config(tof_kea_camera_t ptr, const tof_camera_config_t camera_config, tof_error_t *error);
124
125/** Set both the camera and processing config
126 * @param ptr Pointer to class
127 * @param camera_config Camera config
128 * @param processing_config Processing config
129 * @param error Pointer to error
130 */
131TOF_EXPORT void tof_kea_camera_set_configurations(tof_kea_camera_t ptr, const tof_camera_config_t camera_config, const tof_processing_config_t processing_config, tof_error_t *error);
132
133/** Get the tof library version running on the camera
134 * @param ptr Pointer to class
135 * @param error Pointer to error
136 * @return Version
137 */
138TOF_EXPORT const char* tof_kea_camera_version(tof_kea_camera_t ptr, tof_error_t *error);
139
140/** Check whether the camera is capable of software trigger
141 * @param ptr Pointer to class
142 * @param error Pointer to error
143 * @return Software trigger capable
144 */
145TOF_EXPORT bool tof_kea_camera_software_trigger_capable(tof_kea_camera_t ptr, tof_error_t *error);
146
147/** Software trigger the camera
148 * @param ptr Pointer to class
149 * @param error Pointer to error
150 */
151TOF_EXPORT void tof_kea_camera_software_trigger(tof_kea_camera_t ptr, tof_error_t *error);
152
153/** Check whether the camera is capable of updating remotely
154 * @param ptr Pointer to class
155 * @param error Pointer to error
156 * @return Remote update capable
157 */
158TOF_EXPORT bool tof_kea_camera_remote_update_capable(tof_kea_camera_t ptr, tof_error_t *error);
159
160/** Update the camera remotely. After uploading the update file the function
161 * will return. If a correct update file was uploaded, the camera will flash the
162 * update and reboot. This generally takes about a minute. The camera can also
163 * be updated via a web interface by visiting the ip address of the camera on
164 * port 8080, for example http://192.168.1.208:8080
165 * @param ptr Pointer to class
166 * @param file_location Location of the update file
167 * @param error Pointer to error
168 */
169TOF_EXPORT void tof_kea_camera_remote_update(tof_kea_camera_t ptr, const char* file_location, tof_error_t *error);
170
171/** Check whether camera supports multiple configurations
172 * @param ptr Pointer to class
173 * @param error Pointer to error
174 * @return Multiple configurations possible
175 */
176TOF_EXPORT bool tof_kea_camera_multiple_configurations_possible(const tof_kea_camera_t ptr, tof_error_t *error);
177
178/** Set multiple configurations
179 * @param ptr Pointer to class
180 * @param camera_configs Camera configurations
181 * @param camera_configs_size The size of the above array
182 * @param pro_configs Processing configurations
183 * @param pro_configs_size The size of the above array
184 * @param error Pointer to error
185 */
186TOF_EXPORT void tof_kea_camera_set_multiple_configurations(tof_kea_camera_t ptr, const tof_camera_config_t* camera_configs, size_t camera_configs_size, const tof_processing_config_t* pro_configs, size_t pro_configs_size, tof_error_t *error);
187
188/** Whether the camera is capable of returning temperatures
189 * @param ptr Pointer to class
190 * @param error Pointer to error
191 * @return Capable
192 */
193TOF_EXPORT bool tof_kea_camera_get_temperatures_capable(tof_kea_camera_t ptr, tof_error_t *error);
194
195/** Get the current on camera temperatures
196 * @param ptr Pointer to class
197 * @param temperatures Temperatures
198 * @param capacity The amount of data the above pointer can hold
199 * @param error Pointer to error
200 * @return Number of pointers filled or complete array size
201 */
202TOF_EXPORT size_t tof_kea_camera_get_temperatures(tof_kea_camera_t ptr, float* temperatures, size_t capacity, tof_error_t *error);
203
204/** Whether the camera is persistent ip capable
205 * @param ptr Pointer to class
206 * @param error Pointer to error
207 * @return Persistent IP capable
208 */
209TOF_EXPORT bool tof_kea_camera_persistent_ip_capable(const tof_kea_camera_t ptr, tof_error_t *error);
210
211/** Get the current persistent ip settings
212 * @param ptr Pointer to class
213 * @param error Pointer to error
214 * @return Persistent IP
215 */
216TOF_EXPORT tof_persistent_ip_t tof_kea_camera_get_persistent_ip(const tof_kea_camera_t ptr, tof_error_t *error);
217
218/** Set the persistent ip settings. To activate persistent ip settings run
219 * apply_persistent_ip.
220 * @param ptr Pointer to class
221 * @param persistent_ip The persistent ip
222 * @param error Pointer to error
223 */
224TOF_EXPORT void tof_kea_camera_set_persistent_ip(tof_kea_camera_t ptr, const tof_persistent_ip_t persistent_ip, tof_error_t *error);
225
226/** Whether the camera is capable of applying the persistent ip
227 * @param ptr Pointer to class
228 * @param error Pointer to error
229 * @return Capable
230 */
231TOF_EXPORT bool tof_kea_camera_apply_persistent_ip_capable(const tof_kea_camera_t ptr, tof_error_t *error);
232
233/** Apply persistent ip by rebooting the camera, power cycling the camera is
234 * discouraged because the applied ip settings might not stick.
235 * @param ptr Pointer to class
236 * @param error Pointer to error
237 */
238TOF_EXPORT void tof_kea_camera_apply_persistent_ip(tof_kea_camera_t ptr, tof_error_t *error);
239
240/** Simple class containing information about found kea cameras
241 */
242typedef struct tof_discovered_kea* tof_discovered_kea_t;
243
244/** Destruct tof_discovered_kea */
245TOF_EXPORT void tof_discovered_kea_delete(tof_discovered_kea_t ptr);
246
247/** The serial
248 * @param ptr Pointer to class
249 * @param error Pointer to error
250 * @return Serial
251 */
252TOF_EXPORT const char* tof_discovered_kea_serial(const tof_discovered_kea_t ptr, tof_error_t *error);
253
254/** Additional information about the discovered camera
255 * @param ptr Pointer to class
256 * @param error Pointer to error
257 * @return Additional information
258 */
259TOF_EXPORT const char* tof_discovered_kea_info(const tof_discovered_kea_t ptr, tof_error_t *error);
260
261/** Get the camera model name
262 * @param ptr Pointer to class
263 * @param error Pointer to error
264 * @return Camera model
265 */
266TOF_EXPORT const char* tof_discovered_kea_model(const tof_discovered_kea_t ptr, tof_error_t *error);
267
268/** Check whether this camera is a TUI camera
269 * @param ptr Pointer to class
270 * @param error Pointer to error
271 * @return Is tui
272 */
273TOF_EXPORT bool tof_discovered_kea_is_tui(const tof_discovered_kea_t ptr, tof_error_t *error);
274
275/** Discover all available kea cameras
276 * @param available_kea_cameras All available kea cameras
277 * @param capacity The amount of data the above pointer can hold
278 * @param error Pointer to error
279 * @return Number of pointers filled or complete array size
280 */
281TOF_EXPORT size_t tof_discover_kea_cameras(tof_discovered_kea_t* available_kea_cameras, size_t capacity, tof_error_t *error);
282
283/** Construct a kea camera using the gige interface. This could be useful in two
284 * cases. The first is when the camera is connected with both usb and ethernet
285 * but you want to use ethernet. The second is when for some reason the default
286 * maximum packet size is too large.
287 * @param processing_config The processing config
288 * @param serial The serial number of the camera to connect to, if the camera is
289 * available over both usb and gige it will be connected over usb. If an empty
290 * string is supplied the camera will connect to the first usb camera, if no usb
291 * camera is connected it will connect to the first gige camera that replies
292 * (this reply time is random, so you might connect to a different camera each
293 * time if you've got multiple cameras connected to your network). If no camera
294 * is found with the given serial number a nullptr and error is returned.
295 * @param packet_size The packet size to use for communication over ethernet
296 * @param error Pointer to error
297 * @return A kea camera
298 */
299TOF_EXPORT tof_kea_camera_t tof_create_kea_camera_gige(const tof_processing_config_t processing_config, const char* serial, uint16_t packet_size, tof_error_t *error);
300
301#ifdef __cplusplus
302}
303#endif
304
305#endif