First thoughts to implement the serial connection support.

This commit is contained in:
klaute 2016-08-29 22:02:26 +02:00
parent 03632dfc10
commit 45398caf80

View file

@ -48,6 +48,10 @@ THREAD_LOOP_DELAY_S = 0.01
###############################################################################
ser = None
###############################################################################
baudrate = 0xffffffff
muxLine = 0xff
@ -98,13 +102,14 @@ thread_lock = None
########## function to call by the thread
def processReceivedData():
incoming = []
thread_started = True
for thread_stop == False:
# 1. read byte from serial port into incoming
incoming = []
incoming = ser.read(64)
# 2. process the received data
for c in incoming:
cc_state_fn[cc_state](c)
@ -224,17 +229,16 @@ def resetToBtldr():
#####
def openSerialDevice(d):
pass
ser = serial.Serial(d, 115200, timeout=0)
#####
def closeSerialDevice():
pass
ser.close()
#####
def sendSerialData(data):
for c in data:
pass
ser.write(c)
###############################################################################