| 1 | 7 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 7 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 7 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | |||||||||||
| 7 | =head1 NAME | ||||||||||
| 8 | |||||||||||
| 9 | Device::CableModem::Zoom5341J::Get | ||||||||||
| 10 | |||||||||||
| 11 | =head1 NOTA BENE | ||||||||||
| 12 | |||||||||||
| 13 | This is part of the guts of Device::CableModem::Zoom5341J. If you're | ||||||||||
| 14 | reading this, you're either developing the module, writing tests, or | ||||||||||
| 15 | coloring outside the lines; consider yourself warned. | ||||||||||
| 16 | |||||||||||
| 17 | =cut | ||||||||||
| 18 | |||||||||||
| 19 | |||||||||||
| 20 | =head2 ->get_down_stats | ||||||||||
| 21 | |||||||||||
| 22 | Return all the downstream stats as a hashref. | ||||||||||
| 23 | =cut | ||||||||||
| 24 | sub get_down_stats | ||||||||||
| 25 | 2 | ▶ | { | ||||||||
|
Subroutine
get_down_stats: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 26 | 2 | my $self = shift; | |||||||||
| 27 | |||||||||||
| 28 | 2 | ▶ | $self->parse_conn_stats unless $self->{conn_stats}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | 2 | ▶ | croak "No downstats" unless $self->{conn_stats}{down}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 1 | return $self->{conn_stats}{down}; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | =head2 ->get_up_stats | ||||||||||
| 34 | |||||||||||
| 35 | Return all the upstream stats as a hashref. | ||||||||||
| 36 | =cut | ||||||||||
| 37 | sub get_up_stats | ||||||||||
| 38 | 2 | ▶ | { | ||||||||
|
Subroutine
get_up_stats: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 39 | 2 | my $self = shift; | |||||||||
| 40 | |||||||||||
| 41 | 2 | ▶ | $self->parse_conn_stats unless $self->{conn_stats}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 42 | 2 | ▶ | croak "No upstats" unless $self->{conn_stats}{up}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 43 | 1 | return $self->{conn_stats}{up}; | |||||||||
| 44 | } | ||||||||||
| 45 | |||||||||||
| 46 | |||||||||||
| 47 | =head2 ->get_down_chanid | ||||||||||
| 48 | |||||||||||
| 49 | Return an arrayref of downstream channel ids. | ||||||||||
| 50 | |||||||||||
| 51 | =head2 ->get_down_freq | ||||||||||
| 52 | |||||||||||
| 53 | Return an arrayref of downstream frequencies. | ||||||||||
| 54 | |||||||||||
| 55 | =head2 ->get_down_mod | ||||||||||
| 56 | |||||||||||
| 57 | Return an arrayref of downstream modulation schemata. | ||||||||||
| 58 | |||||||||||
| 59 | =head2 ->get_down_power | ||||||||||
| 60 | |||||||||||
| 61 | Return an arrayref of downstream power levels (dBmV). | ||||||||||
| 62 | |||||||||||
| 63 | =head2 ->get_down_snr | ||||||||||
| 64 | |||||||||||
| 65 | Return an arrayref of downstream SNRs (dB). | ||||||||||
| 66 | =cut | ||||||||||
| 67 | |||||||||||
| 68 | 7 | for my $k (qw(chanid freq mod power snr)) | |||||||||
| 69 | { | ||||||||||
| 70 | 7 | ▶ | no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 71 | 35 | ▶ | *{"get_down_$k"} = sub { | ||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||
| 72 | 6 | my $self = shift; | |||||||||
| 73 | 6 | ▶ | $self->parse_conn_stats unless $self->{conn_stats}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 74 | 6 | ▶ | croak "No down ${k}stats" unless $self->{conn_stats}{down}{$k}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 75 | 5 | return $self->{conn_stats}{down}{$k}; | |||||||||
| 76 | 35 | }; | |||||||||
| 77 | } | ||||||||||
| 78 | |||||||||||
| 79 | |||||||||||
| 80 | =head2 ->get_up_chanid | ||||||||||
| 81 | |||||||||||
| 82 | Return an arrayref of upstream channel ids. | ||||||||||
| 83 | |||||||||||
| 84 | =head2 ->get_up_freq | ||||||||||
| 85 | |||||||||||
| 86 | Return an arrayref of upstream frequencies. | ||||||||||
| 87 | |||||||||||
| 88 | =head2 ->get_up_bw | ||||||||||
| 89 | |||||||||||
| 90 | Return an arrayref of upstream bandwidths (in Ksym/sec). | ||||||||||
| 91 | |||||||||||
| 92 | =head2 ->get_up_power | ||||||||||
| 93 | |||||||||||
| 94 | Return an arrayref of upstream power levels (dBmV). | ||||||||||
| 95 | =cut | ||||||||||
| 96 | |||||||||||
| 97 | 7 | for my $k (qw(chanid freq bw power)) | |||||||||
| 98 | { | ||||||||||
| 99 | 7 | ▶ | no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 100 | 28 | ▶ | *{"get_up_$k"} = sub { | ||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||
| 101 | 6 | my $self = shift; | |||||||||
| 102 | 6 | ▶ | $self->parse_conn_stats unless $self->{conn_stats}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 103 | 6 | ▶ | croak "No up ${k}stats" unless $self->{conn_stats}{up}{$k}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 104 | 5 | return $self->{conn_stats}{up}{$k}; | |||||||||
| 105 | 28 | }; | |||||||||
| 106 | } | ||||||||||
| 107 | |||||||||||
| 108 | |||||||||||
| 109 | |||||||||||
| 110 | 7 | 1; | |||||||||
| 111 | __END__ | ||||||||||