From a7ac66e4c072d3c1a346b8160ac0b133b8f56579 Mon Sep 17 00:00:00 2001 From: Chandrashekhar Dhulipala Date: Tue, 14 Jun 2016 12:26:20 +0530 Subject: [PATCH] Update write function for Unicode strings --- src/SerialPorts.jl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/SerialPorts.jl b/src/SerialPorts.jl index 16a8be3..7380ea7 100644 --- a/src/SerialPorts.jl +++ b/src/SerialPorts.jl @@ -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)