TX specified number of adv packets with CyBle_GappSetNumOfAdvPkts()

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
VaSo_4664306
Level 1
Level 1

Hi.


Question:

  1. What is the parameter “NumOfAdvPkts” of the function “CyBle_GappSetNumOfAdvPkts()”? Is it number of bundles of TX on 3 channels OR this is number of TX packets? What should I see in sniffer if I use value 1 and value 3?
  2. What is the advertising interval  for this function? For example, if I use the NumOfAdvPkts == 9. What is the period between two TX on ch.37 and what is the period between channels 37-38-39?
  3. Can I set the specific number of advertising channels?

I am use BLE version 3.65.

Cypress CYBLE-224110-00.

I want to send advertising packet on 3 channels with period from 1 second to 1 minute.

I use CyBle_GappSetNumOfAdvPkts().

I have 2 inexplicable behavior:

  1. When I use NumOfAdvPkts == 3, I should see 3 TX packets, every on correspond channel: 37, 38, 39. Actual: I see expected advertising event, and after, sometimes, randomly, with delay 3 second, one additional advertising (unexpected). I see the additional packet in the sniffer and I get TX callback (I use CyBle_RegisterBlessInterruptCallback).
  2. When I use the NumOfAdvPkts == 1, I see the advertising on all 3 channels and I don’t see strange additional TX event.

Where can I find the description of the CyBle_GappSetNumOfAdvPkts? I don’t find the answer in the header description and the document “Bluetooth Low Energy” that attached to the PsocCreator.

Please, assist and explain the situation.

0 Likes
5 Replies
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

Q) What is the parameter “NumOfAdvPkts” of the function “CyBle_GappSetNumOfAdvPkts()”? Is it number of bundles of TX on 3 channels OR this is number of TX packets? What should I see in sniffer if I use value 1 and value 3?
Ans: The parameter “NumOfAdvPkts” of the function “CyBle_GappSetNumOfAdvPkts() will define the total number of packets to transmitted over the air. If you set this value to 1 then you will see only one TX packet on channel 37. If you set this value to 3, then you will see three packets on channel 37, 38,39 as shown in below image. After transmitting the Number of packets the advertisement will be stopped.

pastedImage_4.png


Q) What is the advertising interval for this function? For example, if I use the NumOfAdvPkts == 9. What is the period between two TX on ch.37 and what is the period between channels 37-38-39?
Ans: The advertising interval is the value which you set in Advertising settings in the BLE component. The time between the beginning of two consecutive ADV_IND PDUs within an advertising event shall be less than or equal to 10 ms as shown below. The advertising event shall be closed within the advertising interval.

pastedImage_5.png

i) Below image will show the 9 advertisement packets on channel 7 with advertising interval of 50ms(Only channel 7 is selected in Advertising channel map in BLE component).

pastedImage_6.png

ii) Below image will show the 9 advertisement packets on ALL channels with advertising interval of 50ms(All channels are selected in Advertising channel map in BLE component).

pastedImage_7.png

Q) Can I set the specific number of advertising channels?
Ans: You can set the specific number of advertising channels in Advertising settings in BLE component as shown in below.

pastedImage_8.png

Please let me know if you have any questions.

Thanks,

P Yugandhar.

0 Likes

I have 2 unexpected behavior:

1. When CyBle_GappSetNumOfAdvPkts called with value 3, I get one extra, unexpected advertising on 3 channels, with advertising interval delay after expected (required). This happens randomly, with probability 30%. In other words, I send the function with value 3 and i see 3 adv.packets and after delay of the interval i see additional 3 advertising on 3 channels. Total: I get 6 TX packet.

2. When i use CyBle_GappSetNumOfAdvPkts with number of packets 1, I get advertising on channels: 37,38, 39. Total: 3 TX packets. In this case there isn't any additional unexpected broadcast.

The issue happens only when the project compiled with bootloader (Dual-Application) and with Virtual Node Substitution Level is 3.

The issue doesn't happen when tested without bootloader and without optimization. I can't separate the test. For my opinion, the optimization is most likely.

0 Likes

Hello,

Could you please share your project so that we can check at our end ?

Thanks,

P Yugandhar.

0 Likes

Unfortunately I can't share the project.

I called CyBle_GappSetNumOfAdvPkts with value 3. To stop broadcast i use CyBle_GappStopAdvertisement(); The system most of the time in sleep. Waked up ones per second. And according to state it sends broadcast.

According to my test and investigation:
1. The unexpected packet is sent after elapsing advertising interval if CyBle_GappStopAdvertisement was not called before.

2. If new request is sent without a stop, after the broadcast of required number of packets is done and before the advertisement interval elapsed, the new request is ignored. After broadcast of requested number of packets, the system is in state CYBLE_STATE_DISCONNECTED. Apparently i wrong think that we should not sent the stop in this state (when it already finished to send).

Obviously i am wrong about TX 3 packets on 3 channels when CyBle_GappSetNumOfAdvPkts called with value 1. For indication I use Nordic Sniffer. When I request to scan only specific channel, sniffer scans all 3 adv channels.

0 Likes

Hello,

Please share your ble sniffer log files, we can check at our end.

Thanks,

P Yugandhar.

0 Likes