Loading...
Searching...
No Matches
protocol_dict.h
1#pragma once
2#include "protocol.h"
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8typedef struct ProtocolDict ProtocolDict;
9
10typedef int32_t ProtocolId;
11
12#define PROTOCOL_NO (-1)
13#define PROTOCOL_ALL_FEATURES (0xFFFFFFFF)
14
15ProtocolDict* protocol_dict_alloc(const ProtocolBase** protocols, size_t protocol_count);
16
17void protocol_dict_free(ProtocolDict* dict);
18
19void protocol_dict_set_data(
20 ProtocolDict* dict,
21 size_t protocol_index,
22 const uint8_t* data,
23 size_t data_size);
24
25void protocol_dict_get_data(
26 ProtocolDict* dict,
27 size_t protocol_index,
28 uint8_t* data,
29 size_t data_size);
30
31size_t protocol_dict_get_data_size(ProtocolDict* dict, size_t protocol_index);
32
33size_t protocol_dict_get_max_data_size(ProtocolDict* dict);
34
35const char* protocol_dict_get_name(ProtocolDict* dict, size_t protocol_index);
36
37const char* protocol_dict_get_manufacturer(ProtocolDict* dict, size_t protocol_index);
38
39void protocol_dict_decoders_start(ProtocolDict* dict);
40
41uint32_t protocol_dict_get_features(ProtocolDict* dict, size_t protocol_index);
42
43ProtocolId protocol_dict_decoders_feed(ProtocolDict* dict, bool level, uint32_t duration);
44
45ProtocolId protocol_dict_decoders_feed_by_feature(
46 ProtocolDict* dict,
47 uint32_t feature,
48 bool level,
49 uint32_t duration);
50
51ProtocolId protocol_dict_decoders_feed_by_id(
52 ProtocolDict* dict,
53 size_t protocol_index,
54 bool level,
55 uint32_t duration);
56
57bool protocol_dict_encoder_start(ProtocolDict* dict, size_t protocol_index);
58
59LevelDuration protocol_dict_encoder_yield(ProtocolDict* dict, size_t protocol_index);
60
61void protocol_dict_render_uid(ProtocolDict* dict, FuriString* result, size_t protocol_index);
62
63void protocol_dict_render_data(ProtocolDict* dict, FuriString* result, size_t protocol_index);
64
65void protocol_dict_render_brief_data(ProtocolDict* dict, FuriString* result, size_t protocol_index);
66
67uint32_t protocol_dict_get_validate_count(ProtocolDict* dict, size_t protocol_index);
68
69ProtocolId protocol_dict_get_protocol_by_name(ProtocolDict* dict, const char* name);
70
71bool protocol_dict_get_write_data(ProtocolDict* dict, size_t protocol_index, void* data);
72
73#ifdef __cplusplus
74}
75#endif
Definition string.c:4
Definition level_duration.h:15
Definition protocol.h:31
Definition protocol_dict.c:4