.. _nfc_ndef_ch_rec_parser_readme:

Parser for Connection Handover records
######################################

.. contents::
   :local:
   :depth: 2

This library provides a parser for Connection Handover records that can be used to decode NDEF records generated by the :ref:`nfc_ch` 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 :ref:`nfc_ch` library.

This library should be used together with the :ref:`nfc_ndef_parser_readme` in the following way:

1. Obtain the NDEF message descriptor by parsing raw NDEF message data with the :ref:`nfc_ndef_parser_readme`.
#. Search for Connection NDEF records inside the NDEF message descriptor.
#. If there are any such NDEF records, use this library to parse them and print their content.
#. The Connection Handover Records contains the local NDEF message with the Connection Handover Local NDEF Records, use this library to first check their type and next parse them and print their content.

The following code sample demonstrates how to use this module:

.. literalinclude:: ../../../../../samples/nfc/tag_reader/src/main.c
    :language: c
    :start-after: include_startingpoint_ch_rec_parser_rst
    :end-before: include_endpoint_ch_rec_parser_rst

This library is used in the :ref:`nfc_tag_reader` sample.

API documentation
*****************

| Header file: :file:`include/nfc/ndef/ch_rec_parser.h`
| Source file: :file:`subsys/nfc/ndef/ch_rec_parser.c`

.. _nfc_ndef_ch_record_parser:

.. doxygengroup:: nfc_ndef_ch_record_parser
   :project: nrf
   :members:
