Commit eec67a6e authored by 曾思程's avatar 曾思程

设备配置bluetoothTone改为true开启蓝牙提示音

parent 3c98a264
import {Logger, Logger as internalLogger} from './utils/utils'; import { Logger, Logger as internalLogger } from './utils/utils';
const QUERY_DEVICE_INFO = 0x01; const QUERY_DEVICE_INFO = 0x01;
const QUERY_DEVICE_TIME = 0x02; const QUERY_DEVICE_TIME = 0x02;
...@@ -699,7 +699,7 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress) ...@@ -699,7 +699,7 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
if (typeof length != 'number') throw new Error('parameter `length` required'); if (typeof length != 'number') throw new Error('parameter `length` required');
if (length <= 0) throw new Error('parameter `length` must greater than zero'); if (length <= 0) throw new Error('parameter `length` must greater than zero');
Logger.info('jensen', 'getFile',`file download start. filename: ${filename}, length: ${length} `); Logger.info('jensen', 'getFile', `file download start. filename: ${filename}, length: ${length} `);
let fname = []; let fname = [];
for (let i = 0; i < filename.length; i++) fname.push(filename.charCodeAt(i)); for (let i = 0; i < filename.length; i++) fname.push(filename.charCodeAt(i));
...@@ -743,7 +743,7 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress) ...@@ -743,7 +743,7 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
removeAudio(); removeAudio();
if (flen >= length) { if (flen >= length) {
document.removeEventListener('visibilitychange', visibilitychange); document.removeEventListener('visibilitychange', visibilitychange);
Logger.info('jensen', 'getFile','file download finish.') Logger.info('jensen', 'getFile', 'file download finish.')
removeAudio(); removeAudio();
// return OK indicates all file blocks received // return OK indicates all file blocks received
return 'OK'; return 'OK';
...@@ -751,7 +751,7 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress) ...@@ -751,7 +751,7 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
} else { } else {
document.removeEventListener('visibilitychange', visibilitychange); document.removeEventListener('visibilitychange', visibilitychange);
removeAudio(); removeAudio();
Logger.info('jensen', 'getFile','file download fail.') Logger.info('jensen', 'getFile', 'file download fail.')
ondata('fail'); ondata('fail');
} }
}; };
...@@ -928,7 +928,7 @@ Jensen.registerHandler(GET_SETTINGS, (msg) => { ...@@ -928,7 +928,7 @@ Jensen.registerHandler(GET_SETTINGS, (msg) => {
let r1 = msg.body[3]; let r1 = msg.body[3];
let r2 = msg.body[7]; let r2 = msg.body[7];
let r4 = msg.body[15]; let r4 = msg.body[15];
let rst = { autoRecord: r1 === 1, autoPlay: r2 === 1, bluetoothTone: r4 === 1 }; let rst = { autoRecord: r1 === 1, autoPlay: r2 === 1, bluetoothTone: !(r4 === 1) };
if (msg.body.length >= 12) { if (msg.body.length >= 12) {
let r3 = msg.body[11] === 1; let r3 = msg.body[11] === 1;
rst['notification'] = r3; rst['notification'] = r3;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment