Skip to content

Commit 09f8405

Browse files
committed
Remove --sendping as REPLY_APP portnum is disabled in firmware now
1 parent 107629e commit 09f8405

4 files changed

Lines changed: 0 additions & 62 deletions

File tree

meshtastic/__main__.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -394,17 +394,6 @@ def onConnected(interface):
394394
f"Warning: {channelIndex} is not a valid channel. Channel must not be DISABLED."
395395
)
396396

397-
if args.sendping:
398-
payload = str.encode("test string")
399-
print(f"Sending ping message to {args.dest}")
400-
interface.sendData(
401-
payload,
402-
args.dest,
403-
portNum=portnums_pb2.PortNum.REPLY_APP,
404-
wantAck=True,
405-
wantResponse=True,
406-
)
407-
408397
if args.traceroute:
409398
loraConfig = getattr(interface.localNode.localConfig, "lora")
410399
hopLimit = getattr(loraConfig, "hop_limit")
@@ -1241,12 +1230,6 @@ def initParser():
12411230
help="Send a text message. Can specify a destination '--dest' and/or channel index '--ch-index'.",
12421231
)
12431232

1244-
parser.add_argument(
1245-
"--sendping",
1246-
help="Send a ping message (which requests a reply)",
1247-
action="store_true",
1248-
)
1249-
12501233
parser.add_argument(
12511234
"--traceroute",
12521235
help="Traceroute from connected node to a destination. "

meshtastic/tests/test_main.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -713,31 +713,6 @@ def test_main_sendtext_with_dest(capsys, caplog, iface_with_nodes):
713713
assert err == ""
714714

715715

716-
@pytest.mark.unit
717-
@pytest.mark.usefixtures("reset_globals")
718-
def test_main_sendping(capsys):
719-
"""Test --sendping"""
720-
sys.argv = ["", "--sendping"]
721-
Globals.getInstance().set_args(sys.argv)
722-
723-
iface = MagicMock(autospec=SerialInterface)
724-
725-
def mock_sendData(payload, dest, portNum, wantAck, wantResponse):
726-
print("inside mocked sendData")
727-
print(f"{payload} {dest} {portNum} {wantAck} {wantResponse}")
728-
729-
iface.sendData.side_effect = mock_sendData
730-
731-
with patch("meshtastic.serial_interface.SerialInterface", return_value=iface) as mo:
732-
main()
733-
out, err = capsys.readouterr()
734-
assert re.search(r"Connected to radio", out, re.MULTILINE)
735-
assert re.search(r"Sending ping message", out, re.MULTILINE)
736-
assert re.search(r"inside mocked sendData", out, re.MULTILINE)
737-
assert err == ""
738-
mo.assert_called()
739-
740-
741716
@pytest.mark.unit
742717
@pytest.mark.usefixtures("reset_globals")
743718
def test_main_setlat(capsys):

meshtastic/tests/test_smoke1.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,6 @@ def test_smoke1_info():
4040
assert return_value == 0
4141

4242

43-
@pytest.mark.smoke1
44-
def test_smoke1_sendping():
45-
"""Test --sendping"""
46-
return_value, out = subprocess.getstatusoutput("meshtastic --sendping")
47-
assert re.match(r"Connected to radio", out)
48-
assert re.search(r"^Sending ping message", out, re.MULTILINE)
49-
assert return_value == 0
50-
51-
5243
@pytest.mark.smoke1
5344
def test_get_with_invalid_setting():
5445
"""Test '--get a_bad_setting'."""

meshtastic/tests/test_smokevirt.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,6 @@ def test_smokevirt_info():
5050
assert return_value == 0
5151

5252

53-
@pytest.mark.smokevirt
54-
def test_smokevirt_sendping():
55-
"""Test --sendping"""
56-
return_value, out = subprocess.getstatusoutput(
57-
"meshtastic --host localhost --sendping"
58-
)
59-
assert re.match(r"Connected to radio", out)
60-
assert re.search(r"^Sending ping message", out, re.MULTILINE)
61-
assert return_value == 0
62-
63-
6453
@pytest.mark.smokevirt
6554
def test_get_with_invalid_setting():
6655
"""Test '--get a_bad_setting'."""

0 commit comments

Comments
 (0)