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.

CC1352P: Advertisement end detection

Part Number: CC1352P
Other Parts Discussed in Thread: BLE-STACK

Hello forum,

My application do the below activities:

1. Advertise packet for 1100 milliSecond

2. After 1 second it enable scanning and wait for response from other device.

3. Repeat the above steps whenever required.

My Questions:

  1. Is there any method by which I can detect whether advertisement ended or not.
  2. What should be the ideal process/steps to run advertisement and scanning smoothly one by one like both should not interrupt each other?
  3. When should i enable/disable advertisement?
  4. When should i enable/disable scanning?

Details about my project

  1. CC1352P BLE
  2. SDK version - simplelink_cc13x2_26x2_sdk_4_20_01_03
  3. Multi role project from ble5stack
  4. IAR 8.50.5 IDE

Request you to kindly help me with the steps.

  • Hi Kamlesh,

    Assigning an expert to comment. 

    Thanks, 
    Elin 

  • Hi Kamlesh,

    1. Did you see the documentation for GapAdv_setEventMask()? If you set the GAP_ADV_EVT_MASK_END bit you will get an event after each advertisement ends.

     

    2. You can activate scanning and advertising at the same time. Please:

    i) Set the scan interval longer than the scan window to allow some time for advertisements. E.g. set scan interval to 50 ms and scan window to 30 ms.

    ii) Ideally set the advertisement equal to the scan interval or higher. 

    Remember, if there is a conflict, scanning will be prioritized.

    You can read more about the scanning and advertisement parameters in the Scanning and Avertising SimpleLink Academy lab:

    3. You can enable advertisements after the GAP device init done event.

    4. You can enable scanning after the GAP device init done event.

  • Hello Marie,

    Suppose if I am advertising 10 packets at a time then control comes 10 times in  GAP_ADV_EVT_MASK_END event. 

    I have one more doubt. Can a blocking code affect rf communication as I am using some blocking code also during scanning.

  • Hi Kamlesh,

    1) It depends on how many channels you advertise on. If you advertise on all three channels your would get GAP_ADV_EVT_MASK_END when the device has sent the packet on channel 37, 38 and 39. 

    2) Yes. I would not recommend using blocking code along with the BLE-Stack.