ISSDK  1.8
IoT Sensing Software Development Kit
data_format_service.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2016, Freescale Semiconductor, Inc.
3  * Copyright 2016-2017 NXP
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 /**
9 * @file data_format_service.h
10 * @brief The format_service.h file describes the interface and structures for the data-format standards.
11 */
12 
13 #ifndef DATA_FORMAT_SERVICE_H_
14 #define DATA_FORMAT_SERVICE_H_
15 #include <stddef.h>
16 #include <stdint.h>
17 #include <stdbool.h>
18 
19 #define DATA_FORMAT_OK 0 ///< Operation succeeded
20 
21 /*******************************************************************************
22  * Definitions
23  ******************************************************************************/
24 
25 /* @brief This defines the communication handle.
26  */
27 typedef struct _comm_handle_
28 {
29  void *pComm; /*!< pointer to a specific communication channel.*/
30  uint32_t status; /*!< Current Comm status.*/
32 
33 /* Event function signature.*/
34 typedef void (*DATA_FORMAT_Event_t)(void *pData); /*< Pointer to data format Event.*/
35 
36 /*! @brief The interface function to initialize the data-format service.*/
37 typedef int32_t(DATA_FORMAT_Init_t)(DATA_FORMAT_Event_t event, void *pInitializeData);
38 /*! @brief The interface function to serialize the data*/
39 typedef int32_t(DATA_FORMAT_Serialize_t)(void *pData, uint32_t size, void *pDataElement);
40 /*! @brief The interface function to deserialize the data.*/
41 typedef int32_t(DATA_FORMAT_Deserialize_t)(void *pData, uint32_t size, void *pDataElement);
42 /*! @brief The interface function to append the data on the formated stream*/
43 typedef int32_t (DATA_FORMAT_Append_t)) (void * pData, uint32_t size, void* pDataElement));
44 
45 /* @brief This defines the function pointers for the data format interface.
46  */
48 {
49  DATA_FORMAT_Init_t *Init; /*!< Pointer to the data-format Initialize() function. */
50  DATA_FORMAT_Serialize_t *Serialize; /*!< Pointer to the data-format Serialize() function. */
51  DATA_FORMAT_Deserialize_t *Deserialize; /*!< Pointer to the data-format Deserialize() function. */
52  DATA_FORMAT_Append_t *Append; /*!< Pointer to the data-format Append() function. */
54 #endif // DATA_FORMAT_SERVICE_H_
uint32_t size
void(* DATA_FORMAT_Event_t)(void *pData)
int32_t() DATA_FORMAT_Deserialize_t(void *pData, uint32_t size, void *pDataElement)
The interface function to deserialize the data.
uint32_t status
struct _comm_handle_ comm_handle_t
typedef int32_t(DATA_FORMAT_Append_t))(void *pData
The interface function to append the data on the formated stream.
DATA_FORMAT_Deserialize_t * Deserialize
int32_t() DATA_FORMAT_Serialize_t(void *pData, uint32_t size, void *pDataElement)
The interface function to serialize the data.
struct _data_format_interface_ data_format_interface_t
DATA_FORMAT_Append_t * Append
uint32_t void * pDataElement
DATA_FORMAT_Init_t * Init
int32_t() DATA_FORMAT_Init_t(DATA_FORMAT_Event_t event, void *pInitializeData)
The interface function to initialize the data-format service.
DATA_FORMAT_Serialize_t * Serialize