Commit Graph
22674 Commits
Author SHA1 Message Date
MsprgandClaude Fable 5 d852118de5 client: build the tab completion vocabulary at runtime from the command tree
Tab completion used a generated table (pm3line_vocabulary.h, refreshed by
hand via `make commands`) that drifted from the real command tables: new
commands were missing (e.g. `hw bwm*`), removed ones lingered, and the
"offline" flag depended on the platform of whoever regenerated it
(IfPm5() returns true offline on PM5 builds).

Build the vocabulary at startup instead:

- cmdparser: add walkCommandsRecursive(), a tree walk using a fourth
  internal sentinel (XX_internal_command_walk_XX) next to the dump ones.
  It hands each leaf to a visitor as its command_t chain (ancestors +
  leaf). A dispatch counter detects entries shown like a category but
  with their own parser (reveng) and reports them as leaves.
- pm3line_vocabulary: dynamic vocabulary holding the IsAvailable()
  predicates of every command and its ancestor categories, so completion
  applies exactly the rule CmdsHelp() uses, live, for both offline and
  connected devices. Script entries ("script run <relpath>") come from
  the same directories `script list` scans, sorted, including
  subdirectories with the path `script run` needs.
- pm3line: readline and linenoise completers consume the live vocabulary.
  The walk runs with output disabled so category handlers stay silent.
- Drop pm3_help2list.py and the header regeneration from `make commands`.

Behaviour change: entries whose category is hidden by `help` (e.g. `mem`,
`usart` offline) are no longer offered, matching `help`; when connected,
commands the device does not support are no longer offered either.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-28 14:29:04 +02:00
Shaw InnesandClaude Opus 5 b6e9d48a35 Fix standalone mode button trigger on non-PM5 platforms
The 1-second button hold that launches a standalone mode has been a
no-op on every platform except PM5 since e3511c535 ("Used HAL layer").

