Rename apple_pad_send_control to pad_connection_send_control

This commit is contained in:
twinaphex 2014-10-04 18:38:01 +02:00
parent 2e4c2fedb2
commit c93982ef73
5 changed files with 9 additions and 10 deletions

View File

@ -50,7 +50,7 @@ static bool inquiry_off;
static bool inquiry_running;
static struct pad_connection g_connections[MAX_PLAYERS];
void apple_pad_send_control(void *data, uint8_t* data_buf, size_t size)
void pad_connection_send_control(void *data, uint8_t* data_buf, size_t size)
{
struct pad_connection *connection = (struct pad_connection*)data;

View File

@ -42,7 +42,7 @@ struct pad_connection
static IOHIDManagerRef g_hid_manager;
void apple_pad_send_control(void *data, uint8_t* data_buf, size_t size)
void pad_connection_send_control(void *data, uint8_t* data_buf, size_t size)
{
struct pad_connection* connection = (struct pad_connection*)data;

View File

@ -49,7 +49,7 @@ static void hidpad_ps3_send_control(struct hidpad_ps3_data* device)
report_buffer[4] = device->motors[1] >> 8;
report_buffer[6] = device->motors[0] >> 8;
apple_pad_send_control(
pad_connection_send_control(
device->connection, report_buffer, sizeof(report_buffer));
}
@ -68,7 +68,7 @@ static void* hidpad_ps3_connect(void *connect_data, uint32_t slot)
#ifdef IOS
/* Magic packet to start reports. */
static uint8_t data[] = {0x53, 0xF4, 0x42, 0x03, 0x00, 0x00};
apple_pad_send_control(device->connection, data, 6);
pad_connection_send_control(device->connection, data, 6);
#endif
/* Without this, the digital buttons won't be reported. */

View File

@ -43,12 +43,13 @@ static void hidpad_ps4_send_control(struct hidpad_ps4_data* device)
report_buffer[11] = rgb[(device->slot % 4)][2];
#endif
apple_pad_send_control(
pad_connection_send_control(
device->connection, report_buffer, sizeof(report_buffer));
}
static void* hidpad_ps4_connect(void *connect_data, uint32_t slot)
{
uint8_t data[0x25];
struct pad_connection* connection = (struct pad_connection*)connect_data;
struct hidpad_ps4_data* device = (struct hidpad_ps4_data*)
calloc(1, sizeof(struct hidpad_ps4_data));
@ -61,8 +62,7 @@ static void* hidpad_ps4_connect(void *connect_data, uint32_t slot)
/* TODO - unsure of this */
/* This is needed to get full input packet over bluetooth. */
uint8_t data[0x25];
apple_pad_send_control(device->connection, data, 0x2);
pad_connection_send_control(device->connection, data, 0x2);
/* Without this, the digital buttons won't be reported. */
hidpad_ps4_send_control(device);

View File

@ -63,8 +63,7 @@ int classic_ctrl_handshake(struct wiimote_t* wm,
void classic_ctrl_event(struct classic_ctrl_t* cc, byte* msg);
/* TODO - Get rid of Apple-specific functions. */
void apple_pad_send_control(void *data, uint8_t* data_buf, size_t size);
void pad_connection_send_control(void *data, uint8_t* data_buf, size_t size);
/*
* Request the wiimote controller status.
@ -373,7 +372,7 @@ int wiimote_send(struct wiimote_t* wm, byte report_type, byte* msg, int len)
printf("\n");
#endif
apple_pad_send_control(wm->connection, buf, len + 2);
pad_connection_send_control(wm->connection, buf, len + 2);
return 1;
}