This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Difference between iOS and Android Bluetooth "search for devices" mechanism

Hello,

I have a BLE application running on a nRF51822 chip with the S120 softdefice. If I use the standard Android "search for device" mechanism for Bluetooth devices, I can find my nRF51822 and get connected.

On the other side, if I use the standard "search for device" mechanism of iOS (iPhone), I am not able to see my nRF51822. Additionally I`m not able to get connected to the nRF51822. If I use a special Bluetooth scanner application on the iPhone, I can see the nRF51822 device.

Is there any chance to get connected on the iPhone via the standard iOS Bluetooth search mechanism?

Regards!

Parents
  • @BTprogrammer: Could you let me know which mode did you run with the S120. If you run it in central mode, I don't think any phone would be able to search for it. S120 is central stack and will only do scanning.

    I assume the "search for device" you mentioned was the button in the Bluetooth setting. On iPhone only the device that is HID device, audio device or bonded device will appear. This explain why you couldn't see it in the list.

    What I suggest you to do is to have a look at the nRFToolbox app for iOS. The source code is provided, and you should be able to find how to scan for the device in your own app.

  • Hello Hung,

    In my understanding, I can use S120 as central and peripheral. In my application I use it in peripheral mode:

    static void ble_stack_init(void)
    {
        uint32_t err_code;
    		ble_uuid128_t base_uuid = DEVICE_PERIPHERAL_BASE_UUID;
    	
    		// Initialize the SoftDevice handler module.
        SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL);
    
        // Enable BLE stack 
    		ble_enable_params_t ble_enable_params;
        memset(&ble_enable_params, 0, sizeof(ble_enable_params));
    	
        ble_enable_params.gatts_enable_params.service_changed = IS_SRVC_CHANGED_CHARACT_PRESENT;
    	  ble_enable_params.gap_enable_params.role              = BLE_GAP_ROLE_PERIPH;
        
    		err_code = sd_ble_enable(&ble_enable_params);
        APP_ERROR_CHECK(err_code);
    		
    		err_code = sd_ble_uuid_vs_add(&base_uuid, &m_base_uuid_type);
        APP_ERROR_CHECK(err_code);
    	
    	  err_code = softdevice_ble_evt_handler_set(ble_evt_dispatch);
    		APP_ERROR_CHECK(err_code);
    		
    }
    

    But later on, I will do an dynamical switch between central and peripheral. But in connection mode to a smartphone, it will always be peripheral mode. I think your second paragraph is the answer I was searching for. So there is no other option for me like to search in my iOS application for my devices. On iOS I can`t use the standard iOS search function, as this only allows to see HID devices, audio devices or bonded devices!?

    After bonding the device via my iOS app, the device should also appear in the iOS Bluetooth list...

    Thanks

    Regards!

Reply
  • Hello Hung,

    In my understanding, I can use S120 as central and peripheral. In my application I use it in peripheral mode:

    static void ble_stack_init(void)
    {
        uint32_t err_code;
    		ble_uuid128_t base_uuid = DEVICE_PERIPHERAL_BASE_UUID;
    	
    		// Initialize the SoftDevice handler module.
        SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL);
    
        // Enable BLE stack 
    		ble_enable_params_t ble_enable_params;
        memset(&ble_enable_params, 0, sizeof(ble_enable_params));
    	
        ble_enable_params.gatts_enable_params.service_changed = IS_SRVC_CHANGED_CHARACT_PRESENT;
    	  ble_enable_params.gap_enable_params.role              = BLE_GAP_ROLE_PERIPH;
        
    		err_code = sd_ble_enable(&ble_enable_params);
        APP_ERROR_CHECK(err_code);
    		
    		err_code = sd_ble_uuid_vs_add(&base_uuid, &m_base_uuid_type);
        APP_ERROR_CHECK(err_code);
    	
    	  err_code = softdevice_ble_evt_handler_set(ble_evt_dispatch);
    		APP_ERROR_CHECK(err_code);
    		
    }
    

    But later on, I will do an dynamical switch between central and peripheral. But in connection mode to a smartphone, it will always be peripheral mode. I think your second paragraph is the answer I was searching for. So there is no other option for me like to search in my iOS application for my devices. On iOS I can`t use the standard iOS search function, as this only allows to see HID devices, audio devices or bonded devices!?

    After bonding the device via my iOS app, the device should also appear in the iOS Bluetooth list...

    Thanks

    Regards!

Children
No Data
Related