Add in a retry mechanism for channel settings

Attempts multiple times to fetch things over the admin channel
before giving up.
This commit is contained in:
Derek Arnold
2024-09-03 21:47:07 -05:00
parent b4bd9568e4
commit 9612aea9b9
3 changed files with 29 additions and 8 deletions

View File

@@ -77,13 +77,14 @@ class Node:
self.channels = channels
self._fixupChannels()
def requestChannels(self):
def requestChannels(self, startingIndex: int = 0):
"""Send regular MeshPackets to ask channels."""
logging.debug(f"requestChannels for nodeNum:{self.nodeNum}")
self.channels = None
self.partialChannels = [] # We keep our channels in a temp array until finished
self._requestChannel(0)
# only initialize if we're starting out fresh
if startingIndex == 0:
self.channels = None
self.partialChannels = [] # We keep our channels in a temp array until finished
self._requestChannel(startingIndex)
def onResponseRequestSettings(self, p):
"""Handle the response packets for requesting settings _requestSettings()"""