This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NFC Issue

Hi,

 

I’m using SDK 15.00 and I have some issues with NFC. When I’m trying to connect with NFC - NFC_T2T_EVENT_FIELD_ON event occurs. At this point, I need to start BLE advertising, in order to complete connection. Otherwise – it doesn’t work.

 

Why do I have to start advertising, even though I’m using NFC? Is it normal?

Thanks!

  • Hi,

    Yes, that is normal.

    You can use NFC field detection for waking up the device, but you still have to follow the normal procedure for establishing a BLE connection.

    In order to initiate a BLE connection, the peripheral needs to advertise and the central needs to scan for those advertisements. NFC can then be used for out of band communication at a later stage in the connection procedure.

    Regards,
    Terje

  • Thanks, Terje!

    Another question, regarding advertisement:

    After the peripheral is connected and bonded to other central, I need the peripheral to disconnect from the central at a specific point. After that, I want to give the central the option to connect again. Do I have a way to do it, besides advertising again?

  • Hi,

    In order to reestablish the connection at a later stage, you will always have to start by advertising.

    You can use directed advertising in order to advertise to one particular device only, and whitelisting to only allow connections from one device or a short list of given addresses.

    Regards,
    Terje

  • I thought that the meaning of advertising is broadcasting my details, so other devices will know about me and have the option to connect to me. I don't understand how advertising is necessary if I try to connect to a peripheral directly with NFC, or if I was already connected and I want to connect again, while I already know the peripherals details. Maybe I didn't understand it correctly. Can you please try to clarify it?

    Thanks again!

  • Hi,

    You do not use NFC for connecting. If you use NFC during the connection then it is only for sending a short code which is used for encrypting the rest of the pairing / bonding procedure.

    When a device advertises that it is connectable, it will listen for a short period of time after each advertisement is sent out, and in this short period it can receive connection requests from centrals. This is the way establishing a BLE connection works, and it is the same no matter if the devices have previously bonded or not.

    For getting more familiar with BLE, please have a look at our Bluetooth Low Energy tutorials.

    Regards,
    Terje

Related