ofSerial - event receiving?

Hello all.

I’d like to know if it is possible to get an event and handle it when we receive a constant amount of bytes via serial port.

I’m checking out ofSerial, but all the examples I’ve found are reading the serial port at an update and then managing the data…I think it would be nice get an interrupt or event and then manage the complete buffer at once.

Thank you.

Hi ofPAK,

A while ago we had to use serial comm. with a couple of arduinos and somehow I couldn’t use ofSerial. Can’t remember what was going wrong, but I found a great a serial lib using Boost. It does have a callback feature (I didn’t use that) and a function like: serial_obj.readUntil(“end_char”); which returns true when it found the “end_char” character.

We used this on a Mac w/o problems.

I’ve added the classes to my github repos: https://github.com/roxlu/ofxSerial and is just a collection of some handy serial classes. See AsyncSerial for your needs.

Best regards,
roxlu

[quote author=“roxlu”]Hi ofPAK,

A while ago we had to use serial comm. with a couple of arduinos and somehow I couldn’t use ofSerial. Can’t remember what was going wrong, but I found a great a serial lib using Boost. It does have a callback feature (I didn’t use that) and a function like: serial_obj.readUntil(“end_char”); which returns true when it found the “end_char” character.

We used this on a Mac w/o problems.

I’ve added the classes to my github repos: https://github.com/roxlu/ofxSerial and is just a collection of some handy serial classes. See AsyncSerial for your needs.

Best regards,
roxlu[/quote]

Thank you roxlu, this is quite what I was looking for.

Would it work on Windows?
Do you know if there is an example just to look at?

Thank you for your help. :smiley: