|
define(function(require){
require("$UI/system/lib/cordova/cordova");
require("cordova!cordova-plugin-ble-central");
var Model = function(){
this.callParent();
//document.addEventListener('deviceready', this.onDeviceReady, false);
};
Model.prototype.button1Click = function(device){
alert(1);
var me = this;
function onSuccess(device) {
alert("id = " +device.id+", name = "+device.name);
}
function onError() {
alert("fail: search device fail ");
}
window.ble.startScan([], onSuccess, onError);
};
return Model;
});
点按钮后执行startScan方法,然后没反应。enable,showBluetoothSettings 等方法是可用的。有遇到这个问题的吗?希望大家帮我解决啊 |
|