RE: Accessing USB thermometer sensor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> the right direction to be able to read the temperature from command
> line?
> Josh
>
Reading a serial device from the commannd line is not easy.
First because each command you type closes the port after running and so it
flushes buffers.

I would suggest using shell parenthesis to group the commands
Use stty to set the port to raw mode etc.
Use 'echo' and 'dd' which is like 'cat' but much more configurable for
buffer sizes
something like:
( stty 9600 raw; echo 'request'; dd bs=1 count=10 >response.out)
</dev/serialusb >&0

--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux