11#include <string.h>
22
3- #include "si/commands.h"
3+ #include "si/device/ commands.h"
44#include "si/device/gc_controller.h"
55
66/*
@@ -74,7 +74,7 @@ static uint8_t *pack_input_state(struct si_device_gc_input_state *src, uint8_t a
7474 * Command: {0x00}
7575 * Response: A 3-byte device info.
7676 */
77- static int handle_info (const uint8_t * command , si_callback_fn callback , void * context )
77+ static int handle_info (const uint8_t * command , si_complete_cb_t callback , void * context )
7878{
7979 struct si_device_gc_controller * device = (struct si_device_gc_controller * )context ;
8080
@@ -90,7 +90,7 @@ static int handle_info(const uint8_t *command, si_callback_fn callback, void *co
9090 * Command: {0xFF}
9191 * Response: A 3-byte device info.
9292 */
93- static int handle_reset (const uint8_t * command , si_callback_fn callback , void * context )
93+ static int handle_reset (const uint8_t * command , si_complete_cb_t callback , void * context )
9494{
9595 struct si_device_gc_controller * device = (struct si_device_gc_controller * )context ;
9696
@@ -108,7 +108,7 @@ static int handle_reset(const uint8_t *command, si_callback_fn callback, void *c
108108 * Command: {0x40, analog_mode, motor_state}
109109 * Response: An 8-byte packed input state, see `pack_input_state` for details
110110 */
111- static int handle_short_poll (const uint8_t * command , si_callback_fn callback , void * context )
111+ static int handle_short_poll (const uint8_t * command , si_complete_cb_t callback , void * context )
112112{
113113 struct si_device_gc_controller * device = (struct si_device_gc_controller * )context ;
114114
@@ -150,7 +150,7 @@ static int handle_short_poll(const uint8_t *command, si_callback_fn callback, vo
150150 * Command: {0x41}
151151 * Response: A 10-byte input state representing the current origin.
152152 */
153- static int handle_read_origin (const uint8_t * command , si_callback_fn callback , void * context )
153+ static int handle_read_origin (const uint8_t * command , si_complete_cb_t callback , void * context )
154154{
155155 struct si_device_gc_controller * device = (struct si_device_gc_controller * )context ;
156156
@@ -174,7 +174,7 @@ static int handle_read_origin(const uint8_t *command, si_callback_fn callback, v
174174 * Command: {0x42, 0x00, 0x00}
175175 * Response: A 10-byte input state representing the current origin.
176176 */
177- static int handle_calibrate (const uint8_t * command , si_callback_fn callback , void * context )
177+ static int handle_calibrate (const uint8_t * command , si_complete_cb_t callback , void * context )
178178{
179179 struct si_device_gc_controller * device = (struct si_device_gc_controller * )context ;
180180
@@ -205,7 +205,7 @@ static int handle_calibrate(const uint8_t *command, si_callback_fn callback, voi
205205 *
206206 * NOTE: This command is not used by any games, but is included for completeness.
207207 */
208- static int handle_long_poll (const uint8_t * command , si_callback_fn callback , void * context )
208+ static int handle_long_poll (const uint8_t * command , si_complete_cb_t callback , void * context )
209209{
210210 struct si_device_gc_controller * device = (struct si_device_gc_controller * )context ;
211211
@@ -238,7 +238,7 @@ static int handle_long_poll(const uint8_t *command, si_callback_fn callback, voi
238238 * Command: {0x4D, 0x??, 0x??} - 2nd and 3rd bytes seem to differ every time
239239 * Response: 8 bytes of zeroes.
240240 */
241- static int handle_probe_device (const uint8_t * command , si_callback_fn callback , void * context )
241+ static int handle_probe_device (const uint8_t * command , si_complete_cb_t callback , void * context )
242242{
243243 // Respond with 8 bytes of zeroes
244244 uint8_t response [8 ] = {0 };
@@ -255,7 +255,7 @@ static int handle_probe_device(const uint8_t *command, si_callback_fn callback,
255255 * Command: {0x4E, wireless_id_h | SI_WIRELESS_FIX_ID, wireless_id_l}
256256 * Response: A 3-byte device info.
257257 */
258- static int handle_fix_device (const uint8_t * command , si_callback_fn callback , void * context )
258+ static int handle_fix_device (const uint8_t * command , si_complete_cb_t callback , void * context )
259259{
260260 struct si_device_gc_controller * device = (struct si_device_gc_controller * )context ;
261261
0 commit comments