sanei_usb: Add function to check whether we are using fake data

merge-requests/92/head
Povilas Kanapickas 2019-04-29 23:18:38 +03:00
rodzic fd6adf2a46
commit 4edfb7a287
2 zmienionych plików z 13 dodań i 0 usunięć

Wyświetl plik

@ -219,6 +219,11 @@ extern SANE_Status sanei_usb_testing_enable_record(SANE_String_Const path,
*/ */
extern SANE_String sanei_usb_testing_get_backend(); extern SANE_String sanei_usb_testing_get_backend();
/** Returns SANE_TRUE if replay testing mode is enabled, i.e. whether we are working with fake
* scan data.
*/
extern SANE_Bool sanei_usb_is_replay_mode_enabled();
/** Initialize sanei_usb. /** Initialize sanei_usb.
* *
* Call this before any other sanei_usb function. * Call this before any other sanei_usb function.

Wyświetl plik

@ -981,6 +981,14 @@ SANE_String sanei_usb_testing_get_backend()
return ret; return ret;
} }
SANE_Bool sanei_usb_is_replay_mode_enabled()
{
if (testing_mode == sanei_usb_testing_mode_replay)
return SANE_TRUE;
return SANE_FALSE;
}
static void sanei_usb_add_endpoint(device_list_type* device, static void sanei_usb_add_endpoint(device_list_type* device,
SANE_Int transfer_type, SANE_Int transfer_type,
SANE_Int ep_address, SANE_Int ep_address,