2021-11-26 16:53:51 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <furi.h>
|
|
|
|
|
|
|
|
typedef struct BadUsbScript BadUsbScript;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
BadUsbStateInit,
|
|
|
|
BadUsbStateNotConnected,
|
|
|
|
BadUsbStateIdle,
|
|
|
|
BadUsbStateRunning,
|
|
|
|
BadUsbStateDelay,
|
|
|
|
BadUsbStateDone,
|
|
|
|
BadUsbStateScriptError,
|
|
|
|
BadUsbStateFileError,
|
|
|
|
} BadUsbWorkerState;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
BadUsbWorkerState state;
|
|
|
|
uint16_t line_cur;
|
|
|
|
uint16_t line_nb;
|
|
|
|
uint32_t delay_remain;
|
|
|
|
uint16_t error_line;
|
2022-10-12 19:21:54 +03:00
|
|
|
char error[64];
|
2021-11-26 16:53:51 +03:00
|
|
|
} BadUsbState;
|
|
|
|
|
2022-10-05 18:15:23 +03:00
|
|
|
BadUsbScript* bad_usb_script_open(FuriString* file_path);
|
2021-11-26 16:53:51 +03:00
|
|
|
|
|
|
|
void bad_usb_script_close(BadUsbScript* bad_usb);
|
|
|
|
|
2022-10-05 21:27:13 +03:00
|
|
|
void bad_usb_script_set_keyboard_layout(BadUsbScript* bad_usb, FuriString* layout_path);
|
2022-08-03 20:20:49 +03:00
|
|
|
|
2021-11-26 16:53:51 +03: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);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
2022-08-09 14:36:22 +03:00
|
|
|
#endif
|