Callisto4Bootloader: ARK/platform_encoder_cbor.c Source File

Callisto4Bootloader

platform_encoder_cbor.c
Go to the documentation of this file.
1 /*
2 * platform_cbor_encoder.c
3 *
4 * Created on: 27 Jul 2020
5 * Author: Nick Pelling
6 */
7
8 #include "platform_encoder.h"
9
15 static void EncodeStructStart(stPayloadBuffer_t * pstPayload)
16 {
17 (void)pstPayload; // unused
18 // FIXME
19 }
20
26 static void EncodeStructEnd(stPayloadBuffer_t * pstPayload)
27 {
28 (void)pstPayload; // unused
29 // FIXME
30 }
31
37 static void EncodeArrayStart(stPayloadBuffer_t * pstPayload)
38 {
39 (void)pstPayload; // unused
40 // FIXME
41 }
42
48 static void EncodeArraySeparator(stPayloadBuffer_t * pstPayload)
49 {
50 (void)pstPayload; // unused
51 // FIXME
52 }
53
59 static void EncodeArrayEnd(stPayloadBuffer_t * pstPayload)
60 {
61 (void)pstPayload; // unused
62 // FIXME
63 }
64
71 static void EncodeFieldName(stPayloadBuffer_t * pstPayload, const uint8_t *pau8FieldName)
72 {
73 (void)pstPayload; // unused
74 (void)pau8FieldName; // unused
75 // FIXME
76 }
77
83 static void EncodeFieldSeparator(stPayloadBuffer_t * pstPayload)
84 {
85 (void)pstPayload; // unused
86 // FIXME
87 }
88
95 static void EncodeBoolean(stPayloadBuffer_t * pstPayload, bool bValue)
96 {
97 (void)pstPayload; // unused
98 (void)bValue; // unused
99 // FIXME
100 }
101
108 static void EncodeSignedInt(stPayloadBuffer_t * pstPayload, int64_t i64Value)
109 {
110 (void)pstPayload; // unused
111 (void)i64Value; // unused
112 // FIXME
113 }
114
121 static void EncodeUnsignedInt(stPayloadBuffer_t * pstPayload, uint64_t ui64Value)
122 {
123 (void)pstPayload; // unused
124 (void)ui64Value; // unused
125 // FIXME
126 }
127
134 static void EncodeReal(stPayloadBuffer_t * pstPayload, double dValue)
135 {
136 (void)pstPayload; // unused
137 (void)dValue; // unused
138 // FIXME
139 }
140
147 static void EncodeString(stPayloadBuffer_t * pstPayload, const uint8_t * pachString)
148 {
149 (void)pstPayload; // unused
150 (void)pachString; // unused
151 // FIXME
152 }
153
161 static bool DecodeStructStart(stPayloadBuffer_t * pstPayload)
162 {
163 // FIXME
164 return false;
165 }
166
174 static bool DecodeStructEnd(stPayloadBuffer_t * pstPayload)
175 {
176 // FIXME
177 return false;
178 }
179
187 static bool DecodeArrayStart(stPayloadBuffer_t * pstPayload)
188 {
189 // FIXME
190 return false;
191 }
192
200 static bool DecodeArraySeparator(stPayloadBuffer_t * pstPayload)
201 {
202 // FIXME
203 return false;
204 }
205
213 static bool DecodeArrayEnd(stPayloadBuffer_t * pstPayload)
214 {
215 // FIXME
216 return false;
217 }
218
226 static bool DecodeString(stPayloadBuffer_t * pstPayload, const uint8_t ** ppau8String, uint32_t *puiStringLength)
227 {
228 // FIXME
229 return false;
230 }
231
241 static bool DecodeFieldName(stPayloadBuffer_t * pstPayload, const uint8_t ** pachFieldName, uint32_t * puiNameLength)
242 {
243 // FIXME
244 return false;
245 }
246
254 static bool DecodeFieldSeparator(stPayloadBuffer_t * pstPayload)
255 {
256 // FIXME
257 return false;
258 }
259
268 static bool DecodeBoolean(stPayloadBuffer_t * pstPayload, bool *pbValue)
269 {
270 // FIXME
271 return false;
272 }
273
282 static bool DecodeSignedInt(stPayloadBuffer_t * pstPayload, int64_t * pi64Value)
283 {
284 // FIXME
285 return false;
286 }
287
296 static bool DecodeUnsignedInt(stPayloadBuffer_t * pstPayload, uint64_t * pui64Value)
297 {
298 // FIXME
299 return false;
300 }
301
310 static bool DecodeReal(stPayloadBuffer_t * pstPayload, double * pdValue)
311 {
312 // FIXME
313 return false;
314 }
315
316 const stPayloadEncoder_t stCBOREncoder =
317 {
318 // CBOR Encoder virtual function implementations
319 .pfn_EncodeStructStart = EncodeStructStart,
320 .pfn_EncodeStructEnd = EncodeStructEnd,
321 .pfn_EncodeArrayStart = EncodeArrayStart,
322 .pfn_EncodeArraySeparator = EncodeArraySeparator,
323 .pfn_EncodeArrayEnd = EncodeArrayEnd,
324 .pfn_EncodeFieldName = EncodeFieldName,
325 .pfn_EncodeFieldSeparator = EncodeFieldSeparator,
326 .pfn_EncodeBoolean = EncodeBoolean,
327 .pfn_EncodeSignedInt = EncodeSignedInt,
328 .pfn_EncodeUnsignedInt = EncodeUnsignedInt,
329 .pfn_EncodeReal = EncodeReal,
330 .pfn_EncodeString = EncodeString
331 };
332
333 const stPayloadDecoder_t stCBORDecoder =
334 {
335 // CBOR Decoder virtual function implementations
336 .pfn_DecodeStructStart = DecodeStructStart,
337 .pfn_DecodeStructEnd = DecodeStructEnd,
338 .pfn_DecodeArrayStart = DecodeArrayStart,
339 .pfn_DecodeArraySeparator = DecodeArraySeparator,
340 .pfn_DecodeArrayEnd = DecodeArrayEnd,
341 .pfn_DecodeFieldName = DecodeFieldName,
342 .pfn_DecodeFieldSeparator = DecodeFieldSeparator,
343 .pfn_DecodeBoolean = DecodeBoolean,
344 .pfn_DecodeSignedInt = DecodeSignedInt,
345 .pfn_DecodeUnsignedInt = DecodeUnsignedInt,
346 .pfn_DecodeReal = DecodeReal,
347 .pfn_DecodeString = DecodeString
348 };
DecodeSignedInt
static bool DecodeSignedInt(stPayloadBuffer_t *pstPayload, int64_t *pi64Value)
Definition: platform_encoder_cbor.c:282
EncodeArrayEnd
static void EncodeArrayEnd(stPayloadBuffer_t *pstPayload)
Definition: platform_encoder_cbor.c:59
EncodeReal
static void EncodeReal(stPayloadBuffer_t *pstPayload, double dValue)
Definition: platform_encoder_cbor.c:134
EncodeFieldSeparator
static void EncodeFieldSeparator(stPayloadBuffer_t *pstPayload)
Definition: platform_encoder_cbor.c:83
DecodeStructEnd
static bool DecodeStructEnd(stPayloadBuffer_t *pstPayload)
Definition: platform_encoder_cbor.c:174
EncodeArrayStart
static void EncodeArrayStart(stPayloadBuffer_t *pstPayload)
Definition: platform_encoder_cbor.c:37
EncodeSignedInt
static void EncodeSignedInt(stPayloadBuffer_t *pstPayload, int64_t i64Value)
Definition: platform_encoder_cbor.c:108
DecodeArrayEnd
static bool DecodeArrayEnd(stPayloadBuffer_t *pstPayload)
Definition: platform_encoder_cbor.c:213
stPayloadBuffer_t
Definition: platform_encoder.h:20
DecodeArrayStart
static bool DecodeArrayStart(stPayloadBuffer_t *pstPayload)
Definition: platform_encoder_cbor.c:187
DecodeBoolean
static bool DecodeBoolean(stPayloadBuffer_t *pstPayload, bool *pbValue)
Definition: platform_encoder_cbor.c:268
EncodeFieldName
static void EncodeFieldName(stPayloadBuffer_t *pstPayload, const uint8_t *pau8FieldName)
Definition: platform_encoder_cbor.c:71
DecodeFieldName
static bool DecodeFieldName(stPayloadBuffer_t *pstPayload, const uint8_t **pachFieldName, uint32_t *puiNameLength)
Definition: platform_encoder_cbor.c:241
stCBORDecoder
const stPayloadDecoder_t stCBORDecoder
Definition: platform_encoder_cbor.c:333
platform_encoder.h
EncodeArraySeparator
static void EncodeArraySeparator(stPayloadBuffer_t *pstPayload)
Definition: platform_encoder_cbor.c:48
DecodeString
static bool DecodeString(stPayloadBuffer_t *pstPayload, const uint8_t **ppau8String, uint32_t *puiStringLength)
Definition: platform_encoder_cbor.c:226
EncodeStructStart
static void EncodeStructStart(stPayloadBuffer_t *pstPayload)
Definition: platform_encoder_cbor.c:15
DecodeFieldSeparator
static bool DecodeFieldSeparator(stPayloadBuffer_t *pstPayload)
Definition: platform_encoder_cbor.c:254
EncodeString
static void EncodeString(stPayloadBuffer_t *pstPayload, const uint8_t *pachString)
Definition: platform_encoder_cbor.c:147
DecodeReal
static bool DecodeReal(stPayloadBuffer_t *pstPayload, double *pdValue)
Definition: platform_encoder_cbor.c:310
DecodeUnsignedInt
static bool DecodeUnsignedInt(stPayloadBuffer_t *pstPayload, uint64_t *pui64Value)
Definition: platform_encoder_cbor.c:296
DecodeStructStart
static bool DecodeStructStart(stPayloadBuffer_t *pstPayload)
Definition: platform_encoder_cbor.c:161
stPayloadDecoder_t::pfn_DecodeStructStart
bool(* pfn_DecodeStructStart)(stPayloadBuffer_t *pstPayload)
Definition: platform_encoder.h:52
stPayloadEncoder_t::pfn_EncodeStructStart
void(* pfn_EncodeStructStart)(stPayloadBuffer_t *pstPayload)
Definition: platform_encoder.h:35
DecodeArraySeparator
static bool DecodeArraySeparator(stPayloadBuffer_t *pstPayload)
Definition: platform_encoder_cbor.c:200
EncodeBoolean
static void EncodeBoolean(stPayloadBuffer_t *pstPayload, bool bValue)
Definition: platform_encoder_cbor.c:95
stPayloadDecoder_t
Definition: platform_encoder.h:49
stPayloadEncoder_t
Definition: platform_encoder.h:32
EncodeStructEnd
static void EncodeStructEnd(stPayloadBuffer_t *pstPayload)
Definition: platform_encoder_cbor.c:26
stCBOREncoder
const stPayloadEncoder_t stCBOREncoder
Definition: platform_encoder_cbor.c:316
EncodeUnsignedInt
static void EncodeUnsignedInt(stPayloadBuffer_t *pstPayload, uint64_t ui64Value)
Definition: platform_encoder_cbor.c:121