📄 wiimotelayer.h
字号:
/** * Lum, Darrell * Murphy, Ryan * CPE 454-01, Spring 07, Dr. Haungs * This file contains functions for parsing wii-mote data. */ #ifndef WIIMOTE_LAYER_H#define WIIMOTE_LAYER_H#include "wiimote.h"#include "WiimoteData.h"#define MAX_WIIPKT_SIZE 64/** * Helper Macro */#define RAD_TO_DEGREE(x) (((float)x * 180.0f) / 3.14159265f)/** * WiiPacket definitions */#define WIIPKT_BUTTONS_ONLY 0x30#define WIIPKT_BUTTONS_ACCEL 0x31#define WIIPKT_IR_SENSOR 0x33#define WIIPKT_READ_RESPONSE 0x21#define WIIPKT_READ_REQUEST 0x17typedef struct Wiimote{ wiimote_t wiimoted; WiimoteData data;} Wiimote;/** * Initialize the wiimote layer and start listening process. */int initialize_wiimote_layer();/** * Disconnects and cleans up the given wiimote. */void cleanup_wiimote_layer();/** * Connects to a Wiimote. * disconnect() will free a Wiimote *, so the Wiimote layer owns the Wiimote * object. */Wiimote * wiimote_connect();/** * Disconnects and frees the Wiimote pointed to by wm. */void wiimote_disconnect(Wiimote *wm);/** * Updates the WiimoteData struct within the Wiimote. */int get_data(Wiimote *wm);/** * Sends the sendable data in the Wiimote data struct. */int send_data(Wiimote *wm);/** * Takes a WiiPacket definition and enables that feature. */int set_functionality(Wiimote *wm, unsigned char wiiPkt);#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -