Skip to content

Commit

Permalink
Update write function for Unicode strings
Browse files Browse the repository at this point in the history
  • Loading branch information
cshekhard authored and sjkelly committed Aug 29, 2016
1 parent ed35b24 commit a7ac66e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/SerialPorts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,14 @@ function Base.write(serialport::SerialPort, data::UTF8String)
if bytes[4] == 195 bytes[5] = bytes[5] + 64 end
four_bytes = [ bytes[1] , bytes[2] , bytes[3] , bytes[5] ]
serialport.python_ptr[:write](four_bytes)
end
end

elseif bytes[1] == 83
if sizeof(bytes) == 4 serialport.python_ptr[:write](bytes) end
if sizeof(bytes) == 5
four_bytes = [ bytes[1] , bytes[2] , bytes[3] , bytes[5] ]
serialport.python_ptr[:write](four_bytes)
end

else
serialport.python_ptr[:write](bytes)
Expand Down

0 comments on commit a7ac66e

Please sign in to comment.