Fawkes API  Fawkes Development Version
visca.h
1 
2 /***************************************************************************
3  * visca.h - Class for accessing visca cams
4  *
5  * Created: Wed Jun 08 12:06:15 2005 (FireVision)
6  * Copyright 2005-2014 Tim Niemueller [www.niemueller.de]
7  ****************************************************************************/
8 
9 /* This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version. A runtime exception applies to
13  * this software (see LICENSE.GPL_WRE file mentioned below for details).
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
21  */
22 
23 #ifndef _PLUGINS_PANTILT_SONY_VISCA_H_
24 #define _PLUGINS_PANTILT_SONY_VISCA_H_
25 
26 #include <core/exception.h>
27 
28 #ifdef TIMETRACKER_VISCA
29 # warning Visca time tracker enabled
30 # include <utils/timetracker.h>
31 
32 # include <fstream>
33 #endif
34 
35 #include <cstddef>
36 
38 {
39 public:
40  ViscaException(const char *msg);
41  ViscaException(const char *msg, const int _errno);
42 };
43 
45 {
46 public:
48 };
49 
50 class Visca
51 {
52 public:
53  static const unsigned int VISCA_WHITEBLANCE_AUTO;
54  static const unsigned int VISCA_WHITEBALANCE_INDOOR;
55  static const unsigned int VISCA_WHITEBALANCE_OUTDOOR;
56  static const unsigned int VISCA_WHITEBALANCE_ONE_PUSH;
57  static const unsigned int VISCA_WHITEBALANCE_ATW;
58  static const unsigned int VISCA_WHITEBALANCE_MANUAL;
59 
60  static const unsigned int NONBLOCKING_PANTILT;
61  static const unsigned int NONBLOCKING_ZOOM;
62  static const unsigned int NONBLOCKING_NUM;
63 
64  static const unsigned int MAX_PAN_SPEED;
65  static const unsigned int MAX_TILT_SPEED;
66 
67  /// Zoom value: wide
68  static const unsigned int VISCA_ZOOM_VALUE_WIDE = 0x0000;
69  /// Zoom value: 1x
70  static const unsigned int VISCA_ZOOM_VALUE_1X = 0x0E6D;
71  /// Zoom value: 2x
72  static const unsigned int VISCA_ZOOM_VALUE_2X = 0x188E;
73  /// Zoom value: 3x
74  static const unsigned int VISCA_ZOOM_VALUE_3X = 0x2507;
75  /// Zoom value: 4x
76  static const unsigned int VISCA_ZOOM_VALUE_4X = 0x2B82;
77  /// Zoom value: 5x
78  static const unsigned int VISCA_ZOOM_VALUE_5X = 0x3130;
79  /// Zoom value: 6x
80  static const unsigned int VISCA_ZOOM_VALUE_6X = 0x352E;
81  /// Zoom value: 7x
82  static const unsigned int VISCA_ZOOM_VALUE_7X = 0x385D;
83  /// Zoom value: 8x
84  static const unsigned int VISCA_ZOOM_VALUE_8X = 0x3B48;
85  /// Zoom value: 9x
86  static const unsigned int VISCA_ZOOM_VALUE_9X = 0x3E01;
87  /// Zoom value: 10x
88  static const unsigned int VISCA_ZOOM_VALUE_10X = 0x4000;
89  /// Zoom value: 20x
90  static const unsigned int VISCA_ZOOM_VALUE_DIG_20X = 0x5000;
91  /// Zoom value: 30x
92  static const unsigned int VISCA_ZOOM_VALUE_DIG_30X = 0x6000;
93  /// Zoom value: 40x
94  static const unsigned int VISCA_ZOOM_VALUE_DIG_40X = 0x7000;
95 
96  Visca(const char *device_file, unsigned int def_timeout_ms = 10, bool blocking = true);
97  virtual ~Visca();
98 
99  void open();
100  void close();
101 
102  // basic communication
103  void set_address();
104  void clear();
105 
106  // power
107  void set_power(bool powered);
108  bool is_powered();
109 
110  // low level
111  void send();
112  void recv(unsigned int timeout_ms = 0xFFFFFFFF);
113  void recv_ack(unsigned int *socket = NULL);
114  void send_with_reply();
115  void send_nonblocking(unsigned int *socket = NULL);
116  void cancel_command(unsigned int socket);
117  bool data_available();
118  void process();
119 
120  // pan tilt stuff
121  void reset_pan_tilt();
122  /** Query for pan/tilt but do not wait until finished
123  * This will send an inquire to the camera that asks for pan/tilt values but
124  * it does not wait for the data! A later call to getPanTilt will then block and
125  * wait until the results arrive.
126  * Not that you can _not_ run another inquire (get*) method until this call has
127  * finished! You will get VISCA_E_INQRUNNING as error message.
128  */
129  void start_get_pan_tilt();
130  void set_pan_tilt(int pan, int tilt);
131  void get_pan_tilt(int &pan, int &tilt);
132  void set_pan_tilt_limit(int pan_left, int pan_right, int tilt_up, int tilt_down);
133  void reset_pan_tilt_limit();
134  void set_pan_tilt_speed(unsigned char pan_speed, unsigned char tilt_speed);
135  void get_pan_tilt_speed(unsigned char &pan_speed, unsigned char &tilt_speed);
136 
137  bool is_nonblocking_finished(unsigned int item) const;
138 
139  // zoom
140  void reset_zoom();
141  void set_zoom(unsigned int zoom);
142  void get_zoom(unsigned int &zoom);
143  void set_zoom_speed_tele(unsigned int speed);
144  void set_zoom_speed_wide(unsigned int speed);
145  void set_zoom_digital_enabled(bool enabled);
146 
147  // effects, just to play with...
148  void reset_effect();
149  void apply_effect(unsigned char effect);
150  void apply_effect_pastel();
151  void apply_effect_neg_art();
152  void apply_effect_sepia();
153  void apply_effect_bnw();
154  void apply_effect_solarize();
155  void apply_effect_mosaic();
156  void apply_effect_slim();
157  void apply_effect_stretch();
158 
159  unsigned int get_white_balance_mode();
160 
161  bool get_mirror();
162  void set_mirror(bool mirror);
163 
164 private:
165  // possible running inquires
166  static const unsigned int VISCA_RUNINQ_NONE = 0;
167  static const unsigned int VISCA_RUNINQ_PANTILT = 1;
168 
169  // Cameras
170  static const unsigned char VISCA_BUS_0 = 0;
171  static const unsigned char VISCA_BUS_1 = 1;
172  static const unsigned char VISCA_BUS_2 = 2;
173  static const unsigned char VISCA_BUS_3 = 3;
174  static const unsigned char VISCA_BUS_4 = 4;
175  static const unsigned char VISCA_BUS_5 = 5;
176  static const unsigned char VISCA_BUS_6 = 6;
177  static const unsigned char VISCA_BUS_7 = 7;
178  static const unsigned char VISCA_BUS_BROADCAST = 8;
179 
180  // basic formatting
181  static const unsigned char VISCA_COMMAND = 0x01;
182  static const unsigned char VISCA_CANCEL = 0x20;
183  static const unsigned char VISCA_INQUIRY = 0x09;
184  static const unsigned char VISCA_TERMINATOR = 0xFF;
185 
186  // response types
187  static const unsigned char VISCA_RESPONSE_CLEAR = 0x40;
188  static const unsigned char VISCA_RESPONSE_ADDRESS = 0x30;
189  static const unsigned char VISCA_RESPONSE_ACK = 0x40;
190  static const unsigned char VISCA_RESPONSE_COMPLETED = 0x50;
191  static const unsigned char VISCA_RESPONSE_ERROR = 0x60;
192 
193  // errors
194  static const unsigned char VISCA_ERROR_LENGTH = 0x01;
195  static const unsigned char VISCA_ERROR_SYNTAX = 0x02;
196  static const unsigned char VISCA_ERROR_BUFFERFULL = 0x03;
197  static const unsigned char VISCA_ERROR_CANCELLED = 0x04;
198  static const unsigned char VISCA_ERROR_NOSOCKET = 0x05;
199  static const unsigned char VISCA_ERROR_NOTEXECABLE = 0x41;
200 
201  // categories
202  static const unsigned char VISCA_CATEGORY_INTERFACE = 0x00;
203  static const unsigned char VISCA_CATEGORY_CAMERA1 = 0x04;
204  static const unsigned char VISCA_CATEGORY_PAN_TILTER = 0x06;
205  static const unsigned char VISCA_CATEGORY_CAMERA2 = 0x07;
206 
207  static const unsigned char VISCA_POWER = 0x00;
208  static const unsigned char VISCA_POWER_ON = 0x02;
209  static const unsigned char VISCA_POWER_OFF = 0x03;
210  static const unsigned char VISCA_DEVICE_INFO = 0x02;
211  static const unsigned char VISCA_KEYLOCK = 0x17;
212  static const unsigned char VISCA_ID = 0x22;
213  static const unsigned char VISCA_ZOOM = 0x07;
214  static const unsigned char VISCA_ZOOM_STOP = 0x00;
215  static const unsigned char VISCA_ZOOM_TELE = 0x02;
216  static const unsigned char VISCA_ZOOM_WIDE = 0x03;
217  static const unsigned char VISCA_ZOOM_TELE_SPEED = 0x20;
218  static const unsigned char VISCA_ZOOM_WIDE_SPEED = 0x30;
219  static const unsigned char VISCA_ZOOM_VALUE = 0x47;
220  static const unsigned char VISCA_ZOOM_FOCUS_VALUE = 0x47;
221  static const unsigned char VISCA_DZOOM = 0x06;
222  static const unsigned char VISCA_DZOOM_ON = 0x02;
223  static const unsigned char VISCA_DZOOM_OFF = 0x03;
224  static const unsigned char VISCA_FOCUS = 0x08;
225  static const unsigned char VISCA_FOCUS_STOP = 0x00;
226  static const unsigned char VISCA_FOCUS_FAR = 0x02;
227  static const unsigned char VISCA_FOCUS_NEAR = 0x03;
228  static const unsigned char VISCA_FOCUS_FAR_SPEED = 0x20;
229  static const unsigned char VISCA_FOCUS_NEAR_SPEED = 0x30;
230  static const unsigned char VISCA_FOCUS_VALUE = 0x48;
231  static const unsigned char VISCA_FOCUS_AUTO = 0x38;
232  static const unsigned char VISCA_FOCUS_AUTO_MAN = 0x10;
233  static const unsigned char VISCA_FOCUS_ONE_PUSH = 0x18;
234  static const unsigned char VISCA_FOCUS_ONE_PUSH_TRIG = 0x01;
235  static const unsigned char VISCA_FOCUS_ONE_PUSH_INF = 0x02;
236  static const unsigned char VISCA_FOCUS_AUTO_SENSE = 0x58;
237  static const unsigned char VISCA_FOCUS_AUTO_SENSE_HIGH = 0x02;
238  static const unsigned char VISCA_FOCUS_AUTO_SENSE_LOW = 0x03;
239  static const unsigned char VISCA_FOCUS_NEAR_LIMIT = 0x28;
240  static const unsigned char VISCA_WB = 0x35;
241  static const unsigned char VISCA_WB_AUTO = 0x00;
242  static const unsigned char VISCA_WB_INDOOR = 0x01;
243  static const unsigned char VISCA_WB_OUTDOOR = 0x02;
244  static const unsigned char VISCA_WB_ONE_PUSH = 0x03;
245  static const unsigned char VISCA_WB_ATW = 0x04;
246  static const unsigned char VISCA_WB_MANUAL = 0x05;
247  static const unsigned char VISCA_WB_ONE_PUSH_TRIG = 0x05;
248  static const unsigned char VISCA_RGAIN = 0x03;
249  static const unsigned char VISCA_RGAIN_VALUE = 0x43;
250  static const unsigned char VISCA_BGAIN = 0x04;
251  static const unsigned char VISCA_BGAIN_VALUE = 0x44;
252  static const unsigned char VISCA_AUTO_EXP = 0x39;
253  static const unsigned char VISCA_AUTO_EXP_FULL_AUTO = 0x00;
254  static const unsigned char VISCA_AUTO_EXP_MANUAL = 0x03;
255  static const unsigned char VISCA_AUTO_EXP_SHUTTER_PRIORITY = 0x0A;
256  static const unsigned char VISCA_AUTO_EXP_IRIS_PRIORITY = 0x0B;
257  static const unsigned char VISCA_AUTO_EXP_GAIN_PRIORITY = 0x0C;
258  static const unsigned char VISCA_AUTO_EXP_BRIGHT = 0x0D;
259  static const unsigned char VISCA_AUTO_EXP_SHUTTER_AUTO = 0x1A;
260  static const unsigned char VISCA_AUTO_EXP_IRIS_AUTO = 0x1B;
261  static const unsigned char VISCA_AUTO_EXP_GAIN_AUTO = 0x1C;
262  static const unsigned char VISCA_SLOW_SHUTTER = 0x5A;
263  static const unsigned char VISCA_SLOW_SHUTTER_AUTO = 0x02;
264  static const unsigned char VISCA_SLOW_SHUTTER_MANUAL = 0x03;
265  static const unsigned char VISCA_SHUTTER = 0x0A;
266  static const unsigned char VISCA_SHUTTER_VALUE = 0x4A;
267  static const unsigned char VISCA_IRIS = 0x0B;
268  static const unsigned char VISCA_IRIS_VALUE = 0x4B;
269  static const unsigned char VISCA_GAIN = 0x0C;
270  static const unsigned char VISCA_GAIN_VALUE = 0x4C;
271  static const unsigned char VISCA_BRIGHT = 0x0D;
272  static const unsigned char VISCA_BRIGHT_VALUE = 0x4D;
273  static const unsigned char VISCA_EXP_COMP = 0x0E;
274  static const unsigned char VISCA_EXP_COMP_POWER = 0x3E;
275  static const unsigned char VISCA_EXP_COMP_VALUE = 0x4E;
276  static const unsigned char VISCA_BACKLIGHT_COMP = 0x33;
277  static const unsigned char VISCA_APERTURE = 0x02;
278  static const unsigned char VISCA_APERTURE_VALUE = 0x42;
279  static const unsigned char VISCA_ZERO_LUX = 0x01;
280  static const unsigned char VISCA_IR_LED = 0x31;
281  static const unsigned char VISCA_WIDE_MODE = 0x60;
282  static const unsigned char VISCA_WIDE_MODE_OFF = 0x00;
283  static const unsigned char VISCA_WIDE_MODE_CINEMA = 0x01;
284  static const unsigned char VISCA_WIDE_MODE_16_9 = 0x02;
285  static const unsigned char VISCA_MIRROR = 0x61;
286  static const unsigned char VISCA_MIRROR_ON = 0x02;
287  static const unsigned char VISCA_MIRROR_OFF = 0x03;
288  static const unsigned char VISCA_FREEZE = 0x62;
289  static const unsigned char VISCA_PICTURE_EFFECT = 0x63;
290  static const unsigned char VISCA_PICTURE_EFFECT_OFF = 0x00;
291  static const unsigned char VISCA_PICTURE_EFFECT_PASTEL = 0x01;
292  static const unsigned char VISCA_PICTURE_EFFECT_NEGATIVE = 0x02;
293  static const unsigned char VISCA_PICTURE_EFFECT_SEPIA = 0x03;
294  static const unsigned char VISCA_PICTURE_EFFECT_BW = 0x04;
295  static const unsigned char VISCA_PICTURE_EFFECT_SOLARIZE = 0x05;
296  static const unsigned char VISCA_PICTURE_EFFECT_MOSAIC = 0x06;
297  static const unsigned char VISCA_PICTURE_EFFECT_SLIM = 0x07;
298  static const unsigned char VISCA_PICTURE_EFFECT_STRETCH = 0x08;
299  static const unsigned char VISCA_DIGITAL_EFFECT = 0x64;
300  static const unsigned char VISCA_DIGITAL_EFFECT_OFF = 0x00;
301  static const unsigned char VISCA_DIGITAL_EFFECT_STILL = 0x01;
302  static const unsigned char VISCA_DIGITAL_EFFECT_FLASH = 0x02;
303  static const unsigned char VISCA_DIGITAL_EFFECT_LUMI = 0x03;
304  static const unsigned char VISCA_DIGITAL_EFFECT_TRAIL = 0x04;
305  static const unsigned char VISCA_DIGITAL_EFFECT_LEVEL = 0x65;
306  static const unsigned char VISCA_MEMORY = 0x3F;
307  static const unsigned char VISCA_MEMORY_RESET = 0x00;
308  static const unsigned char VISCA_MEMORY_SET = 0x01;
309  static const unsigned char VISCA_MEMORY_RECALL = 0x02;
310  static const unsigned char VISCA_DISPLAY = 0x15;
311  static const unsigned char VISCA_DISPLAY_TOGGLE = 0x10;
312  static const unsigned char VISCA_DATE_TIME_SET = 0x70;
313  static const unsigned char VISCA_DATE_DISPLAY = 0x71;
314  static const unsigned char VISCA_TIME_DISPLAY = 0x72;
315  static const unsigned char VISCA_TITLE_DISPLAY = 0x74;
316  static const unsigned char VISCA_TITLE_DISPLAY_CLEAR = 0x00;
317  static const unsigned char VISCA_TITLE_SET = 0x73;
318  static const unsigned char VISCA_TITLE_SET_PARAMS = 0x00;
319  static const unsigned char VISCA_TITLE_SET_PART1 = 0x01;
320  static const unsigned char VISCA_TITLE_SET_PART2 = 0x02;
321  static const unsigned char VISCA_IRRECEIVE = 0x08;
322  static const unsigned char VISCA_IRRECEIVE_ON = 0x02;
323  static const unsigned char VISCA_IRRECEIVE_OFF = 0x03;
324  static const unsigned char VISCA_IRRECEIVE_ONOFF = 0x10;
325  static const unsigned char VISCA_PT_DRIVE = 0x01;
326  static const unsigned char VISCA_PT_DRIVE_HORIZ_LEFT = 0x01;
327  static const unsigned char VISCA_PT_DRIVE_HORIZ_RIGHT = 0x02;
328  static const unsigned char VISCA_PT_DRIVE_HORIZ_STOP = 0x03;
329  static const unsigned char VISCA_PT_DRIVE_VERT_UP = 0x01;
330  static const unsigned char VISCA_PT_DRIVE_VERT_DOWN = 0x02;
331  static const unsigned char VISCA_PT_DRIVE_VERT_STOP = 0x03;
332  static const unsigned char VISCA_PT_ABSOLUTE_POSITION = 0x02;
333  static const unsigned char VISCA_PT_RELATIVE_POSITION = 0x03;
334  static const unsigned char VISCA_PT_HOME = 0x04;
335  static const unsigned char VISCA_PT_RESET = 0x05;
336  static const unsigned char VISCA_PT_LIMITSET = 0x07;
337  static const unsigned char VISCA_PT_LIMITSET_SET = 0x00;
338  static const unsigned char VISCA_PT_LIMITSET_CLEAR = 0x01;
339  static const unsigned char VISCA_PT_LIMITSET_SET_UR = 0x01;
340  static const unsigned char VISCA_PT_LIMITSET_SET_DL = 0x00;
341  static const unsigned char VISCA_PT_DATASCREEN = 0x06;
342  static const unsigned char VISCA_PT_DATASCREEN_ON = 0x02;
343  static const unsigned char VISCA_PT_DATASCREEN_OFF = 0x03;
344  static const unsigned char VISCA_PT_DATASCREEN_ONOFF = 0x10;
345  static const unsigned char VISCA_PT_VIDEOSYSTEM_INQ = 0x23;
346  static const unsigned char VISCA_PT_MODE_INQ = 0x10;
347  static const unsigned char VISCA_PT_MAXSPEED_INQ = 0x11;
348  static const unsigned char VISCA_PT_POSITION_INQ = 0x12;
349  static const unsigned char VISCA_PT_DATASCREEN_INQ = 0x06;
350  /*****************/
351  /* D30/D31 CODES */
352  /*****************/
353  static const unsigned char VISCA_WIDE_CON_LENS = 0x26;
354  static const unsigned char VISCA_WIDE_CON_LENS_SET = 0x00;
355 
356  static const unsigned char VISCA_AT_MODE = 0x01;
357  static const unsigned char VISCA_AT_ONOFF = 0x10;
358  static const unsigned char VISCA_AT_AE = 0x02;
359  static const unsigned char VISCA_AT_AUTOZOOM = 0x03;
360  static const unsigned char VISCA_ATMD_FRAMEDISPLAY = 0x04;
361  static const unsigned char VISCA_AT_FRAMEOFFSET = 0x05;
362  static const unsigned char VISCA_ATMD_STARTSTOP = 0x06;
363  static const unsigned char VISCA_AT_CHASE = 0x07;
364  static const unsigned char VISCA_AT_CHASE_NEXT = 0x10;
365 
366  static const unsigned char VISCA_MD_MODE = 0x08;
367  static const unsigned char VISCA_MD_ONOFF = 0x10;
368  static const unsigned char VISCA_MD_FRAME = 0x09;
369  static const unsigned char VISCA_MD_DETECT = 0x0A;
370 
371  static const unsigned char VISCA_MD_ADJUST = 0x00;
372  static const unsigned char VISCA_MD_ADJUST_YLEVEL = 0x0B;
373  static const unsigned char VISCA_MD_ADJUST_HUELEVEL = 0x0C;
374  static const unsigned char VISCA_MD_ADJUST_SIZE = 0x0D;
375  static const unsigned char VISCA_MD_ADJUST_DISPTIME = 0x0F;
376  static const unsigned char VISCA_MD_ADJUST_REFTIME = 0x0B;
377  static const unsigned char VISCA_MD_ADJUST_REFMODE = 0x10;
378 
379  static const unsigned char VISCA_AT_ENTRY = 0x15;
380  static const unsigned char VISCA_AT_LOSTINFO = 0x20;
381  static const unsigned char VISCA_MD_LOSTINFO = 0x21;
382  static const unsigned char VISCA_ATMD_LOSTINFO1 = 0x20;
383  static const unsigned char VISCA_ATMD_LOSTINFO2 = 0x07;
384 
385  static const unsigned char VISCA_MD_MEASURE_MODE_1 = 0x27;
386  static const unsigned char VISCA_MD_MEASURE_MODE_2 = 0x28;
387 
388  static const unsigned char VISCA_ATMD_MODE = 0x22;
389  static const unsigned char VISCA_AT_MODE_QUERY = 0x23;
390  static const unsigned char VISCA_MD_MODE_QUERY = 0x24;
391  static const unsigned char VISCA_MD_REFTIME_QUERY = 0x11;
392  static const unsigned char VISCA_AT_POSITION = 0x20;
393  static const unsigned char VISCA_MD_POSITION = 0x21;
394 
395  void recv_packet(unsigned int timeout_ms);
396  void handle_response();
397  void finish_nonblocking(unsigned int socket);
398 
399  char * device_file_;
400  int fd_;
401  bool opened_;
402  unsigned int default_timeout_ms_;
403 
404  unsigned int inquire_;
405 
406  unsigned char recipient_;
407  unsigned char sender_;
408 
409  unsigned char obuffer_[16];
410  unsigned char ibuffer_[1024];
411  int obuffer_length_;
412  int ibuffer_length_;
413 
414  bool blocking_;
415  bool nonblocking_running_[2];
416  unsigned int nonblocking_sockets_[2];
417 
418  unsigned char pan_speed_;
419  unsigned char tilt_speed_;
420 
421 #ifdef TIMETRACKER_VISCA
422  fawkes::TimeTracker *tt_;
423  unsigned int ttc_pantilt_get_send_;
424  unsigned int ttc_pantilt_get_read_;
425  unsigned int ttc_pantilt_get_handle_;
426  unsigned int ttc_pantilt_get_interpret_;
427 #endif
428 };
429 
430 #endif
Visca::get_pan_tilt_speed
void get_pan_tilt_speed(unsigned char &pan_speed, unsigned char &tilt_speed)
Get pan/tilt speed.
Definition: visca.cpp:684
Visca::cancel_command
void cancel_command(unsigned int socket)
Cancel a running command.
Definition: visca.cpp:519
Visca::VISCA_ZOOM_VALUE_DIG_40X
static const unsigned int VISCA_ZOOM_VALUE_DIG_40X
Zoom value: 40x.
Definition: visca.h:94
Visca::apply_effect_pastel
void apply_effect_pastel()
Apply pastel effect.
Definition: visca.cpp:1104
Visca::Visca
Visca(const char *device_file, unsigned int def_timeout_ms=10, bool blocking=true)
Constructor.
Definition: visca.cpp:104
Visca
Visca control protocol implementation over a serial line.
Definition: visca.h:51
Visca::set_address
void set_address()
Set addresses of cameras.
Definition: visca.cpp:221
Visca::VISCA_ZOOM_VALUE_DIG_30X
static const unsigned int VISCA_ZOOM_VALUE_DIG_30X
Zoom value: 30x.
Definition: visca.h:92
Visca::apply_effect_slim
void apply_effect_slim()
Apply slim effect.
Definition: visca.cpp:1176
Visca::send
void send()
Send outbound queue.
Definition: visca.cpp:263
Visca::VISCA_ZOOM_VALUE_3X
static const unsigned int VISCA_ZOOM_VALUE_3X
Zoom value: 3x.
Definition: visca.h:74
Visca::VISCA_WHITEBALANCE_ATW
static const unsigned int VISCA_WHITEBALANCE_ATW
ATW white balance preset.
Definition: visca.h:57
Visca::MAX_TILT_SPEED
static const unsigned int MAX_TILT_SPEED
Number of non-blocking items.
Definition: visca.h:65
Visca::VISCA_WHITEBALANCE_ONE_PUSH
static const unsigned int VISCA_WHITEBALANCE_ONE_PUSH
One push white balance preset.
Definition: visca.h:56
Visca::NONBLOCKING_PANTILT
static const unsigned int NONBLOCKING_PANTILT
Non-blocking pan/tilt item.
Definition: visca.h:60
Visca::apply_effect_solarize
void apply_effect_solarize()
Apply solarize effect.
Definition: visca.cpp:1152
Visca::send_with_reply
void send_with_reply()
Send and wait for reply, blocking.
Definition: visca.cpp:413
Visca::clear
void clear()
Clear command buffers.
Definition: visca.cpp:242
Visca::NONBLOCKING_NUM
static const unsigned int NONBLOCKING_NUM
Number of non-blocking items.
Definition: visca.h:62
ViscaInquiryRunningException
Visca inquire running exception.
Definition: visca.h:45
Visca::VISCA_ZOOM_VALUE_7X
static const unsigned int VISCA_ZOOM_VALUE_7X
Zoom value: 7x.
Definition: visca.h:82
Visca::NONBLOCKING_ZOOM
static const unsigned int NONBLOCKING_ZOOM
Non-blocking zoom item.
Definition: visca.h:61
Visca::VISCA_WHITEBALANCE_MANUAL
static const unsigned int VISCA_WHITEBALANCE_MANUAL
Manual white balance.
Definition: visca.h:58
Visca::set_zoom_speed_wide
void set_zoom_speed_wide(unsigned int speed)
Set zoom speed in wide angle.
Definition: visca.cpp:964
Visca::set_power
void set_power(bool powered)
Set power state.
Definition: visca.cpp:562
Visca::is_powered
bool is_powered()
Check if camera is powered.
Definition: visca.cpp:582
Visca::start_get_pan_tilt
void start_get_pan_tilt()
Query for pan/tilt but do not wait until finished This will send an inquire to the camera that asks f...
Definition: visca.cpp:692
Visca::recv_ack
void recv_ack(unsigned int *socket=NULL)
Receive ACK packet.
Definition: visca.cpp:338
Visca::reset_zoom
void reset_zoom()
Reset zoom.
Definition: visca.cpp:922
Visca::set_zoom_digital_enabled
void set_zoom_digital_enabled(bool enabled)
Enable or disable digital zoome.
Definition: visca.cpp:1050
Visca::VISCA_ZOOM_VALUE_9X
static const unsigned int VISCA_ZOOM_VALUE_9X
Zoom value: 9x.
Definition: visca.h:86
ViscaException
Visca exception.
Definition: visca.h:38
Visca::~Visca
virtual ~Visca()
Destructor.
Definition: visca.cpp:126
Visca::VISCA_WHITEBLANCE_AUTO
static const unsigned int VISCA_WHITEBLANCE_AUTO
Automatic white balance.
Definition: visca.h:53
Visca::set_pan_tilt_speed
void set_pan_tilt_speed(unsigned char pan_speed, unsigned char tilt_speed)
Set pan/tilt speed.
Definition: visca.cpp:666
Visca::apply_effect
void apply_effect(unsigned char effect)
Apply effect.
Definition: visca.cpp:1074
Visca::reset_pan_tilt
void reset_pan_tilt()
Reset pan/tilt.
Definition: visca.cpp:905
Visca::reset_pan_tilt_limit
void reset_pan_tilt_limit()
Reset pan/tilt limit.
Definition: visca.cpp:825
Visca::open
void open()
Open serial port.
Definition: visca.cpp:134
Visca::is_nonblocking_finished
bool is_nonblocking_finished(unsigned int item) const
Check if a non-blocking operation has been finished.
Definition: visca.cpp:403
Visca::reset_effect
void reset_effect()
Reset effects.
Definition: visca.cpp:1092
Visca::VISCA_ZOOM_VALUE_6X
static const unsigned int VISCA_ZOOM_VALUE_6X
Zoom value: 6x.
Definition: visca.h:80
Visca::set_zoom_speed_tele
void set_zoom_speed_tele(unsigned int speed)
Set zoom speed in tele.
Definition: visca.cpp:942
Visca::VISCA_WHITEBALANCE_INDOOR
static const unsigned int VISCA_WHITEBALANCE_INDOOR
Indoor white balance preset.
Definition: visca.h:54
ViscaException::ViscaException
ViscaException(const char *msg)
Constructor.
Definition: visca.cpp:43
Visca::apply_effect_stretch
void apply_effect_stretch()
Apply stretch effect.
Definition: visca.cpp:1188
Visca::apply_effect_sepia
void apply_effect_sepia()
Apply sepia effect.
Definition: visca.cpp:1128
Visca::VISCA_WHITEBALANCE_OUTDOOR
static const unsigned int VISCA_WHITEBALANCE_OUTDOOR
Outdoor white balance preset.
Definition: visca.h:55
Visca::get_pan_tilt
void get_pan_tilt(int &pan, int &tilt)
Get pan and tilt values.
Definition: visca.cpp:720
Visca::VISCA_ZOOM_VALUE_DIG_20X
static const unsigned int VISCA_ZOOM_VALUE_DIG_20X
Zoom value: 20x.
Definition: visca.h:90
Visca::set_zoom
void set_zoom(unsigned int zoom)
Set zoom.
Definition: visca.cpp:986
Visca::VISCA_ZOOM_VALUE_10X
static const unsigned int VISCA_ZOOM_VALUE_10X
Zoom value: 10x.
Definition: visca.h:88
Visca::data_available
bool data_available()
Check data availability.
Definition: visca.cpp:291
Visca::VISCA_ZOOM_VALUE_2X
static const unsigned int VISCA_ZOOM_VALUE_2X
Zoom value: 2x.
Definition: visca.h:72
fawkes::TimeTracker
Time tracking utility.
Definition: tracker.h:37
Visca::get_mirror
bool get_mirror()
Get mirror sate.
Definition: visca.cpp:1260
Visca::VISCA_ZOOM_VALUE_1X
static const unsigned int VISCA_ZOOM_VALUE_1X
Zoom value: 1x.
Definition: visca.h:70
Visca::close
void close()
Close port.
Definition: visca.cpp:211
Visca::VISCA_ZOOM_VALUE_5X
static const unsigned int VISCA_ZOOM_VALUE_5X
Zoom value: 5x.
Definition: visca.h:78
Visca::VISCA_ZOOM_VALUE_4X
static const unsigned int VISCA_ZOOM_VALUE_4X
Zoom value: 4x.
Definition: visca.h:76
Visca::get_zoom
void get_zoom(unsigned int &zoom)
Get zoom.
Definition: visca.cpp:1016
Visca::MAX_PAN_SPEED
static const unsigned int MAX_PAN_SPEED
Number of non-blocking items.
Definition: visca.h:64
Visca::send_nonblocking
void send_nonblocking(unsigned int *socket=NULL)
Send non-blocking.
Definition: visca.cpp:370
Visca::VISCA_ZOOM_VALUE_WIDE
static const unsigned int VISCA_ZOOM_VALUE_WIDE
Zoom value: wide.
Definition: visca.h:68
Visca::set_mirror
void set_mirror(bool mirror)
Sett mirror sate.
Definition: visca.cpp:1240
Visca::apply_effect_neg_art
void apply_effect_neg_art()
Apply negative art effect.
Definition: visca.cpp:1116
Visca::apply_effect_mosaic
void apply_effect_mosaic()
Apply mosaic effect.
Definition: visca.cpp:1164
Visca::recv
void recv(unsigned int timeout_ms=0xFFFFFFFF)
Receive data.
Definition: visca.cpp:302
Visca::get_white_balance_mode
unsigned int get_white_balance_mode()
Get white balance mode.
Definition: visca.cpp:1202
Visca::set_pan_tilt
void set_pan_tilt(int pan, int tilt)
Set pan tilt.
Definition: visca.cpp:610
Visca::apply_effect_bnw
void apply_effect_bnw()
Apply B/W effect.
Definition: visca.cpp:1140
Visca::process
void process()
Process incoming data.
Definition: visca.cpp:543
fawkes::Exception::_errno
int _errno
Error number, should be used if the error was caused by a method that supplies errno.
Definition: exception.h:113
Visca::VISCA_ZOOM_VALUE_8X
static const unsigned int VISCA_ZOOM_VALUE_8X
Zoom value: 8x.
Definition: visca.h:84
ViscaInquiryRunningException::ViscaInquiryRunningException
ViscaInquiryRunningException()
Constructor.
Definition: visca.cpp:60
Visca::set_pan_tilt_limit
void set_pan_tilt_limit(int pan_left, int pan_right, int tilt_up, int tilt_down)
Set pan tilt limit.
Definition: visca.cpp:861
fawkes::Exception
Base class for exceptions in Fawkes.
Definition: exception.h:36