Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

ofxSerial close connection

$
0
0

@v_za wrote:

Hello Everyone,

I’m using the ofxSerial addon to read serial data but I need to close the connection and re-open it again with a different baud rate. how could I do that?
here my ofApp.h

ofx::IO::SerialDevice device;

here my ofApp.cpp inside the setup() function.

string mydevice = "/dev/tty.SLAB_USBtoUART";
int baudrate = 115200;
// Connect to my device
bool success = device.setup(mydevice,
                                baudrate,
                                device.DATA_BITS_EIGHT,
                                device.PAR_EVEN,
                                device.STOP_ONE,
                                device.FLOW_CTRL_NONE);

Thanks!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles