Answer the question
In order to leave comments, you need to log in
The cordova-plugin-bluetoothle plugin - the startScan method does not see the device. Why?
Hello.
I'm trying to use a bluetooth device in the application, namely the button (selfie).
I use plugins
for angularjs
https://github.com/Jewelbots/ng-cordova-bluetoothle
and for cordova
https://github.com/randdusing/BluetoothLE
$scope.bleDeviceScan = function() {
$ionicPlatform.ready(function() {
return $cordovaBluetoothle.initialize(params)
.then(function () {
//successfully initialized
return $cordovaBluetoothle.startScan(startScanSuccess, handleerror,
{
services: [],
"allowDuplicates": true,
"scanMode": bluetoothle.SCAN_MODE_LOW_LATENCY,
"matchMode": bluetoothle.MATCH_MODE_AGGRESSIVE,
"matchNum": bluetoothle.MATCH_NUM_MAX_ADVERTISEMENT,
"callbackType": bluetoothle.CALLBACK_TYPE_ALL_MATCHES,
}).then(function (data) {
//successfully initialized
$scope.deviceStatus = 'Found device: ' + JSON.stringify(data);
return data;
}, function (err) {
//error trying to initialiez
$scope.deviceStatus = 'Error:' + JSON.stringify(err);
});
}, function (err) {
//error trying to initialiez
$scope.deviceStatus = 'Error:' + JSON.stringify(err);
});
});
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question