Snapdragon® Telematics Application Framework (TelAF) Interface Specification
taf_update_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_UPDATE_MESSAGES_H_INCLUDE_GUARD
12 #define TAF_UPDATE_MESSAGES_H_INCLUDE_GUARD
13 
14 
15 #include "taf_update_common.h"
16 
17 #define _MAX_MSG_SIZE IFGEN_TAF_UPDATE_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_update_AddStateHandler 0
28 #define _MSGID_taf_update_RemoveStateHandler 1
29 #define _MSGID_taf_update_Download 2
30 #define _MSGID_taf_update_Install 3
31 #define _MSGID_taf_update_GetDownloadSession 4
32 #define _MSGID_taf_update_StartDownload 5
33 #define _MSGID_taf_update_PauseDownload 6
34 #define _MSGID_taf_update_ResumeDownload 7
35 #define _MSGID_taf_update_CancelDownload 8
36 #define _MSGID_taf_update_GetInstallationSession 9
37 #define _MSGID_taf_update_InstallPreCheck 10
38 #define _MSGID_taf_update_StartInstall 11
39 #define _MSGID_taf_update_InstallPostCheck 12
40 #define _MSGID_taf_update_GetActiveBank 13
41 #define _MSGID_taf_update_VerifyActivation 14
42 #define _MSGID_taf_update_Rollback 15
43 #define _MSGID_taf_update_Sync 16
44 
45 
46 // Define type-safe pack/unpack functions for all enums, including included types
47 
48 static inline bool taf_update_PackState
49 (
50  uint8_t **bufferPtr,
51  taf_update_State_t value
52 )
53 {
54  return le_pack_PackUint32(bufferPtr, (uint32_t)value);
55 }
56 
57 static inline bool taf_update_UnpackState
58 (
59  uint8_t **bufferPtr,
60  taf_update_State_t* valuePtr
61 )
62 {
63  bool result;
64  uint32_t value = 0;
65  result = le_pack_UnpackUint32(bufferPtr, &value);
66  if (result)
67  {
68  *valuePtr = (taf_update_State_t)value;
69  }
70  return result;
71 }
72 
73 static inline bool taf_update_PackError
74 (
75  uint8_t **bufferPtr,
76  taf_update_Error_t value
77 )
78 {
79  return le_pack_PackUint32(bufferPtr, (uint32_t)value);
80 }
81 
82 static inline bool taf_update_UnpackError
83 (
84  uint8_t **bufferPtr,
85  taf_update_Error_t* valuePtr
86 )
87 {
88  bool result;
89  uint32_t value = 0;
90  result = le_pack_UnpackUint32(bufferPtr, &value);
91  if (result)
92  {
93  *valuePtr = (taf_update_Error_t)value;
94  }
95  return result;
96 }
97 
98 static inline bool taf_update_PackOTA
99 (
100  uint8_t **bufferPtr,
101  taf_update_OTA_t value
102 )
103 {
104  return le_pack_PackUint32(bufferPtr, (uint32_t)value);
105 }
106 
107 static inline bool taf_update_UnpackOTA
108 (
109  uint8_t **bufferPtr,
110  taf_update_OTA_t* valuePtr
111 )
112 {
113  bool result;
114  uint32_t value = 0;
115  result = le_pack_UnpackUint32(bufferPtr, &value);
116  if (result)
117  {
118  *valuePtr = (taf_update_OTA_t)value;
119  }
120  return result;
121 }
122 
123 static inline bool taf_update_PackPackageType
124 (
125  uint8_t **bufferPtr,
127 )
128 {
129  return le_pack_PackUint32(bufferPtr, (uint32_t)value);
130 }
131 
132 static inline bool taf_update_UnpackPackageType
133 (
134  uint8_t **bufferPtr,
135  taf_update_PackageType_t* valuePtr
136 )
137 {
138  bool result;
139  uint32_t value = 0;
140  result = le_pack_UnpackUint32(bufferPtr, &value);
141  if (result)
142  {
143  *valuePtr = (taf_update_PackageType_t)value;
144  }
145  return result;
146 }
147 
148 static inline bool taf_update_PackBank
149 (
150  uint8_t **bufferPtr,
151  taf_update_Bank_t value
152 )
153 {
154  return le_pack_PackUint32(bufferPtr, (uint32_t)value);
155 }
156 
157 static inline bool taf_update_UnpackBank
158 (
159  uint8_t **bufferPtr,
160  taf_update_Bank_t* valuePtr
161 )
162 {
163  bool result;
164  uint32_t value = 0;
165  result = le_pack_UnpackUint32(bufferPtr, &value);
166  if (result)
167  {
168  *valuePtr = (taf_update_Bank_t)value;
169  }
170  return result;
171 }
172 
173 // Define pack/unpack functions for all structures, including included types
174 
175 
176 static inline bool taf_update_PackStateInd
177 (
178  uint8_t **bufferPtr,
179  const taf_update_StateInd_t *valuePtr
180 )
181 {
182  __attribute__((unused))
183  bool subResult, result = true;
184 
185  LE_ASSERT(valuePtr);
186  subResult = taf_update_PackState( bufferPtr,
187  valuePtr->state );
188  result = result && subResult;
189  subResult = taf_update_PackError( bufferPtr,
190  valuePtr->error );
191  result = result && subResult;
192  subResult = le_pack_PackUint32( bufferPtr,
193  valuePtr->percent );
194  result = result && subResult;
195  subResult = taf_update_PackOTA( bufferPtr,
196  valuePtr->ota );
197  result = result && subResult;
198  subResult = le_pack_PackString( bufferPtr,
199  valuePtr->name, 32);
200  result = result && subResult;
201 
202  return result;
203 }
204 
205 static inline bool taf_update_UnpackStateInd
206 (
207  uint8_t **bufferPtr,
208  taf_update_StateInd_t *valuePtr
209 )
210 {
211  bool result = true;
212  if (result)
213  {
214  result = taf_update_UnpackState(bufferPtr,
215  &valuePtr->state );
216  }
217  if (result)
218  {
219  result = taf_update_UnpackError(bufferPtr,
220  &valuePtr->error );
221  }
222  if (result)
223  {
224  result = le_pack_UnpackUint32(bufferPtr,
225  &valuePtr->percent );
226  }
227  if (result)
228  {
229  result = taf_update_UnpackOTA(bufferPtr,
230  &valuePtr->ota );
231  }
232  if (result)
233  {
234  result = le_pack_UnpackString(bufferPtr,
235  valuePtr->name,
236  sizeof(valuePtr->name),
237  32);
238  }
239  return result;
240 }
241 
242 #endif // TAF_UPDATE_MESSAGES_H_INCLUDE_GUARD
static bool taf_update_PackBank(uint8_t **bufferPtr, taf_update_Bank_t value)
Definition: taf_update_messages.h:149
Definition: taf_update_common.h:180
static bool taf_update_PackState(uint8_t **bufferPtr, taf_update_State_t value)
Definition: taf_update_messages.h:49
LE_DECLARE_INLINE bool le_pack_UnpackString(uint8_t **bufferPtr, char *stringPtr, uint32_t bufferSize, uint32_t maxStringCount)
Definition: le_pack.h:1565
taf_update_OTA_t ota
Definition: taf_update_common.h:185
uint32_t percent
Definition: taf_update_common.h:184
taf_update_OTA_t
Definition: taf_update_common.h:125
static bool taf_update_PackPackageType(uint8_t **bufferPtr, taf_update_PackageType_t value)
Definition: taf_update_messages.h:124
taf_update_PackageType_t
Definition: taf_update_common.h:142
static bool taf_update_UnpackState(uint8_t **bufferPtr, taf_update_State_t *valuePtr)
Definition: taf_update_messages.h:58
static bool taf_update_PackOTA(uint8_t **bufferPtr, taf_update_OTA_t value)
Definition: taf_update_messages.h:99
taf_update_State_t state
Definition: taf_update_common.h:182
static bool taf_update_UnpackBank(uint8_t **bufferPtr, taf_update_Bank_t *valuePtr)
Definition: taf_update_messages.h:158
taf_update_Error_t error
Definition: taf_update_common.h:183
static bool taf_update_UnpackOTA(uint8_t **bufferPtr, taf_update_OTA_t *valuePtr)
Definition: taf_update_messages.h:108
taf_update_Bank_t
Definition: taf_update_common.h:163
taf_update_Error_t
Definition: taf_update_common.h:102
struct __attribute__((packed))
Definition: taf_update_messages.h:20
LE_DECLARE_INLINE bool le_pack_UnpackUint32(uint8_t **bufferPtr, uint32_t *valuePtr)
Definition: le_pack.h:1205
static bool taf_update_PackStateInd(uint8_t **bufferPtr, const taf_update_StateInd_t *valuePtr)
Definition: taf_update_messages.h:177
_Message_t
Definition: taf_update_messages.h:25
#define LE_ASSERT(condition)
Definition: le_log.h:935
LE_DECLARE_INLINE bool le_pack_PackString(uint8_t **bufferPtr, const char *stringPtr, uint32_t maxStringCount)
Definition: le_pack.h:884
#define _MAX_MSG_SIZE
Definition: taf_update_messages.h:17
static bool taf_update_UnpackStateInd(uint8_t **bufferPtr, taf_update_StateInd_t *valuePtr)
Definition: taf_update_messages.h:206
taf_update_State_t
Definition: taf_update_common.h:55
static bool taf_update_PackError(uint8_t **bufferPtr, taf_update_Error_t value)
Definition: taf_update_messages.h:74
static bool taf_update_UnpackError(uint8_t **bufferPtr, taf_update_Error_t *valuePtr)
Definition: taf_update_messages.h:83
static bool taf_update_UnpackPackageType(uint8_t **bufferPtr, taf_update_PackageType_t *valuePtr)
Definition: taf_update_messages.h:133
LE_DECLARE_INLINE bool le_pack_PackUint32(uint8_t **bufferPtr, uint32_t value)
Definition: le_pack.h:205
char name[32+1]
Definition: taf_update_common.h:186