-
Notifications
You must be signed in to change notification settings - Fork 8
/
WiiPosHandler.js
67 lines (61 loc) · 2.06 KB
/
WiiPosHandler.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
* Phonegap MyPlugin Instance plugin
* Copyright (c) Nimish Nayak 2011
*
*/
var WiiPosition = {
nativeFunction: function(types, success, fail) {
return PhoneGap.exec(success, fail, "WiiPosHandler", "getPosition", types);
}
};
var WiiConnect = {
nativeFunction: function(types, success, fail) {
return PhoneGap.exec(success, fail, "WiiPosHandler", "connect", types);
}
};
var WiiDisconnect = {
nativeFunction: function(types, success, fail) {
return PhoneGap.exec(success, fail, "WiiPosHandler", "disconnect", types);
}
};
function wiiGetPosition()
{
WiiPosition.nativeFunction(
[storedPosition] ,
function(result) {
storedPosition = result;
//alert("Success : \r\n"+result);
},
function(error) {
alert("Error : \r\n"+error);
}
);
}
function wiiConnect()
{
WiiConnect.nativeFunction(
[storedPosition] ,
function(result) {
storedPosition = result;
//alert("Success : \r\n"+result);
},
function(error) {
//alert("FUCK");
alert("Error : \r\n"+error);
}
);
}
function wiiDisconnect()
{
WiiDisconnect.nativeFunction(
[storedPosition] ,
function(result) {
storedPosition = result;
//alert("Success : \r\n"+result);
},
function(error) {
alert("Error : \r\n"+error);
}
);
}
var storedPosition = "50";