1
1
var deviceReady = false ;
2
2
3
- var log = function ( message ) {
3
+ var log = function ( message ) {
4
4
message = message . replace ( / \n / g, "<br/>" ) ;
5
5
console . log ( message ) ;
6
6
info . innerHTML += message + "<br/>" ;
@@ -19,16 +19,16 @@ var isEnabled = function() {
19
19
} ;
20
20
21
21
var showSettings = function ( ) {
22
-
23
- if ( cordova . platformId === 'android ') {
22
+
23
+ if ( cordova . platformId !== 'ios ') {
24
24
ble . showBluetoothSettings ( ) ;
25
25
} else {
26
26
log ( "Show Bluetooth Settings is not available on " + cordova . platformId ) ;
27
27
}
28
28
} ;
29
29
30
30
var enable = function ( ) {
31
-
31
+
32
32
if ( cordova . platformId === 'android' ) {
33
33
ble . enable (
34
34
function ( ) {
@@ -41,7 +41,7 @@ var enable = function() {
41
41
} else {
42
42
log ( "Enable Bluetooth is not available on " + cordova . platformId ) ;
43
43
}
44
-
44
+
45
45
} ;
46
46
47
47
var scan = function ( ) {
@@ -73,15 +73,15 @@ function init() {
73
73
alert ( "Error: Apache Cordova did not initialize. Demo will not run correctly." ) ;
74
74
}
75
75
} , 1000 ) ;
76
-
76
+
77
77
}
78
78
79
79
window . onload = function ( ) {
80
80
addListenerToClass ( 'isEnabled' , isEnabled ) ;
81
81
addListenerToClass ( 'settings' , showSettings ) ;
82
82
addListenerToClass ( 'enable' , enable ) ;
83
83
addListenerToClass ( 'scan' , scan ) ;
84
-
84
+
85
85
addListenerToClass ( 'backBtn' , backHome ) ;
86
86
init ( ) ;
87
87
} ;
0 commit comments