@@ -64,101 +64,11 @@ def translate_to_rpc(self, rpcConnectionState):
6464
6565
6666
67- class PluginInfo :
68- """
69- Plugin info type.
70-
71- Parameters
72- ----------
73- name : std::string
74- Name of the plugin
75-
76- address : std::string
77- Address where the plugin is running
78-
79- port : int32_t
80- Port where the plugin is running
81-
82- """
83-
84-
85-
86- def __init__ (
87- self ,
88- name ,
89- address ,
90- port ):
91- """ Initializes the PluginInfo object """
92- self .name = name
93- self .address = address
94- self .port = port
95-
96- def __equals__ (self , to_compare ):
97- """ Checks if two PluginInfo are the same """
98- try :
99- # Try to compare - this likely fails when it is compared to a non
100- # PluginInfo object
101- return \
102- (self .name == to_compare .name ) and \
103- (self .address == to_compare .address ) and \
104- (self .port == to_compare .port )
105-
106- except AttributeError :
107- return False
108-
109- def __str__ (self ):
110- """ PluginInfo in string representation """
111- struct_repr = ", " .join ([
112- "name: " + str (self .name ),
113- "address: " + str (self .address ),
114- "port: " + str (self .port )
115- ])
116-
117- return f"PluginInfo: [{ struct_repr } ]"
118-
119- @staticmethod
120- def translate_from_rpc (rpcPluginInfo ):
121- """ Translates a gRPC struct to the SDK equivalent """
122- return PluginInfo (
123-
124- rpcPluginInfo .name ,
125-
126-
127- rpcPluginInfo .address ,
128-
129-
130- rpcPluginInfo .port
131- )
132-
133- def translate_to_rpc (self , rpcPluginInfo ):
134- """ Translates this SDK object into its gRPC equivalent """
135-
136-
137-
138-
139- rpcPluginInfo .name = self .name
140-
141-
142-
143-
144-
145- rpcPluginInfo .address = self .address
146-
147-
148-
149-
150-
151- rpcPluginInfo .port = self .port
152-
153-
154-
155-
156-
15767
15868
15969class Core (AsyncBase ):
16070 """
161- Access to the connection state and running plugins.
71+ Access to the connection state and core configurations
16272
16373 Generated by dcsdkgen - MAVSDK Core API
16474 """
@@ -196,26 +106,25 @@ async def connection_state(self):
196106 finally :
197107 connection_state_stream .cancel ()
198108
199- async def list_running_plugins (self ):
109+ async def set_mavlink_timeout (self , timeout_s ):
200110 """
201- Get a list of currently running plugins .
111+ Set timeout of MAVLink transfers .
202112
203- Returns
204- -------
205- plugin_info : [PluginInfo]
206- Plugin info
113+ The default timeout used is generally (0.5 seconds) seconds.
114+ If MAVSDK is used on the same host this timeout can be reduced, while
115+ if MAVSDK has to communicate over links with high latency it might
116+ need to be increased to prevent timeouts.
117+
118+ Parameters
119+ ----------
120+ timeout_s : double
121+ Timeout in seconds
207122
208123
209124 """
210125
211- request = core_pb2 .ListRunningPluginsRequest ()
212- response = await self ._stub .ListRunningPlugins (request )
213-
214-
215-
216- plugin_info = []
217- for plugin_info_rpc in response .plugin_info :
218- plugin_info .append (PluginInfo .translate_from_rpc (plugin_info_rpc ))
126+ request = core_pb2 .SetMavlinkTimeoutRequest ()
127+ request .timeout_s = timeout_s
128+ response = await self ._stub .SetMavlinkTimeout (request )
219129
220- return plugin_info
221-
130+
0 commit comments