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

question about advertising

Hi,

i have some more, for me fundamental, questions and i hope some one can help me :)

1.) can i use the advertise function whenever i want or only in connection interval ? And how big is the size of payload i can send by the advertising function? Will it be send on every of three advertising channels?

2.) how should i handle received advertising packets, with which interrupt or function? So would it be possible that to more or less beacons will communicate over advertising data, so one device sends advertising data and other receives and can react.

3.) Did i understand it correctly, beacon only means advertising with apple "rules"?

best regards,

Nils

  • So, i had a look in BLE white papers where i could found, that there are some GAP roles for ble devices, like Broadcaster, Observer, Peripheral, Central.

    So in my case i need to have a normal BLE connection between my device and a smartphone, so my device will work as Peripheral, right? And in this role i can advertise the data i want at time i want, right? But how can i also have the functionality of an observer so that i can read the advertised data from other devices? Does nordic provide this, it is equal to an product of the company CSR where they use this advertising <-> observing functionality .

    Best regards, Nils :)

  • Currently, Nordic only provides the S110 Peripheral/Broadcaster and the S120 Central/Observer stack for the nRF51822.

    1. The S110 can advertise certain data, up to 31 bytes minus overhead. If an observer sends a scan request to the broadcaster, the broadcaster can provide additional or different data through a scan response. If a Central sends a connect request, and the device is advertising without filter policies or non-connectable params, then a connection will be created and the advertising stopped (transition from Broadcaster->Peripheral). The advertisements are sent on all the three advertising channels sequentially, and they can only be sent outside of a connection. If you do non-connectable advertising, some restrictions apply to the parameters of the advertising, but no central can connect to you and stop the advertising.

    2. Only the S120 can actually receive advertisement packets. (It can function as both a Central and an Observer at the same time, having up to 8 simultaneous connections to Peripherals and still scan for a 9th, but not connect to it.) These will come as events after you have started scanning, and could contain either advertising data og a scan response, depending on whether the scanning is 'active' and if the broadcasters have data to respond with. You can also set a whitelist with addresses and/or IRKs to only receive advertisements from known peers. This is all handled by sd_ble_gap_scan_start() and sd_ble_evt_get() on the lowest level, and I'm not sure how this looks in the SDK.

    3. Yes, beacons are only some rules imposed on top of the existing roles. I won't go into details, but all of these should be implementable using the S110.

    To re-iterate: You do not bother with connections when it comes to iBeacons, and the S110 can function as a non-connectable broadcaster. The S120, or a BLE-enabled mobile phone that implements the Central or Observer role, can receive these advertisements and handle them.

  • Hi Ulrich,

    thanks for so much helpful informations :)

    1.) But now i think i have a problem by handling my problem. I need both in my application, advertising and observing, there should be no connection between two ore more applications, the data exchange should be done by sending small data over advertising messages, and should be received by scanning for advertising. For this kind of data exchange i do not need any big data throughput. --> i am not sure if an central/observer can also advertise, but if it does, i would be able to use S120, correct?

    2.) But it will sometimes be needed to connect my application to an smart-device so an central in BLE. I think this would not work to connect two centrals?

    3.) Instead of using central/observer, would it not bee possible to use the S110 as peripheral with advertising, and make any workaround, i don't know if this is possible, which makes me abele to scan the advertising data, or is this not possible because of the BLE Stack?

    4.) Ok i know the size of advertising data, is there limit in sending advertising data right behind other advertising data?

    I think this is enough :D

    Thanks and best regards, Nils

    1. There is a thread here that addresses this

    2. One peripheral can only be connected to one central each time. However, the new S110 v7.0 softdevice can be in peripheral role (connected with a central) and be a broadcaster at the same time.

    3. I am not sure if I understand your question actually. With S120, the device is a central and it can scan advertising packets sent by a advertiser/broadcaster, and/or be in a connection with a peripheral. With S110 you can advertise/broadcast and/or be in a connection with a central device (peripheral role)

    4. In your application, you can configure your advertising interval. The shorter the advertising interval, the more frequently the advertiser will send out advertising packets, the quicker it is discovered by central devices.

Related