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 = {}) => {
89
89
} ) ;
90
90
} ;
91
91
92
+ const parseCommand = ( data ) => {
93
+ let command = null ;
94
+ if ( data . device === 'tz' ) {
95
+ command = tz . parseCommand ( data ) ;
96
+ }
97
+ return command ;
98
+ } ;
99
+
92
100
module . exports = {
93
101
getImei : getImei ,
94
102
setCache : setCache ,
95
- parse : parse
103
+ parse : parse ,
104
+ parseCommand : parseCommand
96
105
} ;
Original file line number Diff line number Diff line change @@ -115,4 +115,14 @@ describe('tracking-parzer', () => {
115
115
done ( err ) ;
116
116
} ) ;
117
117
} ) ;
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
+ } ) ;
118
128
} ) ;
You can’t perform that action at this time.
0 commit comments