Refactor default port number to variable

This commit is contained in:
DJ Holt committed 2024-09-16 23:41:44 -06:00
1 parent bf904c6906
commit 5cc9627e21
2 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -1159,7 +1159,7 @@ def common():
tcp_hostname, tcp_port = args.host.split(':')
else:
tcp_hostname = args.host
tcp_port = 4403
tcp_port = meshtastic.tcp_interface.DEFAULT_TCP_PORT
client = meshtastic.tcp_interface.TCPInterface(
tcp_hostname,
portNumber=tcp_port,
+2 -1
View File
@@ -6,6 +6,7 @@ from typing import Optional
from meshtastic.stream_interface import StreamInterface
DEFAULT_TCP_PORT = 4403
class TCPInterface(StreamInterface):
"""Interface class for meshtastic devices over a TCP link"""
@@ -16,7 +17,7 @@ class TCPInterface(StreamInterface):
debugOut=None,
noProto=False,
connectNow=True,
portNumber=4403,
portNumber=DEFAULT_TCP_PORT,
noNodes:bool=False,
):
"""Constructor, opens a connection to a specified IP address/hostname