Esp32 in iOS battery widget use HFP Command AT+XAPL

schluesselmeister
Posts: 2
Joined: Tue Apr 23, 2019 5:41 pm

Esp32 in iOS battery widget use HFP Command AT+XAPL

Postby schluesselmeister » Mon Apr 29, 2019 2:06 pm

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

kengster
Posts: 7
Joined: Fri Dec 06, 2019 8:32 pm

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

Postby kengster » Wed Feb 19, 2020 4:41 pm

Did you get any answer about this? I would like to do the same with BLE.

Cheers.

sudhirmetaliya
Posts: 2
Joined: Wed May 06, 2020 11:46 am

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

Postby sudhirmetaliya » Wed May 06, 2020 12:01 pm

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 7495 times

Tnarain5
Posts: 7
Joined: Fri Nov 29, 2019 11:22 am

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

Postby Tnarain5 » Thu Jun 04, 2020 6:33 pm

can you please share the changes @sudhirmetaliya

sudhirmetaliya
Posts: 2
Joined: Wed May 06, 2020 11:46 am

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

Postby sudhirmetaliya » 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.
Attachments
changes.txt
(3.7 KiB) Downloaded 575 times

suroega
Posts: 1
Joined: Sat Oct 15, 2022 2:02 pm

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

Postby suroega » Sat Oct 15, 2022 2:23 pm

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.

Who is online

Users browsing this forum: No registered users and 47 guests