Explorar el Código

insert 360 header when construction packet

Sanjay Govind hace 11 meses
padre
commit
9c63b77b6a
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      helpers/pof_usb.c

+ 3 - 3
helpers/pof_usb.c

@@ -113,6 +113,7 @@ static int32_t pof_thread_worker(void* context) {
             if(pof_usb->dataAvailable > 0) {
             if(pof_usb->dataAvailable > 0) {
                 memset(tx_data, 0, sizeof(tx_data));
                 memset(tx_data, 0, sizeof(tx_data));
                 if (pof_usb ->virtual_portal->type == PoFXbox360) {
                 if (pof_usb ->virtual_portal->type == PoFXbox360) {
+                    // prepend packet with xinput header
                     int send_len =
                     int send_len =
                         virtual_portal_process_message(virtual_portal, pof_usb->data + 2, tx_data + 2);
                         virtual_portal_process_message(virtual_portal, pof_usb->data + 2, tx_data + 2);
                     if(send_len > 0) {
                     if(send_len > 0) {
@@ -123,10 +124,8 @@ static int32_t pof_thread_worker(void* context) {
                 }
                 }
                 if (pof_usb ->virtual_portal->type == PoFHID) {
                 if (pof_usb ->virtual_portal->type == PoFHID) {
                     int send_len =
                     int send_len =
-                        virtual_portal_process_message(virtual_portal, pof_usb->data + 2, tx_data + 2);
+                        virtual_portal_process_message(virtual_portal, pof_usb->data, tx_data);
                     if(send_len > 0) {
                     if(send_len > 0) {
-                        tx_data[0] = 0x1b;
-                        tx_data[1] = send_len;
                         pof_usb_send(dev, tx_data, POF_USB_ACTUAL_OUTPUT_SIZE);
                         pof_usb_send(dev, tx_data, POF_USB_ACTUAL_OUTPUT_SIZE);
                     }
                     }
                 }
                 }
@@ -418,6 +417,7 @@ static const struct PoFUsbDescriptor usb_pof_cfg_descr = {
         },
         },
 };
 };
 
 
+
 static const struct PoFUsbDescriptorXbox360 usb_pof_cfg_descr_x360 = {
 static const struct PoFUsbDescriptorXbox360 usb_pof_cfg_descr_x360 = {
     .config =
     .config =
         {
         {