cleanup fixme

This commit is contained in:
Kevin Hester
2021-02-26 15:55:46 +08:00
parent cfe63d17ef
commit 17da6f464d
4 changed files with 17 additions and 13 deletions

View File

@@ -68,6 +68,7 @@ import base64
import platform
import socket
from . import mesh_pb2, portnums_pb2, apponly_pb2, util
from .util import fixme, catchAndIgnore
from pubsub import pub
from dotmap import DotMap
@@ -90,14 +91,6 @@ format is Mmmss (where M is 1+the numeric major number. i.e. 20120 means 1.1.20
OUR_APP_VERSION = 20200
def catchAndIgnore(reason, closure):
"""Call a closure but if it throws an excpetion print it and continue"""
try:
closure()
except BaseException as ex:
logging.error(f"Exception thrown in {reason}: {ex}")
class MeshInterface:
"""Interface class for meshtastic devices
@@ -379,8 +372,8 @@ class MeshInterface:
"""
Done with initial config messages, now send regular MeshPackets to ask for settings and channels
"""
self._requestSettings()
self._requestChannels()
# self._requestSettings()
# self._requestChannels()
# FIXME, the following should only be called after we have settings and channels
self._connected() # Tell everone else we are ready to go

View File

@@ -7,6 +7,17 @@ import serial.tools.list_ports
blacklistVids = dict.fromkeys([0x1366])
def fixme(message):
raise Exception(f"FIXME: {message}")
def catchAndIgnore(reason, closure):
"""Call a closure but if it throws an excpetion print it and continue"""
try:
closure()
except BaseException as ex:
logging.error(f"Exception thrown in {reason}: {ex}")
def findPorts():
"""Find all ports that might have meshtastic devices