hid_device.c (076788963064effb3613ebccf4a762f6f047dd50) hid_device.c (e2c2b10c79cd6eba09a38a4ded290ea3ab07f7da)
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 710 unchanged lines hidden (view full) ---

719 device->cid = 0;
720 // printf("HID Disconnected\n");
721 hid_device_emit_connection_closed_event(device);
722 }
723 break;
724
725 case L2CAP_EVENT_CAN_SEND_NOW:
726 local_cid = l2cap_event_can_send_now_get_local_cid(packet);
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 710 unchanged lines hidden (view full) ---

719 device->cid = 0;
720 // printf("HID Disconnected\n");
721 hid_device_emit_connection_closed_event(device);
722 }
723 break;
724
725 case L2CAP_EVENT_CAN_SEND_NOW:
726 local_cid = l2cap_event_can_send_now_get_local_cid(packet);
727 device = hid_device_get_instance_for_cid(l2cap_event_can_send_now_get_local_cid(packet));
727 device = hid_device_get_instance_for_cid(local_cid);
728
729 if (!device) return;
730 switch (device->state){
731 case HID_DEVICE_W2_GET_REPORT:{
732 printf("HID_DEVICE_W2_GET_REPORT. on entry device->report_status %d \n", device->report_status);
733 if (device->report_status != HID_HANDSHAKE_PARAM_TYPE_SUCCESSFUL) {
734 report[0] = (HID_MESSAGE_TYPE_HANDSHAKE << 4) | device->report_status;
735 hid_device_send_control_message(device->cid, &report[0], 1);

--- 252 unchanged lines hidden ---
728
729 if (!device) return;
730 switch (device->state){
731 case HID_DEVICE_W2_GET_REPORT:{
732 printf("HID_DEVICE_W2_GET_REPORT. on entry device->report_status %d \n", device->report_status);
733 if (device->report_status != HID_HANDSHAKE_PARAM_TYPE_SUCCESSFUL) {
734 report[0] = (HID_MESSAGE_TYPE_HANDSHAKE << 4) | device->report_status;
735 hid_device_send_control_message(device->cid, &report[0], 1);

--- 252 unchanged lines hidden ---