Related to this crash on Huawei Watch GT:
nodomain.freeyourgadget.gadgetbridge.devices.huawei.HuaweiPacket$MissingTagException: Missing tag: 6
at nodomain.freeyourgadget.gadgetbridge.devices.huawei.HuaweiTLV.getBytes(HuaweiTLV.java:219)
at nodomain.freeyourgadget.gadgetbridge.devices.huawei.HuaweiTLV.getString(HuaweiTLV.java:239)
at nodomain.freeyourgadget.gadgetbridge.devices.huawei.packets.Watchface$WatchfaceParams$Response.parseTlv(Watchface.java:125)
at nodomain.freeyourgadget.gadgetbridge.service.devices.huawei.requests.Request.handleResponse(Request.java:243)
at nodomain.freeyourgadget.gadgetbridge.service.devices.huawei.ResponseManager.handleData(ResponseManager.java:131)
at nodomain.freeyourgadget.gadgetbridge.service.devices.huawei.HuaweiSupportProvider.onCharacteristicChanged(HuaweiSupportProvider.java:875)
at nodomain.freeyourgadget.gadgetbridge.service.devices.huawei.HuaweiLESupport.onCharacteristicChanged(HuaweiLESupport.java:80)
at nodomain.freeyourgadget.gadgetbridge.service.btle.BtLEQueue$InternalGattCallback.onCharacteristicChanged(BtLEQueue.java:679)
at android.bluetooth.BluetoothGattCallback.onCharacteristicChanged(BluetoothGattCallback.java:194)
at android.bluetooth.BluetoothGatt$1$8.run(BluetoothGatt.java:581)
at android.bluetooth.BluetoothGatt.runOrQueueCallback(BluetoothGatt.java:948)
at android.bluetooth.BluetoothGatt.-$$Nest$mrunOrQueueCallback(Unknown Source:0)
at android.bluetooth.BluetoothGatt$1.onNotify(BluetoothGatt.java:575)
at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:329)
at android.os.Binder.execTransactInternal(Binder.java:1299)
at android.os.Binder.execTransact(Binder.java:1253)
Parse the error code and throw an exception instead of doing strange
things due to invalid step ID being used.
To investigate issue #4061.
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
- Also the sunrise/set cannot be zero
- We could send a single forecast more when exactly 7 are provided
- It seems like the watches may require exactly 8 days to be sent for
the forecast - one of which is for today
* Watch 3 reports some values as integer, while internal buffer
now uses short values. Actually all values here fits in short
so just cut leading zeros now. Addin exception for case cutted
values was non zeros
* replaced fileType with fileId which recived on incoming data
in 28 03 FileHashSend.Response
* width/height in WatchfaceDeviceParams could be int or short
(int is present on Watch 3, short is all other tested devices)
* use in 27 05 WatchfaceConfirm.Request data recieved in previous
WatchfaceConfirm.Response
* there are newer watchface files, which need to unpack inner
com.huawei.watchface as zip file and install watchface.bin
* also some description.xml has BOM which cause issue parsing as xml