File tree 1 file changed +13
-0
lines changed
core/services/ardupilot_manager/api/v1/routers
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 18
18
from fastapi_versioning import versioned_api_route
19
19
from loguru import logger
20
20
21
+ from ardupilot_manager .mavlink_proxy .AbstractRouter import TLogCondition
21
22
from autopilot_manager import AutoPilotManager
22
23
from exceptions import InvalidFirmwareFile , NoDefaultFirmwareAvailable
23
24
from typedefs import (
@@ -255,6 +256,18 @@ def preferred_router() -> Any:
255
256
return autopilot .load_preferred_router ()
256
257
257
258
259
+ @index_router_v1 .post ("/tlog_condition" , summary = "Set the condition for when to write Tlog files." )
260
+ def set_tlog_condition (condition : TLogCondition ) -> Any :
261
+ logger .debug ("Setting Tlog condition" )
262
+ autopilot .set_tlog_condition (condition )
263
+ logger .debug (f"Tlog write condition set to { condition } " )
264
+
265
+
266
+ @index_router_v1 .get ("/tlog_condition" , summary = "Retrieve Tlog file write condition" )
267
+ def tlog_condition () -> Any :
268
+ return autopilot .get_tlog_condition ()
269
+
270
+
258
271
@index_router_v1 .get ("/available_routers" , summary = "Retrieve preferred router" )
259
272
@index_to_http_exception
260
273
def available_routers () -> Any :
You can’t perform that action at this time.
0 commit comments