|
RT
cordova-plugin-ble-central 蓝牙插件怎么读取连接设备特定位置的值?
例如我连接了另外一部手机 想读取该手机某个文件夹test.txt的值应该怎么?
Model.prototype.readClick = function(event){
for(var i in characteristics){
var cha = characteristics[i];
if (cha.properties[0] == "Read"){
service_uuid = cha.service;
characteristic_uuid = cha.characteristic;
break;
}
}
ble.read(device_id, service_uuid, characteristic_uuid, function(buffer){
var string = String.fromCharCode.apply(null, new Uint8Array(buffer));
suCallBack(string);
}, errCallBack);
};
看了这个案例 只知道device_id是连接设备的id
怎么指定读取? 给service_uuid 或者 characteristic_uuid 赋值么? |
|