Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: beanz/device-onkyo-perl
base: f9446d1482
...
head fork: beanz/device-onkyo-perl
compare: 3c33a562d9
  • 4 commits
  • 9 files changed
  • 0 commit comments
  • 1 contributor
View
3  Changes
@@ -1,4 +1,7 @@
Revision history for Perl extension Device::Onkyo.
+1.120810 2012-03-21 21:19:52 Europe/London
+ - Make discovery more flexible and fix test portability on FreeBSD.
+
1.120800 2012-03-20 20:58:38 Europe/London
- Initial release.
View
2  META.json
@@ -54,6 +54,6 @@
"web" : "https://github.com/beanz/device-onkyo-perl"
}
},
- "version" : "1.120800"
+ "version" : "1.120810"
}
View
2  META.yml
@@ -31,4 +31,4 @@ requires:
resources:
bugtracker: https://github.com/beanz/device-onkyo-perl/issues
repository: git://github.com/beanz/device-onkyo-perl.git
-version: 1.120800
+version: 1.120810
View
2  Makefile.PL
@@ -39,7 +39,7 @@ my %WriteMakefileArgs = (
'Time::HiRes' => '0',
'constant' => '0'
},
- 'VERSION' => '1.120800',
+ 'VERSION' => '1.120810',
'test' => {
'TESTS' => 't/*.t'
}
View
8 README
@@ -2,7 +2,7 @@ NAME
Device::Onkyo - Perl module to control Onkyo/Integra AV equipment
VERSION
- version 1.120800
+ version 1.120810
SYNOPSIS
my $onkyo = Device::Onkyo->new(device => 'discover');
@@ -51,11 +51,15 @@ METHODS
The port for a TCP device. The default is 60128.
broadcast_source_ip
- The source ip address that the discovery process uses for its
+ The source IP address that the discovery process uses for its
broadcast. The default, '0.0.0.0', should work in most cases but
multi-homed hosts might need to specify the correct local interface
address.
+ broadcast_dest_ip
+ The IP address that the discovery process uses for its broadcast.
+ The default, '255.255.255.255', should work in most cases.
+
"device()"
Returns the device used to connect to the equipment. If a filehandle was
provided this method will return undef.
View
5 bin/onkyo
@@ -16,6 +16,8 @@ my $man;
my $help;
my $device = $ENV{DEVICE_ONKYO} || 'discover';
my $broadcast_source_ip = $ENV{DEVICE_ONKYO_BROADCAST_SOURCE_IP} || '0.0.0.0';
+my $broadcast_dest_ip =
+ $ENV{DEVICE_ONKYO_BROADCAST_DEST_IP} || '255.255.255.255';
GetOptions('device=s' => \$device,
'broadcast_source_ip' => \$broadcast_source_ip,
'help|?' => \$help, man => \$man) or pod2usage(2);
@@ -23,6 +25,7 @@ pod2usage(1) if $help;
pod2usage(-exitstatus => 0, -verbose => 2) if $man;
my $onkyo = Device::Onkyo->new(device => $device,
+ broadcast_dest_ip => $broadcast_dest_ip);
broadcast_source_ip => $broadcast_source_ip);
if (@ARGV) {
$onkyo->command(join ' ', @ARGV);
@@ -54,7 +57,7 @@ onkyo - Perl script to control an Onkyo/Integra AV Receiver
=head1 VERSION
-version 1.120800
+version 1.120810
=head1 SYNOPSIS
View
10 debian/changelog
@@ -1,6 +1,12 @@
-libdevice-onkyo-perl (0.1-1) unstable; urgency=low
+libdevice-onkyo-perl (1.120810-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Mark Hindess <soft-debian@temporalanomaly.com> Wed, 21 Mar 2012 21:15:28 +0000
+
+libdevice-onkyo-perl (1.120800-1) unstable; urgency=low
* Initial release.
- -- Mark Hindess <soft-debian@temporalanomaly.com> Tue, 20 Mar 2012 21:00:00 +0000
+ -- Mark Hindess <soft-debian@temporalanomaly.com> Tue, 20 Mar 2012 20:58:38 +0000
View
14 lib/Device/Onkyo.pm
@@ -2,7 +2,7 @@ use strict;
use warnings;
package Device::Onkyo;
BEGIN {
- $Device::Onkyo::VERSION = '1.120800';
+ $Device::Onkyo::VERSION = '1.120810';
}
use Carp qw/croak carp/;
@@ -30,6 +30,7 @@ sub new {
baud => 9600,
device => 'discover',
broadcast_source_ip => '0.0.0.0',
+ broadcast_dest_ip => '255.255.255.255',
%p
}, $pkg;
if (exists $p{filehandle}) {
@@ -178,7 +179,7 @@ sub discover {
pack("a* N N N a*",
'ISCP', 0x10, 0xb, 0x01000000, "!xECNQSTN\r\n"),
0,
- sockaddr_in($self->port, inet_aton('255.255.255.255')));
+ sockaddr_in($self->port, inet_aton($self->{broadcast_dest_ip})));
my $sel = IO::Select->new($s);
$sel->can_read(10) or die;
my $sender = recv $s, my $buf, 2048, 0;
@@ -388,7 +389,7 @@ Device::Onkyo - Perl module to control Onkyo/Integra AV equipment
=head1 VERSION
-version 1.120800
+version 1.120810
=head1 SYNOPSIS
@@ -449,11 +450,16 @@ The port for a TCP device. The default is C<60128>.
=item broadcast_source_ip
-The source ip address that the discovery process uses for its
+The source IP address that the discovery process uses for its
broadcast. The default, '0.0.0.0', should work in most cases but
multi-homed hosts might need to specify the correct local interface
address.
+=item broadcast_dest_ip
+
+The IP address that the discovery process uses for its broadcast. The
+default, '255.255.255.255', should work in most cases.
+
=back
=head2 C<device()>
View
4 t/03-discover.t
@@ -45,7 +45,9 @@ if ($pid == 0) {
['ISCP', 0x10, 0x8, 0x01000000, "!1PWR01\r"], '... power on';
} elsif ($pid) {
# parent
- my $onkyo = Device::Onkyo->new(device => 'discover', port => $port);
+ my $onkyo = Device::Onkyo->new(device => 'discover', port => $port,
+ broadcast_dest_ip => '127.0.0.1',
+ broadcast_source_ip => '127.0.0.1');
ok $onkyo, 'object';
is $onkyo->port, $tcp_port, '... discovered';
$onkyo->command('power on');

No commit comments for this range

Something went wrong with that request. Please try again.