Skip to content

Commit

Permalink
core: fix wrong usage of 'udpclient' instead of 'udp' for serial ports
Browse files Browse the repository at this point in the history
  • Loading branch information
Williangalvani committed May 24, 2024
1 parent 238ede4 commit ec569c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default Vue.extend({
}
}
}
const regex1 = /(tcpclient|udpclient|tcpin|udpin):(?<ip>[^:]+):(?<port>\d+)$/
const regex1 = /(tcpclient|udp|tcpin|udpin):(?<ip>[^:]+):(?<port>\d+)$/
if (regex1.test(input)) {
const match = regex1.exec(input)
const ip = match?.groups?.ip ?? ''
Expand All @@ -200,7 +200,7 @@ export default Vue.extend({
if (input.startsWith('/dev/')) {
return true
}
return 'unknown format. Supported formats are "tcpclient", "udpclient", "tcpin", "udpin", and system device paths'
return 'unknown format. Supported formats are "tcpclient", "udp", "tcpin", "udpin", and system device paths'
},
},
})
Expand Down
4 changes: 2 additions & 2 deletions core/services/ardupilot_manager/typedefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class EndpointType(str, Enum):
"""Supported Mavlink endpoint types."""

UDPServer = "udpin"
UDPClient = "udpout"
UDPClient = "udp"
TCPServer = "tcpin"
TCPClient = "tcpout"
Serial = "serial"
Expand Down Expand Up @@ -200,7 +200,7 @@ def valid_endpoint(cls: Any, value: str) -> str:
return value
if re.compile(r"tcp:\d*:wait$").match(value):
return value
matches = re.compile(r"(tcpclient|udpclient|tcpin|udpin):(?P<ip>(\d*\.){3}\d+):(?P<port>\d*)$").match(value)
matches = re.compile(r"(tcpclient|udp|tcpin|udpin):(?P<ip>(\d*\.){3}\d+):(?P<port>\d*)$").match(value)
if matches:
ipaddress.ip_address(matches.group("ip"))
if 0 <= int(matches.group("port")) <= 65535:
Expand Down

0 comments on commit ec569c3

Please sign in to comment.