Snapdragon® Telematics Application Framework (TelAF) Interface Specification
taf_pm_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_PM_MESSAGES_H_INCLUDE_GUARD
12 #define TAF_PM_MESSAGES_H_INCLUDE_GUARD
13 
14 
15 #include "taf_pm_common.h"
16 
17 #define _MAX_MSG_SIZE IFGEN_TAF_PM_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_pm_AddStateChangeHandler 0
28 #define _MSGID_taf_pm_RemoveStateChangeHandler 1
29 #define _MSGID_taf_pm_AddStateChangeExHandler 2
30 #define _MSGID_taf_pm_RemoveStateChangeExHandler 3
31 #define _MSGID_taf_pm_NewWakeupSource 4
32 #define _MSGID_taf_pm_StayAwake 5
33 #define _MSGID_taf_pm_Relax 6
34 #define _MSGID_taf_pm_GetPowerState 7
35 #define _MSGID_taf_pm_SetAllVMPowerState 8
36 #define _MSGID_taf_pm_SetVMPowerState 9
37 #define _MSGID_taf_pm_GetMachineList 10
38 #define _MSGID_taf_pm_GetFirstMachineName 11
39 #define _MSGID_taf_pm_GetNextMachineName 12
40 #define _MSGID_taf_pm_DeleteMachineList 13
41 #define _MSGID_taf_pm_SendStateChangeAck 14
42 
43 
44 // Define type-safe pack/unpack functions for all enums, including included types
45 
46 static inline bool taf_pm_PackState
47 (
48  uint8_t **bufferPtr,
49  taf_pm_State_t value
50 )
51 {
52  return le_pack_PackUint32(bufferPtr, (uint32_t)value);
53 }
54 
55 static inline bool taf_pm_UnpackState
56 (
57  uint8_t **bufferPtr,
58  taf_pm_State_t* valuePtr
59 )
60 {
61  bool result;
62  uint32_t value = 0;
63  result = le_pack_UnpackUint32(bufferPtr, &value);
64  if (result)
65  {
66  *valuePtr = (taf_pm_State_t)value;
67  }
68  return result;
69 }
70 
71 static inline bool taf_pm_PackStatus
72 (
73  uint8_t **bufferPtr,
74  taf_pm_Status_t value
75 )
76 {
77  return le_pack_PackUint32(bufferPtr, (uint32_t)value);
78 }
79 
80 static inline bool taf_pm_UnpackStatus
81 (
82  uint8_t **bufferPtr,
83  taf_pm_Status_t* valuePtr
84 )
85 {
86  bool result;
87  uint32_t value = 0;
88  result = le_pack_UnpackUint32(bufferPtr, &value);
89  if (result)
90  {
91  *valuePtr = (taf_pm_Status_t)value;
92  }
93  return result;
94 }
95 
96 static inline bool taf_pm_PackNadVm
97 (
98  uint8_t **bufferPtr,
99  taf_pm_NadVm_t value
100 )
101 {
102  return le_pack_PackUint32(bufferPtr, (uint32_t)value);
103 }
104 
105 static inline bool taf_pm_UnpackNadVm
106 (
107  uint8_t **bufferPtr,
108  taf_pm_NadVm_t* valuePtr
109 )
110 {
111  bool result;
112  uint32_t value = 0;
113  result = le_pack_UnpackUint32(bufferPtr, &value);
114  if (result)
115  {
116  *valuePtr = (taf_pm_NadVm_t)value;
117  }
118  return result;
119 }
120 
121 static inline bool taf_pm_PackClientAck
122 (
123  uint8_t **bufferPtr,
124  taf_pm_ClientAck_t value
125 )
126 {
127  return le_pack_PackUint32(bufferPtr, (uint32_t)value);
128 }
129 
130 static inline bool taf_pm_UnpackClientAck
131 (
132  uint8_t **bufferPtr,
133  taf_pm_ClientAck_t* valuePtr
134 )
135 {
136  bool result;
137  uint32_t value = 0;
138  result = le_pack_UnpackUint32(bufferPtr, &value);
139  if (result)
140  {
141  *valuePtr = (taf_pm_ClientAck_t)value;
142  }
143  return result;
144 }
145 
146 // Define pack/unpack functions for all structures, including included types
147 
148 
149 #endif // TAF_PM_MESSAGES_H_INCLUDE_GUARD
_Message_t
Definition: taf_pm_messages.h:25
static bool taf_pm_PackState(uint8_t **bufferPtr, taf_pm_State_t value)
Definition: taf_pm_messages.h:47
taf_pm_Status_t
Definition: taf_pm_common.h:77
static bool taf_pm_UnpackStatus(uint8_t **bufferPtr, taf_pm_Status_t *valuePtr)
Definition: taf_pm_messages.h:81
taf_pm_ClientAck_t
Definition: taf_pm_common.h:107
static bool taf_pm_PackStatus(uint8_t **bufferPtr, taf_pm_Status_t value)
Definition: taf_pm_messages.h:72
taf_pm_NadVm_t
Definition: taf_pm_common.h:94
static bool taf_pm_PackClientAck(uint8_t **bufferPtr, taf_pm_ClientAck_t value)
Definition: taf_pm_messages.h:122
#define _MAX_MSG_SIZE
Definition: taf_pm_messages.h:17
taf_pm_State_t
Definition: taf_pm_common.h:54
LE_DECLARE_INLINE bool le_pack_UnpackUint32(uint8_t **bufferPtr, uint32_t *valuePtr)
Definition: le_pack.h:1205
static bool taf_pm_UnpackClientAck(uint8_t **bufferPtr, taf_pm_ClientAck_t *valuePtr)
Definition: taf_pm_messages.h:131
static bool taf_pm_UnpackNadVm(uint8_t **bufferPtr, taf_pm_NadVm_t *valuePtr)
Definition: taf_pm_messages.h:106
static bool taf_pm_PackNadVm(uint8_t **bufferPtr, taf_pm_NadVm_t value)
Definition: taf_pm_messages.h:97
struct __attribute__((packed))
Definition: taf_pm_messages.h:20
LE_DECLARE_INLINE bool le_pack_PackUint32(uint8_t **bufferPtr, uint32_t value)
Definition: le_pack.h:205
static bool taf_pm_UnpackState(uint8_t **bufferPtr, taf_pm_State_t *valuePtr)
Definition: taf_pm_messages.h:56