From 9c44d3bd16d68c28347532689494140c4c27adcf Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Thu, 23 Jul 2015 14:44:36 -0400 Subject: rename query to avoid name clashing --- query.m | 20 -------------------- query_usbtmc.m | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 20 deletions(-) delete mode 100644 query.m create mode 100644 query_usbtmc.m diff --git a/query.m b/query.m deleted file mode 100644 index f276125..0000000 --- a/query.m +++ /dev/null @@ -1,20 +0,0 @@ -function [out_str] = query(fname, in_str) - fname = '/dev/usbtmc0'; - - string_terminator = 10; - - fhr = fopen( fname, 'r'); - fhw = fopen( fname, 'w'); - fwrite(fhw, in_str); - - out_str = []; - [out_byte, cnt] = fread(fhr,1,'*uint8'); - while (out_byte ~= string_terminator) & (cnt ~= 0) - out_str = [ out_str, char(out_byte) ]; - out_byte = fread(fhr,1,'*uint8'); - end - - fclose(fhr); - fclose(fhw); - -end diff --git a/query_usbtmc.m b/query_usbtmc.m new file mode 100644 index 0000000..266e579 --- /dev/null +++ b/query_usbtmc.m @@ -0,0 +1,20 @@ +function [out_str] = query_usbtmc(fname, in_str) + fname = '/dev/usbtmc0'; + + string_terminator = 10; + + fhr = fopen( fname, 'r'); + fhw = fopen( fname, 'w'); + fwrite(fhw, in_str); + + out_str = []; + [out_byte, cnt] = fread(fhr,1,'*uint8'); + while (out_byte ~= string_terminator) & (cnt ~= 0) + out_str = [ out_str, char(out_byte) ]; + out_byte = fread(fhr,1,'*uint8'); + end + + fclose(fhr); + fclose(fhw); + +end -- cgit v1.2.3