Page 1 of 1

Esp32 in iOS battery widget use HFP Command AT+XAPL

Posted: Mon Apr 29, 2019 2:06 pm
by schluesselmeister
I build a wearable based on esp32 witch connects to an iOS app. It would be great if my customers could see the current battery level in the default iOS widget. To do so, you have to implement the custom at-command „HFP Command AT+XAPL“.
In Detail it is described here: 13.1 page 66:
https://developer.apple.com/accessories ... pdf#page66

Did anyone implement this? Or does this only works for bluetoooth and not Bluetooth LE?

Thanks a lot

Re: Esp32 in iOS battery widget use HFP Command AT+XAPL

Posted: Wed Feb 19, 2020 4:41 pm
by kengster
Did you get any answer about this? I would like to do the same with BLE.

Cheers.

Re: Esp32 in iOS battery widget use HFP Command AT+XAPL

Posted: Wed May 06, 2020 12:01 pm
by sudhirmetaliya
I have implemented AT+XAPL command. But for this you have to make changes to the ESP32 IDF framework and add functions implementing APPLE command. There is no direct function available that can be used to send custom AT commands.

image.PNG
image.PNG (198.67 KiB) Viewed 7504 times

Re: Esp32 in iOS battery widget use HFP Command AT+XAPL

Posted: Thu Jun 04, 2020 6:33 pm
by Tnarain5
can you please share the changes @sudhirmetaliya

Re: Esp32 in iOS battery widget use HFP Command AT+XAPL

Posted: Thu Aug 13, 2020 5:58 am
by sudhirmetaliya
I have attached the changes.txt file, follow the instructions mentioned in it to make the respective changes in ESP-IDF. All the details like dir, file name, line number and changes to be made are mentioned in the file.

Re: Esp32 in iOS battery widget use HFP Command AT+XAPL

Posted: Sat Oct 15, 2022 2:23 pm
by suroega
sudhirmetaliya wrote:
Thu Aug 13, 2020 5:58 am
I have attached the changes.txt file, follow the instructions mentioned in it to make the respective changes in ESP-IDF. All the details like dir, file name, line number and changes to be made are mentioned in the file.
Hello, I'm new in develop ESP32. I do this changes like in your instruction, but have errors
esp/esp-idf/components/bt/host/bluedroid/api/esp_hf_client_api.c:339:16:error: 'BTC_HF_CLIENT_SEND_APPLE_EVT' undeclared (first use in this function); did you mean 'BTC_HF_CLIENT_SEND_NREC_EVT'?
msg.act = BTC_HF_CLIENT_SEND_APPLE_EVT;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
BTC_HF_CLIENT_SEND_NREC_EVT
esp/esp-idf/components/bt/host/bluedroid/api/esp_hf_client_api.c:358:16: error: 'BTC_HF_CLIENT_SEND_BATT_EVT' undeclared (first use in this function); did you mean 'BTC_HF_CLIENT_SEND_NREC_EVT'?
msg.act = BTC_HF_CLIENT_SEND_BATT_EVT;
^~~~~~~~~~~~~~~~~~~~~~~~~~~
BTC_HF_CLIENT_SEND_NREC_EVT
/esp/esp-idf/components/bt/host/bluedroid/api/esp_hf_client_api.c:362:9: error: 'btc_hf_client_args_t' {aka 'union <anonymous>'} has no member named 'apple_batt'
arg.apple_batt.val = val;

Does this file contain all the changes?

missing BTC_HF_CLIENT_SEND_APPLE_EVT definition
and BTC_HF_CLIENT_SEND_BATT_EVT

In newer IDF 5.0 components updated and have the same examples with apple specific commands, but it doesn't work on iPhone specifically. and it works on android OS/

Can you help me?
Maybe because IDF 5.0 does not stable release.