File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,28 +115,28 @@ bool ELM327::initializeELM()
115115*/
116116void ELM327::formatQueryArray (uint16_t service, uint32_t pid)
117117{
118- query[0 ] = ((service >> 8 ) & 0xFF ) + ' 0' ;
119- query[1 ] = (service & 0xFF ) + ' 0' ;
118+ query[0 ] = ((service >> 4 ) & 0xF ) + ' 0' ;
119+ query[1 ] = (service & 0xF ) + ' 0' ;
120120
121121 // determine PID length (standard queries have 16-bit PIDs,
122122 // but some custom queries have PIDs with 32-bit values)
123123 if (pid & 0xFF00 )
124124 {
125125 longQuery = true ;
126126
127- query[2 ] = ((pid >> 24 ) & 0xFF ) + ' 0' ;
128- query[3 ] = ((pid >> 16 ) & 0xFF ) + ' 0' ;
129- query[4 ] = ((pid >> 8 ) & 0xFF ) + ' 0' ;
130- query[5 ] = (pid & 0xFF ) + ' 0' ;
127+ query[2 ] = ((pid >> 12 ) & 0xF ) + ' 0' ;
128+ query[3 ] = ((pid >> 8 ) & 0xF ) + ' 0' ;
129+ query[4 ] = ((pid >> 4 ) & 0xF ) + ' 0' ;
130+ query[5 ] = (pid & 0xF ) + ' 0' ;
131131
132132 upper (query, 6 );
133133 }
134134 else
135135 {
136136 longQuery = false ;
137137
138- query[2 ] = ((pid >> 8 ) & 0xFF ) + ' 0' ;
139- query[3 ] = (pid & 0xFF ) + ' 0' ;
138+ query[2 ] = ((pid >> 4 ) & 0xF ) + ' 0' ;
139+ query[3 ] = (pid & 0xF ) + ' 0' ;
140140 query[4 ] = ' \0 ' ;
141141 query[5 ] = ' \0 ' ;
142142
You can’t perform that action at this time.
0 commit comments