Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions macros/readbyteserial
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function buf=readserial(h,n)
// 12/1/2009: corrected version after report of bug 3829
if ~exists("n","local") then
N=serialstatus(h); n=N(1)
end
TCL_EvalStr("binary scan [read "+h+" "+string(n)+"] cu* ttybuf")
buf=evstr(TCL_GetVar("ttybuf"));//returns an array of bytes instead of char, useful since scilab does not want to cast strings into matrixes
endfunction