From cba83e780a9350eb45eb1c2f09fc87f5d389e1ac Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 20 May 2018 15:54:03 +0200 Subject: Move documentation and simulation stuff to its own subdir --- firmware/olsndot.py | 126 ---------------------------------------------------- 1 file changed, 126 deletions(-) delete mode 100644 firmware/olsndot.py (limited to 'firmware/olsndot.py') diff --git a/firmware/olsndot.py b/firmware/olsndot.py deleted file mode 100644 index 557226a..0000000 --- a/firmware/olsndot.py +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/env python3 - -import serial -import struct -from cobs import cobs -from collections import namedtuple -from enum import Enum -import time - -EOP = b'\0' - -#def cobs_encode(data): -# return b''.join(bytes([len(x)+1]) + x for x in data.split(EOP)) -# -#def cobs_decode(data): -# out = b'' -# while data: -# n, *rest = data -# out += b'\0' + bytes(rest[:n-1]) -# data = rest[n-1:] -# return out[1:] - -def address_pkt(addr): - return struct.pack(''.format( - self.fw_ver, self.hw_ver, self.addr, self.nchannels, self.channel_format, - st.uptime_s, st.vcc_mv/1000, st.temp_celsius) - - @property - def channel_format(self): - return '{}{}'.format(self.color_spec.name, self.nbits) - -if __name__ == '__main__': - d = Driver('/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A50285BI-if00-port0') - for addr, tid, drv in d.probe_devices(): - print(addr, tid, drv) -- cgit