File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 25
25
##
26
26
## Copyright 2013 Arduino LLC (http://www.arduino.cc/)
27
27
28
- import os , tty , termios , select
28
+ import tty , termios , select
29
29
from contextlib import contextmanager
30
30
from sys import stdin , stdout
31
31
from subprocess import call
32
32
33
33
@contextmanager
34
34
def cbreak ():
35
- if hasattr (stdin , "fileno" ) and os .isatty (stdin .fileno ()):
36
- old_attrs = termios .tcgetattr (stdin )
37
- tty .setcbreak (stdin )
38
- tty .setraw (stdin )
35
+ old_attrs = termios .tcgetattr (stdin )
36
+ tty .setcbreak (stdin )
37
+ tty .setraw (stdin )
39
38
try :
40
39
yield
41
40
finally :
42
- if hasattr (stdin , "fileno" ) and os .isatty (stdin .fileno ()):
43
- termios .tcsetattr (stdin , termios .TCSADRAIN , old_attrs )
41
+ termios .tcsetattr (stdin , termios .TCSADRAIN , old_attrs )
44
42
45
43
class CRC :
46
44
def __init__ (self , file ):
@@ -94,7 +92,7 @@ def run(self, data):
94
92
call (['/usr/bin/blink-start' , '100' ])
95
93
return chr (2 )
96
94
call (['/usr/bin/blink-stop' ])
97
- return chr (0 )
95
+ return chr (0 ) + '101' # send the actual bridge version
98
96
99
97
class PacketReader :
100
98
def __init__ (self , processor ):
You can’t perform that action at this time.
0 commit comments