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

gatt_security_client can't connect mouse (IDFGH-11780) #12875

Closed
3 tasks done
jjj19950710 opened this issue Dec 27, 2023 · 4 comments
Closed
3 tasks done

gatt_security_client can't connect mouse (IDFGH-11780) #12875

jjj19950710 opened this issue Dec 27, 2023 · 4 comments
Assignees
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@jjj19950710
Copy link

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

When the gatt_security_client connects to a Bluetooth mouse, it will not trigger the secure pairing process, and it will automatically disconnect after about 110 seconds of connection.
the configure:

#define GATTC_TAG             "RAPOO 5.0MS"
#define REMOTE_SERVICE_UUID   ESP_GATT_UUID_HID_SVC
#define REMOTE_NOTIFY_UUID    ESP_GATT_UUID_HID_REPORT

the client log with esp32s3:

I (59427) RAPOO 5.0MS: EVT 46, gattc if 3
I (59497) RAPOO 5.0MS: EVT 18, gattc if 3
I (59497) RAPOO 5.0MS: ESP_GATTC_CFG_MTU_EVT, Status 0, MTU 23, conn_id 0
I (59497) RAPOO 5.0MS: EVT 7, gattc if 3
I (59497) RAPOO 5.0MS: SEARCH RES: conn_id = 0 is primary service 1
I (59507) RAPOO 5.0MS: start handle 25 end handle 44 current handle value 25
I (59517) RAPOO 5.0MS: UUID16: 1812
I (59517) RAPOO 5.0MS: EVT 6, gattc if 3
I (59517) RAPOO 5.0MS: Get service information from remote device
I (59527) RAPOO 5.0MS: EVT 38, gattc if 3
I (59567) RAPOO 5.0MS: EVT 9, gattc if 3
I (59567) RAPOO 5.0MS: write descr success
I (59597) RAPOO 5.0MS: EVT 4, gattc if 3
I (59597) RAPOO 5.0MS: Write char success
W (174227) BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x8
W (174227) BT_HCI: hcif disc complete: hdl 0x1, rsn 0x8
I (174227) RAPOO 5.0MS: EVT 41, gattc if 3
I (174227) RAPOO 5.0MS: ESP_GATTC_DISCONNECT_EVT, reason = 0x8
I (174237) RAPOO 5.0MS: EVT 5, gattc if 3

the client log with esp32:

I (18425) RAPOO 5.0MS: EVT 46, gattc if 3
I (18425) RAPOO 5.0MS: EVT 18, gattc if 3
I (18425) RAPOO 5.0MS: ESP_GATTC_CFG_MTU_EVT, Status 0, MTU 23, conn_id 0
I (18435) RAPOO 5.0MS: EVT 7, gattc if 3
I (18435) RAPOO 5.0MS: SEARCH RES: conn_id = 0 is primary service 1
I (18445) RAPOO 5.0MS: start handle 21 end handle 24 current handle value 21
I (18455) RAPOO 5.0MS: UUID16: 180f
I (18455) RAPOO 5.0MS: EVT 6, gattc if 3
I (18465) RAPOO 5.0MS: Get service information from remote device
I (18475) RAPOO 5.0MS: EVT 38, gattc if 3
I (18745) RAPOO 5.0MS: EVT 9, gattc if 3
I (18745) RAPOO 5.0MS: write descr success
lld_pdu_get_tx_flush_nb HCI packet count mismatch (0, 1)
I (168524) RAPOO 5.0MS: EVT 41, gattc if 3
I (168524) RAPOO 5.0MS: ESP_GATTC_DISCONNECT_EVT, reason = 0x8
I (168524) RAPOO 5.0MS: EVT 5, gattc if 3
@espressif-bot espressif-bot added the Status: Opened Issue is new label Dec 27, 2023
@github-actions github-actions bot changed the title gatt_security_client can't connect mouse gatt_security_client can't connect mouse (IDFGH-11780) Dec 27, 2023
@jjj19950710
Copy link
Author

jjj19950710 commented Dec 27, 2023

esp32-mouse.zip
This is the Bluetooth packet I caught.I hope it will be helpful to you.

@esp-zhp
Copy link
Collaborator

esp-zhp commented Jan 2, 2024

@jjj19950710
thanks for report the issu,I will check.

@esp-zhp
Copy link
Collaborator

esp-zhp commented Jan 5, 2024

The API for initiating pairing is 'esp_ble_set_encryption,' which is not actively called in the 'gatt_security_client' example. You can modify the example to initiate pairing when ESP_GATTC_CONNECT_EVT occurs.

@jjj19950710
Copy link
Author

Now the client can initiate pairing requests proactively.Thanks very much!

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Opened Issue is new labels Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

3 participants