-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in esp_hf_ag_api.c? (IDFGH-3614) #5554
Comments
Hi This status just indicates that ESP has successfully posted the task to BTC to process. Thanks |
I have run the example and each of the above functions that are called in the example return |
@howroyd Is correct, it should read Here's a Compiler Explorer comparing the wrong and correct versions: |
@howroyd |
@Wth-Esp no worries, easy mistake to make. Glad I could help. Interestingly, one of the MISRA rules is to always put the constant first when doing comparisons. That way if you accidentally put
But the following won't compile:
|
@howroyd Oh! Thank you, I get the tip. |
The fix is not yet in esp-idf master tree. And the v4.1-rc does not include this fix. |
@AxelLin Thanks for the notes.
Will update once the fix is available on GitHub. |
will update once fix on release/4.1 is available, thanks. |
IDF release v4.1 in file
esp-idf/components/bt/host/bluedroid/api/esp_hf_ag_api.c
Lines:
All lines read
return (status = BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
Am I right in saying
BT_STATUS_SUCCESS
is the first enum (i.e. zero), therefore the ternary operator will always evaluate tofalse
, thereforeESP_FAIL
?Should the lines not be
return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
The text was updated successfully, but these errors were encountered: