@@ -417,7 +417,6 @@ static hid_handshake_param_type_t hid_device_set_report_cmd_is_valid(uint16_t ci
417417 default :
418418 break ;
419419 }
420- // printf("hid_device_set_report_cmd_is_valid: report_id %d, status %d \n", report_id, report_id_status);
421420 }
422421
423422 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
450449 return ;
451450 }
452451 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);
454452 switch (message_type ){
455453 case HID_MESSAGE_TYPE_GET_REPORT :
456454
@@ -527,7 +525,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
527525
528526 switch (device -> protocol_mode ){
529527 case HID_PROTOCOL_MODE_BOOT :
530- // printf("HID_PROTOCOL_MODE_BOOT \n");
531528 if (packet_size < 3 ){
532529 device -> report_status = HID_HANDSHAKE_PARAM_TYPE_ERR_INVALID_PARAMETER ;
533530 break ;
@@ -538,7 +535,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
538535 (* hci_device_set_report )(device -> cid , device -> report_type , packet_size - 1 , & packet [1 ]);
539536 break ;
540537 case HID_PROTOCOL_MODE_REPORT :
541- // printf("HID_PROTOCOL_MODE_REPORT \n");
542538 device -> report_status = hid_device_set_report_cmd_is_valid (device -> cid , device -> report_type , packet_size - 1 , & packet [1 ]);
543539 if (device -> report_status != HID_HANDSHAKE_PARAM_TYPE_SUCCESSFUL ) break ;
544540
@@ -557,15 +553,13 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
557553 l2cap_request_can_send_now_event (device -> control_cid );
558554 break ;
559555 case HID_MESSAGE_TYPE_GET_PROTOCOL :
560- // printf(" HID_MESSAGE_TYPE_GET_PROTOCOL\n");
561556 device -> state = HID_DEVICE_W2_GET_PROTOCOL ;
562557 if (packet_size != 1 ) {
563558 device -> report_status = HID_HANDSHAKE_PARAM_TYPE_ERR_INVALID_PARAMETER ;
564559 break ;
565560 }
566561 device -> report_status = HID_HANDSHAKE_PARAM_TYPE_SUCCESSFUL ;
567562 // hid_device_request_can_send_now_event(channel);
568- // printf("HID_MESSAGE_TYPE_GET_PROTOCOL l2cap_request_can_send_now_event\n");
569563 l2cap_request_can_send_now_event (device -> control_cid );
570564 break ;
571565
@@ -583,10 +577,8 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
583577 device -> protocol_mode = (hid_protocol_mode_t ) param ;
584578 switch (device -> protocol_mode ){
585579 case HID_PROTOCOL_MODE_BOOT :
586- // printf("Set protocol mode to BOOT\n");
587580 break ;
588581 case HID_PROTOCOL_MODE_REPORT :
589- // printf("Set protocol mode to REPORT\n");
590582 break ;
591583 default :
592584 btstack_assert (false);
@@ -714,7 +706,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
714706
715707 // connect HID Interrupt for outgoing
716708 if ((device -> incoming == 0 ) && (psm == PSM_HID_CONTROL )){
717- // printf("Create outgoing HID Interrupt\n");
718709 status = l2cap_create_channel (packet_handler , device -> bd_addr , PSM_HID_INTERRUPT , 48 , & device -> interrupt_cid );
719710 break ;
720711 }
@@ -753,7 +744,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
753744 if (!device ) return ;
754745 switch (device -> state ){
755746 case HID_DEVICE_W2_GET_REPORT :{
756- // printf("HID_DEVICE_W2_GET_REPORT. on entry device->report_status %d \n", device->report_status);
757747 if (device -> report_status != HID_HANDSHAKE_PARAM_TYPE_SUCCESSFUL ) {
758748 report [0 ] = (HID_MESSAGE_TYPE_HANDSHAKE << 4 ) | device -> report_status ;
759749 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
765755 if (device -> report_id ){
766756 report [pos ++ ] = device -> report_id ;
767757 }
768- // printf(" report size with header and id %d\n", pos);
769758
770759 report_size = 0 ;
771760 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);
773761
774762 switch (status ){
775763 case 0 :
@@ -802,7 +790,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
802790 // break;
803791 // }
804792
805- // printf("report type %d, report_size %d, report_size %d \n", device->report_type, report_size, device->report_size);
806793 hid_device_send_control_message (device -> cid , & report [0 ], device -> report_size );
807794 // device->state = HID_DEVICE_IDLE;
808795 break ;
@@ -814,13 +801,11 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * pack
814801 break ;
815802 case HID_DEVICE_W2_GET_PROTOCOL :
816803 if (device -> report_status != HID_HANDSHAKE_PARAM_TYPE_SUCCESSFUL ){
817- // printf("send HID_MESSAGE_TYPE_HANDSHAKE, report_status %d \n", device->report_status);
818804 report [0 ] = (HID_MESSAGE_TYPE_HANDSHAKE << 4 ) | device -> report_status ;
819805 hid_device_send_control_message (device -> cid , & report [0 ], 1 );
820806 break ;
821807 }
822808
823- // printf("send HID_MESSAGE_TYPE_DATA, protocol_mode %d \n", device->protocol_mode);
824809 report [0 ] = (HID_MESSAGE_TYPE_DATA << 4 );
825810 report [1 ] = device -> protocol_mode ;
826811 hid_device_send_control_message (device -> cid , & report [0 ], 2 );
0 commit comments