Skip to content

Commit f385c84

Browse files
cshekhardsjkelly
authored andcommitted
Update write function for Unicode strings
1 parent 0e9d304 commit f385c84

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/SerialPorts.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,14 @@ function Base.write(serialport::SerialPort, data::UTF8String)
100100
if bytes[4] == 195 bytes[5] = bytes[5] + 64 end
101101
four_bytes = [ bytes[1] , bytes[2] , bytes[3] , bytes[5] ]
102102
serialport.python_ptr[:write](four_bytes)
103-
end
103+
end
104+
105+
elseif bytes[1] == 83
106+
if sizeof(bytes) == 4 serialport.python_ptr[:write](bytes) end
107+
if sizeof(bytes) == 5
108+
four_bytes = [ bytes[1] , bytes[2] , bytes[3] , bytes[5] ]
109+
serialport.python_ptr[:write](four_bytes)
110+
end
104111

105112
else
106113
serialport.python_ptr[:write](bytes)

0 commit comments

Comments
 (0)