2021-11-26 13:53:51 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <furi.h>
|
|
|
|
#include <m-string.h>
|
|
|
|
|
|
|
|
typedef struct BadUsbScript BadUsbScript;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
BadUsbStateInit,
|
|
|
|
BadUsbStateNotConnected,
|
|
|
|
BadUsbStateIdle,
|
|
|
|
BadUsbStateRunning,
|
|
|
|
BadUsbStateDelay,
|
|
|
|
BadUsbStateDone,
|
|
|
|
BadUsbStateScriptError,
|
|
|
|
BadUsbStateFileError,
|
|
|
|
} BadUsbWorkerState;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
BadUsbWorkerState state;
|
2022-08-08 10:58:32 +00:00
|
|
|
bool run_from_p;
|
2021-11-26 13:53:51 +00:00
|
|
|
uint16_t line_cur;
|
|
|
|
uint16_t line_nb;
|
|
|
|
uint32_t delay_remain;
|
|
|
|
uint16_t error_line;
|
|
|
|
} BadUsbState;
|
|
|
|
|
|
|
|
BadUsbScript* bad_usb_script_open(string_t file_path);
|
|
|
|
|
|
|
|
void bad_usb_script_close(BadUsbScript* bad_usb);
|
|
|
|
|
2022-08-03 17:20:49 +00:00
|
|
|
void bad_usb_script_set_keyboard_layout(BadUsbScript* bad_usb, string_t layout_path);
|
|
|
|
|
2021-11-26 13:53:51 +00:00
|
|
|
void bad_usb_script_start(BadUsbScript* bad_usb);
|
|
|
|
|
|
|
|
void bad_usb_script_stop(BadUsbScript* bad_usb);
|
|
|
|
|
|
|
|
void bad_usb_script_toggle(BadUsbScript* bad_usb);
|
|
|
|
|
|
|
|
BadUsbState* bad_usb_script_get_state(BadUsbScript* bad_usb);
|
|
|
|
|
2022-08-08 10:58:32 +00:00
|
|
|
void bad_usb_script_set_run_state(BadUsbState* st, bool run);
|
|
|
|
|
2021-11-26 13:53:51 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
2022-08-03 17:20:49 +00:00
|
|
|
#endif
|