Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POD added to ~_Items.pm #105

Merged
merged 2 commits into from
Mar 3, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,840 changes: 1,789 additions & 2,051 deletions docs/faq.pod

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions lib/Acid.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,33 @@ use IO::Socket;
use IO::Select;
package Acid;

=head1 NAME

B<Acid>

=head1 SYNOPSIS

NONE

=head1 DESCRIPTION

Sends callerid to Audrey acid program for dispaly.

This is called from CID_Server, which is called from code/common/callerid.pl

=head1 INHERITS

NONE

=head1 METHODS

=over

=item C<UnDoc>

=cut


my $sel;
my $udp_fh;
my %clientList = ();
Expand Down Expand Up @@ -111,3 +138,28 @@ sub CID_TYPE_ERROR_CALL {return(4);} # Same as of ICallerIDNotify.OnError()
sub CID_TYPE_TEST{return(5);} # same syntax as subscribe (ping request)

1;

=back

=head1 INI PARAMETERS

NONE

=head1 AUTHOR

Andrew Drummond on 01/2003

=head1 SEE ALSO

NONE

=head1 LICENSE

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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

=cut

208 changes: 168 additions & 40 deletions lib/DSC_Alarm.pm
Original file line number Diff line number Diff line change
@@ -1,47 +1,74 @@
##################################################################
# Interface to DSC alarm system via DSC PC5400 Printer Module #
# #
# The PC5400 works with: PC5010, PC1555, PC580, PC5015, and #
# PC1575 main panels. #
# #
# Add these entries to your mh.ini file: #
# #
# DSC_Alarm_serial_port=COM2 #
# DSC_Alarm_baudrate=4800 #
# #
# Multiple instances may be supported by adding instance #
# numbers to the parms as in: #
# #
# DSC_Alarm:1_serial_port=COMx #
# DSC_Alarm:1_baudrate=4800 #
# #
# DSC programming location 801 subsection 01 set to: #
# 1-3---78 #
# 1 = Printer Enabled #
# 2 = Handshake from printer (DTR) #
# 3 = 80 Column Printer (off = 40 Column) #
# 4 = 300 Baud Enabled #
# 5 = 1200 Baud Enabled #
# 6 = 2400 Baud Enabled #
# 7 = 4800 Baud Enabled #
# 8 = Local clock displays 24hr time #
# DSC programming location 801 subsection 02 set to: #
# 01 = English #
# #
# See mh/code/public/Danal/DSC_Alarm.pl for more info/examples #
# #
# By: Danal Estes, N5SVV #
# E-Mail: [email protected] #
# #
# Based on original code by Bill Sobel: #
# [email protected] #
# #
##################################################################

use strict;

package DSC_Alarm;

=head1 NAME

B<DSC_Alarm>

=head1 SYNOPSIS

mh.ini entry of 'DSC_Alarm_serial_port=com2'

$DSC_Alarm = new DSC_Alarm;
if (my $log = said $DSC_Alarm) {
print_log "Alarm system data = $log\n";
}

mh.ini entry of 'DSC_Alarm:2_serial_port=com5'

$DSC_test = new DSC_Alarm('DSC_Alarm:2');
if (my $state = state $DSC_test) {
print_log "Alarm system state change, state = $state\n";
}

=head1 DESCRIPTION

DSC_Alarm module supports the DSC PC5400 serial printer interface. This allows mh to be aware of events that DSC alarm systems log to their event buffers

The PC5400 works with: PC5010, PC1555, PC580, PC5015, and PC1575 main panels.

DSC programming location 801 subsection 01 set to:
1-3---78
1 = Printer Enabled
2 = Handshake from printer (DTR)
3 = 80 Column Printer (off = 40 Column)
4 = 300 Baud Enabled
5 = 1200 Baud Enabled
6 = 2400 Baud Enabled
7 = 4800 Baud Enabled
8 = Local clock displays 24hr time
DSC programming location 801 subsection 02 set to: 01 = English

Logging: The internal support module for DSC_Alarm (DSC_Alarm.pm) maintains a log of all serial data received from the DSC PC5400 interface. This log is placed in /mh.ini parm data_dir/logs/$port_name.YYYY_MM.log; for example, the log entries shown below would be in file '/mh/data/logs/DSC_Alarm.2000_10.log'. This implies a new log will be started each month.

DSC User Codes:
40 = Master code (can arm/disarm, change codes, any keypad function)
41 = Supervisor code (can arm/disarm, change codes)
42 = Supervisor code (can arm/disarm, change codes)
01-32 = User codes (can arm/disarm, can be associated to individual wireless keys)
33 = Duress code (can arm/disarm + sends duress code to master station)
34 = Duress code (can arm/disarm + sends duress code to master station)

The above information derived from PC1555 master panel; please see the installer manual for your particular panel for further information.

Duress code reporting is NOT reflected via states as of December 2000. Coming soon...

