Skip to content

Commit

Permalink
core: ArdupilotManager: implement missing endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Williangalvani committed Dec 7, 2023
1 parent 19be039 commit eb5943a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,18 @@ def convert_endpoint(endpoint: Endpoint) -> str:
EndpointType.UDPServer,
EndpointType.Serial,
EndpointType.TCPServer,
EndpointType.TCPClient,
]:
raise ValueError(
f"Master endpoint of type {master_endpoint.connection_type} not supported on MavlinkRouter."
)
if master_endpoint.connection_type == EndpointType.TCPClient:
return f"{self.binary()} \
--tcp-endpoint {master_endpoint.place}:{master_endpoint.argument} {endpoints}"

if master_endpoint.connection_type == EndpointType.TCPServer:
return f"{self.binary()} \
--tcp-endpoint {master_endpoint.place}:{master_endpoint.argument} {endpoints}"
--tcp-port {master_endpoint.argument} {endpoints}"

return f"{self.binary()} {master_endpoint.place}:{master_endpoint.argument} {endpoints} -l {self.logdir()}"

Expand Down
7 changes: 6 additions & 1 deletion core/services/ardupilot_manager/mavlink_proxy/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,12 @@ def serial_test_mavlink_router(valid_output_endpoints: Set[Endpoint], valid_mast
EndpointType.TCPServer,
EndpointType.TCPClient,
]
allowed_master_types = [EndpointType.UDPServer, EndpointType.Serial, EndpointType.TCPServer]
allowed_master_types = [
EndpointType.UDPServer,
EndpointType.TCPServer,
EndpointType.TCPClient,
EndpointType.Serial,
]
run_common_routing_tests(
mavlink_router, allowed_output_types, allowed_master_types, valid_output_endpoints, valid_master_endpoints
)
Expand Down

0 comments on commit eb5943a

Please sign in to comment.