Snapdragon® Telematics Application Framework (TelAF) Interface Specification
taf_gpio_messages.h
Go to the documentation of this file.
1 /*
2  * ====================== WARNING ======================
3  *
4  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
5  * DO NOT MODIFY IN ANY WAY.
6  *
7  * ====================== WARNING ======================
8  */
9 
10 
11 #ifndef TAF_GPIO_MESSAGES_H_INCLUDE_GUARD
12 #define TAF_GPIO_MESSAGES_H_INCLUDE_GUARD
13 
14 
15 #include "taf_gpio_common.h"
16 
17 #define _MAX_MSG_SIZE IFGEN_TAF_GPIO_MSG_SIZE
18 
19 // Define the message type for communicating between client and server
20 typedef struct __attribute__((packed))
21 {
22  uint32_t id;
23  uint8_t buffer[_MAX_MSG_SIZE];
24 }
26 
27 #define _MSGID_taf_gpio_SetInput 0
28 #define _MSGID_taf_gpio_Activate 1
29 #define _MSGID_taf_gpio_Deactivate 2
30 #define _MSGID_taf_gpio_Read 3
31 #define _MSGID_taf_gpio_AddChangeEventHandler 4
32 #define _MSGID_taf_gpio_RemoveChangeEventHandler 5
33 #define _MSGID_taf_gpio_SetEdgeSense 6
34 #define _MSGID_taf_gpio_DisableEdgeSense 7
35 #define _MSGID_taf_gpio_IsOutput 8
36 #define _MSGID_taf_gpio_IsInput 9
37 #define _MSGID_taf_gpio_GetName 10
38 #define _MSGID_taf_gpio_GetEdgeSense 11
39 #define _MSGID_taf_gpio_GetPolarity 12
40 #define _MSGID_taf_gpio_IsActive 13
41 
42 
43 // Define type-safe pack/unpack functions for all enums, including included types
44 
45 static inline bool taf_gpio_PackPolarity
46 (
47  uint8_t **bufferPtr,
49 )
50 {
51  return le_pack_PackUint32(bufferPtr, (uint32_t)value);
52 }
53 
54 static inline bool taf_gpio_UnpackPolarity
55 (
56  uint8_t **bufferPtr,
57  taf_gpio_Polarity_t* valuePtr
58 )
59 {
60  bool result;
61  uint32_t value = 0;
62  result = le_pack_UnpackUint32(bufferPtr, &value);
63  if (result)
64  {
65  *valuePtr = (taf_gpio_Polarity_t)value;
66  }
67  return result;
68 }
69 
70 static inline bool taf_gpio_PackState
71 (
72  uint8_t **bufferPtr,
73  taf_gpio_State_t value
74 )
75 {
76  return le_pack_PackUint32(bufferPtr, (uint32_t)value);
77 }
78 
79 static inline bool taf_gpio_UnpackState
80 (
81  uint8_t **bufferPtr,
82  taf_gpio_State_t* valuePtr
83 )
84 {
85  bool result;
86  uint32_t value = 0;
87  result = le_pack_UnpackUint32(bufferPtr, &value);
88  if (result)
89  {
90  *valuePtr = (taf_gpio_State_t)value;
91  }
92  return result;
93 }
94 
95 static inline bool taf_gpio_PackEdge
96 (
97  uint8_t **bufferPtr,
98  taf_gpio_Edge_t value
99 )
100 {
101  return le_pack_PackUint32(bufferPtr, (uint32_t)value);
102 }
103 
104 static inline bool taf_gpio_UnpackEdge
105 (
106  uint8_t **bufferPtr,
107  taf_gpio_Edge_t* valuePtr
108 )
109 {
110  bool result;
111  uint32_t value = 0;
112  result = le_pack_UnpackUint32(bufferPtr, &value);
113  if (result)
114  {
115  *valuePtr = (taf_gpio_Edge_t)value;
116  }
117  return result;
118 }
119 
120 // Define pack/unpack functions for all structures, including included types
121 
122 
123 #endif // TAF_GPIO_MESSAGES_H_INCLUDE_GUARD
static bool taf_gpio_PackEdge(uint8_t **bufferPtr, taf_gpio_Edge_t value)
Definition: taf_gpio_messages.h:96
struct __attribute__((packed))
Definition: taf_gpio_messages.h:20
static bool taf_gpio_UnpackPolarity(uint8_t **bufferPtr, taf_gpio_Polarity_t *valuePtr)
Definition: taf_gpio_messages.h:55
static bool taf_gpio_UnpackState(uint8_t **bufferPtr, taf_gpio_State_t *valuePtr)
Definition: taf_gpio_messages.h:80
taf_gpio_State_t
Definition: taf_gpio_common.h:47
_Message_t
Definition: taf_gpio_messages.h:25
#define _MAX_MSG_SIZE
Definition: taf_gpio_messages.h:17
LE_DECLARE_INLINE bool le_pack_UnpackUint32(uint8_t **bufferPtr, uint32_t *valuePtr)
Definition: le_pack.h:1205
taf_gpio_Edge_t
Definition: taf_gpio_common.h:64
taf_gpio_Polarity_t
Definition: taf_gpio_common.h:33
static bool taf_gpio_PackPolarity(uint8_t **bufferPtr, taf_gpio_Polarity_t value)
Definition: taf_gpio_messages.h:46
static bool taf_gpio_PackState(uint8_t **bufferPtr, taf_gpio_State_t value)
Definition: taf_gpio_messages.h:71
LE_DECLARE_INLINE bool le_pack_PackUint32(uint8_t **bufferPtr, uint32_t value)
Definition: le_pack.h:205
static bool taf_gpio_UnpackEdge(uint8_t **bufferPtr, taf_gpio_Edge_t *valuePtr)
Definition: taf_gpio_messages.h:105