def __init__(self, application_info: ApplicationInfo): self.application_info = application_info self.platform_info = application_info.platform_info self.name = application_info.name self.version = application_info.version self.settings = application_info.settings self.status = DeviceStatus() self.watchdog = Watchdog(device=self, settings=self.settings) # Conditionally enable terminal on UART0. Default: False. #try: # self.terminal = Terminal(self.settings) # self.terminal.start() #except Exception as ex: # log.exc(ex, 'Enabling Terminal failed') self.device_id = get_device_id() self.networking = None self.telemetry = None self.rtc = None
def __init__(self, uri, format): log.info('Telemetry transport: MQTT over TCP over WiFi') # Addressing. self.uri = uri self.format = format # v1 #self.scheme, self.netloc, self.path, self.query, self.fragment = urlsplit(self.uri) # v2 self.target = urlparse(self.uri) # Todo: Refactor `get_device_id` somehow better. self.client_id = 'terkin.{}'.format(get_device_id()) # Status flags. self.defunct = False self.defunctness_reported = False # TODO: Start connecting to MQTT broker here already? # Maybe we should defer this to the point where the # first transmission will require it. self.ensure_connection()
def __init__(self, name=None, version=None, settings=None): self.name = name self.version = version self.settings = settings # Conditionally enable terminal on UART0. Default: False. self.terminal = Terminal(self.settings) self.terminal.start() self.device_id = get_device_id() self.networking = None self.telemetry = None self.wdt = None self.rtc = None self.status = DeviceStatus()
def __init__(self, application_info): self.application_info = application_info self.name = application_info.name self.version = application_info.version self.settings = application_info.settings self.status = DeviceStatus() self.watchdog = Watchdog(device=self, settings=self.settings) # Conditionally enable terminal on UART0. Default: False. self.terminal = Terminal(self.settings) self.terminal.start() self.device_id = get_device_id() self.networking = None self.telemetry = None self.rtc = None