Home  >> Developers Forum  >> SDK V2.1.8 issue with CallBacks

Louk

Add new friend

Join Date:2009/7/3

Location:

Posts:4

Posted at 2015-02-28 18:37:56
[ SDK V2.1.8 issue with CallBacks ]

After extensive testing and debugging, I found a nasty issue with event callbacks for the HFRE protocol and possible with other protocols like A2DP where I've seen similar effects.

When you send an AT+COPS? for example, the SDK will response with 3 callback responses:

  - a BTSDK_HFP_EV_NETWORK_OPERATOR_IND with the name of the network operator

  - a BTSDK_HFP_EV_EXTEND_CMD_IND event with the result of the extended AT command that should hold "AT+COPS: 0,0,\"NL KPN\"", but actually contains "\r\nOK\r\nS:0,0,\"NL KPN\"". The first 6 characters are overwritten by a string that is actually belonging to the next response.

  - a BTSDK_HFP_EV_ATCMD_RESULT with the result of a normal AT command: "\r\nOK\r\n"


Based on the argument pointer that is provided as a parameter of the callback, I found that this happens when the SDK is (re-) using the same buffer for the next response. In some cases the SDK seems to use more buffers to store the callback data, but when a lot of commands are processed short after each other, this problem occurs even when there are more responses between the two responses that use the same buffer space.

I've tried to handle those responses as fast as possible, like processing the necessary tasks on another low priority thread after just copying the required data. But nothing helped.

Then I found that the sample program that comes with the SDK (SdkSample.exe), suffers from the same problems and those problems can be reproduced with this program.


When this isn't clear enough, please ask me for more information.

poonam

Add new friend

Join Date:2020/2/14

Location: India

Posts:0

ligape

Add new friend

Join Date:2022/4/19

Location: United States of America

Posts:7

Posted at 2022-04-19 20:50:42

sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex sex

NOTE:
1.The reply should be more than 20 characters.
2.Image Size: less than 1MB, max pixel: 300 * 300.