A
A
Art Root2016-08-26 18:15:44
Android
Art Root, 2016-08-26 18:15:44

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);
                    });

            });
        };

Initialization goes fine, shows status: enabled
but startScan returns an empty object
What am I doing wrong?
Ps The android itself sees and connects this button, and automatically when turned on, but it is not visible in the application.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2019-11-08
@Yauheni85

Haven't solved the problem? I have the same bug...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question