-
Notifications
You must be signed in to change notification settings - Fork 7
Change mode Original Code (Java)
Mich edited this page Jul 31, 2022
·
2 revisions
List of light mode "paramInt1":
int modes = new int[]{37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
97, 98, 99}Speed is paramInt2 and need to be edited with bitwise operation (AND -> &). Here the code:
if (paramInt1 < 0 || paramInt1 >= this.Mods.length)
return;
this.modId = paramInt1;
byte[] arrayOfByte = new byte[4];
arrayOfByte[0] = (byte)-69;
arrayOfByte[1] = (byte)this.Mods[paramInt1];
byte b = (byte)(paramInt2 & 0xFF);
arrayOfByte[2] = b;
arrayOfByte[3] = (byte)68;
this.cachecmd = arrayOfByte;
writeCharacteristic("0000ffd5-0000-1000-8000-00805f9b34fb", "0000ffd9-0000-1000-8000-00805f9b34fb", arrayOfByte);
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("setMod Speed=");
stringBuilder.append(paramInt2);
stringBuilder.append(" mod=");
stringBuilder.append(this.Mods[paramInt1]);
Log.e("setMod", stringBuilder.toString());
synTimedata(this.Mods[paramInt1], b, (byte)0, (byte)0, (byte)0, (byte)0);