Skip to content

Commit

Permalink
JS: Improve and fix subghz module
Browse files Browse the repository at this point in the history
- Fix some memory leaks
- Check for setup() being called
- Add end(), can setup() again to check for external module
- Add support for custom modulation presets
- Improve error handling
- Deinit correctly at exit
- Fix RAW files
- Fix repeat behavior, can specify with transmitFile(path, repeat)
  • Loading branch information
Willy-JL committed Jul 6, 2024
1 parent 0f4f844 commit 49a63bf
Show file tree
Hide file tree
Showing 3 changed files with 240 additions and 86 deletions.
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
- OFW: Add `mf_classic_set_sector_trailer_read()` function (by @Astrrra)
- OFW: RFID: Added Support for Securakey Protocol and RKKTH Plain Text Format (by @zinongli)
- MNTM Settings: Click Ok on Asset Pack setting to choose from a full-screen list (by @Willy-JL)
- JS: Added ADC (analog voltage) support to gpio library (by @jamisonderek)
- JS:
- Added ADC (analog voltage) support to gpio library (by @jamisonderek)
- Support `subghz` custom modulation, support `transmitFile(path, repeats)`, new `end()` function (by @Willy-JL)
- FBT: New `SKIP_EXTERNAL` toggle and `EXTRA_EXT_APPS` config option (by @Willy-JL)
- Desktop: Added TV animation from OFW which was missing (internal on OFW)
- UL: BadKB: Add Finnish keyboard layout (by @nicou)
Expand Down Expand Up @@ -60,7 +62,7 @@
- Sub-GHz:
- Refactor Weather protocols in Sub-GHz app, shows only correct data (by @Willy-JL)
- Streamline generic serialize +1.5k free flash (by @Willy-JL)
- JS: Refactored widget and keyboard modules with `ViewHolder`, fix crash (by @Willy-JL)
- JS: Refactored `widget` and `keyboard` modules with `ViewHolder`, fix crash (by @Willy-JL)
- Desktop: Slim down internal anims, +3.4kb free flash (by @Willy-JL)
- RFID:
- UL: Update T5577 password list (by @korden32)
Expand Down Expand Up @@ -88,9 +90,11 @@
- Archive: Fix favorite's parent folders thinking they are favorited too (by @Willy-JL)
- FBT: Consistent version/branch info, fix gitorigin (by @Willy-JL)
- AssetPacker: Pack pre-compiled icons and fonts too (by @Willy-JL)
- JS:
- Fix `subghz` RAW files, fix memory leaks, deinit correctly, better error handling (by @Willy-JL)
- OFW: Disable logging in mjs +2k free flash (by @hedger)
- OFW: RPC: Fix input lockup on disconnect (by @Willy-JL)
- OFW: ELF/Flipper application: Do not crash on "out of memory" (by @DrZlo13)
- OFW: JS: Disable logging in mjs +2k free flash (by @hedger)
- OFW: NFC: Fixed infinite loop in dictionary attack scene (by @RebornedBrain)
- OFW: Desktop: Lockup fix, GUI improvements (by @skotopes)
- OFW: Loader: Fix crash on locked via cli loader (by @DrZlo13)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,17 @@ changeFrequency(433920000);
printRXline();
delay(1000);

let result = subghz.transmitFile("/ext/subghz/0.sub");
print(result ? "Send success" : "Send failed");
print("Sending 0.sub")
subghz.transmitFile("/ext/subghz/0.sub");
// Can also specify repeat count: subghz.transmitFile(path, repeat)
// If not provided, defaults to 1 repeat for RAW and 10 repeats for parsed
// These 10 repeats by default are to simulate holding the button on remote
print("Send success");
delay(1000);

changeFrequency(315000000);
printRXline();
printRXline();

// Optional, done automatically at script end
subghz.end()
// But can be used to setup again, which will retry to detect external modules
Loading

0 comments on commit 49a63bf

Please sign in to comment.