flipperzero-firmware/applications/main/bad_usb/helpers/ducky_script.h
Leo Smith efc52ab469
BdUSBadded WAIT_FOR_BUTTON_PRESS functionality (#2544)
Co-authored-by: p4p1 <p4p1@vivaldi.net>
Co-authored-by: あく <alleteam@gmail.com>
2023-04-04 11:40:19 +08:00

52 lines
1.0 KiB
C

#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <furi.h>
#include <furi_hal.h>
typedef enum {
BadUsbStateInit,
BadUsbStateNotConnected,
BadUsbStateIdle,
BadUsbStateWillRun,
BadUsbStateRunning,
BadUsbStateDelay,
BadUsbStateStringDelay,
BadUsbStateWaitForBtn,
BadUsbStateDone,
BadUsbStateScriptError,
BadUsbStateFileError,
} BadUsbWorkerState;
typedef struct {
BadUsbWorkerState state;
uint16_t line_cur;
uint16_t line_nb;
uint32_t delay_remain;
uint16_t error_line;
char error[64];
} BadUsbState;
typedef struct BadUsbScript BadUsbScript;
BadUsbScript* bad_usb_script_open(FuriString* file_path);
void bad_usb_script_close(BadUsbScript* bad_usb);
void bad_usb_script_set_keyboard_layout(BadUsbScript* bad_usb, FuriString* layout_path);
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
}
#endif