diff --git a/src/index.js b/src/index.js index 358af90..19a6c69 100644 --- a/src/index.js +++ b/src/index.js @@ -737,6 +737,10 @@ const parseCommand = (data) => { return command; }; +const getRebootCommand = (password='000000') => { + return `*${password},991#`; +}; + module.exports = { parse: parse, patterns: patterns, @@ -752,5 +756,6 @@ module.exports = { verifyLen: verifyLen, verifyCrc: verifyCrc, isTz: isTz, - parseCommand: parseCommand + parseCommand: parseCommand, + getRebootCommand: getRebootCommand }; diff --git a/test/test.js b/test/test.js index 0fdb3b2..02800e2 100644 --- a/test/test.js +++ b/test/test.js @@ -849,4 +849,14 @@ describe('tz-parzer', () => { const raw = tz.parseCommand(data); expect(raw).to.eql('*000000,404,1,300#'); }); + + it('should return raw command reboot', () => { + const raw = tz.getRebootCommand(); + expect(raw).to.eql('*000000,991#'); + }); + + it('should return raw command reboot with password', () => { + const raw = tz.getRebootCommand('123456'); + expect(raw).to.eql('*123456,991#'); + }); });