Callisto4Bootloader: ARK/platform_encoder.c Source File

Callisto4Bootloader

platform_encoder.c
Go to the documentation of this file.
1 /*
2 * platform_encoder.c
3 *
4 * Created on: 19 Aug 2020
5 * Author: Nick Pelling
6 */
7
8 #include "platform-api.h"
9 #include "platform_encoder.h"
10
18 const stPayloadEncoder_t * PayloadEncoder_Get(uint16_t ui16MediaType)
19 {
20 if (ui16MediaType == PLATFORM_MEDIATYPE_JSON)
21 {
22 return &stJSONEncoder;
23 }
24
25 if (ui16MediaType == PLATFORM_MEDIATYPE_CBOR)
26 {
27 return &stCBOREncoder;
28 }
29
30 return NULL;
31 }
32
40 const stPayloadDecoder_t * PayloadDecoder_Get(uint16_t ui16MediaType)
41 {
42 if (ui16MediaType == PLATFORM_MEDIATYPE_JSON)
43 {
44 return &stJSONDecoder;
45 }
46
47 if (ui16MediaType == PLATFORM_MEDIATYPE_CBOR)
48 {
49 return &stCBORDecoder;
50 }
51
52 return NULL;
53 }
stCBORDecoder
const stPayloadDecoder_t stCBORDecoder
Definition: platform_encoder_cbor.c:333
NULL
#define NULL
Definition: bootloader_common.h:26
stJSONDecoder
const stPayloadDecoder_t stJSONDecoder
Definition: platform_encoder_json.c:533
platform_encoder.h
stCBOREncoder
const stPayloadEncoder_t stCBOREncoder
Definition: platform_encoder_cbor.c:316
PayloadEncoder_Get
const stPayloadEncoder_t * PayloadEncoder_Get(uint16_t ui16MediaType)
Definition: platform_encoder.c:18
stJSONEncoder
const stPayloadEncoder_t stJSONEncoder
Definition: platform_encoder_json.c:516
stPayloadDecoder_t
Definition: platform_encoder.h:49
stPayloadEncoder_t
Definition: platform_encoder.h:32
PayloadDecoder_Get
const stPayloadDecoder_t * PayloadDecoder_Get(uint16_t ui16MediaType)
Definition: platform_encoder.c:40