How to use the serialio.SerialIO function in serialio

To help you get started, we’ve selected a few serialio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github q3k / m16c-interface / host / View on Github external
fmt = '%(message)s'
    if args.timestamps:
        fmt = '%(asctime)-15s %(levelname)s %(message)s'
    if args.verbose:
        logging.basicConfig(level=logging.DEBUG, format=fmt)
        logging.basicConfig(level=logging.INFO, format=fmt)

    adapter_logger, protocol_logger = None, None
    if args.debug_adapter:
        adapter_logger = logging
    if args.debug_protocol:
        protocol_logger = logging

    a = adapter.Adapter(args.port, logger=adapter_logger)
    s = serialio.SerialIO(a, logger=protocol_logger)
    s.adapter.connect()"Connected to adapter version {}".format(s.adapter.version()))
    s.connect()"Connected to target version {}".format(s.version()))

    sys.exit(args.func(args, s) or 0)
github twpayne / flightrecorder / flightrecorder / View on Github external
return block

    def read_track_logs(self, flight_number):'>BBH', 3, 5, flight_number))
            while True:
                self.buf +=
        except TimeoutError:
        return self.buf

if __name__ == '__main__':
    from serialio import SerialIO
    s = SerialIO('/dev/cu.usbmodem641')
    a = Ascent(s)
    if True:
        print repr(a.dev_drv_status_res())
    if True:
        for block in a.dev_drv_list_tracks():
            print repr(block)
github twpayne / flightrecorder / flightrecorder / View on Github external
def __new__(self, device=None, model=None):
        if device:
            devices = (device,)
            device_globs = DEVICE_GLOBS.get(os.uname()[0], ())
            devices = list(filename for device_glob in device_globs for filename in sorted(glob(device_glob)))
        if model is not None and model not in FlightRecorder.SUPPORTED_MODELS:
            raise RuntimeError  # FIXME
        for device in devices:
                io = SerialIO(device)
            except IOError:
            if model in Fifty20.SUPPORTED_MODELS:
                return Fifty20(io)
            elif model in Flymaster.SUPPORTED_MODELS:
                return Flymaster(io)
            elif model in Sixty15.SUPPORTED_MODELS:
                return Sixty15(io)
            elif model is None:
                        line = 'PBRSNP,'.encode('nmea_sentence')
              'write %r' % line)
                        line =
                        while line.find('\x11' if line[0] == '\x13' else '\n') == -1:


Concurrency agnostic serialio API

Latest version published 2 years ago

Package Health Score

57 / 100
Full package analysis

Similar packages