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

The Nordic_UART device is not visible from iOS BT setting

Hello.

I imported the "Nordic_UART" example from "nRF5_SDK_15.2.0_9412b96 examples ble_peripheral\"
The device is visible from the Android BT settings and is not visible from the BT settings of iOS(8.0).
The "nRF Connect" application on iOS(8.0) recognizes the "Nordic_UART" device.
What changes should I make to my code ?

I tried to use the "ble_app_ancs_c_pca10040_s132.hex" file downloaded from "nRF5_SDK_15.2.0_9412b96\examples\ble_peripheral\ble_app_ancs_c\hex\"
The "ANCS" device is visible from the BT settings of iOS.

I think of where to add some code from the example from "RF5_SDK_15.2.0_9412b96 example ble_peripheral ble_app_ancs_c".
What code should I add ?
Where can I find an iOS example for "Nordic_UART" ?

Thank you

Demetrio Magrin

  • Hi Demetrio

    IOS devices won't discover bluetooth devices that aren't "useful" to the IOS device, which is why you aren't able to discover the Nordic UART device using the Bluetooth setting. To make it visible I think you have to add the HID service in the advertising packet and add HID profile to your attribute table as well. You can look at our ble_app_hids_keyboard example to see how this is done.

    By doing this you will trick the device into thinking the nRF is a HID (Human Interface Device), which means it finds it useful and will show it as a connectable Bluetooth device.

    Best regards,

    Simon

  • Hi Simonr

    I thank you for your reply.
    It seems to me that there is some confusion about it.
    Try to see the links I have listed below and tell me what you think.
    Thank you.

    https://www.youtube.com/watch?v=yMQHo1N707Y

    https://stackoverflow.com/questions/45598377/does-bluetooth-low-energy-devices-still-not-show-under-ios-bluetooth-settings-m

    BR

    Demetrio Magrin

  • Hi Demetrio

    Yes, you could use an app for this like the one in the YouTube link you provided or our nRFConnect app for iOS. But in the second answer in the stackoverflow link you provided it is stated: "If you hobby project is to do something related to built-in supported devices, like HID (keyboard, mouse, remote control, etc.), you will actually see them during discovery from Settings app." Which is what I suggest you make your nRF advertise as if you don't want to use an app. 

    Best regards,

    Simon

  • Hi Simonr

    I thank you for your reply.

    In my "Nordic_UART" application I had already tried to make these simple changes:

    static void advertising_init(void)
    {
        uint32_t               err_code;
        ble_advertising_init_t init;

        memset(&init, 0, sizeof(init));

        init.advdata.name_type          = BLE_ADVDATA_FULL_NAME;
        init.advdata.include_appearance = true;
        init.advdata.flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;

        init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
        init.srdata.uuids_complete.p_uuids  = m_adv_uuids;

        init.config.ble_adv_fast_enabled  = true;
        init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
        init.config.ble_adv_fast_timeout  = APP_ADV_DURATION;
        init.evt_handler = on_adv_evt;

        err_code = ble_advertising_init(&m_advertising, &init);
        APP_ERROR_CHECK(err_code);

        ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG);
    }

    static void gap_params_init(void)
    {
        uint32_t                err_code;
        ble_gap_conn_params_t   gap_conn_params;
        ble_gap_conn_sec_mode_t sec_mode;

        BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);

        err_code = sd_ble_gap_device_name_set(&sec_mode,
                                              (const uint8_t *) DEVICE_NAME,
                                              strlen(DEVICE_NAME));
        APP_ERROR_CHECK(err_code);
        //
        // see function "static void advertising_init(void)"
        // "init.advdata.include_appearance = true";
        //
        err_code = sd_ble_gap_appearance_set(BLE_APPEARANCE_HID_KEYBOARD);
        APP_ERROR_CHECK(err_code);

        memset(&gap_conn_params, 0, sizeof(gap_conn_params));

        gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
        gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
        gap_conn_params.slave_latency     = SLAVE_LATENCY;
        gap_conn_params.conn_sup_timeout  = CONN_SUP_TIMEOUT;

        err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
        APP_ERROR_CHECK(err_code);
    }

    After these simple changes my iPAD mini (iOS 8.0) does not yet see the "Nordic_UART" device.
    Maybe it depends on the too old iOS version ?
    If I can make my device visible from iOS it will be possible to perform the pairing (to enable encrypted communication).
    What are the advantages of making my "Nordic_UART" device visible from iOS ?
    I have read that without the MFi chip it will never be possible to execute encrypted communication. It's true ?
    If so, what's the point in making my device visible from iOS ?
    What difference is there in communication with and without pairing ?
    With Android, if I enable pairing I have an encrypted communication.

    BR
    Demetrio Magrin
  • Hi Demetrio

    You will have to add the HID service as well in order for your iOS device to see it.

    Honestly, I'm not sure about the encrypted connection possibilities through BLE for iOS, as we generally use nRFConnect for this purpose. Using nRFConnect you should be able to pair and communicate using encryption at least. There also won't be any trouble with visibility there. So if you're not sure why you want to connect via the settings, then neither am I.

    The main difference between communication using pairing and not, is that you will be able to encrypt your messages when paired, and is generally a safer way of communication. If the devices aren't paired, the information will have to be sent via the advertising packets, and will be out in the open for "anyone" to see.

    Best regards,

    Simon

Related