Tx interval of Directed Advertise changes unintentionally

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

cross mob
GregG_16
Employee
Employee
50 sign-ins 25 sign-ins 25 comments on KBA

The following initially configured values for Directed Advertise change unintentionally. Interval : 30 msec Duration : 300 sec Procedure :

1. Connect BCM20736 with a device

2. Send Indication from BCM20736 to the connecting device.

3. The connecting device disconnects without sending Confirm.

4. BCM20736 calls leatt_timeoutCallback() in callback function that is bound to disconnection event.

5. BCM20736 starts sending Directed Advertise.

The sub steps are below.

     5-1 : Stops Directed Advertise with bleprofile_Discoverable().

     5-2 : Starts Directed Advertise with bleprofile_Discoverable().

     5-3 : Disallow Directed Advertise with blecm_setAdvEnable(0).

     5-4 : Configure parameters with blecm_setAdvParam().

     5-5 : Allow Directed Advertise with blecm_setAdvEnable(1).

6. Repeat step 1 ~ 5 for 15 times and the interval of advertise changes unintentionally.

7. When the unintentional change happens, if customer application calls bleprofile_Discoverable() to stop Directed Advertise, the function occasionally never returns and software reset is triggered.

0 Likes
3 Replies
JacobT_81
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

Any problems in the code are almost certainly stemming from step 5 above.

By calling bleprofile_Discoverable to start directed advertisements, the stack starts a timer based on the specified BLE_PROFILE_CFG table (see image below). In this table you specify high and low intervals for your advertisements and for what durations to transmit them. The timer takes over and starts high interval advertisements for the specified duration and when those are complete, a timer callback starts low interval directed advertisements for the specified duration. When low intervals are complete, an advertisement stopped callback fires and the radio stops advertising.

pastedImage_3.png

With that said, calling bleprofile_Discoverable(HIGH_DIRECETD_DISCOVERABLE, my_addr) is all that is necessary to implement directed advertising. That is, steps 5-3 through 5-5 are unnecessary. just be sure to properly set your intervals and duration in the configuration table. 

By using low level functions blecm_setAdvEnable and blecm_setAdvParam you are in direct conflict with what the stack is doing. So when you manually override what you have set in  bleprofile_Discoverable using these other blecm function, the timers from bleprofile_Discoverable are still set, and when they fire will change the interval to whatever you told it to in the configuration table.

Jacob

Hi jakewtorres

Thanks for the support.

Regarding the step 3. "The connecting device disconnects without sending Confirm", if BCM20736 successfully receives the confirmation, the transition to high -> low interval does not occur.  Is this a expected behavior?

Best,

Wataru

0 Likes

No, whether or not the client device sends an indication received ACK, this should not affect your advertising state.

Does this happen when you started advertisements using only bleprofile_Discoverable and not any of the other low-level functions? Or is this still including blecm_setAdvParam, and blecm_setAdvEnable?

Jacob

0 Likes