unleashed-firmware/applications/external/pacs_fuzzer/lib/worker/protocol.h

63 lines
1.2 KiB
C
Raw Normal View History

2023-06-02 14:48:21 +00:00
#pragma once
#include <stdint.h>
2023-06-03 11:24:27 +00:00
// #define RFID_125_PROTOCOL
2023-06-05 11:10:51 +00:00
typedef struct FuzzerPayload FuzzerPayload;
2023-06-03 11:24:27 +00:00
2023-06-05 11:10:51 +00:00
typedef enum {
2023-06-03 11:24:27 +00:00
#if defined(RFID_125_PROTOCOL)
EM4100,
HIDProx,
PAC,
H10301,
#else
2023-06-02 14:48:21 +00:00
DS1990,
Metakom,
Cyfral,
2023-06-03 11:24:27 +00:00
#endif
2023-06-05 11:10:51 +00:00
} FuzzerProtocolsID;
2023-06-03 11:24:27 +00:00
2023-06-05 11:10:51 +00:00
typedef enum {
FuzzerMainMenuIndexDefaultValues = 0,
FuzzerMainMenuIndexLoadFile,
FuzzerMainMenuIndexLoadFileCustomUids,
} FuzzerMainMenuIndex;
struct FuzzerPayload {
uint8_t* data;
uint8_t data_size;
2023-06-02 14:48:21 +00:00
};
2023-06-05 17:24:38 +00:00
/**
* Get maximum length of UID among all supported protocols
* @return Maximum length of UID
*/
2023-06-05 11:10:51 +00:00
uint8_t fuzzer_proto_get_max_data_size();
2023-06-02 14:48:21 +00:00
2023-06-05 17:24:38 +00:00
/**
* Get protocol name based on its index
* @param index protocol index
* @return pointer to a string containing the name
*/
2023-06-05 11:10:51 +00:00
const char* fuzzer_proto_get_name(FuzzerProtocolsID index);
2023-06-05 17:24:38 +00:00
/**
* Get number of protocols
* @return number of protocols
*/
2023-06-05 11:10:51 +00:00
uint8_t fuzzer_proto_get_count_of_protocols();
2023-06-02 14:48:21 +00:00
2023-06-05 17:24:38 +00:00
/**
* Get menu label based on its index
* @param index menu index
* @return pointer to a string containing the menu label
*/
2023-06-05 11:10:51 +00:00
const char* fuzzer_proto_get_menu_label(FuzzerMainMenuIndex index);
2023-06-02 14:48:21 +00:00
2023-06-05 17:24:38 +00:00
/**
* Get number of menu items
* @return number of menu items
*/
2023-06-05 11:10:51 +00:00
uint8_t fuzzer_proto_get_count_of_menu_items();