mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-27 23:33:53 +03:00
6de2934394
* BadUSB: media keys, GLOBE command * f18 api table fix * BadUSB over BLE * Made PVS happy Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
56 lines
1.2 KiB
C
56 lines
1.2 KiB
C
#pragma once
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <furi.h>
|
|
#include <furi_hal.h>
|
|
#include "bad_usb_hid.h"
|
|
|
|
typedef enum {
|
|
BadUsbStateInit,
|
|
BadUsbStateNotConnected,
|
|
BadUsbStateIdle,
|
|
BadUsbStateWillRun,
|
|
BadUsbStateRunning,
|
|
BadUsbStateDelay,
|
|
BadUsbStateStringDelay,
|
|
BadUsbStateWaitForBtn,
|
|
BadUsbStatePaused,
|
|
BadUsbStateDone,
|
|
BadUsbStateScriptError,
|
|
BadUsbStateFileError,
|
|
} BadUsbWorkerState;
|
|
|
|
typedef struct {
|
|
BadUsbWorkerState state;
|
|
size_t line_cur;
|
|
size_t line_nb;
|
|
uint32_t delay_remain;
|
|
size_t error_line;
|
|
char error[64];
|
|
} BadUsbState;
|
|
|
|
typedef struct BadUsbScript BadUsbScript;
|
|
|
|
BadUsbScript* bad_usb_script_open(FuriString* file_path, BadUsbHidInterface interface);
|
|
|
|
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_start_stop(BadUsbScript* bad_usb);
|
|
|
|
void bad_usb_script_pause_resume(BadUsbScript* bad_usb);
|
|
|
|
BadUsbState* bad_usb_script_get_state(BadUsbScript* bad_usb);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|