<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Connect BLE via NFC</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111523/connect-ble-via-nfc</link><description>Hi,all 
 I need to connect BLE via NFC,but I do not know which example should i use to start。and i am a new field of NFC ,is there some document about NFC?thank you a lot !! 
 nRF5_SDK_17.1.0_ddde560</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 01 Jun 2024 07:10:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111523/connect-ble-via-nfc" /><item><title>RE: Connect BLE via NFC</title><link>https://devzone.nordicsemi.com/thread/486975?ContentTypeID=1</link><pubDate>Sat, 01 Jun 2024 07:10:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e44e85e-aaf5-45c9-b153-1b829d5edcf6</guid><dc:creator>ycp</dc:creator><description>&lt;p&gt;thank you very much! i got it!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connect BLE via NFC</title><link>https://devzone.nordicsemi.com/thread/486953?ContentTypeID=1</link><pubDate>Fri, 31 May 2024 17:13:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:612373ee-2498-43a7-81f1-49463ba879a8</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
[quote user="ycp"]I have Q3:if the board&amp;nbsp;boned with a phone ,next time this phone put on&amp;nbsp;the board again ,will it pair again? i wish it can&amp;nbsp; just connect ,do not pair ,what i should do?[/quote]
&lt;p&gt;You only need to bond once. If you turn off the board, and on again, and connect with the phone, you don&amp;#39;t need to pair/bond again.&lt;/p&gt;
[quote user="ycp"]can I use S332 softdevice to run NFC ?[/quote]
&lt;p&gt;Yes, that should work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connect BLE via NFC</title><link>https://devzone.nordicsemi.com/thread/486818?ContentTypeID=1</link><pubDate>Fri, 31 May 2024 08:43:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f95484d6-be30-4e56-97e3-1092dce17ee5</guid><dc:creator>ycp</dc:creator><description>&lt;p&gt;Q4:can I use S332 softdevice to run NFC ? Because the&amp;nbsp;project&amp;nbsp;&amp;nbsp;need ANT+ feature too!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connect BLE via NFC</title><link>https://devzone.nordicsemi.com/thread/486780?ContentTypeID=1</link><pubDate>Fri, 31 May 2024 06:46:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8521a993-0995-4a03-b0cf-429f7cd010ae</guid><dc:creator>ycp</dc:creator><description>&lt;p&gt;Thank you,it is vary useful !,&lt;/p&gt;
&lt;p&gt;I have Q3:if the board&amp;nbsp;boned with a phone ,next time this phone put on&amp;nbsp;the board again ,will it pair again? i wish it can&amp;nbsp; just connect ,do not pair ,what i should do?&lt;/p&gt;
&lt;p&gt;i read the code below,it seems will generate new&amp;nbsp;Authentication OOB Key again.thank you a lot!&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**
 * @brief Function for handling NFC events.
 *
 * @details Starts advertising and generates new OOB keys on the NFC_T2T_EVENT_FIELD_ON event.
 *
 * @param[in] p_context    Context for callback execution, not used in this callback implementation.
 * @param[in] event        Event generated by hal NFC lib.
 * @param[in] p_data       Received/transmitted data or NULL, not used in this callback implementation.
 * @param[in] data_length  Size of the received/transmitted packet, not used in this callback implementation.
 */
