|
@@ -292,7 +292,7 @@ export function senBlData(deviceId, serviceId, characteristicId,uint8Array,laste
|
|
},
|
|
},
|
|
fail(e) {
|
|
fail(e) {
|
|
console.log('发送数据失败',e)
|
|
console.log('发送数据失败',e)
|
|
- lasterError()
|
|
|
|
|
|
+ lasterError(e)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -303,7 +303,7 @@ export function senBlData(deviceId, serviceId, characteristicId,uint8Array,laste
|
|
export function sendDataToDevice(options) {
|
|
export function sendDataToDevice(options) {
|
|
let byteLength = options.value.byteLength;
|
|
let byteLength = options.value.byteLength;
|
|
//这里默认一次20个字节发送
|
|
//这里默认一次20个字节发送
|
|
- const speed = plus.os.name != 'Android' ? 180 : 15; //20;
|
|
|
|
|
|
+ const speed = plus.os.name != 'Android' ? 180 : 20; //20;
|
|
console.log("send data 20");
|
|
console.log("send data 20");
|
|
console.log(options,byteLength,options.value);
|
|
console.log(options,byteLength,options.value);
|
|
if (byteLength > 0) {
|
|
if (byteLength > 0) {
|
|
@@ -318,14 +318,14 @@ export function sendDataToDevice(options) {
|
|
...options,
|
|
...options,
|
|
value: options.value.slice(speed, byteLength),
|
|
value: options.value.slice(speed, byteLength),
|
|
});
|
|
});
|
|
- },50)
|
|
|
|
|
|
+ },100)
|
|
} else {
|
|
} else {
|
|
options.lasterSuccess && options.lasterSuccess();
|
|
options.lasterSuccess && options.lasterSuccess();
|
|
}
|
|
}
|
|
})
|
|
})
|
|
.catch((res) => {
|
|
.catch((res) => {
|
|
console.log(res);
|
|
console.log(res);
|
|
- options.lasterError && options.lasterError();
|
|
|
|
|
|
+ options.lasterError && options.lasterError(res);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|