That commit repurposed the long press as a power-off gesture for PM5,
but commented out the RunMod() call unconditionally while guarding only
the new power-off code with #ifdef PM5. On PM3 builds the BUTTON_HOLD
branch therefore compiles down to an empty block, leaving CMD_STANDALONE
(the client's `hw standalone` command) as the only remaining entry point
to a standalone mode -- which defeats their purpose, since standalone
modes exist to run without a host attached.

Restore the call under #ifndef PM5 and move the PM5 power-off code to
the #else branch, matching the guard style used elsewhere in the same
commit.

Verified: PM3RDV4 and PM3GENERIC images now have two RunMod call sites
(AppMain + CMD_STANDALONE); PM5 still has one and retains its power-off
path.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-28 14:16:02 +02:00
Niel Nielsen bd52734774 Modify PLATFORM_EXTRAS comments in Makefile
Updated commented PLATFORM_EXTRAS options for clarity.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 14:14:29 +02:00
Niel Nielsen 755fdc7c7a Implement low-battery shutdown and update comments
Added support for low-battery shutdown features and updated comments for clarity.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 14:14:29 +02:00
Niel Nielsen d35ddce206 Update low-battery options in Makefile.hal
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 14:14:29 +02:00
Niel Nielsen 98abc5d5f7 Clarify low-battery options in Makefile.hal
Updated comments for clarity on low-battery options.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 14:14:29 +02:00
Niel Nielsen b7b20ef698 Update Makefile with PLATFORM_EXTRAS comments
Added comments for PLATFORM_EXTRAS options in Makefile.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 14:14:29 +02:00
Philippe Teuwen a6b4107066 Add --on to hw bwmcharge, same syntax as hw bwmautooff 2026-08-28 13:17:05 +02:00
Niel Nielsen c2aec48b49 Add files via upload
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Niel Nielsen 4cf2e83c3a Add support for BWM charger, buzzer, and RGB indicator
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Niel Nielsen 2535307642 Add BWM charger and PM5 RGB indicator support
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Niel Nielsen 4ec53ea2e6 Add newline at end of appmain.c
Fix missing newline at end of file

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Niel Nielsen 767f7b2531 Refactor battery management functions and integrate buzzer
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Niel Nielsen e9688db826 Refactor BWM_WIFI command handling logic
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Niel Nielsen b3fc31f58f Fix header file formatting and add missing defines
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Niel Nielsen 33535330e1 Enhance WiFi command with stop option and error messages
Updated command handling for WiFi configuration to include a stop option and adjusted error messages accordingly.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Niel Nielsen fd2cfbd194 Define DHCP wait and poll times in bwm_wifi.h
Added definitions for DHCP wait and poll times.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Niel Nielsen 26cb7495a6 Adjust DHCP wait time and improve IP handling
Increase DHCP wait time to accommodate slower hotspots and improve IP acquisition reliability.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Philippe Teuwen f08792fef0 Add -n to hf 14a reader 2026-08-28 10:29:26 +02:00
Iceman 9a2ba4f5d6 Merge pull request #3542 from Antiklesys/master
Fixing bugs from 76181dfb8 and 377d7cd61
2026-08-28 13:07:14 +07:00
Antiklesys f5dc8ab42f FIxing bugs from 76181dfb8 and 377d7cd61
FIxing bugs from 76181dfb8 and 377d7cd61 breaking secure channel operations
2026-08-28 13:43:11 +08:00
iceman1001 77a9f45db6 texts 2026-08-28 01:16:30 +02:00
iceman1001 377d7cd612 since it still felt a bit slow, Claude came up with the idea of burst mode transfers. A new sim module firmware 'sim022.bin' and we now can auto-negotiate for TA1 = 0x95 which give us 125 000 bits/s which is almost 10x from the 10752 bits/s we were doing before. Thanks Claude! 2026-08-28 01:16:11 +02:00
Iceman 9c962ed537 Merge pull request #3541 from Msprg/fix-install-simfw
Fix make install after sim014 firmware removal
2026-08-28 05:23:53 +07:00
Iceman d92ae331b3 Merge pull request #3540 from Msprg/felica-argtable-longopt
hf felica liteauth: use NULL instead of "" for options without a long name
2026-08-28 05:23:08 +07:00
Msprg 2d898d31e7 fix make install after sim014 firmware removal
e2cf7dee5 removed sim014.bin but the top-level Makefile still lists it
in INSTALLSIMFW, so 'make install' fails on cp. Install sim020 instead,
and point the pm3_tests.sh existence check at the same file.
2026-08-27 23:55:50 +02:00
MsprgandClaude Fable 5 f2c214722c hf felica liteauth: use NULL instead of "" for options without a long name
argtable treats the long option field as a string to scan; an empty
literal makes arg_parse() read one byte past it. AddressSanitizer flags
it as a global-buffer-overflow whenever the command's help is built,
e.g. on every `proxmark3 --fulltext`. Every other command in the client
passes NULL here.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-27 23:34:45 +02:00
Niel Nielsen 4353c0bb8c Implement low-battery beep functionality
Added low-battery audible warning feature with buzzer control and checks for battery status.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 23:02:46 +02:00
iceman1001 e2cf7dee5f clean up old firmware files 2026-08-27 22:40:50 +02:00
iceman1001 7bdd6760a2 maur 2026-08-27 22:37:59 +02:00
iceman1001 76181dfb8e sim module firmware is now v4.60, (sim020.bin) it adds a better drain when T=0 exits abnormal (abort). Better waiting time floor, with faster ETU which doesnt shrink with WWT.\n Changes to i2c with SDA timings, also modified the fixed msleep(100) with an idle time waiting which leads to 107 ms off from every iteration.\n Added a ATR cache to remember which TA1 was autonegotiated. This impact i2c comms speed with sim module for same card. 'smart pps' is better documented.\n The sam_common.c now also logs 61xx and GET_RESPONSE :) and generic long-form ASN-1 lengths. trace list -t 7816 now also shows rdr frames in us. \n All in all, this should lead for 'emv reader -w' to go from 5.87sec to 2.78sec. 'hf seos sam' is down to 1.92sec. 'hw ping' is down to 0.57sec. A USB round trip is down from 20.8ms to 1.3ms. It should give a snappier end user experience 2026-08-27 22:37:32 +02:00
Niel Nielsen d996b75578 Update BWM-USAGE.md for clearer power-off instructions
Clarified note regarding auto power-off behavior and usage.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 21:15:24 +02:00
Niel Nielsen 96d9a5de9a Update description for hw bwmautooff command
Clarify the behavior of the auto power-off feature.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 21:09:06 +02:00
Niel Nielsen f92d4714df Merge branch 'RfidResearchGroup:master' into WIFI-test 2026-08-27 21:07:23 +02:00
Philippe Teuwen 1871fe942c bwm doc 2026-08-27 20:44:39 +02:00
Niel Nielsen d26aa891da Merge branch 'RfidResearchGroup:master' into WIFI-test 2026-08-27 20:05:25 +02:00
Niel Nielsen bbe24cfdb6 Add files via upload
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 20:05:14 +02:00
Niel Nielsen bfa279cd57 Update BWM framing constants and comments
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 20:03:15 +02:00
Niel Nielsen 5fa3ac2446 Fix formatting and comments in bwm_forward.c
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 20:03:15 +02:00
Niel Nielsen 426c9f11fd Add hostname configuration command to bwm_wifi.h
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 20:03:15 +02:00
Niel Nielsen 6cbd863abe Add hostname parameter to bwm_wifi_forward_up function
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 20:03:15 +02:00
Niel Nielsen cc8a2c04ca Add host parameter to bwm_wifi_forward_up function
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 20:03:15 +02:00
Niel Nielsen 4aa7e2ecb6 Add hostname parameter to WiFi command
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 20:03:15 +02:00
Niel Nielsen b60f5e2ac8 Add PM3 command includes and fix function closing
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 20:03:15 +02:00
Niel Nielsen 0fd8f8ea36 Replace ticks.h with ticks_apis.h in bwm_wifi.c
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 20:03:15 +02:00
Niel Nielsen 9769372618 Implement CmdBWMWifi for WiFi connection setup
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 20:03:15 +02:00
Niel Nielsen 3b92e411e9 Add CmdBWMWifi function for WiFi BWM logging
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 20:03:15 +02:00
Niel Nielsen fffd5cdf33 Add bwm_wifi.h include for WiFi functionality
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 20:03:15 +02:00
Niel Nielsen fd479f8f9c Add bwm_wifi.c to SRC_BWM when WITH_BWM_FORWARD is set
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 20:03:15 +02:00
Niel Nielsen 917e23f698 Add WiFi forwarding command handling
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 20:03:15 +02:00