Examples of typical DSC alarm system event/log entries:
Mon 10/09/00 17:09:00 DSC_Alarm.pm Initialized Mon 10/09/00 17:10:16 17:10 10/09/00 System [*1] Access by User Mon 10/09/00 17:12:28 17:12 10/09/00 System Partial Closing Mon 10/09/00 17:12:28 17:12 10/09/00 System Bypass Zone 1 Mon 10/09/00 17:12:28 17:12 10/09/00 System Bypass Zone 2 Mon 10/09/00 17:12:28 17:12 10/09/00 System Bypass Zone 4 Mon 10/09/00 17:12:29 17:12 10/09/00 System Closing by User Code 40 Mon 10/09/00 17:12:29 17:12 10/09/00 System Armed in Away Mode Mon 10/09/00 17:12:45 17:12 10/09/00 System Opening by User Code 2 Mon 10/09/00 17:14:42 17:14 10/09/00 System Closing by User Code 40 Mon 10/09/00 17:14:43 17:14 10/09/00 System Armed in Away Mode Mon 10/09/00 17:14:47 17:14 10/09/00 System Opening by User Code 40 Mon 10/09/00 17:22:28 17:22 10/09/00 System [*1] Access by User Mon 10/09/00 17:33:39 DSC_Alarm.pm Initialized Tue 10/10/00 09:47:38 09:47 10/10/00 System Closing by User Code 40 Tue 10/10/00 09:47:38 09:47 10/10/00 System Armed in Away Mode Tue 10/10/00 17:48:42 17:48 10/10/00 System Opening by User Code 40 Tue 10/10/00 23:37:33 23:37 10/10/00 System Closing by User Code 40 Tue 10/10/00 23:37:33 23:37 10/10/00 System Armed in Away Mode Wed 10/11/00 07:38:11 07:38 10/11/00 System Opening by User Code 40


=head1 INHERITS

B<Generic_Item>

=head1 METHODS

=over

=cut


@DSC_Alarm::ISA = ('Generic_Item');

my @DSC_Alarm_Ports;
Expand Down Expand Up @@ -146,6 +173,12 @@ sub check_for_data
# End of system functions; start of functions called by user scripts.
#

=item C<new('alarm-name')>

Where 'alarm-name' is the prefix used in the mh.ini entry 'DSC_Alarm_serial_port=xyz'. The 'alarm-name' argument defaults to 'DSC_Alarm' if not specified.

=cut

sub new {
my ($class, $port_name) = @_;
$port_name = 'DSC_Alarm' if !$port_name;
Expand All @@ -164,11 +197,24 @@ sub new {
return $self;
}

=item C<said>

Returns the last serial data received. Valid for 1 pass only. Important Note: Due to mh internals, the "said" method and the "state" method (and all "state" derived methods) lag each other's values by 1 pass through the user scripts. As such, any given script should use "said" or "state", but should NOT mix the two!

=cut


sub said {
my $port_name = $_[0]->{port_name};
return $main::Serial_Ports{$port_name}{data_record};
}

=item C<user>

User number of last code used to arm/disarm system. If present, mh.ini parm DSC_Alarm_user_nn=xyz will cause "user" to return string "xyz" from the parm.

=cut

sub user {
my $instance = $_[0]->{port_name};
my $user = $_[0]->{user};
Expand All @@ -177,15 +223,37 @@ sub user {
return $name;
}

=item C<alarm_now>

True when system enters Alarm state. Valid for 1 pass only.

=cut

sub alarm_now {
return 'Alarm' eq $_[0]->{state_now};
}

=item C<zone>

Zone number that caused Alarm. Valid only when alarm_now is true.

=cut

sub zone {
return if !alarm_now $_[0];
return $_[0]->{zone};
}

=item C<mode>

Returns arming mode. Valid only when state = Armed.
Stay = System armed in stay mode; User pressed F1 key before arming.
Away = System armed in away mode; User pressed F2 key (or nothing) before arming

Note: Most DSC systems will not arm in "Stay" mode unless at least one zone is defined as a "Stay/Away" zone. Also, even when "Away" mode is requested system will be in "Stay" mode unless a delay zone is violated during the exit delay.

=cut

sub mode {
return if 'Armed' ne $_[0]->{state};
return $_[0]->{mode};
Expand All @@ -194,3 +262,63 @@ sub mode {

1;

=back

=head1 INHERITED METHODS

=over

=item C<state>

Returns last state of alarm system from following values:
Armed = System is closed and armed.
Disarmed = System is opened.
Alarm = System is alarming.

=item C<state_now>

Same as state, but valid for 1 pass only.


=back

=head1 INI PARAMETERS

DSC_Alarm_serial_port=COM1 or /dev/ttys0
DSC_Alarm_baudrate=4800

Multiple instances may be supported by adding instance numbers to the parms as in:

DSC_Alarm:1_serial_port=COMx or /dev/ttysX
DSC_Alarm:1_baudrate=4800
DSC_Alarm:2_serial_port=COMy or /dev/ttysY
DSC_Alarm:2_baudrate=4800

Optional mh.ini entries:

DSC_Alarm_user_40=Jane Doe
DSC_Alarm_user_1=Bob Smith

=head1 AUTHOR

By: Danal Estes, N5SVV
E-Mail: [email protected]

Based on original code by Bill Sobel:
[email protected]

=head1 SEE ALSO

See mh/code/public/Danal/DSC_Alarm.pl for more info/examples

=head1 LICENSE

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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

=cut


2 changes: 2 additions & 0 deletions lib/Generic_Item.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1597,6 +1597,8 @@ sub android_xml_tag {
return $xml_objects;
}

=back

=head1 INI PARAMETERS

=over
Expand Down
2 changes: 1 addition & 1 deletion lib/LCD.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ NONE

=over

=item C<new($type, $port, $size, $menu_group, $keymap)
=item C<new($type, $port, $size, $menu_group, $keymap)>

$type: Either lcdproc or keyboard.
$port: The ip:port of where lcdproc is running.
Expand Down
2 changes: 1 addition & 1 deletion lib/Network_Item.pm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ B<Generic_Item>
use IO::Socket qw(AF_INET SOCK_DGRAM SOL_SOCKET SO_BROADCAST);
use Socket;

=item C<new($address, $interval)
=item C<new($address, $interval)>

$address: Ip address of the box you want to ping
$interval: How often to ping (in seconds)
Expand Down
Loading