|
@@ -129,7 +129,7 @@ class BtCmd {
|
|
const hours = Math.floor(time / day);
|
|
const hours = Math.floor(time / day);
|
|
const minutes = Math.floor((time % day) / hour);
|
|
const minutes = Math.floor((time % day) / hour);
|
|
const seconds = Math.floor((time % day % hour));
|
|
const seconds = Math.floor((time % day % hour));
|
|
-// console.log(`${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`);
|
|
|
|
|
|
+ // console.log(`${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`);
|
|
console.log("休眠:", hour, minutes, seconds)
|
|
console.log("休眠:", hour, minutes, seconds)
|
|
return this._build(CmdRtc.setSleepAfterPlayPause, [hours, minutes, seconds]);
|
|
return this._build(CmdRtc.setSleepAfterPlayPause, [hours, minutes, seconds]);
|
|
} else {
|
|
} else {
|
|
@@ -301,7 +301,7 @@ class BtCmd {
|
|
const length = cmd.length + 1;
|
|
const length = cmd.length + 1;
|
|
const l = this._int2Hex(length);
|
|
const l = this._int2Hex(length);
|
|
cmd.splice(5, 0, l);
|
|
cmd.splice(5, 0, l);
|
|
- return new Uint8Array(cmd);
|
|
|
|
|
|
+ return cmd;
|
|
}
|
|
}
|
|
|
|
|
|
// 打印cmd
|
|
// 打印cmd
|
|
@@ -323,9 +323,11 @@ class BtCmd {
|
|
}
|
|
}
|
|
|
|
|
|
static _int2Hex(num) {
|
|
static _int2Hex(num) {
|
|
- let value = num ?? 0
|
|
|
|
- let hexStr = value.toString(16).toUpperCase(); // 转换为16进制字符串并转为大写
|
|
|
|
- return hexStr.padStart(2, '0');
|
|
|
|
|
|
+ let value = num ?? 0;
|
|
|
|
+ let hexStr = value.toString(16).toUpperCase();
|
|
|
|
+ hexStr = hexStr.padStart(2, '0');
|
|
|
|
+ let hexNum = parseInt(hexStr, 16);
|
|
|
|
+ return hexNum;
|
|
}
|
|
}
|
|
|
|
|
|
static _int2HexString(value) {
|
|
static _int2HexString(value) {
|