ESPixelStick Firmware
Firmware for the ESPixelStick
Loading...
Searching...
No Matches
fseq.h
Go to the documentation of this file.
1#pragma once
2/*
3* fseq.h
5* Copyright (c) 2021, 2022 Shelby Merrick
6* http://www.forkineye.com
8* This program is provided free for you to use in any way that you wish,
9* subject to the laws and regulations where you are using it. Due diligence
10* is strongly suggested before using this code. Please give credit where due.
12* The Author makes no warranty of any kind, express or implied, with regard
13* to this program or the documentation contained in this document. The
14* Author shall not be liable in any event for incidental or consequential
15* damages in connection with, or arising out of, the furnishing, performance
16* or use of these programs.
17*
18*/
19//-----------------------------------------------------------------------------
20typedef union
21{
22 struct
23 {
24 uint8_t header[4]; //FPPD
25 uint8_t packet_type;
26 uint16_t data_len;
27 } __attribute__ ((packed));
28 uint8_t raw[301];
29} FPPPacket;
30
31typedef union
32{
33 struct
34 {
35 uint8_t header[4]; //FPPD
36 uint8_t packet_type;
37 uint16_t data_len;
38 uint8_t ping_version;
39 uint8_t ping_subtype;
41 uint16_t versionMajor;
42 uint16_t versionMinor;
44 uint8_t ipAddress[4];
45 char hostName[65];
46 char version[41];
47 char hardwareType[41];
48 char ranges[121];
49 } __attribute__ ((packed));
50 uint8_t raw[301];
52
53typedef union
54{
55 struct
56 {
57 uint8_t header[4]; //FPPD
58 uint8_t packet_type;
59 uint16_t data_len;
60 uint8_t sync_action;
61 uint8_t sync_type;
62 uint32_t frame_number;
64 char filename[250];
65 } __attribute__ ((packed));
66 uint8_t raw[301];
68
69// https://github.com/FalconChristmas/fpp/blob/master/docs/FSEQ_Sequence_File_Format.txt
71{
72 uint8_t length[2];
73 char type[2];
74 uint8_t data;
75};
76
78{
79 uint16_t length;
80 char type[2];
81 String Data;
82};
83
85{
86 uint8_t Start[3];
87 uint8_t Length[3];
88
89} __attribute__ ((packed));
90
92{
93 uint32_t DataOffset;
94 uint32_t ChannelCount;
95};
96
98{
99 uint8_t header[4]; // PSEQ
100 uint8_t dataOffset[2];
104 uint8_t channelCount[4];
106 uint8_t stepTime;
107 uint8_t flags;
111 uint8_t flags2;
112 uint8_t id[8];
113} __attribute__ ((packed));
114
116{
117 uint8_t header[4]; // PSEQ
118 uint16_t dataOffset;
122 uint32_t channelCount;
124 uint8_t stepTime;
125 uint8_t flags;
129 uint8_t flags2;
130 uint64_t id;
131};
132
133inline uint64_t read64 (uint8_t* buf, int idx) {
134 uint32_t r1 = (int)(buf[idx + 3]) << 24;
135 r1 |= (int)(buf[idx + 2]) << 16;
136 r1 |= (int)(buf[idx + 1]) << 8;
137 r1 |= (int)(buf[idx]);
138
139 uint32_t r2 = (int)(buf[idx + 7]) << 24;
140 r2 |= (int)(buf[idx + 6]) << 16;
141 r2 |= (int)(buf[idx + 5]) << 8;
142 r2 |= (int)(buf[idx + 4]);
143 uint64_t r = r2;
144 r <<= 32;
145 r |= r1;
146 return r;
147}
148//-----------------------------------------------------------------------------
149inline uint32_t read32 (uint8_t* buf, int idx) {
150 uint32_t r = (int)(buf[idx + 3]) << 24;
151 r |= (int)(buf[idx + 2]) << 16;
152 r |= (int)(buf[idx + 1]) << 8;
153 r |= (int)(buf[idx]);
154 return r;
155}
156
157inline void write32 (uint8_t* pData, uint32_t value)
158{
159 pData[0] = (value >> 0) & 0xff;
160 pData[1] = (value >> 8) & 0xff;
161 pData[2] = (value >> 16) & 0xff;
162 pData[3] = (value >> 24) & 0xff;
163} // write16
164
165//-----------------------------------------------------------------------------
166inline uint32_t read24 (uint8_t* pData)
167{
168 return ((uint32_t)(pData[0]) |
169 (uint32_t)(pData[1]) << 8 |
170 (uint32_t)(pData[2]) << 16);
171} // read24
172
173//-----------------------------------------------------------------------------
174inline uint16_t read16 (uint8_t* pData)
175{
176 return ((uint16_t)(pData[0]) |
177 (uint16_t)(pData[1]) << 8);
178} // read16
179
180inline void write16 (uint8_t* pData, uint16_t value)
181{
182 pData[0] = value & 0xff;
183 pData[1] = (value >> 8) & 0xff;
184} // write16
uint16_t read16(uint8_t *pData)
Definition fseq.h:174
void write32(uint8_t *pData, uint32_t value)
Definition fseq.h:157
uint8_t header[4]
Definition fseq.h:0
uint8_t ipAddress[4]
Definition fseq.h:9
uint64_t read64(uint8_t *buf, int idx)
Definition fseq.h:133
void write16(uint8_t *pData, uint16_t value)
Definition fseq.h:180
char ranges[121]
Definition fseq.h:13
char filename[250]
Definition fseq.h:7
char version[41]
Definition fseq.h:11
char hardwareType[41]
Definition fseq.h:12
uint32_t read24(uint8_t *pData)
Definition fseq.h:166
uint32_t read32(uint8_t *buf, int idx)
Definition fseq.h:149
char hostName[65]
Definition fseq.h:10
struct FSEQParsedRangeEntry __attribute__
Definition fseq.h:116
uint8_t numSparseRanges
Definition fseq.h:128
uint8_t flags2
Definition fseq.h:129
uint8_t numCompressedBlocks
Definition fseq.h:127
uint8_t header[4]
Definition fseq.h:117
uint8_t flags
Definition fseq.h:125
uint16_t dataOffset
Definition fseq.h:118
uint64_t id
Definition fseq.h:130
uint8_t majorVersion
Definition fseq.h:120
uint8_t minorVersion
Definition fseq.h:119
uint8_t stepTime
Definition fseq.h:124
uint32_t channelCount
Definition fseq.h:122
uint8_t compressionType
Definition fseq.h:126
uint32_t TotalNumberOfFramesInSequence
Definition fseq.h:123
uint16_t VariableHdrOffset
Definition fseq.h:121
Definition fseq.h:92
uint32_t ChannelCount
Definition fseq.h:94
uint32_t DataOffset
Definition fseq.h:93
Definition fseq.h:78
String Data
Definition fseq.h:81
char type[2]
Definition fseq.h:80
uint16_t length
Definition fseq.h:79
Definition fseq.h:98
uint8_t compressionType
Definition fseq.h:108
uint8_t VariableHdrOffset[2]
Definition fseq.h:103
uint8_t channelCount[4]
Definition fseq.h:104
uint8_t dataOffset[2]
Definition fseq.h:100
uint8_t stepTime
Definition fseq.h:106
uint8_t header[4]
Definition fseq.h:99
uint8_t numCompressedBlocks
Definition fseq.h:109
uint8_t numSparseRanges
Definition fseq.h:110
uint8_t flags2
Definition fseq.h:111
uint8_t flags
Definition fseq.h:107
uint8_t majorVersion
Definition fseq.h:102
uint8_t minorVersion
Definition fseq.h:101
uint8_t TotalNumberOfFramesInSequence[4]
Definition fseq.h:105
Definition fseq.h:85
uint8_t Start[3]
Definition fseq.h:86
uint8_t Length[3]
Definition fseq.h:87
Definition fseq.h:71
char type[2]
Definition fseq.h:73
uint8_t data
Definition fseq.h:74
uint8_t length[2]
Definition fseq.h:72
Definition fseq.h:54
uint8_t sync_type
Definition fseq.h:61
uint8_t packet_type
Definition fseq.h:58
uint16_t data_len
Definition fseq.h:59
uint8_t sync_action
Definition fseq.h:60
uint32_t frame_number
Definition fseq.h:62
float seconds_elapsed
Definition fseq.h:63
Definition fseq.h:21
uint16_t data_len
Definition fseq.h:26
uint8_t packet_type
Definition fseq.h:25
Definition fseq.h:32
uint16_t versionMinor
Definition fseq.h:42
uint8_t ping_subtype
Definition fseq.h:39
uint8_t ping_hardware
Definition fseq.h:40
uint16_t data_len
Definition fseq.h:37
uint8_t ping_version
Definition fseq.h:38
uint8_t operatingMode
Definition fseq.h:43
uint8_t packet_type
Definition fseq.h:36
uint16_t versionMajor
Definition fseq.h:41