Open fpinho opened 7 years ago
Hi,
I am using the cordova plugin bluetoothle, but I can’t scan any device, only appear my macbook in list You know why? I try with empty array in services, and with filter 'fc12', that is my device. but only appears my mac, see the attachment.
this is the code:
bluetoothle.initialize(initializeSuccess, initializeError);
function initializeSuccess(obj) { myApp.alert(JSON.stringify(obj)); params = '{'+ '"services": ['+ '"180D",'+ '"fc12"'+ '],'+ '"allowDuplicates": false'+ '"scanMode": bluetoothle.SCAN_MODE_LOW_LATENCY,'+ '"matchMode": bluetoothle.MATCH_MODE_AGGRESSIVE,'+ '"matchNum": bluetoothle.MATCH_NUM_MAX_ADVERTISEMENT,'+ '"callbackType": bluetoothle.CALLBACK_TYPE_ALL_MATCHES,'+ '}'; bluetoothle.startScan(initializeSuccess2,initializeError2,params); } function initializeError(obj) { myApp.alert(JSON.stringify(obj)); }
function initializeSuccess2(obj) { myApp.alert(JSON.stringify(obj));
} function initializeError2(obj) { myApp.alert(JSON.stringify(obj)); }
It looks like the scan is working overall. Are you sure your devices are Bluetooth LE?
Hi,
I am using the cordova plugin bluetoothle, but I can’t scan any device, only appear my macbook in list You know why? I try with empty array in services, and with filter 'fc12', that is my device. but only appears my mac, see the attachment.
this is the code:
bluetoothle.initialize(initializeSuccess, initializeError);
function initializeSuccess(obj) { myApp.alert(JSON.stringify(obj)); params = '{'+ '"services": ['+ '"180D",'+ '"fc12"'+ '],'+ '"allowDuplicates": false'+ '"scanMode": bluetoothle.SCAN_MODE_LOW_LATENCY,'+ '"matchMode": bluetoothle.MATCH_MODE_AGGRESSIVE,'+ '"matchNum": bluetoothle.MATCH_NUM_MAX_ADVERTISEMENT,'+ '"callbackType": bluetoothle.CALLBACK_TYPE_ALL_MATCHES,'+ '}'; bluetoothle.startScan(initializeSuccess2,initializeError2,params); } function initializeError(obj) { myApp.alert(JSON.stringify(obj)); }
function initializeSuccess2(obj) { myApp.alert(JSON.stringify(obj));
} function initializeError2(obj) { myApp.alert(JSON.stringify(obj)); }