| 1 | package Protocol::IR::Proto::NECX1; | ||
| 2 | 55 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 55 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 55 | our $VERSION = '1.5'; | |
| 6 | |||
| 7 | 55 | ▶ | use parent 'Protocol::IR::Proto::NEC'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | # NECx1 is the MakeHex NECx1.irp protocol: a 16-bit address with a half | ||
| 10 | # (4500/4500 µs) header. The second address byte is a real byte (Default | ||
| 11 | # S=D), not an inversion, so it is never normalized to -1. | ||
| 12 | 23 | ▶ | sub _protocol_name { 'NECX1' } |
|
Subroutine
_protocol_name: called CC=1 SCAR=0.0
| |||
| 13 | 86 | ▶ | sub _half_header { 1 } |
|
Subroutine
_half_header: called CC=1 SCAR=0.0
| |||
| 14 | 1 | ▶ | sub _inverted_subaddress_default { 0 } |
|
Subroutine
_inverted_subaddress_default: called CC=1 SCAR=0.0
| |||
| 15 | 3 | ▶ | sub _normalize_subaddress { 0 } |
|
Subroutine
_normalize_subaddress: called CC=1 SCAR=0.0
| |||
| 16 | |||
| 17 | 55 | 1; | |
| 18 | |||
| 19 | =encoding utf8 | ||
| 20 | |||
| 21 | =head1 NAME | ||
| 22 | |||
| 23 | Protocol::IR::Proto::NECX1 - NECx1 protocol handler (extended NEC, half header) | ||
| 24 | |||
| 25 | =head1 VERSION | ||
| 26 | |||
| 27 | version 1.5 | ||
| 28 | |||
| 29 | =head1 SYNOPSIS | ||
| 30 | |||
| 31 | use Protocol::IR::Converter; | ||
| 32 | |||
| 33 | my $converter = Protocol::IR::Converter->new(); | ||
| 34 | |||
| 35 | # NECx1 ("extended NEC") uses a half 4500/4500 µs header and a real | ||
| 36 | # 16-bit address: the subaddress byte is the low half, not an | ||
| 37 | # inversion of the address. | ||
| 38 | my $code = $converter->import_code('NECX1', | ||
| 39 | { device => 162, subdevice => 162, command => 1 }); | ||
| 40 | |||
| 41 | =head1 DESCRIPTION | ||
| 42 | |||
| 43 | The NECx1 protocol (MakeHex F<NECx1.irp>) transmits the same 32-bit frame | ||
| 44 | layout as L<Protocol::IR::Proto::NEC> but with a half B<4500/4500 µs> header and a | ||
| 45 | B<16-bit address>: the second byte is the low half of the address (Default | ||
| 46 | S=D), so it is kept as a real byte and never normalized to C<-1> (see | ||
| 47 | L<Protocol::IR::Proto::NEC> for the full data layout and timing). This is the | ||
| 48 | framing IRDB files Samsung, Grundig, KAWA, and others label C<NECx1>. | ||
| 49 | |||
| 50 | The repeat frame is a short header+gap "ditto" frame, like NEC1. The | ||
| 51 | C<NECx2> variant (L<Protocol::IR::Proto::NECX2>) repeats the whole frame instead; | ||
| 52 | a single frame of either is timing-identical. | ||
| 53 | |||
| 54 | A NECx1 frame shares its 4500/4500 µs header with L<Protocol::IR::Proto::SAMSUNG> | ||
| 55 | (Samsung is IRDB's most common NECx2 user), so the two cannot be told apart | ||
| 56 | from timing alone. L<Protocol::IR::Converter> registers C<SAMSUNG> before C<NECX1>, | ||
| 57 | matching real-world Samsung captures; the C<NECX1> name is produced when a | ||
| 58 | code is imported by name (CSV, C<decode_params>, C<decode_raw>), the | ||
| 59 | IRDB-to-wig path. The data word is identical under either label. | ||
| 60 | |||
| 61 | =head1 METHODS | ||
| 62 | |||
| 63 | All methods are inherited from L<Protocol::IR::Proto::NEC>; only the protocol | ||
| 64 | name, header, and subaddress behavior differ. | ||
| 65 | |||
| 66 | =head1 SUPPORT | ||
| 67 | |||
| 68 | Source code: L<https://github.com/bwarden/perl-protocol-ir> | ||
| 69 | |||
| 70 | Bug reports and feature requests: L<https://github.com/bwarden/perl-protocol-ir/issues> | ||
| 71 | |||
| 72 | =head1 AUTHOR | ||
| 73 | |||
| 74 | Brett T. Warden <bwarden@cpan.org> | ||
| 75 | |||
| 76 | =head1 COPYRIGHT AND LICENSE | ||
| 77 | |||
| 78 | Copyright (c) 2026 Brett T. Warden | ||
| 79 | |||
| 80 | This library is free software; you can redistribute it and/or modify it | ||
| 81 | under the terms of the GNU General Public License as published by the | ||
| 82 | Free Software Foundation; either version 2 of the License, or (at your | ||
| 83 | option) any later version. | ||