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 authored and patrickelectric committed May 28, 2024
1 parent 8de898e commit 865f565
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 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
2 changes: 1 addition & 1 deletion core/services/ardupilot_manager/typedefs.py
Original file line number Diff line number Diff line change
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 865f565

Please sign in to comment.