kopia lustrzana https://gitlab.com/sane-project/backends
Merge branch 'sanei-usb-configure-record-open-clear' into 'master'
sanei_usb: Allow backends to specify when USB recording is cleared See merge request sane-project/backends!392escl-fix-sleep-mode
commit
5af7850ba6
|
@ -224,6 +224,19 @@ extern SANE_String sanei_usb_testing_get_backend();
|
|||
*/
|
||||
extern SANE_Bool sanei_usb_is_replay_mode_enabled();
|
||||
|
||||
/** Clears currently recorded data.
|
||||
|
||||
This is useful on certain backends to clear the currently recorded data if it relates to
|
||||
other devices than the one that the scan will be performed on. On these backends all
|
||||
devices that the backend supports are opened multiple times. Recording this interaction
|
||||
to XML file makes it impossible to replay it, as the existence of these devices is not mocked
|
||||
currently.
|
||||
|
||||
This function may only be called when no USB devices are open, otherwise the behavior is
|
||||
unpredictable.
|
||||
*/
|
||||
extern void sanei_usb_testing_record_clear();
|
||||
|
||||
/** Records a debug message in the captured USB data if testing mode is enabled. If testing mode
|
||||
* is not enabled, this function does nothing.
|
||||
*
|
||||
|
|
|
@ -1124,6 +1124,19 @@ static void sanei_usb_replay_debug_msg(SANE_String_Const message)
|
|||
}
|
||||
}
|
||||
|
||||
extern void sanei_usb_testing_record_clear()
|
||||
{
|
||||
if (testing_mode != sanei_usb_testing_mode_record)
|
||||
return;
|
||||
|
||||
// we only need to indicate that we never opened a device and sanei_usb_record_open() will
|
||||
// reinitialize everything for us.
|
||||
testing_already_opened = 0;
|
||||
testing_known_commands_input_failed = 0;
|
||||
testing_last_known_seq = 0;
|
||||
testing_append_commands_node = NULL;
|
||||
}
|
||||
|
||||
extern void sanei_usb_testing_record_message(SANE_String_Const message)
|
||||
{
|
||||
if (testing_mode == sanei_usb_testing_mode_record)
|
||||
|
@ -1356,6 +1369,10 @@ SANE_Bool sanei_usb_is_replay_mode_enabled()
|
|||
return SANE_FALSE;
|
||||
}
|
||||
|
||||
void sanei_usb_testing_record_clear()
|
||||
{
|
||||
}
|
||||
|
||||
void sanei_usb_testing_record_message(SANE_String_Const message)
|
||||
{
|
||||
(void) message;
|
||||
|
|
Ładowanie…
Reference in New Issue