nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
msg_parser.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef NFC_NDEF_MSG_PARSER_H_
8#define NFC_NDEF_MSG_PARSER_H_
9
17#include <stdint.h>
18#include <zephyr/types.h>
20#include <nfc/ndef/msg.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
33};
34
42};
43
47#define NFC_NDEF_MSG_PARSER_DELTA (sizeof(struct nfc_ndef_msg_parser_msg_2) - \
48 sizeof(struct nfc_ndef_msg_parser_msg_1))
49
56#define NFC_NDEF_PARSER_REQUIRED_MEM(max_count_of_records) \
57 (sizeof(struct nfc_ndef_msg_parser_msg_1) + \
58 ((NFC_NDEF_MSG_PARSER_DELTA) * ((uint32_t)(max_count_of_records) - 1)))
59
84int nfc_ndef_msg_parse(uint8_t *result_buf,
85 uint32_t *result_buf_len,
86 const uint8_t *raw_data,
87 uint32_t *raw_data_len);
88
94void nfc_ndef_msg_printout(const struct nfc_ndef_msg_desc *msg_desc);
95
96#ifdef __cplusplus
97}
98#endif
99
104#endif /* NFC_NDEF_MSG_PARSER_H_ */
void nfc_ndef_msg_printout(const struct nfc_ndef_msg_desc *msg_desc)
Print the parsed contents of an NDEF message.
int nfc_ndef_msg_parse(uint8_t *result_buf, uint32_t *result_buf_len, const uint8_t *raw_data, uint32_t *raw_data_len)
Parse NFC NDEF messages.
Binary data descriptor containing the payload for the record.
Definition: record.h:128
NDEF message descriptor.
Definition: msg.h:30
struct nfc_ndef_record_desc rec_desc[1]
Definition: msg_parser.h:32
struct nfc_ndef_record_desc * record_desc_array[1]
Definition: msg_parser.h:30
struct nfc_ndef_bin_payload_desc bin_pay_desc[1]
Definition: msg_parser.h:31
struct nfc_ndef_msg_desc msg_desc
Definition: msg_parser.h:29
Memory allocated for a one-record message.
Definition: msg_parser.h:28
struct nfc_ndef_record_desc rec_desc[2]
Definition: msg_parser.h:41
struct nfc_ndef_bin_payload_desc bin_pay_desc[2]
Definition: msg_parser.h:40
struct nfc_ndef_record_desc * record_desc_array[2]
Definition: msg_parser.h:39
struct nfc_ndef_msg_desc msg_desc
Definition: msg_parser.h:38
Memory allocated for a two-record message.
Definition: msg_parser.h:37
NDEF record descriptor.
Definition: record.h:91