DeviceReadBuffer
DeviceReadBuffer[device]
reads the complete contents of the buffer on a device.
DeviceReadBuffer[device,n]
reads n elements from the buffer.
DeviceReadBuffer[device,crit]
reads elements from the buffer until the device-specific criterion crit is met.
DeviceReadBuffer[device,crit,param]
reads elements associated with the parameter param.
DeviceReadBuffer[device,crit,{param1,param2,…}]
reads elements associated with the parami.
Details
- A device can be specified either by a DeviceObject or by a string representing a device class.
- DeviceReadBuffer is a blocking function; when called, it communicates with the device and does not return until it has the data it needs.
- Not all devices have buffers. For those that do not, DeviceReadBuffer generates a message.
Examples
open allclose allBasic Examples (2)
Applications (2)
Open a serial connection to an Arduino device running a custom program called sketch:
Write a string of bytes to a Sphero serial device after opening a connection to it:
Read the specified number of bytes from the device buffer:
Read the rest of the response:
Write the same values and read the buffered response until a specified terminator is encountered:
Text
Wolfram Research (2014), DeviceReadBuffer, Wolfram Language function, https://reference.wolfram.com/language/ref/DeviceReadBuffer.html.
CMS
Wolfram Language. 2014. "DeviceReadBuffer." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DeviceReadBuffer.html.
APA
Wolfram Language. (2014). DeviceReadBuffer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DeviceReadBuffer.html