@@ -417,7 +417,6 @@ static hid_handshake_param_type_t hid_device_set_report_cmd_is_valid(uint16_t ci
417
417
default :
418
418
break ;
419
419
}
420
- // printf("hid_device_set_report_cmd_is_valid: report_id %d, status %d \n", report_id, report_id_status);
421
420
}
422
421
423
422
if (!hid_report_size_valid (cid , report_id , report_type , report_size - pos )){
@@ -450,7 +449,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
450
449
return ;
451
450
}
452
451
message_type = (hid_message_type_t )(packet [0 ] >> 4 );
453
- // printf("L2CAP_DATA_PACKET message_type %d, packet_size %d \n", message_type, packet_size);
454
452
switch (message_type ){
455
453
case HID_MESSAGE_TYPE_GET_REPORT :
456
454
@@ -527,7 +525,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
527
525
528
526
switch (device -> protocol_mode ){
529
527
case HID_PROTOCOL_MODE_BOOT :
530
- // printf("HID_PROTOCOL_MODE_BOOT \n");
531
528
if (packet_size < 3 ){
532
529
device -> report_status = HID_HANDSHAKE_PARAM_TYPE_ERR_INVALID_PARAMETER ;
533
530
break ;
@@ -538,7 +535,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
538
535
(* hci_device_set_report )(device -> cid , device -> report_type , packet_size - 1 , & packet [1 ]);
539
536
break ;
540
537
case HID_PROTOCOL_MODE_REPORT :
541
- // printf("HID_PROTOCOL_MODE_REPORT \n");
542
538
device -> report_status = hid_device_set_report_cmd_is_valid (device -> cid , device -> report_type , packet_size - 1 , & packet [1 ]);
543
539
if (device -> report_status != HID_HANDSHAKE_PARAM_TYPE_SUCCESSFUL ) break ;
544
540
@@ -557,15 +553,13 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
557
553
l2cap_request_can_send_now_event (device -> control_cid );
558
554
break ;
559
555
case HID_MESSAGE_TYPE_GET_PROTOCOL :
560
- // printf(" HID_MESSAGE_TYPE_GET_PROTOCOL\n");
561
556
device -> state = HID_DEVICE_W2_GET_PROTOCOL ;
562
557
if (packet_size != 1 ) {
563
558
device -> report_status = HID_HANDSHAKE_PARAM_TYPE_ERR_INVALID_PARAMETER ;
564
559
break ;
565
560
}
566
561
device -> report_status = HID_HANDSHAKE_PARAM_TYPE_SUCCESSFUL ;
567
562
// hid_device_request_can_send_now_event(channel);
568
- // printf("HID_MESSAGE_TYPE_GET_PROTOCOL l2cap_request_can_send_now_event\n");
569
563
l2cap_request_can_send_now_event (device -> control_cid );
570
564
break ;
571
565
@@ -583,10 +577,8 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
583
577
device -> protocol_mode = (hid_protocol_mode_t ) param ;
584
578
switch (device -> protocol_mode ){
585
579
case HID_PROTOCOL_MODE_BOOT :
586
- // printf("Set protocol mode to BOOT\n");
587
580
break ;
588
581
case HID_PROTOCOL_MODE_REPORT :
589
- // printf("Set protocol mode to REPORT\n");
590
582
break ;
591
583
default :
592
584
btstack_assert (false);
@@ -714,7 +706,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
714
706
715
707
// connect HID Interrupt for outgoing
716
708
if ((device -> incoming == 0 ) && (psm == PSM_HID_CONTROL )){
717
- // printf("Create outgoing HID Interrupt\n");
718
709
status = l2cap_create_channel (packet_handler , device -> bd_addr , PSM_HID_INTERRUPT , 48 , & device -> interrupt_cid );
719
710
break ;
720
711
}
@@ -753,7 +744,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
753
744
if (!device ) return ;
754
745
switch (device -> state ){
755
746
case HID_DEVICE_W2_GET_REPORT :{
756
- // printf("HID_DEVICE_W2_GET_REPORT. on entry device->report_status %d \n", device->report_status);
757
747
if (device -> report_status != HID_HANDSHAKE_PARAM_TYPE_SUCCESSFUL ) {
758
748
report [0 ] = (HID_MESSAGE_TYPE_HANDSHAKE << 4 ) | device -> report_status ;
759
749
hid_device_send_control_message (device -> cid , & report [0 ], 1 );
@@ -765,11 +755,9 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
765
755
if (device -> report_id ){
766
756
report [pos ++ ] = device -> report_id ;
767
757
}
768
- // printf(" report size with header and id %d\n", pos);
769
758
770
759
report_size = 0 ;
771
760
status = (* hci_device_get_report )(device -> cid , device -> report_type , device -> report_id , & report_size , & report [pos ]);
772
- // printf(" report size %d, status after callback %d, expected report_size %d\n", report_size + pos, status, device->report_size + pos);
773
761
774
762
switch (status ){
775
763
case 0 :
@@ -802,7 +790,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
802
790
// break;
803
791
// }
804
792
805
- // printf("report type %d, report_size %d, report_size %d \n", device->report_type, report_size, device->report_size);
806
793
hid_device_send_control_message (device -> cid , & report [0 ], device -> report_size );
807
794
// device->state = HID_DEVICE_IDLE;
808
795
break ;
@@ -814,13 +801,11 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
814
801
break ;
815
802
case HID_DEVICE_W2_GET_PROTOCOL :
816
803
if (device -> report_status != HID_HANDSHAKE_PARAM_TYPE_SUCCESSFUL ){
817
- // printf("send HID_MESSAGE_TYPE_HANDSHAKE, report_status %d \n", device->report_status);
818
804
report [0 ] = (HID_MESSAGE_TYPE_HANDSHAKE << 4 ) | device -> report_status ;
819
805
hid_device_send_control_message (device -> cid , & report [0 ], 1 );
820
806
break ;
821
807
}
822
808
823
- // printf("send HID_MESSAGE_TYPE_DATA, protocol_mode %d \n", device->protocol_mode);
824
809
report [0 ] = (HID_MESSAGE_TYPE_DATA << 4 );
825
810
report [1 ] = device -> protocol_mode ;
826
811
hid_device_send_control_message (device -> cid , & report [0 ], 2 );
0 commit comments