douglasjunior / AndroidBluetoothLibrary

A Library for easy implementation of Serial Bluetooth Classic and Low Energy on Android. 💙
MIT License
224 stars 68 forks source link

startScan returns duplicated devices. #19

Closed benevbright closed 6 years ago

benevbright commented 6 years ago

It's actually tested on React Native project with react-native-easybluetooth-classic which wraps this library.

Hi, thanks for the great library.

I tried scan with below code.

            (async () => {
                const config = {
                    "deviceName": "XXXXX",
                    "bufferSize": 1024,
                    "characterDelimiter": "\n"
                }
                let res = EasyBluetooth.init(config);
                console.log('[BT init]', res);

                res = await EasyBluetooth.startScan();
                console.log('[BT startScan]', res);
            })();

It returns 26 objects but the problem is that they are all same objects. I'm not testing in a special place but just in the house. The address and name of them are all same.

Any help?

Thanks.

douglasjunior commented 6 years ago

Answered in https://github.com/douglasjunior/react-native-easybluetooth-classic/issues/10