Advertise and scan connectable

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at https://www.dialog-semiconductor.com/support . We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
tplux42
Offline
Last seen: 7 months 1 week ago
Joined: 2019-03-01 11:41
Advertise and scan connectable

Hi

We have an existing project with the DA14585 as a central device. It's scanning for advertisements and in our setup there are a lot of advertisements it has to sample.

But we would also like to be able to connect to it with a mobile phone. I found a topic in the forum that explains how to alternate between central and peripheral role, but my question is: is it possible to connect to the DA14585 while it is scanning for advertisements? I.e. if the phone has seen an advertisment, does it have to start a connection while the DA14585 is still in peripheral role, or can it be connectable all the time? I would like to limit the time the device acts as a peripheral.

Best regards

Tommy

Device: 
PM_Dialog
Offline
Last seen: 6 months 3 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi tplux42,

Hi tplux42,

Thanks for your question online. According to BLE specs, it’s not possible to advertise ( GAP Peripheral role ) and scanning ( GAP Central role ) at the same time. So, what is discussed on a couple of forum tickets is to perform role switching from GAP Central to GAP Peripheral at the same timer. Since it is a DA14585, you could use the GAP_ROLE_ALL and perform the role switching.

You could take a look at the DA14531-DA14585-586 BLE Multirole Example SW Example from out support website. This SW examples aims to demonstrate the capabilities of the DA14531/585/586 as a Central and a peripheral i.e. scan and advertise role.

Once the DA14585 is configured as GAPG Peripheral and start advertising and detectable by the mobile phone, then it will be connectable thus you could initiate a BLE connection from the phone. The GAP Central is always initiating the connection.

Thanks, PM_Dialog

tplux42
Offline
Last seen: 7 months 1 week ago
Joined: 2019-03-01 11:41
Hi

Hi

Thanks for your answer, but it wasn't quite what I was looking for.

I would like to have very short advertising periods, but I'm worried that it is not possible to connect outside of these periods. E.g. let's say the DA14585 is scanning for 9 seconds and advertising for 1 second, scanning for 9, advertising for 1 and so on. Is it only possible to connect in the 1 second window, or can the phone connect during the 9 second window as well?

PM_Dialog
Offline
Last seen: 6 months 3 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi tplux42

Hi tplux42

You could setup a timer in order to change GAP roles between scanning and advertising, but 1 sec for advertising is too short. In the advertising period, the device should be scanned and detected in the air by the Mobile phone and in that period, you should connect to it as a BLE connection is initiated always by the GAP Central.

Thanks, PM_Dialog