feat: add IR, NFC, RFID, and SubGHz capability modules#8
Open
adrbn wants to merge 2 commits into
Open
Conversation
Adds four new capability modules exposing the Flipper Zero's radio and contactless subsystems as MCP tools, plus a CLI bridge that lets modules fall back to the Flipper CLI when protobuf RPC lacks coverage. - core/cli_bridge.py: toggles between CLI and protobuf RPC over the existing transport so modules can issue text-mode CLI commands safely - modules/subghz: list/read/delete .sub files, raw & file-based TX, RX (incl. raw), frequency analyzer, decode_raw, chat, launch_app - modules/nfc: list/read/parse/write/delete .nfc files, reader detection, launch_app / launch_file - modules/rfid: read/write/emulate 125kHz tags, raw read/analyze/ emulate for T5577-class workflows, file management, launch_app - modules/ir: list/read/decode/delete .ir files, TX (saved + raw), RX capture, universal remotes (TV/AC/audio/projector/etc.), launch_app - core/flipper_client.py: wire CLIBridge into FlipperClient.connect() once the protobuf RPC is ready
`FlipperStorage.read()` went straight to `rpc.storage_read()`, which on this firmware returns empty for many .sub and .ir files (the protobuf path only captures the first chunk's data). That made both `subghz_read_file` and `ir_read_file` unusable — reported as "(empty or failed)" even for valid saved files. When protobuf returns empty, fall back to the Flipper CLI's `storage read "<path>"` via the CLIBridge added in the previous commit, and strip the `Size: N` header the CLI prepends.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds four new capability modules that expose the Flipper Zero's radio and contactless subsystems as MCP tools, plus a CLI bridge that lets modules fall back to the Flipper CLI where the protobuf RPC doesn't have coverage.
core/cli_bridge.py— toggles between CLI and protobuf RPC over the existing transport so modules can safely issue text-mode CLI commands.modules/subghz— list/read/delete.subfiles, raw & file-based TX, RX (incl. raw), frequency analyzer,decode_raw, chat,launch_app.modules/nfc— list/read/parse/write/delete.nfcfiles, reader detection,launch_app/launch_file.modules/rfid— read/write/emulate 125 kHz tags, raw read/analyze/emulate for T5577-class workflows, file management,launch_app.modules/ir— list/read/decode/delete.irfiles, TX (saved + raw), RX capture, universal remotes (TV/AC/audio/projector/etc.),launch_app.core/flipper_client.py— wiresCLIBridgeintoFlipperClient.connect()once the protobuf RPC is ready.Total: 1 modified file, 9 new files, ~1,748 lines added.
Test plan
FlipperClient.connect()initializesCLIBridgewithout errorssubghz: list/ext/subghz, read a saved.sub, TX from file withconfirm=true, runrx/rx_rawbriefly, launch frequency analyzernfc: list/ext/nfc, parse a saved.nfc, run reader detectionrfid: read a 125 kHz tag, emulate a saved.rfid, run raw read/analyzeir: list/ext/infrared, TX a saved.irsignal, RX capture briefly, send a universal remote commandFlipperClientchanges