forked from dougpat/zmhacks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FI9831W_arc.pm
758 lines (694 loc) · 22 KB
/
FI9831W_arc.pm
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
# Modified by ARC on March 2015 to clean up user/auth dependencies inside the script
# Changes marked by #ARC
# Also, you can specify your auth credentials in the Control tab of the monitor
# In "ControlDevice" put in
# usr=xxxx&pwd=xxx
# where xxx is the auth credentials to your foscam camera
# ==========================================================================
#
# ZoneMinder FOSCAM version 1.0 API Control Protocol Module, $Date$, $Revision$
# Copyright (C) 2001-2008 Philip Coombes
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# =========================================================================================
#
# This module FI8620_Y2k.pm contains the implementation of API camera control
# For FOSCAM FI8620 Dome PTZ Camera (This cam support only H264 streaming)
# V1.0 Le 09 AOUT 2013 - production usable for the script but not for the camera "reboot itself"
# If you wan't to contact me i understand French and English, precise ZoneMinder in subject
# My name is Christophe DAPREMONT my email is [email protected]
#
# =========================================================================================
#
package ZoneMinder::Control::FI9831W_arc;
use 5.006;
use strict;
use warnings;
require ZoneMinder::Base;
require ZoneMinder::Control;
our @ISA = qw(ZoneMinder::Control);
# ===================================================================================================================================
#
# FI9821 FOSCAM PT H264 Control Protocol
# with Firmware version V1.2.1.1 (latest at 09/08/2013)
# based with the latest buggy CGI doc from FOSCAM ( http://foscam.us/forum/cgi-sdk-for-hd-camera-t6045.html )
# This IPCAM work under ZoneMinder V1.25 from alternative source of code
# from this svn at https://svn.unixmedia.net/public/zum/trunk/zum/
# Many Thanks to "MASTERTHEKNIFE" for the excellent speed optimisation ( http://www.zoneminder.com/forums/viewtopic.php?f=9&t=17652 )
# And to "NEXTIME" for the recent source update and incredible plugins ( http://www.zoneminder.com/forums/viewtopic.php?f=9&t=20587 )
# And all people helping ZoneMinder dev.
#
# -FUNCTION: display on OSD
# speed is progressive in function of where you click on arrow ========>
# speed low=/ \=speed high
# ===================================================================================================================================
use ZoneMinder::Logger qw(:all);
use ZoneMinder::Config qw(:all);
use Time::HiRes qw( usleep );
# Set $osd to "off" if you wan't disabled OSD i need to place this variable in another script because
# this script is reload at every command ,if i want the button on/off (Focus MAN) for OSD works...
my $osd = "on";
sub new
{
my $class = shift;
my $id = shift;
my $self = ZoneMinder::Control->new( $id );
bless( $self, $class );
srand( time() );
return $self;
}
our $AUTOLOAD;
sub AUTOLOAD
{
my $self = shift;
my $class = ref($self) || croak( "$self not object" );
my $name = $AUTOLOAD;
$name =~ s/.*://;
if ( exists($self->{$name}) )
{
return( $self->{$name} );
}
Fatal( "Can't access $name member of object of class $class" );
}
sub open
{
my $self = shift;
$self->loadMonitor();
use LWP::UserAgent;
$self->{ua} = LWP::UserAgent->new;
#ARC
#$self->{ua}->agent( "ZoneMinder Control Agent/".ZoneMinder::Base::ZM_VERSION );
$self->{ua}->agent( "ZoneMinder Control Agent/" );
$self->{state} = 'open';
}
sub close
{
my $self = shift;
$self->{state} = 'closed';
}
sub printMsg
{
my $self = shift;
my $msg = shift;
my $msg_len = length($msg);
Debug( $msg."[".$msg_len."]" );
}
sub sendCmd
{
my $self = shift;
my $cmd = shift;
my $result = undef;
printMsg( $cmd, "Tx" );
my $temps = time();
#ARC
my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/cgi-bin/CGIProxy.fcgi?cmd=".$cmd."&".$self->{Monitor}->{ControlDevice} );
#my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/cgi-bin/CGIProxy.fcgi?usr%3Dadmin%26pwd%3D".$self->{Monitor}->{ControlDevice}."%26cmd%3D".$cmd."%26".$temps );
my $res = $self->{ua}->request($req);
if ( $res->is_success )
{
$result = !undef;
}
else
{
Error( "Error check failed: '".$res->status_line()."'" );
}
return( $result );
}
sub reset
{ my $self = shift;
Debug ( "Reset = setup camera FI9821W" );
# Setup OSD
my $cmd = "setOSDSetting%26isEnableTimeStamp%3D0%26isEnableDevName%3D1%26dispPos%3D0%26isEnabledOSDMask%3D0";
$self->sendCmd( $cmd );
# Setup For Stream=0 Resolution=720p Bandwith=4M FPS=30 KeyFrameInterval/GOP=100 VBR=ON
$cmd = "setVideoStreamParam%26streamType%3D0%26resolution%3D0%26bitRate%3D4194304%26frameRate%3D30%26GOP%3D100%26isVBR%3D1";
$self->sendCmd( $cmd );
# Setup For Infrared AUTO
$cmd = "setInfraLedConfig%26Mode%3D1";
$self->sendCmd( $cmd );
# Reset image settings
$cmd = "resetImageSetting";
$self->sendCmd( $cmd );
}
sub moveStop
{
my $self = shift;
Debug( "Move Stop" );
my $cmd = "ptzStopRun";
$self->sendCmd( $cmd );
$cmd = "setDevName%26devName%3D.";
$self->sendCmd( $cmd );
$cmd = "setOSDSetting%26isEnableDevName%3D1";
$self->sendCmd( $cmd );
}
sub autoStop
{
my $self = shift;
my $autostop = shift;
if( $autostop )
{
Debug( "Auto Stop" );
usleep( $autostop );
my $cmd = "ptzStopRun";
$self->sendCmd( $cmd );
}
}
sub moveConUp
{
my $self = shift;
my $params = shift;
my $tiltspeed = $self->getParam( $params, 'tiltspeed' );
# speed inverter 4-->0 , 3-->1 , 2-->2 , 1-->3 , 0-->4
$tiltspeed = abs($tiltspeed - 4);
# Normalisation en cas de valeur erronée dans la base de données
if ( $tiltspeed > 4 ) {
$tiltspeed = 4;
}
if ( $tiltspeed < 0 ) {
$tiltspeed = 0;
}
Debug( "Move Up" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DMove Up $tiltspeed";
$self->sendCmd( $cmd );
}
my $cmd = "setPTZSpeed%26speed%3D$tiltspeed";
$self->sendCmd( $cmd );
$cmd = "ptzMoveUp";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub moveConDown
{
my $self = shift;
my $params = shift;
my $tiltspeed = $self->getParam( $params, 'tiltspeed' );
# speed inverter 4-->0 , 3-->1 , 2-->2 , 1-->3 , 0-->4
$tiltspeed = abs($tiltspeed - 4);
# Normalization
if ( $tiltspeed > 4 ) {
$tiltspeed = 4;
}
if ( $tiltspeed < 0 ) {
$tiltspeed = 0;
}
Debug( "Move Down" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DMove Down $tiltspeed";
$self->sendCmd( $cmd );
}
my $cmd = "setPTZSpeed%26speed%3D$tiltspeed";
$self->sendCmd( $cmd );
$cmd = "ptzMoveDown";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub moveConLeft
{
my $self = shift;
my $params = shift;
my $panspeed = $self->getParam( $params, 'panspeed' );
# Normalisation en cas de valeur erronée dans la base de données
if ( $panspeed > 4 ) {
$panspeed = 4;
}
if ( $panspeed < 0 ) {
$panspeed = 0;
}
Debug( "Move Left" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DMove Left $panspeed";
$self->sendCmd( $cmd );
}
my $cmd = "setPTZSpeed%26speed%3D$panspeed";
$self->sendCmd( $cmd );
$cmd = "ptzMoveLeft";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub moveConRight
{
my $self = shift;
my $params = shift;
my $panspeed = $self->getParam( $params, 'panspeed' );
# speed inverter 4-->0 , 3-->1 , 2-->2 , 1-->3 , 0-->4
$panspeed = abs($panspeed - 4);
# Normalisation en cas de valeur erronée dans la base de données
if ( $panspeed > 4 ) {
$panspeed = 4;
}
if ( $panspeed < 0 ) {
$panspeed = 0;
}
Debug( "Move Right" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DMove Right $panspeed";
$self->sendCmd( $cmd );
}
my $cmd = "setPTZSpeed%26speed%3D$panspeed";
$self->sendCmd( $cmd );
$cmd = "ptzMoveRight";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub moveConUpLeft
{
my $self = shift;
my $params = shift;
my $tiltspeed = $self->getParam( $params, 'tiltspeed' );
# speed inverter 4-->0 , 3-->1 , 2-->2 , 1-->3 , 0-->4
$tiltspeed = abs($tiltspeed - 4);
# Normalisation en cas de valeur erronée dans la base de données
if ( $tiltspeed > 4 ) {
$tiltspeed = 4;
}
if ( $tiltspeed < 0 ) {
$tiltspeed = 0;
}
Debug( "Move Con Up Left" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DMove Up Left $tiltspeed";
$self->sendCmd( $cmd );
}
my $cmd = "setPTZSpeed%26speed%3D$tiltspeed";
$self->sendCmd( $cmd );
$cmd = "ptzMoveTopLeft";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub moveConUpRight
{
my $self = shift;
my $params = shift;
my $tiltspeed = $self->getParam( $params, 'tiltspeed' );
# speed inverter 4-->0 , 3-->1 , 2-->2 , 1-->3 , 0-->4
$tiltspeed = abs($tiltspeed - 4);
# Normalisation en cas de valeur erronée dans la base de données
if ( $tiltspeed > 4 ) {
$tiltspeed = 4;
}
if ( $tiltspeed < 0 ) {
$tiltspeed = 0;
}
Debug( "Move Con Up Right" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DMove Up Right $tiltspeed";
$self->sendCmd( $cmd );
}
my $cmd = "setPTZSpeed%26speed%3D$tiltspeed";
$self->sendCmd( $cmd );
$cmd = "ptzMoveTopRight";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub moveConDownLeft
{
my $self = shift;
my $params = shift;
my $tiltspeed = $self->getParam( $params, 'tiltspeed' );
# speed inverter 4-->0 , 3-->1 , 2-->2 , 1-->3 , 0-->4
$tiltspeed = abs($tiltspeed - 4);
# Normalisation en cas de valeur erronée dans la base de données
if ( $tiltspeed > 4 ) {
$tiltspeed = 4;
}
if ( $tiltspeed < 0 ) {
$tiltspeed = 0;
}
Debug( "Move Con Down Left" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DMove Down Left $tiltspeed";
$self->sendCmd( $cmd );
}
my $cmd = "setPTZSpeed%26speed%3D$tiltspeed";
$self->sendCmd( $cmd );
$cmd = "ptzMoveBottomLeft";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub moveConDownRight
{
my $self = shift;
my $params = shift;
my $tiltspeed = $self->getParam( $params, 'tiltspeed' );
# speed inverter 4-->0 , 3-->1 , 2-->2 , 1-->3 , 0-->4
$tiltspeed = abs($tiltspeed - 4);
# Normalisation en cas de valeur erronée dans la base de données
if ( $tiltspeed > 4 ) {
$tiltspeed = 4;
}
if ( $tiltspeed < 0 ) {
$tiltspeed = 0;
}
Debug( "Move Con Down Right" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DMove Down Right $tiltspeed";
$self->sendCmd( $cmd );
}
my $cmd = "setPTZSpeed%26speed%3D$tiltspeed";
$self->sendCmd( $cmd );
$cmd = "ptzMoveBottomRight";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub zoomConTele
{
my $self = shift;
Debug( "Zoom-Tele=MANU IR LED ON" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DManual IR LED Switch ON";
$self->sendCmd( $cmd );
}
my $cmd = "setInfraLedConfig%26mode%3D1";
$self->sendCmd( $cmd );
$cmd = "openInfraLed";
$self->sendCmd( $cmd );
}
sub zoomConWide
{
my $self = shift;
Debug( "Zoom-Wide=MANU IR LED OFF" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DManual IR LED Switch OFF";
$self->sendCmd( $cmd );
}
my $cmd = "setInfraLedConfig%26mode%3D1";
$self->sendCmd( $cmd );
$cmd = "closeInfraLed";
$self->sendCmd( $cmd );
}
sub wake
{
my $self = shift;
Debug( "Wake=AUTO IR LED" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DAuto IR LED Mode";
$self->sendCmd( $cmd );
}
my $cmd = "setInfraLedConfig%26mode%3D0";
$self->sendCmd( $cmd );
}
sub focusConNear
{
my $self = shift;
my $params = shift;
my $speed = $self->getParam( $params, 'speed' );
# Normalisation en cas de valeur erronée dans la base de données
if ( $speed > 100 ) {
$speed = 100;
}
if ( $speed < 0 ) {
$speed = 0;
}
Debug( "Focus Near=Sharpness" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DSharpness $speed";
$self->sendCmd( $cmd );
$cmd = "setOSDSetting%26isEnableDevName%3D1";
$self->sendCmd( $cmd );
}
my $cmd = "setSharpness%26sharpness%3D$speed";
$self->sendCmd( $cmd );
# La variable speed ne fonctionne pas en paramètre du focus, alors je l'utilise pour définir la durée de la commande
# le résulat est identique
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub focusConFar
{
my $self = shift;
my $params = shift;
my $speed = $self->getParam( $params, 'speed' );
# Normalisation en cas de valeur erronée dans la base de données
if ( $speed > 100 ) {
$speed = 100;
}
if ( $speed < 0 ) {
$speed = 0;
}
Debug( "Focus Far" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DSharpness $speed";
$self->sendCmd( $cmd );
}
my $cmd = "setSharpness%26sharpness%3D$speed";
$self->sendCmd( $cmd );
# La variable speed ne fonctionne pas en paramètre du focus alors je l'utilise pour définir la durée de la commande
# le résulat est identique
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub focusAuto
{
my $self = shift;
Debug( "Focus Auto=Reset Sharpness" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DReset Sharpness";
$self->sendCmd( $cmd );
}
my $cmd = "setSharpness%26sharpness%3D10";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub focusMan
{
my $self = shift;
Debug( "Focus Manu=Reset Sharpness" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DFOSCAM FI9821W Script V1.0 By Christophe_y2k";
$self->sendCmd( $cmd );
}
}
sub whiteConIn
{
my $self = shift;
my $params = shift;
my $speed = $self->getParam( $params, 'speed' );
# Normalisation en cas de valeur erronée dans la base de données
if ( $speed > 100 ) {
$speed = 100;
}
if ( $speed < 0 ) {
$speed = 0;
}
Debug( "White ConIn=brightness" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DBrightness $speed";
$self->sendCmd( $cmd );
}
my $cmd = "setBrightness%26brightness%3D$speed";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub whiteConOut
{
my $self = shift;
my $params = shift;
my $speed = $self->getParam( $params, 'speed' );
# Normalisation en cas de valeur erronée dans la base de données
if ( $speed > 100 ) {
$speed = 100;
}
if ( $speed < 0 ) {
$speed = 0;
}
Debug( "White ConOut=Contrast" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DContrast $speed";
$self->sendCmd( $cmd );
}
my $cmd = "setContrast%26constrast%3D$speed";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub whiteAuto
{
my $self = shift;
Debug( "White Auto=Brightness Reset" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DBrightness Reset";
$self->sendCmd( $cmd );
}
my $cmd = "setBrightness%26brightness%3D50";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub whiteMan
{
my $self = shift;
Debug( "White Manuel=Contrast Reset" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DContrast Reset";
$self->sendCmd( $cmd );
}
my $cmd = "setContrast%26constrast%3D44";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub irisConOpen
{
my $self = shift;
my $params = shift;
my $speed = $self->getParam( $params, 'speed' );
# Normalisation en cas de valeur erronée dans la base de données
if ( $speed > 100 ) {
$speed = 100;
}
if ( $speed < 0 ) {
$speed = 0;
}
Debug( "Iris ConOpen=Saturation" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DSaturation $speed";
$self->sendCmd( $cmd );
}
my $cmd = "setSaturation%26saturation%3D$speed";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub irisConClose
{
my $self = shift;
my $params = shift;
my $speed = $self->getParam( $params, 'speed' );
# Normalisation en cas de valeur erronée dans la base de données
if ( $speed > 100 ) {
$speed = 100;
}
if ( $speed < 0 ) {
$speed = 0;
}
Debug( "Iris ConClose=Hue" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DHue $speed";
$self->sendCmd( $cmd );
}
my $cmd = "setHue%26hue%3D$speed";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub irisAuto
{
my $self = shift;
Debug( "Iris Auto=Saturation Reset" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DSaturation Reset";
$self->sendCmd( $cmd );
}
my $cmd = "setSaturation%26saturation%3D30";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub irisMan
{
my $self = shift;
Debug( "Iris Manuel=Hue Reset" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DHue Reset";
$self->sendCmd( $cmd );
}
my $cmd = "setHue%26hue%3D6";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub presetSet
{
my $self = shift;
my $params = shift;
my $preset = $self->getParam( $params, 'preset' );
if ( ( $preset >= 1 ) && ( $preset <= 16 ) ) {
Debug( "Clear Preset $preset" );
my $cmd = "ptzDeletePresetPoint%26name%3D$preset";
$self->sendCmd( $cmd );
Debug( "Set Preset $preset" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DSet Preset $preset";
$self->sendCmd( $cmd );
}
$cmd = "ptzAddPresetPoint%26name%3D$preset";
$self->sendCmd( $cmd );
}
}
sub presetGoto
{
my $self = shift;
my $params = shift;
my $preset = $self->getParam( $params, 'preset' );
if ( ( $preset >= 1 ) && ( $preset <= 16 ) ) {
Debug( "Goto Preset $preset" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DGoto Preset $preset";
$self->sendCmd( $cmd );
}
my $cmd = "setPTZSpeed%26speed%3D0";
$self->sendCmd( $cmd );
$cmd = "ptzGotoPresetPoint%26name%3D$preset";
$self->sendCmd( $cmd );
}
}
1;
__END__
# Below is stub documentation for your module. You'd better edit it!
=head1 FI9821W
ZoneMinder::Database - Perl extension for FOSCAM FI9821W
=head1 SYNOPSIS
use ZoneMinder::Database;
blah blah blah
=head1 DESCRIPTION
Stub documentation for ZoneMinder, created by h2xs. It looks like the
author of the extension was negligent enough to leave the stub
unedited.
Blah blah blah.
=head2 EXPORT
None by default.
=head1 SEE ALSO
Mention other useful documentation such as the documentation of
related modules or operating system documentation (such as man pages
in UNIX), or any relevant external documentation such as RFCs or
standards.
If you have a mailing list set up for your module, mention it here.
If you have a web site set up for your module, mention it here.
=head1 AUTHOR
Philip Coombes, E<lt>[email protected]<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2001-2008 Philip Coombes
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.3 or,
at your option, any later version of Perl 5 you may have available.
=cut