00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #if defined(VMDPHONETRACKER)
00019
00020 #include "VMDApp.h"
00021 #include "ResizeArray.h"
00022 #include "P_Buttons.h"
00023 #include "PhoneButtons.h"
00024 #include "Inform.h"
00025
00026 PhoneButtons::PhoneButtons(VMDApp *vmdapp) {
00027 app = vmdapp;
00028 numButtons = 31;
00029 }
00030
00031 int PhoneButtons::do_start(const SensorConfig *) {
00032 msgInfo << "Opening VMD console Phone device (buttons)." << sendmsg;
00033 return 1;
00034 }
00035
00036 void PhoneButtons::update() {
00037 float tx, ty, tz, rx, ry, rz;
00038 tx=ty=tz=rx=ry=rz=0.0f;
00039 int buttons;
00040 buttons=0;
00041
00042
00043 if (app != NULL) {
00044 app->mobile_get_tracker_status(tx, ty, tz, rx, ry, rz, buttons);
00045 }
00046
00047 stat[0] = 0;
00048 for(int i = 0; i < numButtons; i++) {
00049 stat[i] = (buttons >> i) & 1;
00050 stat[0] |= (buttons >> i) & 1;
00051 }
00052 }
00053
00054 #endif
00055