NAME
Protocol::IR::Proto::SAMSUNG36 - SAMSUNG36 protocol handler (36-bit)
VERSION
version 1.0
SYNOPSIS
use Protocol::IR::Converter;
my $converter = Protocol::IR::Converter->new();
# From a raw 36-bit value or from parameters
my $code = $converter->import_code('SAMSUNG36', '0x7004F023E3');
my $code = $converter->import_code('SAMSUNG36',
{ address => 0x7004, command => 0xF023E });
DESCRIPTION
The SAMSUNG36 protocol transmits 36-bit frames at 38 kHz in two blocks: block #1 carries the top 16 bits (the address) behind a 4515/4438 us header, and block #2 carries the remaining 20 bits (the command) with no header. Each block is sent MSB-first with a 512 us mark and a 1468 us (1) / 490 us (0) space, and each block ends with a 512 us mark; block #1's footer is followed by a 4438 us space and block #2's by the ~27 ms inter-message gap. The whole frame is sent once.
Because the word is transmitted MSB-first as a whole, the stored data is the same value the transmitter sent -- what IRremoteESP8266 reports as value, the "Code" column of the sample tables. The "LSB" column is the same word read bit-for-bit in reverse; see decode_byte_order. SAMSUNG36 has no subaddress; subaddress is set to -1.
Timing and bit ordering follow IRremoteESP8266 (David Conran et al., GPLv2, https://github.com/crankyoldgit/IRremoteESP8266): kSamsung36HdrMark/ kSamsung36HdrSpace, kSamsung36BitMark, kSamsung36OneSpace, and kSamsung36ZeroSpace.
METHODS
decode_raw
my $code = $class->decode_raw('0x7004F023E3');
Builds an Protocol::IR::Code from the raw 36-bit display value.
decode_byte_order
my $code = $class->decode_byte_order($raw, $lsb);
Decodes from either byte order: $lsb true reads the whole word reversed end to end (the "LSB" column), false reads the display form (the "Code" column) directly.
decode_params
my $code = $class->decode_params(address => 0x7004, command => 0xF023E);
Builds an Protocol::IR::Code from discrete parameters. Accepts address or device, and command or function.
decode_timing
my $code = $class->decode_timing(\@burst_pairs_us);
Decodes an arrayref of microsecond [mark_us, space_us] pairs. Returns an Protocol::IR::Code when the header, 39 burst pairs, both block footers, and the stop bit match the SAMSUNG36 timing signature, otherwise undef.
to_pronto
my $pronto = $class->to_pronto($ir_code);
Encodes an Protocol::IR::Code object as a Pronto Hex string at 38 kHz.
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.