State transitions according to the TWAIN-Specification
Brought to you by:
kevin_gill
If not sending TWAIN-Messages in the right order you might get Errors like "GeneralFailure in response to DAT_PENDINGXFER. DG DAT MSG is out of expected sequence." from the source you are talking to.
In our case this was caused by the TWAIN implementation in twain.C which sent a transfere Acknowledgment when closing a Source, no matter what state the source was in.
To fix this I track the state of the source and only send the the needed messages when closing a source down as suggested by the TODO-comments within twain.C.
The attached patch applies to version 1.0.4 of the module.
State-transition patch