meshcore-cli 1.2.11__py3-none-any.whl → 1.2.12__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,7 +32,7 @@ import re
32
32
  from meshcore import MeshCore, EventType, logger
33
33
 
34
34
  # Version
35
- VERSION = "v1.2.11"
35
+ VERSION = "v1.2.12"
36
36
 
37
37
  # default ble address is stored in a config file
38
38
  MCCLI_CONFIG_DIR = str(Path.home()) + "/.config/meshcore/"
@@ -578,6 +578,7 @@ def make_completion_dict(contacts, pending={}, to=None, channels=None):
578
578
  "logout" : None,
579
579
  "req_status" : None,
580
580
  "req_bstatus" : None,
581
+ "req_neighbours": None,
581
582
  "cmd" : None,
582
583
  "ver" : None,
583
584
  "advert" : None,
@@ -1083,6 +1084,7 @@ async def process_contact_chat_line(mc, contact, line):
1083
1084
  line == "dp" or line == "disc_path" or\
1084
1085
  line == "contact_info" or line == "ci" or\
1085
1086
  line == "req_status" or line == "rs" or\
1087
+ line == "req_neighbours" or line == "rn" or\
1086
1088
  line == "req_bstatus" or line == "rbs" or\
1087
1089
  line == "req_telemetry" or line == "rt" or\
1088
1090
  line == "req_acl" or\
@@ -2634,6 +2636,31 @@ async def next_cmd(mc, cmds, json_output=False):
2634
2636
  name = f"{ct['adv_name']:<20} [{e['key']}]"
2635
2637
  print(f"{name:{' '}<35}: {e['perm']:02x}")
2636
2638
 
2639
+ case "req_neighbours"|"rn" :
2640
+ argnum = 1
2641
+ await mc.ensure_contacts()
2642
+ contact = mc.get_contact_by_name(cmds[1])
2643
+ timeout = 0 if not "timeout" in contact else contact["timeout"]
2644
+ res = await mc.commands.fetch_all_neighbours(contact, timeout=timeout)
2645
+ if res is None :
2646
+ if json_output :
2647
+ print(json.dumps({"error" : "Getting data"}))
2648
+ else:
2649
+ print("Error getting data")
2650
+ else :
2651
+ if json_output:
2652
+ print(json.dumps(res, indent=4))
2653
+ else:
2654
+ print(f"Got {res['results_count']} neighbours out of {res['neighbours_count']} from {contact['adv_name']}:")
2655
+ for n in res['neighbours']:
2656
+ ct = mc.get_contact_by_key_prefix(n["pubkey"])
2657
+ if ct :
2658
+ name = f"[{n['pubkey'][0:8]}] {ct['adv_name']}"
2659
+ else:
2660
+ name = f"[{n['pubkey']}]"
2661
+
2662
+ print(f" {name:30} last viewed {n['secs_ago']} sec ago at {n['snr']} ")
2663
+
2637
2664
  case "req_binary" :
2638
2665
  argnum = 2
2639
2666
  await mc.ensure_contacts()
@@ -3131,6 +3158,7 @@ def command_help():
3131
3158
  cmd <name> <cmd> : sends a command to a repeater (no ack) c [
3132
3159
  wmt8 : wait for a msg (reply) with a timeout ]
3133
3160
  req_status <name> : requests status from a node rs
3161
+ req_neighbours <name> : requests for neighbours in binary form rn
3134
3162
  trace <path> : run a trace, path is comma separated""")
3135
3163
 
3136
3164
  def usage () :
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshcore-cli
3
- Version: 1.2.11
3
+ Version: 1.2.12
4
4
  Summary: Command line interface to meshcore companion radios
5
5
  Project-URL: Homepage, https://github.com/fdlamotte/meshcore-cli
6
6
  Project-URL: Issues, https://github.com/fdlamotte/meshcore-cli/issues
@@ -10,7 +10,7 @@ License-File: LICENSE
10
10
  Classifier: Operating System :: OS Independent
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Requires-Python: >=3.10
13
- Requires-Dist: meshcore>=2.1.23
13
+ Requires-Dist: meshcore>=2.1.24
14
14
  Requires-Dist: prompt-toolkit>=3.0.50
15
15
  Requires-Dist: pycryptodome
16
16
  Requires-Dist: requests>=2.28.0
@@ -0,0 +1,8 @@
1
+ meshcore_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ meshcore_cli/__main__.py,sha256=PfYgibmu2LEtC-OV7L1UgmvV3swJ5rQ4bbXHlwUFlgE,83
3
+ meshcore_cli/meshcore_cli.py,sha256=cbZPbXrhDENJvnGlR63lrupJQ22Nzk4bxGzudBKQMxQ,143616
4
+ meshcore_cli-1.2.12.dist-info/METADATA,sha256=XU2LqLOUEHonAUDaa2VaiLsp_wvVa5XIwobda-mP_NE,11658
5
+ meshcore_cli-1.2.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
+ meshcore_cli-1.2.12.dist-info/entry_points.txt,sha256=77V29Pyth11GteDk7tneBN3MMk8JI7bTlS-BGSmxCmI,103
7
+ meshcore_cli-1.2.12.dist-info/licenses/LICENSE,sha256=F9s987VtS0AKxW7LdB2EkLMkrdeERI7ICdLJR60A9M4,1066
8
+ meshcore_cli-1.2.12.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- meshcore_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- meshcore_cli/__main__.py,sha256=PfYgibmu2LEtC-OV7L1UgmvV3swJ5rQ4bbXHlwUFlgE,83
3
- meshcore_cli/meshcore_cli.py,sha256=3_pEZET6KLP327yh99zKmRx8a_sfgyx4mVLnT430HP4,142190
4
- meshcore_cli-1.2.11.dist-info/METADATA,sha256=bQTAr3A4YUZ3igdHJD7SgQp3DAPnN20TIVUlD6IKLS0,11658
5
- meshcore_cli-1.2.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
- meshcore_cli-1.2.11.dist-info/entry_points.txt,sha256=77V29Pyth11GteDk7tneBN3MMk8JI7bTlS-BGSmxCmI,103
7
- meshcore_cli-1.2.11.dist-info/licenses/LICENSE,sha256=F9s987VtS0AKxW7LdB2EkLMkrdeERI7ICdLJR60A9M4,1066
8
- meshcore_cli-1.2.11.dist-info/RECORD,,