NAME

Protocol::IR::Proto::JVC - JVC protocol handler (16-bit)

VERSION

version 1.0

SYNOPSIS

use Protocol::IR::Converter;

my $converter = Protocol::IR::Converter->new();

# From a raw 16-bit value or from parameters
my $code = $converter->import_code('JVC', '0x030C');
my $code = $converter->import_code('JVC',
    { address => 3, command => 12 });

DESCRIPTION

The JVC protocol transmits a 16-bit frame at 38 kHz: an address byte followed by a command byte, each sent LSB-first. The data value has the address in bits 8-15 and the command in bits 0-7, matching Tasmota's Data field. JVC has no subaddress; subaddress is set to -1.

Frame timing: 8400 us header mark and 4200 us header space; each bit is a 526 us mark followed by a space of 526 us for 0 or 1578 us for 1; a 526 us stop mark ends the frame. The inter-frame gap is about 17080 us for repeated frames or 42000 us for a lone frame.

The decode_timing decoder validates both the header and the stop bit, so a capture from a protocol whose header overlaps JVC's but has a different frame structure is rejected rather than misidentified.

METHODS

decode_raw

my $code = $class->decode_raw('0x030C');

Builds an Protocol::IR::Code from the raw 16-bit value.

decode_byte_order

my $code = $class->decode_byte_order($raw, $lsb);

Decodes from either byte order: $lsb true reads the accumulated (DataLSB) form directly; false reads the display (Data) form, the per-byte bit reversal of the accumulated word. JVC sends each byte LSB-first, so the accumulated word is the one carried on the wire and by Tasmota's DataLSB.

lsb_is_accumulated

my $flag = $class->lsb_is_accumulated;

True (always, for JVC) when the accumulated byte order is what decode_raw reads, informing the Tasmota structured importer which of its Data/DataLSB fields to prefer.

decode_params

my $code = $class->decode_params(address => 3, command => 12);

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, 16 data bits, and stop bit match the JVC 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.