|
@@ -102,9 +102,28 @@ const deviceTool = {
|
|
|
getUUID(){
|
|
getUUID(){
|
|
|
let arr = [85,253,0,253];
|
|
let arr = [85,253,0,253];
|
|
|
sendData(arr)
|
|
sendData(arr)
|
|
|
|
|
+ },
|
|
|
|
|
+ sendWifiPwd(wifi,pwd){
|
|
|
|
|
+ let arr = buildWifiPwd(wifi,pwd)
|
|
|
|
|
+ addLast(arr)
|
|
|
|
|
+ sendData(arr)
|
|
|
}
|
|
}
|
|
|
|
|
+}
|
|
|
|
|
+function buildWifiPwd(wifi,pwd){
|
|
|
|
|
+ let arr = [85,160,wifi.length+pwd.length+1];
|
|
|
|
|
+ for (let i = 0; i < wifi.length; i++) {
|
|
|
|
|
+ let c = wifi.charCodeAt(0);
|
|
|
|
|
+ arr.push(c);
|
|
|
|
|
+ }
|
|
|
|
|
+ arr.push(59)
|
|
|
|
|
|
|
|
|
|
+ for (let i = 0; i < pwd.length; i++) {
|
|
|
|
|
+ let c = pwd.charCodeAt(0);
|
|
|
|
|
+ arr.push(c);
|
|
|
|
|
+ }
|
|
|
|
|
+ return arr;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
function addLast(arr){
|
|
function addLast(arr){
|
|
|
let total = 0;
|
|
let total = 0;
|
|
|
for(let i =1;i<arr.length;i++){
|
|
for(let i =1;i<arr.length;i++){
|
|
@@ -469,7 +488,7 @@ export function getUUID(){
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function test(){
|
|
function test(){
|
|
|
- console.log( parseDataObj("AA AC 06 01 01 01 01 01 01 B8"))
|
|
|
|
|
|
|
+ deviceTool.sendWifiPwd("11","11")
|
|
|
}
|
|
}
|
|
|
-//test()
|
|
|
|
|
|
|
+// test()
|
|
|
|
|
|