8 # how often should a command retried when busy? |
8 # how often should a command retried when busy? |
9 RETRIES = 10 |
9 RETRIES = 10 |
10 |
10 |
11 # define loglevels |
11 # define loglevels |
12 DEBUG = 20 |
12 DEBUG = 20 |
|
13 LOGLEVEL = 20 |
13 def log(level, msg): |
14 def log(level, msg): |
14 """ |
15 """ |
15 Logging output function |
16 Logging output function |
16 """ |
17 """ |
17 print msg |
18 if level <= LOGLEVEL: print msg |
18 |
19 |
19 class SerialCommunicator(): |
20 class SerialCommunicator(): |
20 def __init__(self, device, speed): |
21 def __init__(self, device, speed): |
21 self.device = device |
22 self.device = device |
22 self.speed = speed |
23 self.speed = speed |