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