2022-07-29 14:48:51 +00:00
|
|
|
#pragma once
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <furi_hal_spi.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <nrf24.h>
|
|
|
|
#include <furi.h>
|
|
|
|
#include <furi_hal.h>
|
2022-09-10 23:09:02 +00:00
|
|
|
#include <toolbox/stream/file_stream.h>
|
2022-07-29 14:48:51 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char* name;
|
|
|
|
uint8_t hid;
|
|
|
|
uint8_t mod;
|
|
|
|
} MJDuckyKey;
|
|
|
|
|
2022-09-10 23:09:02 +00:00
|
|
|
typedef struct {
|
2023-03-07 21:18:23 +00:00
|
|
|
FuriMutex* mutex;
|
2022-09-10 23:09:02 +00:00
|
|
|
bool ducky_err;
|
|
|
|
bool addr_err;
|
|
|
|
bool is_thread_running;
|
2022-09-21 19:29:42 +00:00
|
|
|
bool is_ducky_running;
|
2023-07-17 23:53:30 +00:00
|
|
|
bool is_nrf24_connected;
|
2022-09-10 23:09:02 +00:00
|
|
|
bool close_thread_please;
|
|
|
|
Storage* storage;
|
|
|
|
FuriThread* mjthread;
|
|
|
|
Stream* file_stream;
|
|
|
|
} PluginState;
|
|
|
|
|
2022-07-29 14:48:51 +00:00
|
|
|
void mj_process_ducky_script(
|
|
|
|
FuriHalSpiBusHandle* handle,
|
|
|
|
uint8_t* addr,
|
|
|
|
uint8_t addr_size,
|
|
|
|
uint8_t rate,
|
2022-09-10 23:09:02 +00:00
|
|
|
char* script,
|
|
|
|
PluginState* plugin_state);
|
2022-07-29 14:48:51 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|