Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Matlo committed Aug 13, 2014
1 parent eb086c3 commit 93b3482
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion core/connectors/connector.c
Expand Up @@ -9,14 +9,14 @@
#include "connectors/connector.h"
#include "connectors/udp_con.h"
#include "connectors/gpp_con.h"
#include "connectors/usb_con.h"
#include "connectors/usb_spoof.h"
#include <adapter.h>
#include <report.h>
#include "display.h"
#ifndef WIN32
#include "connectors/sixaxis.h"
#include "connectors/btds4.h"
#include "connectors/usb_con.h"
#endif

int connector_init()
Expand Down
5 changes: 3 additions & 2 deletions core/connectors/windows/serial.c
Expand Up @@ -102,14 +102,15 @@ int serial_read(int id, void* pdata, unsigned int size)

int serial_recv(int id, void* pdata, unsigned int size)
{
return serial_read(serials[id].handle, pdata, size);
return serial_read(id, pdata, size);
}

/*
* Close the serial port.
*/
void serial_close(int id)
int serial_close(int id)
{
usleep(10000);//sleep 10ms to leave enough time for the last packet to be sent
CloseHandle(serials[id].handle);
return 0;
}
9 changes: 0 additions & 9 deletions core/include/connectors/serial.h
Expand Up @@ -6,15 +6,6 @@
#ifndef SERIAL_H_
#define SERIAL_H_

#ifndef WIN32
typedef int SERIALOBJECT;
#define SERIALOBJECT_UNDEF -1
#else
#include <windows.h>
typedef HANDLE SERIALOBJECT;
#define SERIALOBJECT_UNDEF NULL
#endif

#define HEADER_SIZE 0x02
#define BUFFER_SIZE 0xFF

Expand Down
4 changes: 2 additions & 2 deletions core/include/connectors/usb_spoof.h
Expand Up @@ -27,8 +27,8 @@ int usb_spoof_init_usb_device(int vendor, int product,
uint16_t* bus_id, uint8_t* device_address, int libusb_debug);
void usb_spoof_release_usb_device();
int usb_spoof_forward_to_device(control_request* creq);
int usb_spoof_forward_to_adapter(SERIALOBJECT serial, unsigned char* data, unsigned char length);
int usb_spoof_forward_to_adapter(int id, unsigned char* data, unsigned char length);

int usb_spoof_spoof_360_controller(SERIALOBJECT serial);
int usb_spoof_spoof_360_controller(int id);

#endif /* USB_SPOOF_H_ */

0 comments on commit 93b3482

Please sign in to comment.