2021-07-16 15:37:48 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <m-string.h>
|
|
|
|
#include <m-array.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
string_t name;
|
|
|
|
uint64_t key;
|
|
|
|
uint16_t type;
|
|
|
|
} SubGhzKey;
|
|
|
|
|
|
|
|
ARRAY_DEF(SubGhzKeyArray, SubGhzKey, M_POD_OPLIST)
|
|
|
|
|
|
|
|
#define M_OPL_SubGhzKeyArray_t() ARRAY_OPLIST(SubGhzKeyArray, M_POD_OPLIST)
|
|
|
|
|
|
|
|
typedef struct SubGhzKeystore SubGhzKeystore;
|
|
|
|
|
2021-09-01 21:05:00 +00:00
|
|
|
/** Allocate SubGhzKeystore
|
|
|
|
*
|
|
|
|
* @return SubGhzKeystore*
|
|
|
|
*/
|
2021-07-16 15:37:48 +00:00
|
|
|
SubGhzKeystore* subghz_keystore_alloc();
|
|
|
|
|
2021-09-01 21:05:00 +00:00
|
|
|
/** Free SubGhzKeystore
|
|
|
|
*
|
|
|
|
* @param instance
|
|
|
|
*/
|
2021-07-16 15:37:48 +00:00
|
|
|
void subghz_keystore_free(SubGhzKeystore* instance);
|
|
|
|
|
2021-09-01 21:05:00 +00:00
|
|
|
/** Loading manufacture key from file
|
|
|
|
*
|
|
|
|
* @param instance - SubGhzKeystore instance
|
|
|
|
* @param filename - const char* full path to the file
|
|
|
|
*/
|
2021-11-01 13:11:25 +00:00
|
|
|
bool subghz_keystore_load(SubGhzKeystore* instance, const char* filename);
|
|
|
|
|
|
|
|
/** Save manufacture key to file
|
|
|
|
*
|
|
|
|
* @param instance - SubGhzKeystore instance
|
|
|
|
* @param filename - const char* full path to the file
|
|
|
|
*/
|
|
|
|
bool subghz_keystore_save(SubGhzKeystore* instance, const char* filename, uint8_t* iv);
|
2021-07-16 15:37:48 +00:00
|
|
|
|
2021-09-01 21:05:00 +00:00
|
|
|
/** Get array of keys and names manufacture
|
|
|
|
*
|
|
|
|
* @param instance - SubGhzKeystore instance
|
|
|
|
* @return SubGhzKeyArray_t*
|
|
|
|
*/
|
2021-07-16 15:37:48 +00:00
|
|
|
SubGhzKeyArray_t* subghz_keystore_get_data(SubGhzKeystore* instance);
|