libgphoto2 icon indicating copy to clipboard operation
libgphoto2 copied to clipboard

Move serial cache from Canon to port library

Open RReverser opened this issue 1 year ago • 2 comments

I've done this as one of changes in the attempt to ensure re-entrancy, but I figured it's standalone enough to deserve a separate review.

This moves the serial cache (the one that reads a larger chunk to reduce overhead from reading a few bytes at a time) from canon.c to the generic serial port library. The actual cache now lives in the _GPPortPrivateLibrary structure instead of static variables, ensuring that it can't be accidentally modified from competing threads. Additionally, by virtue of being in the generic serial port implementation, the cache logic can now benefit all cameras that communicate over the serial port instead of just a single function in Canon driver.

Note that I don't have any ability to actually test cameras over the serial port so would appreciate another pair of eyes.

RReverser avatar Oct 30 '22 18:10 RReverser

I will get some serial cameras out of storage to verify it works ;)

msmeissn avatar Oct 31 '22 09:10 msmeissn

still trying to get my serial setup to work again with he current version. not sure why it does not work currently.

msmeissn avatar Nov 07 '22 12:11 msmeissn