Skip to content
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

Bluetooth: Extended Inquiry Request: can't set service UUIDs (IDFGH-10266) #11529

Closed
3 tasks done
ilutchenko opened this issue May 28, 2023 · 1 comment · Fixed by #11572
Closed
3 tasks done

Bluetooth: Extended Inquiry Request: can't set service UUIDs (IDFGH-10266) #11529

ilutchenko opened this issue May 28, 2023 · 1 comment · Fixed by #11572
Assignees
Labels
Resolution: Won't Do This will not be worked on Status: Done Issue is done internally

Comments

@ilutchenko
Copy link
Contributor

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

Hello!

I use ESP32 with IDF v5.0.1.
I need to configure a SDP service record and place the same UUID in the Extended Inquiry Request (EIR).

I used this code to create a SDP record and it is works pretty well:

char *sdp_service_name = "TEST RECORD";

esp_bluetooth_sdp_record_t record = {};
record.hdr.type = ESP_SDP_TYPE_RAW;
record.hdr.uuid.len = 2;
record.hdr.uuid.uuid.uuid16 = 0xff00;
record.hdr.service_name_length = strlen(sdp_service_name) + 1;
record.hdr.service_name = sdp_service_name;
record.hdr.rfcomm_channel_number = BT_IAP2_RFCOMM;
record.hdr.l2cap_psm = BT_L2CAP_DYNMIC_PSM;
record.hdr.profile_version = BT_IAP2_PROFILE_VERSION;
esp_sdp_create_record(&record);

I see my test record in sdptool output:

Service Name: TEST RECORD
Service RecHandle: 0x10001
Service Class ID List:
  "" (0xff00)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 1
Profile Descriptor List:
  "Serial Port" (0x1101)
    Version: 0x0102

Then I used this code to configure the EIR data:

   esp_bt_eir_data_t eir_data;
    eir_data.fec_required = true;     /*!< FEC is required or not, true by default */
    eir_data.include_txpower = false; /*!< EIR data include TX power, false by default */
    eir_data.include_uuid = true;     /*!< EIR data include UUID, false by default */
    eir_data.flag = 0; /*!< EIR flags, see ESP_BT_EIR_FLAG for details, EIR will not
                          include flag if it is 0, 0 by default */
    eir_data.manufacturer_len = 0; /*!< Manufacturer data length, 0 by default */
    eir_data.p_manufacturer_data = nullptr; /*!< Manufacturer data point */
    eir_data.url_len = 0;                      /*!< URL length, 0 by default */
    eir_data.p_url = nullptr;//(uint8_t*)&eir_uuid;                  /*!< URL point */
    esp_bt_gap_config_eir_data(&eir_data);

Then I captured EIR with wireshark when hcitool scan is performed.
I see that after this code UUID fields appeared, but they are empty!
image
They must contain UUIDs from the SDP.

So I can't understand how to add UUIDs to the EIR data. I don't see any API besides esp_bt_gap_config_eir_data().
Could you help me to find the solution, please?

@espressif-bot espressif-bot added the Status: Opened Issue is new label May 28, 2023
@github-actions github-actions bot changed the title Bluetooth: Extended Inquiry Request: can't set service UUIDs Bluetooth: Extended Inquiry Request: can't set service UUIDs (IDFGH-10266) May 28, 2023
@shangke1112
Copy link
Collaborator

Currently ,there is no API to add UUIDs to the EIR data ,and we may provide them in future version.
Now I think you can do this by modifying the function.
This function creates EIR tagged data and writes it to controller.
bta_dm_act.c : static void bta_dm_set_eir (char *local_name)

ilutchenko added a commit to ilutchenko/esp-idf that referenced this issue Oct 25, 2023
1. Added new API functions that can add 32 and 128-bit UUID to the EIR data
when these UUIDs are set in SDP.
The old functions that only work with 16-bit UUIDs have been left
unchanged to avoid having to redo code that already utilizes them.

2. Fixed bug with zero handler return in btc_sdp.c
sdp_create_record.handle in tBTA_SDP struct wasn't saved before.
Because of it Bluetooth stack always returned zero handler to
application callback.

Closes espressif#11529
ilutchenko added a commit to ilutchenko/esp-idf that referenced this issue Oct 25, 2023
1. Added new API functions that can add 32 and 128-bit UUID to the EIR data
when these UUIDs are set in SDP.
The old functions that only work with 16-bit UUIDs have been left
unchanged to avoid having to redo code that already utilizes them.

2. Fixed bug with zero handler return in btc_sdp.c
sdp_create_record.handle in tBTA_SDP struct wasn't saved before.
Because of it Bluetooth stack always returned zero handler to
application callback.

Closes espressif#11529
ilutchenko added a commit to ilutchenko/esp-idf that referenced this issue Oct 31, 2023
1. Added new API functions that can add 32 and 128-bit UUID to the EIR data
when these UUIDs are set in SDP.
The old functions that only work with 16-bit UUIDs have been left
unchanged to avoid having to redo code that already utilizes them.

2. Fixed bug with zero handler return in btc_sdp.c
sdp_create_record.handle in tBTA_SDP struct wasn't saved before.
Because of it Bluetooth stack always returned zero handler to
application callback.

Closes espressif#11529
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Won't Do This will not be worked on Status: In Progress Work is in progress and removed Status: Opened Issue is new Status: Done Issue is done internally Resolution: Won't Do This will not be worked on Status: In Progress Work is in progress labels Nov 2, 2023
ilutchenko added a commit to ilutchenko/esp-idf that referenced this issue Nov 2, 2023
1. Added new API functions that can add 32 and 128-bit UUID to the EIR data
when these UUIDs are set in SDP.
The old functions that only work with 16-bit UUIDs have been left
unchanged to avoid having to redo code that already utilizes them.

2. Fixed bug with zero handler return in btc_sdp.c
sdp_create_record.handle in tBTA_SDP struct wasn't saved before.
Because of it Bluetooth stack always returned zero handler to
application callback.

Closes espressif#11529
espressif-bot pushed a commit that referenced this issue Nov 22, 2023
1. Added new API functions that can add 32 and 128-bit UUID to the EIR data
when these UUIDs are set in SDP.
The old functions that only work with 16-bit UUIDs have been left
unchanged to avoid having to redo code that already utilizes them.

2. Fixed bug with zero handler return in btc_sdp.c
sdp_create_record.handle in tBTA_SDP struct wasn't saved before.
Because of it Bluetooth stack always returned zero handler to
application callback.

Closes #11529
movsb pushed a commit to movsb/esp-idf that referenced this issue Dec 1, 2023
1. Added new API functions that can add 32 and 128-bit UUID to the EIR data
when these UUIDs are set in SDP.
The old functions that only work with 16-bit UUIDs have been left
unchanged to avoid having to redo code that already utilizes them.

2. Fixed bug with zero handler return in btc_sdp.c
sdp_create_record.handle in tBTA_SDP struct wasn't saved before.
Because of it Bluetooth stack always returned zero handler to
application callback.

Closes espressif#11529
espressif-bot pushed a commit that referenced this issue Dec 13, 2023
1. Added new API functions that can add 32 and 128-bit UUID to the EIR data
when these UUIDs are set in SDP.
The old functions that only work with 16-bit UUIDs have been left
unchanged to avoid having to redo code that already utilizes them.

2. Fixed bug with zero handler return in btc_sdp.c
sdp_create_record.handle in tBTA_SDP struct wasn't saved before.
Because of it Bluetooth stack always returned zero handler to
application callback.

Closes #11529
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Won't Do This will not be worked on Status: Done Issue is done internally
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants