@@ -90,7 +90,7 @@ def __init__(self, message):
9090 super ().__init__ (self .message )
9191
9292 def __init__ (
93- self , debugOut = None , noProto : bool = False , noNodes : bool = False
93+ self , debugOut = None , noProto : bool = False , noNodes : bool = False , timeout : int = 300
9494 ) -> None :
9595 """Constructor
9696
@@ -99,13 +99,14 @@ def __init__(
9999 link - just be a dumb serial client.
100100 noNodes -- If True, instruct the node to not send its nodedb
101101 on startup, just other configuration information.
102+ timeout -- How long to wait for replies (default: 300 seconds)
102103 """
103104 self .debugOut = debugOut
104105 self .nodes : Optional [Dict [str , Dict ]] = None # FIXME
105106 self .isConnected : threading .Event = threading .Event ()
106107 self .noProto : bool = noProto
107108 self .localNode : meshtastic .node .Node = meshtastic .node .Node (
108- self , - 1
109+ self , - 1 , timeout = timeout
109110 ) # We fixup nodenum later
110111 self .myInfo : Optional [
111112 mesh_pb2 .MyNodeInfo
@@ -119,7 +120,7 @@ def __init__(
119120 self .failure = (
120121 None # If we've encountered a fatal exception it will be kept here
121122 )
122- self ._timeout : Timeout = Timeout ()
123+ self ._timeout : Timeout = Timeout (maxSecs = timeout )
123124 self ._acknowledgment : Acknowledgment = Acknowledgment ()
124125 self .heartbeatTimer : Optional [threading .Timer ] = None
125126 random .seed () # FIXME, we should not clobber the random seedval here, instead tell user they must call it
0 commit comments