From f584b800ba1069616625dfe34fdf68d0eafda672 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sat, 16 Dec 2006 22:03:43 +0000 Subject: first stab at porting the Max aka.wiiremote object. it builds now, but I don't think it works svn path=/trunk/externals/io/; revision=6923 --- wiiremote/wiiremote.h | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 wiiremote/wiiremote.h (limited to 'wiiremote/wiiremote.h') diff --git a/wiiremote/wiiremote.h b/wiiremote/wiiremote.h new file mode 100644 index 0000000..1e8cb00 --- /dev/null +++ b/wiiremote/wiiremote.h @@ -0,0 +1,62 @@ +// wiiremote.h +// Copyright by Masayuki Akamatsu +// Based on "DarwiinRemote" by Hiroaki Kimura + +#include +#include +#include + +#include +#include + +typedef struct { + int x, y, s; +} IRData; + +typedef struct _WiiRemoteRec +{ + IOBluetoothDeviceInquiryRef inquiry; + IOBluetoothDeviceRef device; + IOBluetoothL2CAPChannelRef ichan; + IOBluetoothL2CAPChannelRef cchan; + + unsigned char accX; + unsigned char accY; + unsigned char accZ; + unsigned short buttonData; + + float lowZ; + float lowX; + int orientation; + int leftPoint; // is point 0 or 1 on the left. -1 when not tracking. + float posX; + float posY; + float angle; + Boolean tracking; + + IRData irData[4]; + double batteryLevel; + + Boolean isIRSensorEnabled; + Boolean isMotionSensorEnabled; + Boolean isVibrationEnabled; + + Boolean isExpansionPortUsed; + Boolean isLED1Illuminated; + Boolean isLED2Illuminated; + Boolean isLED3Illuminated; + Boolean isLED4Illuminated; + + IOBluetoothUserNotificationCallback *disconnectNotification; +} WiiRemoteRec, *WiiRemoteRef; + +WiiRemoteRef wiiremote_init(void); +Boolean wiiremote_search(void); +Boolean wiiremote_stopsearch(void); +Boolean wiiremote_connect(void); +Boolean wiiremote_disconnect(void); +Boolean wiiremote_motionsensor(Boolean enabled); +Boolean wiiremote_irsensor(Boolean enabled); +Boolean wiiremote_vibration(Boolean enabled); +Boolean wiiremote_led(Boolean enabled1, Boolean enabled2, Boolean enabled3, Boolean enabled4); +void wiiremote_getstatus(void); -- cgit v1.2.1