BLE for keyboard and mouse

From: Seyed Pouria Mousavizadeh Tehrani <info_at_spmzt.net>
Date: Tue, 02 Dec 2025 15:24:38 UTC
Hi,

Does any tutorial exist for connecting peripherals using BLE?

I'm able to see my mouse:

# hccontrol -n ubt0hci le_scan -av -n 6
Scan 1
Scan result, num_reports: 1
BD_ADDR mouse
Address type: Random Device Address
ADV Data: 03 19 c2 03 02 01 06 03 03 12 18 06 ff 06 00 03 00 80 d3
Appearance: c2 03
Flags: 06
Complete list of service class UUIDs (16-bit): 12 18
Manufacturer: Microsoft
Manufacturer specific data: 03 00 80
RSSI: -45 dBm

Scan 2
Scan result, num_reports: 1
BD_ADDR mouse
Address type: Random Device Address
ADV Data: 14 09 4b 65 79 63 68 72 6f 6e 20 4d 33 20 6d 69 6e 69 20 34 4b d3
Complete local name: Keychron M3 mini 4K
RSSI: -45 dBm

And I can connect to it:

# hccontrol -n ubt0hci le_connect -a mouse -t random -v
Handle: 2048
Status: No error
Role: Master
Address Type: Random Device Address
Address: mouse
Interval: 93.75ms
Latency: 0 events
Supervision timeout: 327680ms
Master clock accuracy: Unknown accuracy

# hccontrol -n ubt0hci read_connection_list
Remote BD_ADDR    Handle Type Mode Role Encrypt Pending Queue State
mouse   2048  SCO    0 MAST    NONE       0     0 OPEN

However, it doesn't show up as an hid device like normal bluetooth 
devices do.

For non-BLE devices one must run a quary, but it doesn't work for BLE:

# bthidcontrol -a mouse Query

Could not perform SDP query on the device f6:31:70:6a:f9:6c. Host is 
down (64)


I don't know what to do anymore.

Here is what i have tried so far:

hccontrol -n ubt0hci add_sco_connection 2048

hccontrol -n ubt0hci write_le_host_support 1 1

hccontrol -n ubt0hci write_authentication_enable 1

hccontrol -n ubt0hci write_encryption_mode 1


Thank you in advance!

-- 
spmzt