This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2540: simpleBLEBroadcaster Advertising Interval at 20ms?

Part Number: CC2540
Other Parts Discussed in Thread: CC2640R2F

Hello,

What do I need to change in the simpleBLEBroadcaster example in order to get the advertising interval down to 20ms?  Changing the advertisement type and interval value doesn't work, I'm obviously missing something.

Thanks,

Andy

  • Hi Andy,

    What advertiement type are you using? (scannable undirected and non-connectable undirected advertiment can not have an advertisement interval smaller than 100 ms, according to the BLE core spec.)
  • Hi AndewS,

    Adv time period ranges from 20 ms to 10.24s in steps of 0.625ms. However, It is depend on the different types of advertising packets such as: ADV_IND, ADV_DIRECT_IND, ADV_NONCONN_IND

    You can see more detail in BLE spec V4.0. 

    https://www.bluetooth.com/specifications/adopted-specifications

  • Marie,

    In simpleBLEBroadcast.c the advertising is set to GAP_ADTYPE_ADV_NONCONN_IND (advertising interval of 160ms).  If I change the advertising type to GAP_ADTYPE_ADV_IND the advertising interval could drop to 20ms.  So with the advertising type set to GA_ADTYPE_ADV_IND and the DEFAULT_ADVERTISING_INTERVAL set to 20ms I get 'error' displayed on the CC2540DK's LCD and no output from the CC2540.

    Something else in simpleBLEBroadcast.c or broadcast.c needs to be changed in order to get 20mS advertising intervals working.

    GAP_ADTYPE_ADV_IND is connectable undirected advertising with an interval of 20ms to 10.24s.

    Any suggestions?

    Thanks,

    Andy

  • Hi Andrew,

    The GAP_ADTYPE_ADV_IND advertising type is for connectable advertisments, which is not applicable for the broadcaster profile. 

    #define GAP_ADTYPE_ADV_LDC_DIRECT_IND     0x04  //!< Connectable low duty cycle directed advertisement

  • Marie,

    Set the advertising type to GAP_ADTYPE_ADV_LDC_DIRECT_IND; as before, "error"  is displayed on line 3 of the LCD.

    Thanks,

    Andy

  • Hi Andrew,

    If using connectable advertisements, please use the simpleBLEPeripheral project.

    Best wishes
  • Zahid,

    Since I am only interested in sending X number of packets and not interested in any response, connections, etc.. I should be able to change the broadcast and advertising type within the simpleBLEBroadcast.

    Thanks for your help,
    Andy
  • Hello Andy,

    As explained, SimpleBLEBroadcaster supports Non-Connectable ADV only. In Bluetooth 4.0, the fastest non-connectable ADV rate is 100ms. If you use SimpleBLEPeripheral and send connectable ADV, you can send as fast as 20ms. If you don't want to support connections, you can set the whitelist to some random addr and enable an ADV filter policy . That will block any connections not matching the whitelist. Note that the packets will be connectable ADV type.

    In Bluetooth 5, 20 ms non-connectable ADV is supported. This requires CC2640R2F though.

    Best wishes

  • JXS,

    Thank you for the answer!

    Andy