[Solved] hpvPlayer stop when ofSerial try to send something

Hi everyone,

I’m experiencing an issue when i try to write something on serial port (micro controller 32u4 from arduino). It work well when my OF app try to catch something from the serial but when it’s time to write everything stop.

When I say everything, I mean the video player stop.

I’m using HPV player because I need smooth 4k video playing.

I did not try with another player but the communication example is working as expected.

If you have any tips, this will be very appreciated !

Ok, found. It seems that when you pass the bytes size to the writeBytes function you have to do -1 to the value. It do not trow you an error if you not, but freeze frame and block everything.

but in example the bug is present, ofSerial.h, line 292 :

	/// \brief This writes bytes into the serial buffer from the buffer pointer passed in
	///
	/// ~~~~{.cpp}
	/// unsigned char buf[3] = {'o', 'f', '!'};
	/// device.writeBytes(&buf[0], 3);
	/// ~~~~
	long writeBytes(const unsigned char * buffer, size_t length);
	long writeBytes(const char * buffer, size_t length);
	long writeBytes(const ofBuffer & buffer);