How can I modify my board so that my iPhone automatically connects to it

I'm testing my code based on nrf5SDK v17.0.0 with nrf52832 board.

By nrf connect application,I can see the broadcast packet from my board.It looks something like this.

Some of my hypothetical users are iPhone users.Then I  test my board with iphone.

It is OK when I use iphone to connect,pair and bond with my board.

But when I restart the bluetooth on iphone or reenter Bluetooth broadcast range of my board, iphone will not connect to it automatically.But Android phone can connect to it automatically.

Besides,I tried the example that hid_mouse,The example can achieve this effect,but it seem based on whitelist.But I want to support multiple phones to connect and support them reconnect automatically at the same time.

Parents
  • Hi

    The iOS Bluetooth stack will only automatically connect to a devices which has services that are natively supported, such as HID. For devices without those servics, you will need have an app running on the phone that handles the (re-)connection. This is normally requierd anyway for devices with such services in order to use/interact with the services on the device (given that they are not natively supported in iOS).

  • Hi, 你好,

    I think something not mentioned by omission before.In the raw data,you can see the uuid in advertising packet is set as 我想有些东西之前没有被遗漏。在原始数据中,可以看到advertising packet中的uuid被设置为我想有些东西之前没有被遗漏。在原始数据中,可以看到advertising packet中的uuid被设置为我想有些东西之前没有被遗漏。在原始数据中,可以看到advertising packet中的uuid被设置为

    BLE_UUID_HUMAN_INTERFACE_DEVICE_SERVICE.BLE_UUID_HUMAN_INTERFACE_DEVICE_SERVICE。BLE_UUID_HUMAN_INTERFACE_DEVICE_SERVICE。BLE_UUID_HUMAN_INTERFACE_DEVICE_SERVICE。
    The services on my board as follow:我的板子上的服务如下:我的板子上的服务如下:我的板子上的服务如下:
    Just add a nus service to the hid_mouse sample.That is using the same HID service with the hid_mouse sample.They have the same uuid,service,character and HID map.只需向hid_mouse示例添加一个nus服务。这是在hid_mouse示例中使用相同的HID服务。他们有相同的uuid,服务,字符和HID地图。只需向hid_mouse示例添加一个nus服务。这是在hid_mouse示例中使用相同的HID服务。他们有相同的uuid,服务,字符和HID地图。只需向hid_mouse示例添加一个nus服务。这是在hid_mouse示例中使用相同的HID服务。他们有相同的uuid,服务,字符和HID地图。
    I don't know why they are different.So I guess maybe due to whitelist.我不知道它们为什么不一样。所以我想可能是白名单的缘故。我不知道它们为什么不一样。所以我想可能是白名单的缘故。我不知道它们为什么不一样。所以我想可能是白名单的缘故。
    Below is my code,I hope to get further guidance from you.下面是我的代码,希望能得到你的进一步指导。下面是我的代码,希望能得到你的进一步指导。下面是我的代码,希望能得到你的进一步指导。

    我觉得有些东西reload-alertreload-alertreload-alert

  • Hi,

    There doesn't seem to be a difference between the two methods from the logs.

    Now I have a new problem.

    If there's a way to speed up the connection back to my board.

    Adjusting the TX power is one way, but it's not enough.

    I also tried to shorten the broadcast interval.

    According to the manual, the minimum broadcast interval can be adjusted to 20ms, but its performance is still poor.

    I even use while (NRF_LOG_PROCESS()) in the main loop; Replace idle_state_handle(); Because I guess the low power consumption also has an impact on the back connection.

    So what else can I do to speed up the connection?

  • Hi,

    As a periphearl, the only thing you can do to speed up re-connection is to increase the advertising interval. The advertising module used in the nRF5 SDK and in use in the hids_mouse sample use slow advertising after a long time (longest interval), fast advertising and aditionally high duty cycle directed advertising immediately after a disconnect to ensure fast reconnection. You can adjust when to use these modes, and the intervals used. Note however that it is also very important how frequently and for how long time the central (phone) scans, as this needs to overlap in time in order to establish a connection, and you do not have much control on how this is handeld on the phone side.

  • Hi,

    Are you saying that all I can do is adjust the broadcast interval and use directed broadcast ?(although my program is based on the hid_mouse routine, I disable whitelisting)

    I don't know much about directed broadcasting.Can Bluetooth be scanned by other (unspecified) devices after directed broadcasting is enabled?

  • As a peripheral device, the only thing you can do to incrase the likelyhood of a fast re-connect it to increase the advertising interval. Directed broadcasting in itself doe snot help in that regard, but by BLE scpec it is allowed to to a very high advertising interval for a short period of time when using directed advertising. This is typically used for HID devices to allow fast reconnect after an unwanted disconnect.The hids_mouse example allready use directed high duty advertising after a disconnect.

    The other factor that greately affect time to reconnect is the scanning on the central, but this is controlled by the Bluetooth stack on the central device and cannot easily be controlled.

  • Hi,

    Is the directed high duty advertising that you're talking about in hid_mouse implemented through whitelist?And if there anything that needs attention here?

Reply Children
Related