Hi,
I am new in Bluetooth development. I used the latest version of BTstack as hog host, and got stuck in 2 kinds of keyboards for several days:
(1) Acer's keyboard OKW215:
After connecting with the device, I didn't operate it and the connection is lost in 15 minutes automatically.
What confused me is that each time it has different error code when disconnected. I try to find some tracks using wireshark and usb dongle but find it is disconnected without warning.
(2) Logitech's keyboard K580
After connecting with the device, the keyboard stop to send HID reports in 30s, and the connect still alive.
Those keyboards looks like trapped in some kind of sleep or power saving mode. I guess I miss something in initializing BTstack.
I attach part of my codes here:
l2cap_init();
sm_init();
sm_set_authentication_requirements(
SM_AUTHREQ_MITM_PROTECTION | SM_AUTHREQ_SECURE_CONNECTION );
gatt_client_init();
battery_service_client_init();
sdp_init();
gap_inquiry_set_lap(GAP_IAC_GENERAL_INQUIRY);
gap_set_default_link_policy_settings(
LM_LINK_POLICY_ENABLE_SNIFF_MODE | LM_LINK_POLICY_ENABLE_ROLE_SWITCH );
gap_set_allow_role_switch(true);
gap_set_bondable_mode(1);
gap_inquiry_set_scan_activity(0x50, 0x40);
gap_set_scan_parameters(1, 0x50, 0x40);
gap_set_local_name("BTstack_demo");
gap_discoverable_control(0);
gap_random_address_set_mode(GAP_RANDOM_ADDRESS_TYPE_OFF);
gap_random_address_set_update_period(10000);
gap_whitelist_clear();
hci_set_master_slave_policy(HCI_ROLE_MASTER);
hci_set_inquiry_mode(INQUIRY_MODE_RSSI_AND_EIR);
Please let me know if there are some suggestions.