/* * Information on the Sony IR protocol (SIRC): * http://www.sbprojects.net/knowledge/ir/sirc.php */ // Good source for codes: https://web.archive.org/web/20160505000933/http://www.hifi-remote.com/sony/Sony_rcvr.htm export interface SonyProtocolVariation { totalLengthBits: 12 | 15 | 20; commandLengthBits: 7; deviceTypeLengthBits: 5 | 8; extensionLengthBits: 0 | 8; } export const SONY_PROTOCOL_COMMAND_LENGTH_BITS = 7; export const SONY_PROTOCOL_MAX_DEVICE_TYPE_LENGTH_BITS = 8; export const SONY_PROTOCOL_12_BITS: SonyProtocolVariation = { totalLengthBits: 12, commandLengthBits: SONY_PROTOCOL_COMMAND_LENGTH_BITS, deviceTypeLengthBits: 5, extensionLengthBits: 0, }; export const SONY_PROTOCOL_15_BITS: SonyProtocolVariation = { totalLengthBits: 15, commandLengthBits: SONY_PROTOCOL_COMMAND_LENGTH_BITS, deviceTypeLengthBits: 8, extensionLengthBits: 0, }; export const SONY_PROTOCOL_20_BITS: SonyProtocolVariation = { totalLengthBits: 20, commandLengthBits: SONY_PROTOCOL_COMMAND_LENGTH_BITS, deviceTypeLengthBits: 5, extensionLengthBits: 8, }; export const DATA_LENGTH_BITS_TO_SONY_PROTOCOL_VARIATION = new Map< number, SonyProtocolVariation >([ [12, SONY_PROTOCOL_12_BITS], [15, SONY_PROTOCOL_15_BITS], [20, SONY_PROTOCOL_20_BITS], ]);