NHS31xx SW API
msg_response.h
1 /*
2  * Copyright 2015-2019 NXP
3  * This software is owned or controlled by NXP and may only be used strictly
4  * in accordance with the applicable license terms. By expressly accepting
5  * such terms or by downloading, installing, activating and/or otherwise using
6  * the software, you are agreeing that you have read, and that you agree to
7  * comply with and are bound by, such license terms. If you do not agree to
8  * be bound by the applicable license terms, then you may not retain, install,
9  * activate or otherwise use the software.
10  */
11 
16 #ifndef __MSG_RESPONSE_H_
17 #define __MSG_RESPONSE_H_
18 
19 /* -------------------------------------------------------------------------
20  * Include files
21  * ------------------------------------------------------------------------- */
22 
23 #include <stdint.h>
24 #include <stdbool.h>
25 
26 /* -------------------------------------------------------------------------
27  * Types and defines
28  * ------------------------------------------------------------------------- */
29 
33 #define MSG_API_MAJOR_VERSION (0x6)
34 
39 #define MSG_API_MINOR_VERSION (0x1)
40 
42 typedef enum MSG_ERR {
44  MSG_OK = 0,
45 
48 
54 
57 
60 
65 
72 
81 } MSG_ERR_T;
82 
83 /* ------------------------------------------------------------------------- */
84 
85 #pragma pack(push, 1)
86 
88 typedef struct MSG_RESPONSE_RESULTONLY_S {
107  uint32_t result;
109 
111 typedef struct MSG_RESPONSE_GETVERSION_S {
112  uint16_t reserved2;
113  uint16_t swMajorVersion;
114  uint16_t swMinorVersion;
115  uint16_t apiMajorVersion;
116  uint16_t apiMinorVersion;
123  uint32_t deviceId;
125 
127 typedef struct MSG_RESPONSE_READREGISTER_S {
132  uint32_t result;
133 
134  uint32_t data;
136 
138 typedef struct MSG_RESPONSE_READMEMORY_S {
143  uint32_t result;
144 
145  uint8_t length;
151  uint8_t data[32];
153 
155 typedef struct MSG_RESPONSE_GETUID_S {
156  uint32_t uid[4];
158 
160 typedef struct MSG_RESPONSE_GETNFCUID_S {
161  uint8_t nfcuid[8];
163 
165 typedef struct MSG_RESPONSE_CHECKBATTERY_S {
170  uint32_t result;
171 
177  int32_t threshold;
179 
180 #if MSG_ENABLE_GETCALIBRATIONTIMESTAMP
181 
182 typedef struct MSG_RESPONSE_GETCALIBRATIONTIMESTAMP_S {
187  uint32_t result;
188 
189  uint32_t timestamp;
190 } MSG_RESPONSE_GETCALIBRATIONTIMESTAMP_T;
191 #endif
192 
193 #if ENABLE_DIAG_MODULE
194 
195 typedef DIAG_DATA_T MSG_RESPONSE_GETDIAGDATA_T;
196 #endif
197 
198 #pragma pack(pop)
199 
200 /* ------------------------------------------------------------------------- */
201 
217 typedef bool (*pMsg_ResponseCb_t)(int responseLength, const uint8_t* pResponseData);
218 
221 #endif
uint16_t swMajorVersion
Definition: msg_response.h:113
Definition: msg_response.h:80
Definition: msg_response.h:59
Definition: diag.h:104
Definition: msg_response.h:71
Definition: msg_response.h:47
uint32_t result
Definition: msg_response.h:107
uint32_t data
Definition: msg_response.h:134
uint32_t deviceId
Definition: msg_response.h:123
uint16_t apiMajorVersion
Definition: msg_response.h:115
uint8_t length
Definition: msg_response.h:145
MSG_ERR_T
Definition: msg_response.h:42
Definition: msg_response.h:53
uint16_t swMinorVersion
Definition: msg_response.h:114
Definition: msg_response.h:44
uint16_t apiMinorVersion
Definition: msg_response.h:116
uint16_t reserved2
Definition: msg_response.h:112
bool(* pMsg_ResponseCb_t)(int responseLength, const uint8_t *pResponseData)
Definition: msg_response.h:217
Definition: msg_response.h:127
Definition: msg_response.h:138
Definition: msg_response.h:155
Definition: msg_response.h:160
Definition: msg_response.h:165
Definition: msg_response.h:88
Definition: msg_response.h:111
int32_t threshold
Definition: msg_response.h:177
Definition: msg_response.h:64
Definition: msg_response.h:56