NAME
Protocol::IR::Proto::NEC2 - NEC2 protocol handler (repeats the whole frame)
VERSION
version 1.0
SYNOPSIS
use Protocol::IR::Converter;
my $converter = Protocol::IR::Converter->new();
# NEC2 differs from NEC1 only in its repeat behavior: while NEC1
# repeats a short header+gap "ditto" frame, NEC2 re-transmits the
# entire 32-bit frame. A single NEC2 frame is timing-identical to a
# NEC1 frame.
my $code = $converter->import_code('NEC2',
{ device => 26, subdevice => 232, command => 5 });
DESCRIPTION
The NEC2 protocol (MakeHex nec2.irp) transmits the same 32-bit frame as Protocol::IR::Proto::NEC with the same full 9000/4500 us header and the same "Default S=~D" subaddress rule. The only difference from NEC1 is the repeat frame: NEC1 repeats a short header+gap, NEC2 repeats the whole data frame. That difference is not observable in any single frame, so the timing decoders treat NEC1 and NEC2 identically (see Protocol::IR::Proto::NEC for the data layout and timing). This class exists so that codes imported under the IRDB name NEC2 keep that identity and its repeat semantics.
Because a single NEC2 frame is indistinguishable from a NEC1 frame, the decode_timing decoder of Protocol::IR::Proto::NEC (registered first) matches it in Protocol::IR::Converter; the NEC2 name is only produced when a code is imported by name (CSV, decode_params, decode_raw), which is the IRDB-to-wig path this distribution is built around.
METHODS
All methods are inherited from Protocol::IR::Proto::NEC; only the protocol name differs.
SUPPORT
Source code: https://github.com/bwarden/perl-protocol-ir
Bug reports and feature requests: https://github.com/bwarden/perl-protocol-ir/issues
AUTHOR
Brett T. Warden <bwarden@cpan.org>
COPYRIGHT AND LICENSE
Copyright (c) 2026 Brett T. Warden
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation.