unleashed-firmware/lib/toolbox/protocols/protocol_dict.h
Sergey Gavrilov 4bf29827f8
M*LIB: non-inlined strings, FuriString primitive ()
* Quicksave 1
* Header stage complete
* Source stage complete
* Lint & merge fixes
* Includes
* Documentation step 1
* FBT: output free size considering BT STACK
* Documentation step 2
* py lint
* Fix music player plugin
* unit test stage 1: string allocator, mem, getters, setters, appends, compare, search.
* unit test: string equality
* unit test: string replace
* unit test: string start_with, end_with
* unit test: string trim
* unit test: utf-8
* Rename
* Revert fw_size changes
* Simplify CLI backspace handling
* Simplify CLI character insert
* Merge fixes
* Furi: correct filenaming and spelling
* Bt: remove furi string include

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-06 00:15:23 +09:00

73 lines
2 KiB
C

#pragma once
#include "protocol.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ProtocolDict ProtocolDict;
typedef int32_t ProtocolId;
#define PROTOCOL_NO (-1)
#define PROTOCOL_ALL_FEATURES (0xFFFFFFFF)
ProtocolDict* protocol_dict_alloc(const ProtocolBase** protocols, size_t protocol_count);
void protocol_dict_free(ProtocolDict* dict);
void protocol_dict_set_data(
ProtocolDict* dict,
size_t protocol_index,
const uint8_t* data,
size_t data_size);
void protocol_dict_get_data(
ProtocolDict* dict,
size_t protocol_index,
uint8_t* data,
size_t data_size);
size_t protocol_dict_get_data_size(ProtocolDict* dict, size_t protocol_index);
size_t protocol_dict_get_max_data_size(ProtocolDict* dict);
const char* protocol_dict_get_name(ProtocolDict* dict, size_t protocol_index);
const char* protocol_dict_get_manufacturer(ProtocolDict* dict, size_t protocol_index);
void protocol_dict_decoders_start(ProtocolDict* dict);
uint32_t protocol_dict_get_features(ProtocolDict* dict, size_t protocol_index);
ProtocolId protocol_dict_decoders_feed(ProtocolDict* dict, bool level, uint32_t duration);
ProtocolId protocol_dict_decoders_feed_by_feature(
ProtocolDict* dict,
uint32_t feature,
bool level,
uint32_t duration);
ProtocolId protocol_dict_decoders_feed_by_id(
ProtocolDict* dict,
size_t protocol_index,
bool level,
uint32_t duration);
bool protocol_dict_encoder_start(ProtocolDict* dict, size_t protocol_index);
LevelDuration protocol_dict_encoder_yield(ProtocolDict* dict, size_t protocol_index);
void protocol_dict_render_data(ProtocolDict* dict, FuriString* result, size_t protocol_index);
void protocol_dict_render_brief_data(ProtocolDict* dict, FuriString* result, size_t protocol_index);
uint32_t protocol_dict_get_validate_count(ProtocolDict* dict, size_t protocol_index);
ProtocolId protocol_dict_get_protocol_by_name(ProtocolDict* dict, const char* name);
bool protocol_dict_get_write_data(ProtocolDict* dict, size_t protocol_index, void* data);
#ifdef __cplusplus
}
#endif