diff --git a/apple/iOS/bluetooth/btpad.c b/apple/iOS/bluetooth/btpad.c index 098c962703..5e85898f84 100644 --- a/apple/iOS/bluetooth/btpad.c +++ b/apple/iOS/bluetooth/btpad.c @@ -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; diff --git a/input/apple_joypad_hid.c b/input/apple_joypad_hid.c index 0736c1abf8..2100bfbf96 100644 --- a/input/apple_joypad_hid.c +++ b/input/apple_joypad_hid.c @@ -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; diff --git a/input/apple_joypad_ps3.c b/input/apple_joypad_ps3.c index e4b05f1c75..43ca1fae5b 100644 --- a/input/apple_joypad_ps3.c +++ b/input/apple_joypad_ps3.c @@ -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. */ diff --git a/input/apple_joypad_ps4.c b/input/apple_joypad_ps4.c index 99b753ba55..9c6dec5896 100644 --- a/input/apple_joypad_ps4.c +++ b/input/apple_joypad_ps4.c @@ -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); diff --git a/input/wiimote.c b/input/wiimote.c index 68bf8a2fe7..7d90637b51 100644 --- a/input/wiimote.c +++ b/input/wiimote.c @@ -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; }