diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2006-12-16 22:03:43 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@iem.at> | 2015-10-14 15:08:25 +0200 |
commit | f584b800ba1069616625dfe34fdf68d0eafda672 (patch) | |
tree | 62d30820036823edba4083c1f53f80fc853aa5c6 /wiiremote/wiiremote.h | |
parent | 16d980cd5cc5539fef38c4cb99465aba97737073 (diff) |
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
Diffstat (limited to 'wiiremote/wiiremote.h')
-rw-r--r-- | wiiremote/wiiremote.h | 62 |
1 files changed, 62 insertions, 0 deletions
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 <CoreFoundation/CoreFoundation.h> +#include <IOBluetooth/Bluetooth.h> +#include <IOBluetooth/IOBluetoothUserLib.h> + +#include <stdio.h> +#include <string.h> + +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); |