mirror of
https://github.com/TheCommsChannel/TC2-BBS-mesh.git
synced 2025-12-14 23:44:42 -05:00
Add support for non-default TCP port
This commit is contained in:
parent
295fb35c92
commit
3f709b8504
1 changed files with 4 additions and 1 deletions
|
|
@ -169,9 +169,12 @@ def get_interface(system_config:dict[str, Any]) -> meshtastic.stream_interface.S
|
||||||
else:
|
else:
|
||||||
raise ValueError("No serial ports detected.")
|
raise ValueError("No serial ports detected.")
|
||||||
elif system_config['interface_type'] == 'tcp':
|
elif system_config['interface_type'] == 'tcp':
|
||||||
|
port_num = meshtastic.tcp_interface.DEFAULT_TCP_PORT
|
||||||
if not system_config['hostname']:
|
if not system_config['hostname']:
|
||||||
raise ValueError("Hostname must be specified for TCP interface")
|
raise ValueError("Hostname must be specified for TCP interface")
|
||||||
return meshtastic.tcp_interface.TCPInterface(hostname=system_config['hostname'])
|
if system_config['port']:
|
||||||
|
port_num = system_config['port']
|
||||||
|
return meshtastic.tcp_interface.TCPInterface(hostname=system_config['hostname'], portNumber=port_num)
|
||||||
else:
|
else:
|
||||||
raise ValueError("Invalid interface type specified in config file")
|
raise ValueError("Invalid interface type specified in config file")
|
||||||
except PermissionError as e:
|
except PermissionError as e:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue