feat: Support 2-byte and 3-byte path hash modes + fix config_validation example path #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/path-hash-mode-support"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
_get_command_prefix_to_section()inconfig_validation.pysuchte Example-Configs im Projektstamm statt imconfigs/-Unterverzeichnis — Ähnlichkeitsvorschläge für unbekannte Sektionen wurden dadurch nie angezeigt.Changes
modules/core.pypath_hash_modeausself_infobeim Connect und speichert alsbot.path_hash_mode(default 0 = 1-byte, unverändertes Verhalten)modules/message_handler.py_path_bytes_to_nodes()und_path_hex_to_nodes()mit konfigurierbarer Hash-Größedecode_meshcore_packet(): übergibthash_sizean_process_packet_path()_process_packet_path(): akzeptierthash_size-Parameter (TRACE-Pfad-Hashes bleiben 1-byte gemäß Protokollspezifikation)_update_mesh_graph_from_advert(): nutzt Geräte-hash_sizefür Node-Splitting_store_observed_path(): nutzt Geräte-hash_sizefürfrom_prefix/to_prefix_format_path_string(): akzeptierthash_size-Parameterdiscover_message_path: leitenhash_sizeausout_path_hash_mode-Feld des Kontakts abmodules/config_validation.py_get_command_prefix_to_section()sucht Example-Configs nun zuerst inconfigs/, dann im Projektstamm als Fallbacktests/unit/test_path_hash_mode.py_path_bytes_to_nodes,_path_hex_to_nodes,_format_path_string,_process_packet_path,discover_message_path,_update_mesh_graph_from_advertund diepath_hash_mode-Initialisierung incore.pyTest plan
🤖 Generated with Claude Code
MeshCore firmware supports three path hash sizes (1/2/3 bytes per node). Previously the bot always assumed 1-byte node hashes, silently misinterpreting paths when the device was configured for mode 1 or 2. Changes: - modules/core.py: Read path_hash_mode from self_info at connect time and store as bot.path_hash_mode (default 0 = 1-byte, unchanged behaviour) - modules/message_handler.py: - Add module-level helpers _path_bytes_to_nodes() and _path_hex_to_nodes() that chunk by configurable hash_size - decode_meshcore_packet(): pass device hash_size to _process_packet_path() - _process_packet_path(): accept hash_size parameter; TRACE path hashes remain 1-byte as per protocol spec - _update_mesh_graph_from_advert(): use device hash_size for node splitting - _store_observed_path(): use device hash_size for from_prefix/to_prefix - _format_path_string(): accept hash_size parameter - DM path display and _discover_message_path/_debug_decode_message_path: derive hash_size from contact's out_path_hash_mode field Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>