Loading...
Searching...
No Matches
protocol.h
1#pragma once
2#include <stdint.h>
3#include <stddef.h>
4#include <stdbool.h>
5#include <lib/toolbox/level_duration.h>
6#include <furi.h>
7
8typedef void* (*ProtocolAlloc)(void);
9typedef void (*ProtocolFree)(void* protocol);
10typedef uint8_t* (*ProtocolGetData)(void* protocol);
11
12typedef void (*ProtocolDecoderStart)(void* protocol);
13typedef bool (*ProtocolDecoderFeed)(void* protocol, bool level, uint32_t duration);
14
15typedef bool (*ProtocolEncoderStart)(void* protocol);
16typedef LevelDuration (*ProtocolEncoderYield)(void* protocol);
17
18typedef void (*ProtocolRenderData)(void* protocol, FuriString* result);
19typedef bool (*ProtocolWriteData)(void* protocol, void* data);
20
21typedef struct {
22 ProtocolDecoderStart start;
23 ProtocolDecoderFeed feed;
25
26typedef struct {
27 ProtocolEncoderStart start;
28 ProtocolEncoderYield yield;
30
31typedef struct {
32 const size_t data_size;
33 const char* name;
34 const char* manufacturer;
35 const uint32_t features;
36 const uint8_t validate_count;
37
38 ProtocolAlloc alloc;
39 ProtocolFree free;
40 ProtocolGetData get_data;
41 ProtocolDecoder decoder;
42 ProtocolEncoder encoder;
43 ProtocolRenderData render_uid;
44 ProtocolRenderData render_data;
45 ProtocolRenderData render_brief_data;
46 ProtocolWriteData write_data;
Definition string.c:4
Definition level_duration.h:15
Definition protocol.h:31
Definition protocol.h:21
Definition protocol.h:26