move some platform-specific code out of the main wiiuse source
Initializing and cleaning up platform-specific fields in the wiimote structure is now done in a separate routine.
This commit is contained in:
11
src/io_nix.c
11
src/io_nix.c
@@ -278,6 +278,17 @@ int wiiuse_io_write(struct wiimote_t* wm, byte* buf, int len) {
|
||||
return write(wm->out_sock, buf, len);
|
||||
}
|
||||
|
||||
void wiiuse_init_platform_fields(struct wiimote_t* wm) {
|
||||
memset(&(wm->bdaddr), 0, sizeof(bdaddr_t)); /* = *BDADDR_ANY;*/
|
||||
wm->out_sock = -1;
|
||||
wm->in_sock = -1;
|
||||
}
|
||||
|
||||
void wiiuse_cleanup_platform_fields(struct wiimote_t* wm) {
|
||||
wm->out_sock = -1;
|
||||
wm->in_sock = -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* ifdef WIIUSE_BLUEZ */
|
||||
|
||||
Reference in New Issue
Block a user