static void nfc_callback(void            * p_context,
                         nfc_t2t_event_t   event,
                         uint8_t const   * p_data,
                         size_t            data_length)
{
    UNUSED_PARAMETER(p_context);
    UNUSED_PARAMETER(p_data);
    UNUSED_PARAMETER(data_length);

    ret_code_t         err_code = NRF_SUCCESS;
    nfc_pairing_mode_t pairing_mode;

    switch (event)
    {
        case NFC_T2T_EVENT_FIELD_ON:
            NRF_LOG_DEBUG(&amp;quot;NFC_EVENT_FIELD_ON&amp;quot;);

            pairing_mode = nfc_ble_pair_mode_get();

            if ((pairing_mode == NFC_PAIRING_MODE_OOB) ||
                (pairing_mode == NFC_PAIRING_MODE_GENERIC_OOB))
            {
                // Generate Authentication OOB Key and update NDEF message content.
                uint8_t length = random_vector_generate(m_oob_auth_key.tk, BLE_GAP_SEC_KEY_LEN);
                random_vector_log(length);
                err_code = nfc_tk_group_modifier_update(&amp;amp;m_oob_auth_key);
                APP_ERROR_CHECK(err_code);
            }

            // Start advertising when NFC field is sensed and there is a place for another connection.
            if (m_connections &amp;lt; NRF_SDH_BLE_PERIPHERAL_LINK_COUNT)
            {
                err_code = ble_advertising_start(m_p_advertising, BLE_ADV_MODE_FAST);
                if (err_code != NRF_ERROR_INVALID_STATE)
                {
                    APP_ERROR_CHECK(err_code);
                }
            }

            break;

        case NFC_T2T_EVENT_FIELD_OFF:
            NRF_LOG_DEBUG(&amp;quot;NFC_EVENT_FIELD_OFF&amp;quot;);
            break;

        default:
            break;
    }
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connect BLE via NFC</title><link>https://devzone.nordicsemi.com/thread/486248?ContentTypeID=1</link><pubDate>Tue, 28 May 2024 15:37:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e75ec7c0-7074-4539-8265-e26e3075f84f</guid><dc:creator>Sigurd</dc:creator><description>[quote user="ycp"]Q1: it seems can bond between&amp;nbsp;nrf52832 and smart phone ,but if i turn off the board,and turn on the board again ,it can not atuo conneted to the smart phone,is some config should i do? or the&amp;nbsp;APP on smart phone should config something?[/quote]
&lt;p&gt;If you have your own android app, then you have the&amp;nbsp;&lt;span&gt;autoConnect parameter in connectGatt() you can set to true&lt;/span&gt;&lt;/p&gt;
[quote user="ycp"]Q2:is there any function to test the&amp;nbsp;antenna&amp;nbsp;performance,output some value ,like RSSI? Aim to optimize the &lt;span&gt;antenna&amp;nbsp;&amp;nbsp;&lt;/span&gt;for a better&amp;nbsp;sensing distance[/quote]
&lt;p&gt;It&amp;#39;s already tuned on the DK. For custom nRF52 boards, see this white paper for NFC antenna tuning.&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/nwp_026/WP/nwp_026/nWP_026_intro.html"&gt;https://infocenter.nordicsemi.com/topic/nwp_026/WP/nwp_026/nWP_026_intro.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connect BLE via NFC</title><link>https://devzone.nordicsemi.com/thread/486038?ContentTypeID=1</link><pubDate>Mon, 27 May 2024 13:24:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ffdbb09-e9c5-46c1-98c8-600e956fe46e</guid><dc:creator>ycp</dc:creator><description>&lt;p&gt;thank you for you nice answer, i used this sample:&amp;nbsp;nRF5_SDK_17.1.0_ddde560\examples\ble_peripheral\experimental\ble_app_hrs_nfc_pairing\pca10040.&lt;/p&gt;
&lt;p&gt;Q1: it seems can bond between&amp;nbsp;nrf52832 and smart phone ,but if i turn off the board,and turn on the board again ,it can not atuo conneted to the smart phone,is some config should i do? or the&amp;nbsp;APP on smart phone should config something?&lt;/p&gt;
&lt;p&gt;Q2:is there any function to test the&amp;nbsp;antenna&amp;nbsp;performance,output some value ,like RSSI? Aim to optimize the &lt;span&gt;antenna&amp;nbsp;&amp;nbsp;&lt;/span&gt;for a better&amp;nbsp;sensing distance&lt;/p&gt;
&lt;p&gt;thank you&amp;nbsp;a lot!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connect BLE via NFC</title><link>https://devzone.nordicsemi.com/thread/485987?ContentTypeID=1</link><pubDate>Mon, 27 May 2024 09:18:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f915555-9f80-4319-addc-781dd8bb74ab</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div&gt;We&amp;nbsp;provide several examples in nRF5 SDK v17.1.0 that demonstrate the use of NFC for BLE pairing:&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;
&lt;div&gt;&lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/nfc_writable_ndef_msg.html" rel="noopener noreferrer" target="_blank"&gt;Writable NDEF Message Example&lt;/a&gt;: This example shows how to use the NFC tag to expose a writable NDEF message.&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;
&lt;div&gt;&lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/ble_sdk_nfc_pairing_reference.html" rel="noopener noreferrer" target="_blank"&gt;Experimental: BLE Pairing Using NFC - Peripheral Reference Example&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;and&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/ble_sdk_nfc_pairing_reference_c.html" rel="noopener noreferrer" target="_blank"&gt;Experimental: BLE Pairing Using NFC - Central Reference Example&lt;/a&gt;:&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;
&lt;div&gt;&lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/ble_sdk_app_hrs_nfc_pairing.html" rel="noopener noreferrer" target="_blank"&gt;Experimental: Heart Rate Application with BLE Pairing Using NFC Pairing Library&lt;/a&gt;:&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;
&lt;div&gt;&lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/ble_sdk_app_hid_keyboard_pairing_nfc.html" rel="noopener noreferrer" target="_blank"&gt;Experimental: HID Keyboard Application with BLE pairing using NFC&lt;/a&gt;:&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;
&lt;div&gt;&lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/ble_sdk_app_hrs_nfc_c.html" rel="noopener noreferrer" target="_blank"&gt;Experimental: BLE Heart Rate Collector Example with NFC Pairing&lt;/a&gt;:&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;For detailed information about NFC and the available libraries and modules, you can refer to the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/library_nfc.html" rel="noopener noreferrer" target="_blank"&gt;NFC library and modules&lt;/a&gt;.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;PS: If this is a new project, I strongly recommend using nRF Connect SDK instead:&amp;nbsp;&lt;a href="https://www.nordicsemi.com/Products/Development-software/nRF-Connect-SDK"&gt;https://www.nordicsemi.com/Products/Development-software/nRF-Connect-SDK&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Here I would recommend this sample to start with:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/peripheral_nfc_pairing/README.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/peripheral_nfc_pairing/README.html&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>