This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.
ofSerial.h
Go to the documentation of this file.
Definition ofFileUtils.h:15
std::string getDevicePath()
Gets the path to the device.
Definition ofSerial.h:59
std::string getDeviceName()
Gets the name of the device.
Definition ofSerial.h:68
ofSerialDeviceInfo()
Construct an undefined serial device.
Definition ofSerial.h:49
ofSerialDeviceInfo(std::string devicePathIn, std::string deviceNameIn, int deviceIDIn)
Construct an ofSerialDeviceInfo with parameters.
Definition ofSerial.h:42
ofSerial provides a cross platform system for interfacing with the serial port. You can choose the po...
Definition ofSerial.h:113
std::vector< ofSerialDeviceInfo > getDeviceList()
Returns a vector of ofSerialDeviceInfo instances with the devicePath, deviceName, deviceID set.
Definition ofSerial.cpp:232
void drain()
Drain is only available on OSX and Linux and is very similar to flush(), but blocks until all the dat...
Definition ofSerial.cpp:649
void buildDeviceList()
Enumerate all devices attached to a serial port.
Definition ofSerial.cpp:154
bool setup(std::string portName, int baudrate)
Opens the serial port, with the given name and baud rate.
struct termios oldoptions
This is the set of (current) terminal attributes to be reused when changing a subset of options.
Definition ofSerial.h:378
bool bHaveEnumeratedDevices
< This vector stores information about all serial devices found.
Definition ofSerial.h:344
long writeBytes(const unsigned char *buffer, size_t length)
This writes bytes into the serial buffer from the buffer pointer passed in.
Definition ofSerial.cpp:505
bool setup()
Attempts to setup the first available device at a baud rate of 9600.
Definition ofSerial.cpp:267
OF_DEPRECATED_MSG("Use listDevices() instead", void enumerateDevices())
Prints out the available serial devices.
int readByte()
Reads and returns a single byte from the requested device.
Definition ofSerial.cpp:575
bool writeByte(unsigned char singleByte)
Writes a single byte to the connected serial device.
Definition ofSerial.cpp:566
int available()
The available method is useful when you want to know how many bytes are available in the serial port....
Definition ofSerial.cpp:663
void flush(bool flushIn=true, bool flushOut=true)
Clears data from one or both of the serial buffers.
Definition ofSerial.cpp:622
void listDevices()
This lists all the available serial devices to the console or standard output.
Definition ofSerial.cpp:223
long readBytes(unsigned char *buffer, size_t length)
Reads 'length' bytes from the connected serial device.
Definition ofSerial.cpp:555