Skip to content

[Proposal] JavaScript IR Module Implementation #4345

@bad-antics

Description

@bad-antics

Proposal: Infrared JavaScript Module for Flipper Zero

Following up on #4322 — I'd like to propose implementing the JavaScript Infrared module and would be willing to contribute a PR.

Scope:

  • infrared JS module wrapping the existing C IR API
  • Send raw signals (timings array + frequency)
  • Send protocol-based commands (NEC, Samsung, RC5, RC6, etc.)
  • Send commands from saved .ir files by name
  • Optional: receive with timeout (polling-based)

Implementation Plan:

  1. Create js_infrared.c following the pattern in js_gpio.c / js_serial.c
  2. Register module in the JS engine plugin system
  3. Expose infrared_send_raw(), infrared_send() from the C API
  4. Add .ir file parser for named command lookup
  5. Write documentation + example scripts

API Design:

let ir = require('infrared');

// Protocol-based
ir.send('NEC', 0x04, 0x08);

// From file
ir.sendFile('/ext/infrared/tv.ir', 'Power');

// Raw timings
ir.sendRaw([9000, 4500, 560, 560], 38000);

About Me:

Happy to discuss the approach or adapt to the team's preferred architecture.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions