mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-22 07:21:06 +00:00
alpakka: test classic hid
This commit is contained in:
parent
8c35a1166e
commit
5045b73fdb
@ -59,7 +59,7 @@
|
|||||||
// MBP 2016 static const char * remote_addr_string = "F4-0F-24-3B-1B-E1";
|
// MBP 2016 static const char * remote_addr_string = "F4-0F-24-3B-1B-E1";
|
||||||
// iMpulse static const char * remote_addr_string = "64:6E:6C:C1:AA:B5";
|
// iMpulse static const char * remote_addr_string = "64:6E:6C:C1:AA:B5";
|
||||||
// Logitec
|
// Logitec
|
||||||
static const char * remote_addr_string = "00:1F:20:86:DF:52";
|
static const char * remote_addr_string = "00:1A:7D:DA:71:04";
|
||||||
|
|
||||||
static bd_addr_t remote_addr;
|
static bd_addr_t remote_addr;
|
||||||
|
|
||||||
@ -334,6 +334,8 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
|||||||
} else {
|
} else {
|
||||||
printf("Cannot handle input report, HID Descriptor is not available, status 0x%02x\n", status);
|
printf("Cannot handle input report, HID Descriptor is not available, status 0x%02x\n", status);
|
||||||
}
|
}
|
||||||
|
gap_discoverable_control(0);
|
||||||
|
gap_connectable_control(0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HID_SUBEVENT_REPORT:
|
case HID_SUBEVENT_REPORT:
|
||||||
|
@ -363,6 +363,11 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
|
|||||||
printf("HID Connected, sending demo text...\n");
|
printf("HID Connected, sending demo text...\n");
|
||||||
demo_text_timer_handler(NULL);
|
demo_text_timer_handler(NULL);
|
||||||
#endif
|
#endif
|
||||||
|
hid_device_request_can_send_now_event(hid_cid);
|
||||||
|
|
||||||
|
gap_discoverable_control(0);
|
||||||
|
gap_connectable_control(0);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case HID_SUBEVENT_CONNECTION_CLOSED:
|
case HID_SUBEVENT_CONNECTION_CLOSED:
|
||||||
btstack_run_loop_remove_timer(&send_timer);
|
btstack_run_loop_remove_timer(&send_timer);
|
||||||
@ -371,19 +376,10 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
|
|||||||
hid_cid = 0;
|
hid_cid = 0;
|
||||||
break;
|
break;
|
||||||
case HID_SUBEVENT_CAN_SEND_NOW:
|
case HID_SUBEVENT_CAN_SEND_NOW:
|
||||||
if (send_keycode){
|
send_report(send_modifier, send_keycode++);
|
||||||
send_report(send_modifier, send_keycode);
|
|
||||||
// schedule key up
|
|
||||||
send_keycode = 0;
|
|
||||||
send_modifier = 0;
|
|
||||||
btstack_run_loop_set_timer_handler(&send_timer, trigger_key_up);
|
btstack_run_loop_set_timer_handler(&send_timer, trigger_key_up);
|
||||||
btstack_run_loop_set_timer(&send_timer, TYPING_KEYDOWN_MS);
|
btstack_run_loop_set_timer(&send_timer, 5);
|
||||||
} else {
|
|
||||||
send_report(0, 0);
|
|
||||||
// schedule next key down
|
|
||||||
btstack_run_loop_set_timer_handler(&send_timer, send_next);
|
|
||||||
btstack_run_loop_set_timer(&send_timer, TYPING_DELAY_MS);
|
|
||||||
}
|
|
||||||
btstack_run_loop_add_timer(&send_timer);
|
btstack_run_loop_add_timer(&send_timer);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user