20 #define NCI_BRCM_CO_ID 0x2E
24 #define NCI_MSG_HDR_SIZE 3
25 #define NCI_DATA_HDR_SIZE 3
26 #define NCI_MAX_PAYLOAD_SIZE 0xFE
27 #define NCI_MAX_CTRL_SIZE 0xFF
28 #define NCI_CTRL_INIT_SIZE 32
29 #define NCI_MAX_VSC_SIZE 0xFF
30 #define NCI_VSC_MSG_HDR_SIZE \
34 #define NCI_ISO_DEP_MAX_INFO \
37 #define NCI_NFC_DEP_MAX_DATA \
46 #define NCI_MT_MASK 0xE0
47 #define NCI_MT_SHIFT 5
48 #define NCI_MT_DATA 0x00
54 #define NCI_MTS_CMD 0x20
55 #define NCI_MTS_RSP 0x40
56 #define NCI_MTS_NTF 0x60
57 #define NCI_MTS_CFG 0x80
59 #define NCI_NTF_BIT 0x80
60 #define NCI_RSP_BIT 0x40
64 #define NCI_LS_DATA 0x00
65 #define NCI_LS_DATA_PBF 0x01
68 #define NCI_PBF_MASK 0x10
69 #define NCI_PBF_SHIFT 4
70 #define NCI_PBF_NO_OR_LAST 0x00
71 #define NCI_PBF_ST_CONT 0x10
74 #define NCI_GID_MASK 0x0F
75 #define NCI_GID_SHIFT 0
76 #define NCI_GID_CORE 0x00
77 #define NCI_GID_RF_MANAGE 0x01
78 #define NCI_GID_EE_MANAGE 0x02
79 #define NCI_GID_PROP 0x0F
83 #define NCI_OID_MASK 0x3F
84 #define NCI_OID_SHIFT 0
89 #define NCI_TEST_ID 0xFE
92 #define NCI_DEST_TYPE_NFCC 1
93 #define NCI_DEST_TYPE_REMOTE 2
94 #define NCI_DEST_TYPE_NFCEE 3
97 #define NCI_MSG_BLD_HDR0(p, mt, gid) *(p)++ = (uint8_t)(((mt) << NCI_MT_SHIFT) | (gid));
99 #define NCI_MSG_PBLD_HDR0(p, mt, pbf, gid) \
100 *(p)++ = (uint8_t)(((mt) << NCI_MT_SHIFT) | ((pbf) << NCI_PBF_SHIFT) | (gid));
103 #define NCI_MSG_BLD_HDR1(p, oid) *(p)++ = (uint8_t)(((oid) << NCI_OID_SHIFT));
106 #define NCI_MSG_PRS_HDR0(p, mt, pbf, gid) \
107 mt = (*(p) &NCI_MT_MASK) >> NCI_MT_SHIFT; \
108 pbf = (*(p) &NCI_PBF_MASK) >> NCI_PBF_SHIFT; \
109 gid = *(p)++ & NCI_GID_MASK;
112 #define NCI_MSG_PRS_MT_PBF(p, mt, pbf) \
113 mt = (*(p) &NCI_MT_MASK) >> NCI_MT_SHIFT; \
114 pbf = (*(p) &NCI_PBF_MASK) >> NCI_PBF_SHIFT;
117 #define NCI_MSG_PRS_HDR1(p, oid) \
118 oid = (*(p) &NCI_OID_MASK); \
126 #define NCI_CID_MASK 0x0F
129 #define NCI_DATA_BLD_HDR(p, cid, len) \
130 *(p)++ = (uint8_t)(cid); \
132 *(p)++ = (uint8_t)(len);
134 #define NCI_DATA_PBLD_HDR(p, pbf, cid, len) \
135 *(p)++ = (uint8_t)(((pbf) << NCI_PBF_SHIFT) | (cid)); \
139 #define NCI_DATA_PRS_HDR(p, pbf, cid, len) \
140 (pbf) = (*(p) &NCI_PBF_MASK) >> NCI_PBF_SHIFT; \
141 (cid) = (*(p) &NCI_CID_MASK); \
148 #define BE_STREAM_TO_uint32_t(u32, p) \
150 u32 = ((uint32_t)(*((p) + 3)) + ((uint32_t)(*((p) + 2)) << 8) + \
151 ((uint32_t)(*((p) + 1)) << 16) + ((uint32_t)(*(p)) << 24)); \
160 uint16_t layer_specific;
183 #define NFA_TNF_EMPTY NDEF_TNF_EMPTY
184 #define NFA_TNF_WKT NDEF_TNF_WKT
185 #define NFA_TNF_RFC2046_MEDIA NDEF_TNF_MEDIA
186 #define NFA_TNF_RFC3986_URI NDEF_TNF_URI
187 #define NFA_TNF_EXTERNAL NDEF_TNF_EXT
188 #define NFA_TNF_UNKNOWN case NDEF_TNF_UNKNOWN
189 #define NFA_TNF_UNCHANGED NDEF_TNF_UNCHANGED
190 #define NFA_TNF_RESERVED NDEF_TNF_RESERVED
191 #define NFA_TNF_DEFAULT case 0xFF
194 #define NDEF_MB_MASK 0x80
195 #define NDEF_ME_MASK 0x40
196 #define NDEF_CF_MASK 0x20
197 #define NDEF_SR_MASK 0x10
198 #define NDEF_IL_MASK 0x08
199 #define NDEF_TNF_MASK 0x07
202 #define NDEF_TNF_EMPTY 0
203 #define NDEF_TNF_WKT 1
204 #define NDEF_TNF_MEDIA 2
205 #define NDEF_TNF_URI 3
206 #define NDEF_TNF_EXT 4
207 #define NDEF_TNF_UNKNOWN 5
208 #define NDEF_TNF_UNCHANGED 6
209 #define NDEF_TNF_RESERVED 7
218 int codeNFC(NfcPayload* nfcData, uint8_t* msg);
229 uint8_t*
NDEF_RecGetType(uint8_t* p_rec, uint8_t* p_tnf, uint8_t* p_type_len);
Utilities to get config values from the environment.
Utilities for consuming RabbitMQ messages.
tNDEF_STATUS NDEF_MsgValidate(uint8_t *p_msg, uint32_t msg_len, int b_allow_chunks)
uint8_t * NDEF_RecGetId(uint8_t *p_rec, uint8_t *p_id_len)
void createBufNdef_TypeURI(uint8_t *strIN, int sizLen, uint8_t *strOUT)
void vshort_actidata(uint8_t *strIN, int sizLen, uint8_t *strOUT)
int codeNFC(NfcPayload *nfcData, uint8_t *msg)
Defines ports and structures for sensor threads.
void createBufNdef_TypeSmartPoster(uint8_t *strIN, uint8_t *strIN2, int sizLen, uint8_t *strOUT)
uint8_t * NDEF_RecGetPayload(uint8_t *p_rec, uint32_t *p_payload_len)
uint8_t * NDEF_RecGetType(uint8_t *p_rec, uint8_t *p_tnf, uint8_t *p_type_len)
void createBufNdef_TypeText(uint8_t *strIN, int sizLen, uint8_t *strOUT)
Define common buffer sizes.
Define socket utilities to simplify networking.
void vshort_sendata(uint8_t *strIN, int sizLen, uint8_t *strOUT)