Hi!
I’m working on getting BLE integrated into my app.
I have the following controller:
crosstimer.controller('MenuCtrl', function ($scope, $cordovaBLE, $cordovaToast, BLE) {
$scope.status = "ion-flash-off";
$scope.connectBLE = function () {
console.log("Connect button clicked!");
$cordovaBLE.isConnected (BLE.id,
function () {
console.log("Peripheral is connected, disconnecting");
$cordovaBLE.disconnect(BLE.id, disconnectSuccess);
},
function () {
console.log("Peripheral is *not* connected");
enableBLE();
}
);
...
But it isn’t working.
But if I change
$cordovaBLE.isConnected...
to
ble.isConnected...
everthing works fine.
I get no error, nothing. The strange thing is, that $cordovaToast works as expected.
Systeminfo:
Cordova CLI: 4.2.0
Ionic Version: 1.0.0
Ionic CLI Version: 1.4.5
Ionic App Lib Version: 0.0.22
OS: Windows 7 SP1
Node Version: v0.10.33