Parser for Bluetooth LE OOB records

This library provides a parser for Bluetooth® LE OOB records that can be used to decode NDEF records generated by the Bluetooth LE OOB records library. The output of this library is a descriptor with the same content as the one that would be used to encode the data with the Bluetooth LE OOB records library.

This library should be used together with the Parser for messages and records in the following way:

  1. Obtain the NDEF message descriptor by parsing raw NDEF message data with the Parser for messages and records.

  2. Search for LE OOB NDEF records inside the NDEF message descriptor.

  3. If there are any such NDEF records, use this library to parse them and print their content.

The following code sample demonstrates how to use this module:

static void ndef_le_oob_rec_analyze(const struct nfc_ndef_record_desc *le_oob_rec_desc)
{
	int err;
	uint8_t desc_buf[NFC_NDEF_REC_PARSER_BUFF_SIZE];
	uint32_t desc_buf_len = sizeof(desc_buf);

	err = nfc_ndef_le_oob_rec_parse(le_oob_rec_desc, desc_buf,
					&desc_buf_len);
	if (err) {
		printk("Error during NDEF LE OOB Record parsing, err: %d.\n",
			err);
	} else {
		nfc_ndef_le_oob_rec_printout(
			(struct nfc_ndef_le_oob_rec_payload_desc *) desc_buf);
	}
}

This library is used in the NFC: Tag reader sample.

API documentation

Header file: include/nfc/ndef/le_oob_rec_parser.h
Source file: subsys/nfc/ndef/le_oob_rec_parser.c
Parser for NDEF LE OOB Records