Auto Connect After Pairing

8 posts / 0 new
Last post
justinturley
Offline
Last seen:4 years 4 months ago
加入:2016-06-19 23:55
Auto Connect After Pairing

Hi,

I've searched the forums and ap notes, but I have not been successful in finding an example that is helpful to me. I would like to set up my peripheral device with custom service to connect automatically with the central after it has been paired. I built my project on top of the ble_app_peripheral project.

Currently I start undirected advertising after holding a button for 4 seconds. And this works well, but after power off then back on, I would like them to connect automatically.

是在中央上实现的自动配对的代码,还是外围设备也必须具有特定代码?

I don't need a secure connection, or for this device to be the only connectable device, so I would like the most simple and efficient method possible.

Can you please direct me to an example or note that explains this better? Do I need to used Directed adv? Or do I have to have a bonded connection to make it work? Do I have to add the central's address to a whitelist?

谢谢。

Keywords:
Device:
MT_dialog
Offline
Last seen:1 month 1 week ago
工作人员
加入:2015-06-08 11:34
Hi justinturley,

Hi justinturley,

There are a few ways for the devices to re-connect automatically, you can either have the peripheral to perform a direct advertising to the central, in order to establish a fast reconnection, or you can perform undirected advertising and have the central filter the device through the advertising string (check for specific data in the advertising string) or the bd address and issue a connection request. In all cases only the central device sends a connection request (you not going to be able to force a connection from your peripheral). Regarding the examples you can check the keyboard example in order for your peripheral to perform a directed advertising and also you can check the DSPS host project where the host checks the advertising string of the device detected and checks for specific services on the adv string (in that specific case the DSPS service) and if the service is the one that the host is looking for then it issues a connection request.

谢谢mt_dialog.

justinturley
Offline
Last seen:4 years 4 months ago
加入:2016-06-19 23:55
谢谢,

谢谢,

只是为了澄清,我可以在没有粘合的情况下做一个指示的广告吗?我不需要或想要融合。如果是这样,请在发送Direct Adv命令之前有什么需要做的......即,我是否需要先获取并存储客户端地址,将其放入消息中,然后发送命令?

MT_dialog
Offline
Last seen:1 month 1 week ago
工作人员
加入:2015-06-08 11:34
Hi justinturley,

Hi justinturley,

In order for your peripheral to direct advertise to the device it has to know the bd address of the host that it was connected to previously, so you will have to store the bd address of your central in order to direct advertise to it. You can get this info (the bd address of the host during the connection procedure). The host's adress should be placed in the direct struct member of the gapm_adv_info union of the gapm_start_advertise_cmd you allocate when you are about to advertise. You dont need to bond with the device in order to connect to it via directed advertising.

谢谢mt_dialog.

Lange
Offline
Last seen:3 years 4 months ago
加入:2016-09-14 02:59
Hi MT_dialog:

Hi MT_dialog:
I have a question, DA14580 firmware can't auto connect to APPLE IOS when reboot it. What should I do?
Looking forward to your answer!
谢谢。

MT_dialog
Offline
Last seen:1 month 1 week ago
工作人员
加入:2015-06-08 11:34
Hi Lange,

Hi Lange,

The connection procedure is something that the iOS is going to decide (the application running on the master and not the slave), normally the iOS should retain the bonding data after it has been rebooted in order to establish a secure connection and not going through the pairing procedure again. But again the connection procedure is something that it is initated from the master and not the slave (the connection command is only send from the master). Even in the directed advertising procedure the master is the one that decides if it will be connected with the peripheral or not.

谢谢mt_dialog.

Lange
Offline
Last seen:3 years 4 months ago
加入:2016-09-14 02:59
Hi MT_dialog

Hi MT_dialog
Maybe something wrong with my post. Now again my question: DA14580 firmware can't auto connect to APPLE IOS after DA14580 reboot.Do you have Solutions?

Thanks Lange

MT_dialog
Offline
Last seen:1 month 1 week ago
工作人员
加入:2015-06-08 11:34
Hi Lange,

Hi Lange,

提供的信息对我来说不够了解你的问题是什么,问题“da14580 fw无法自动连接到da14580重新启动后的苹果ios”是非常通用的:

  • 如上所述,连接过程由主设备启动而不是从从机启动(主机应该开始连接,从而不能执行此操作)。
  • What is the fw that you are using, is it any dialog reference design ?
  • 与iOS设备的FW键合?
  • If it is bonding with the iOS device and the device is rebooted if you dont save the bonding data in a flash or in general in a NV memory the iOS device will try to connect to it without going through the pairing procedure and by using the same bonding data that had before the device was rebooted. Therefore the peripheral will decline connection with the peripheral.
  • There are quite a few reasons for a device not to be able to connect to a central, i trust that the above reason is the most probable, but you have to be more precise on what the problem is and what you observe.

谢谢mt_dialog.