File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -89,8 +89,17 @@ const parse = (raw, options = {}) => {
8989 } ) ;
9090} ;
9191
92+ const parseCommand = ( data ) => {
93+ let command = null ;
94+ if ( data . device === 'tz' ) {
95+ command = tz . parseCommand ( data ) ;
96+ }
97+ return command ;
98+ } ;
99+
92100module . exports = {
93101 getImei : getImei ,
94102 setCache : setCache ,
95- parse : parse
103+ parse : parse ,
104+ parseCommand : parseCommand
96105} ;
Original file line number Diff line number Diff line change @@ -115,4 +115,14 @@ describe('tracking-parzer', () => {
115115 done ( err ) ;
116116 } ) ;
117117 } ) ;
118+
119+ it ( 'should return TZ raw command' , ( ) => {
120+ const data = {
121+ instruction : 'reboot' ,
122+ password : 897463 ,
123+ device : 'tz'
124+ } ;
125+ const raw = tracking . parseCommand ( data ) ;
126+ expect ( raw ) . to . eql ( '*897463,991#' ) ;
127+ } ) ;
118128} ) ;
You can’t perform that action at this time.
0 commit comments