@@ -219,88 +219,86 @@ public WLQ_N(byte[] bytes) {
219219 byte [] flashConfigPart = new byte [configFlashSize ];
220220 System .arraycopy (bytes , 26 , flashConfigPart , 0 , configFlashSize );
221221
222- if (!Arrays .equals (flashConfig , flashConfigPart )) {
223- flashConfig = new byte [configFlashSize ];
224- System .arraycopy (flashConfigPart , 0 , flashConfig , 0 , flashConfigPart .length );
225-
226- tempConfig = new byte [flashConfig .length ];
227- System .arraycopy (flashConfig , 0 , tempConfig , 0 , flashConfig .length );
228-
229- Log .d (TAG , "New flashConfig: " + Utils .ByteArrayToHex (flashConfig ));
230-
231- firmwareVersion = bytes [firmwareVersionMajor_INDEX ] + "." + bytes [firmwareVersionMinor_INDEX ];
232- Log .d (TAG , "Firmware Version: " + firmwareVersion );
233-
234- SharedPreferences .Editor editor = PreferenceManager .getDefaultSharedPreferences (MyApplication .getContext ()).edit ();
235- editor .putString ("firmwareVersion" , firmwareVersion );
236- editor .apply ();
237-
238- keyMode = bytes [keyMode_INDEX ];
239- USBVinThreshold = ((flashConfig [USBVinThresholdHigh_INDEX ] & 0xFF ) << 8 ) | (flashConfig [USBVinThresholdLow_INDEX ] & 0xFF );
240- RTKSensitivity = flashConfig [RTKSensitivity_INDEX ];
241- RTKPagePressKeyType = flashConfig [RTKPagePressKeyType_INDEX ];
242- RTKPagePressKeyModifier = flashConfig [RTKPagePressKeyModifier_INDEX ];
243- RTKPagePressKey = flashConfig [RTKPagePressKey_INDEX ];
244- RTKPageDoublePressKeyType = flashConfig [RTKPageDoublePressKeyType_INDEX ];
245- RTKPageDoublePressKeyModifier = flashConfig [RTKPageDoublePressKeyModifier_INDEX ];
246- RTKPageDoublePressKey = flashConfig [RTKPageDoublePressKey_INDEX ];
247- RTKZoomPPressKeyType = flashConfig [RTKZoomPPressKeyType_INDEX ];
248- RTKZoomPPressKeyModifier = flashConfig [RTKZoomPPressKeyModifier_INDEX ];
249- RTKZoomPPressKey = flashConfig [RTKZoomPPressKey_INDEX ];
250- RTKZoomPDoublePressKeyType = flashConfig [RTKZoomPDoublePressKeyType_INDEX ];
251- RTKZoomPDoublePressKeyModifier = flashConfig [RTKZoomPDoublePressKeyModifier_INDEX ];
252- RTKZoomPDoublePressKey = flashConfig [RTKZoomPDoublePressKey_INDEX ];
253- RTKZoomMPressKeyType = flashConfig [RTKZoomMPressKeyType_INDEX ];
254- RTKZoomMPressKeyModifier = flashConfig [RTKZoomMPressKeyModifier_INDEX ];
255- RTKZoomMPressKey = flashConfig [RTKZoomMPressKey_INDEX ];
256- RTKZoomMDoublePressKeyType = flashConfig [RTKZoomMDoublePressKeyType_INDEX ];
257- RTKZoomMDoublePressKeyModifier = flashConfig [RTKZoomMDoublePressKeyModifier_INDEX ];
258- RTKZoomMDoublePressKey = flashConfig [RTKZoomMDoublePressKey_INDEX ];
259- RTKSpeakPressKeyType = flashConfig [RTKSpeakPressKeyType_INDEX ];
260- RTKSpeakPressKeyModifier = flashConfig [RTKSpeakPressKeyModifier_INDEX ];
261- RTKSpeakPressKey = flashConfig [RTKSpeakPressKey_INDEX ];
262- RTKSpeakDoublePressKeyType = flashConfig [RTKSpeakDoublePressKeyType_INDEX ];
263- RTKSpeakDoublePressKeyModifier = flashConfig [RTKSpeakDoublePressKeyModifier_INDEX ];
264- RTKSpeakDoublePressKey = flashConfig [RTKSpeakDoublePressKey_INDEX ];
265- RTKMutePressKeyType = flashConfig [RTKMutePressKeyType_INDEX ];
266- RTKMutePressKeyModifier = flashConfig [RTKMutePressKeyModifier_INDEX ];
267- RTKMutePressKey = flashConfig [RTKMutePressKey_INDEX ];
268- RTKMuteDoublePressKeyType = flashConfig [RTKMuteDoublePressKeyType_INDEX ];
269- RTKMuteDoublePressKeyModifier = flashConfig [RTKMuteDoublePressKeyModifier_INDEX ];
270- RTKMuteDoublePressKey = flashConfig [RTKMuteDoublePressKey_INDEX ];
271- RTKDisplayPressKeyType = flashConfig [RTKDisplayPressKeyType_INDEX ];
272- RTKDisplayPressKeyModifier = flashConfig [RTKDisplayPressKeyModifier_INDEX ];
273- RTKDisplayPressKey = flashConfig [RTKDisplayPressKey_INDEX ];
274- RTKDisplayDoublePressKeyType = flashConfig [RTKDisplayDoublePressKeyType_INDEX ];
275- RTKDisplayDoublePressKeyModifier = flashConfig [RTKDisplayDoublePressKeyModifier_INDEX ];
276- RTKDisplayDoublePressKey = flashConfig [RTKDisplayDoublePressKey_INDEX ];
277-
278- fullSensitivity = flashConfig [fullSensitivity_INDEX ];
279- fullRightPressKeyType = flashConfig [fullRightPressKeyType_INDEX ];
280- fullRightPressKeyModifier = flashConfig [fullRightPressKeyModifier_INDEX ];
281- fullRightPressKey = flashConfig [fullRightPressKey_INDEX ];
282- fullRightLongPressKeyType = flashConfig [fullRightLongPressKeyType_INDEX ];
283- fullRightLongPressKeyModifier = flashConfig [fullRightLongPressKeyModifier_INDEX ];
284- fullRightLongPressKey = flashConfig [fullRightLongPressKey_INDEX ];
285- fullLeftPressKeyType = flashConfig [fullLeftPressKeyType_INDEX ];
286- fullLeftPressKeyModifier = flashConfig [fullLeftPressKeyModifier_INDEX ];
287- fullLeftPressKey = flashConfig [fullLeftPressKey_INDEX ];
288- fullLeftLongPressKeyType = flashConfig [fullLeftLongPressKeyType_INDEX ];
289- fullLeftLongPressKeyModifier = flashConfig [fullLeftLongPressKeyModifier_INDEX ];
290- fullLeftLongPressKey = flashConfig [fullLeftLongPressKey_INDEX ];
291- fullScrollUpKeyType = flashConfig [fullScrollUpKeyType_INDEX ];
292- fullScrollUpKeyModifier = flashConfig [fullScrollUpKeyModifier_INDEX ];
293- fullScrollUpKey = flashConfig [fullScrollUpKey_INDEX ];
294- fullScrollDownKeyType = flashConfig [fullScrollDownKeyType_INDEX ];
295- fullScrollDownKeyModifier = flashConfig [fullScrollDownKeyModifier_INDEX ];
296- fullScrollDownKey = flashConfig [fullScrollDownKey_INDEX ];
297- fullSignalPressKeyType = flashConfig [fullSignalPressKeyType_INDEX ];
298- fullSignalPressKeyModifier = flashConfig [fullSignalPressKeyModifier_INDEX ];
299- fullSignalPressKey = flashConfig [fullSignalPressKey_INDEX ];
300- fullSignalLongPressKeyType = flashConfig [fullSignalLongPressKeyType_INDEX ];
301- fullSignalLongPressKeyModifier = flashConfig [fullSignalLongPressKeyModifier_INDEX ];
302- fullSignalLongPressKey = flashConfig [fullSignalLongPressKey_INDEX ];
303- }
222+ flashConfig = new byte [configFlashSize ];
223+ System .arraycopy (flashConfigPart , 0 , flashConfig , 0 , flashConfigPart .length );
224+
225+ tempConfig = new byte [flashConfig .length ];
226+ System .arraycopy (flashConfig , 0 , tempConfig , 0 , flashConfig .length );
227+
228+ Log .d (TAG , "New flashConfig: " + Utils .ByteArrayToHex (flashConfig ));
229+
230+ firmwareVersion = bytes [firmwareVersionMajor_INDEX ] + "." + bytes [firmwareVersionMinor_INDEX ];
231+ Log .d (TAG , "Firmware Version: " + firmwareVersion );
232+
233+ SharedPreferences .Editor editor = PreferenceManager .getDefaultSharedPreferences (MyApplication .getContext ()).edit ();
234+ editor .putString ("firmwareVersion" , firmwareVersion );
235+ editor .apply ();
236+
237+ keyMode = bytes [keyMode_INDEX ];
238+ USBVinThreshold = ((flashConfig [USBVinThresholdHigh_INDEX ] & 0xFF ) << 8 ) | (flashConfig [USBVinThresholdLow_INDEX ] & 0xFF );
239+ RTKSensitivity = flashConfig [RTKSensitivity_INDEX ];
240+ RTKPagePressKeyType = flashConfig [RTKPagePressKeyType_INDEX ];
241+ RTKPagePressKeyModifier = flashConfig [RTKPagePressKeyModifier_INDEX ];
242+ RTKPagePressKey = flashConfig [RTKPagePressKey_INDEX ];
243+ RTKPageDoublePressKeyType = flashConfig [RTKPageDoublePressKeyType_INDEX ];
244+ RTKPageDoublePressKeyModifier = flashConfig [RTKPageDoublePressKeyModifier_INDEX ];
245+ RTKPageDoublePressKey = flashConfig [RTKPageDoublePressKey_INDEX ];
246+ RTKZoomPPressKeyType = flashConfig [RTKZoomPPressKeyType_INDEX ];
247+ RTKZoomPPressKeyModifier = flashConfig [RTKZoomPPressKeyModifier_INDEX ];
248+ RTKZoomPPressKey = flashConfig [RTKZoomPPressKey_INDEX ];
249+ RTKZoomPDoublePressKeyType = flashConfig [RTKZoomPDoublePressKeyType_INDEX ];
250+ RTKZoomPDoublePressKeyModifier = flashConfig [RTKZoomPDoublePressKeyModifier_INDEX ];
251+ RTKZoomPDoublePressKey = flashConfig [RTKZoomPDoublePressKey_INDEX ];
252+ RTKZoomMPressKeyType = flashConfig [RTKZoomMPressKeyType_INDEX ];
253+ RTKZoomMPressKeyModifier = flashConfig [RTKZoomMPressKeyModifier_INDEX ];
254+ RTKZoomMPressKey = flashConfig [RTKZoomMPressKey_INDEX ];
255+ RTKZoomMDoublePressKeyType = flashConfig [RTKZoomMDoublePressKeyType_INDEX ];
256+ RTKZoomMDoublePressKeyModifier = flashConfig [RTKZoomMDoublePressKeyModifier_INDEX ];
257+ RTKZoomMDoublePressKey = flashConfig [RTKZoomMDoublePressKey_INDEX ];
258+ RTKSpeakPressKeyType = flashConfig [RTKSpeakPressKeyType_INDEX ];
259+ RTKSpeakPressKeyModifier = flashConfig [RTKSpeakPressKeyModifier_INDEX ];
260+ RTKSpeakPressKey = flashConfig [RTKSpeakPressKey_INDEX ];
261+ RTKSpeakDoublePressKeyType = flashConfig [RTKSpeakDoublePressKeyType_INDEX ];
262+ RTKSpeakDoublePressKeyModifier = flashConfig [RTKSpeakDoublePressKeyModifier_INDEX ];
263+ RTKSpeakDoublePressKey = flashConfig [RTKSpeakDoublePressKey_INDEX ];
264+ RTKMutePressKeyType = flashConfig [RTKMutePressKeyType_INDEX ];
265+ RTKMutePressKeyModifier = flashConfig [RTKMutePressKeyModifier_INDEX ];
266+ RTKMutePressKey = flashConfig [RTKMutePressKey_INDEX ];
267+ RTKMuteDoublePressKeyType = flashConfig [RTKMuteDoublePressKeyType_INDEX ];
268+ RTKMuteDoublePressKeyModifier = flashConfig [RTKMuteDoublePressKeyModifier_INDEX ];
269+ RTKMuteDoublePressKey = flashConfig [RTKMuteDoublePressKey_INDEX ];
270+ RTKDisplayPressKeyType = flashConfig [RTKDisplayPressKeyType_INDEX ];
271+ RTKDisplayPressKeyModifier = flashConfig [RTKDisplayPressKeyModifier_INDEX ];
272+ RTKDisplayPressKey = flashConfig [RTKDisplayPressKey_INDEX ];
273+ RTKDisplayDoublePressKeyType = flashConfig [RTKDisplayDoublePressKeyType_INDEX ];
274+ RTKDisplayDoublePressKeyModifier = flashConfig [RTKDisplayDoublePressKeyModifier_INDEX ];
275+ RTKDisplayDoublePressKey = flashConfig [RTKDisplayDoublePressKey_INDEX ];
276+
277+ fullSensitivity = flashConfig [fullSensitivity_INDEX ];
278+ fullRightPressKeyType = flashConfig [fullRightPressKeyType_INDEX ];
279+ fullRightPressKeyModifier = flashConfig [fullRightPressKeyModifier_INDEX ];
280+ fullRightPressKey = flashConfig [fullRightPressKey_INDEX ];
281+ fullRightLongPressKeyType = flashConfig [fullRightLongPressKeyType_INDEX ];
282+ fullRightLongPressKeyModifier = flashConfig [fullRightLongPressKeyModifier_INDEX ];
283+ fullRightLongPressKey = flashConfig [fullRightLongPressKey_INDEX ];
284+ fullLeftPressKeyType = flashConfig [fullLeftPressKeyType_INDEX ];
285+ fullLeftPressKeyModifier = flashConfig [fullLeftPressKeyModifier_INDEX ];
286+ fullLeftPressKey = flashConfig [fullLeftPressKey_INDEX ];
287+ fullLeftLongPressKeyType = flashConfig [fullLeftLongPressKeyType_INDEX ];
288+ fullLeftLongPressKeyModifier = flashConfig [fullLeftLongPressKeyModifier_INDEX ];
289+ fullLeftLongPressKey = flashConfig [fullLeftLongPressKey_INDEX ];
290+ fullScrollUpKeyType = flashConfig [fullScrollUpKeyType_INDEX ];
291+ fullScrollUpKeyModifier = flashConfig [fullScrollUpKeyModifier_INDEX ];
292+ fullScrollUpKey = flashConfig [fullScrollUpKey_INDEX ];
293+ fullScrollDownKeyType = flashConfig [fullScrollDownKeyType_INDEX ];
294+ fullScrollDownKeyModifier = flashConfig [fullScrollDownKeyModifier_INDEX ];
295+ fullScrollDownKey = flashConfig [fullScrollDownKey_INDEX ];
296+ fullSignalPressKeyType = flashConfig [fullSignalPressKeyType_INDEX ];
297+ fullSignalPressKeyModifier = flashConfig [fullSignalPressKeyModifier_INDEX ];
298+ fullSignalPressKey = flashConfig [fullSignalPressKey_INDEX ];
299+ fullSignalLongPressKeyType = flashConfig [fullSignalLongPressKeyType_INDEX ];
300+ fullSignalLongPressKeyModifier = flashConfig [fullSignalLongPressKeyModifier_INDEX ];
301+ fullSignalLongPressKey = flashConfig [fullSignalLongPressKey_INDEX ];
304302 }
305303
306304 @ Override
0 commit comments