Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions 27 meshtastic/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ def onConnected(interface):
print(f"{node.localConfig.__class__.__name__} and {node.moduleConfig.__class__.__name__} do not have an attribute {pref[0]}.")
else:
print(f"{node.localConfig.__class__.__name__} and {node.moduleConfig.__class__.__name__} do not have attribute {pref[0]}.")
print("Choices are...")
printConfig(node.localConfig)
printConfig(node.moduleConfig)

if args.configure:
with open(args.configure[0], encoding='utf8') as file:
Expand Down Expand Up @@ -573,8 +576,11 @@ def setSimpleConfig(modem_preset):
print(f"{localConfig.__class__.__name__} and {moduleConfig.__class__.__name__} do not have an attribute {pref[0]}.")
else:
print(f"{localConfig.__class__.__name__} and {moduleConfig.__class__.__name__} do not have attribute {pref[0]}.")

print("Completed getting preferences")
print("Choices are...")
printConfig(localConfig)
printConfig(moduleConfig)
else:
print("Completed getting preferences")

if args.nodes:
closeNow = True
Expand Down Expand Up @@ -606,6 +612,20 @@ def setSimpleConfig(modem_preset):
print(f"Aborting due to: {ex}")
interface.close() # close the connection now, so that our app exits

def printConfig(config):
objDesc = config.DESCRIPTOR
for config_section in objDesc.fields:
if config_section.name != "version":
config = objDesc.fields_by_name.get(config_section.name)
print(f"{config_section.name}:")
names = []
for field in config.message_type.fields:
tmp_name = f'{config_section.name}.{field.name}'
if Globals.getInstance().get_camel_case():
tmp_name = meshtastic.util.snake_to_camel(tmp_name)
names.append(tmp_name)
for temp_name in sorted(names):
print(f" {temp_name}")

def onNode(node):
"""Callback invoked when the node DB changes"""
Expand Down Expand Up @@ -812,8 +832,7 @@ def initParser():

parser.add_argument(
"--get", help=("Get a preferences field. Use an invalid field such as '0' to get a list of all fields."
" Can use either snake_case or camelCase format. (ex: 'ls_secs' or 'lsSecs')"),
nargs=1, action='append')
" Can use either snake_case or camelCase format. (ex: 'ls_secs' or 'lsSecs')"), action='append')

parser.add_argument(
"--set", help="Set a preferences field. Can use either snake_case or camelCase format. (ex: 'ls_secs' or 'lsSecs')", nargs=2, action='append')
Expand Down
4 changes: 2 additions & 2 deletions 4 meshtastic/admin_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions 4 meshtastic/apponly_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions 4 meshtastic/cannedmessages_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions 4 meshtastic/channel_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.