Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static byte getCheckValue(int i, int j, int k, int l, int i1, int j1)
- {
- int k1 = 255 + (i + (j + (k + (l + (j1 + i1)))));
- if (k1 != 0);
- int l1 = k1 % 255;
- if (l1 == 0)
- {
- l1 = 255;
- }
- return (byte)l1;
- }
- public static void main(String args[])
- {
- Protocol protocol;
- byte abyte0[];
- String s;
- int i;
- protocol = new Protocol();
- protocol.setProduct(0);
- protocol.setProduct_mode(0);
- protocol.setStatic_dynamic(1);
- protocol.setSwith_on(1);
- protocol.setBar_no(50);
- protocol.setColorRGB(255, 6, 32);
- protocol.setSpeed(0);
- protocol.setPause(0);
- protocol.setDynamic_mode(0);
- protocol.setDynamic_effect(0);
- protocol.setController(0);
- protocol.setRGB_sort(0);
- protocol.setIC_number(0);
- protocol.setCurCheckValue(50, 255, 6, 32, 1, 0);
- protocol.setAll();
- abyte0 = protocol.getAll();
- s = "";
- i = 0;
- _L3:
- if (i < 20) goto _L2; else goto _L1
- _L1:
- byte abyte1[];
- String s1;
- int j;
- System.out.println((new StringBuilder("###########:")).append(s).toString());
- protocol.exchangeBytes();
- abyte1 = protocol.getAll();
- s1 = "";
- j = 0;
- _L4:
- if (j >= 20)
- {
- System.out.println((new StringBuilder("###########:")).append(s1).toString());
- return;
- }
- break MISSING_BLOCK_LABEL_224;
- _L2:
- s = (new StringBuilder(String.valueOf(s))).append(protocol.printHexString(abyte0[i])).append("*").toString();
- i++;
- goto _L3
- s1 = (new StringBuilder(String.valueOf(s1))).append(protocol.printHexString(abyte1[j])).append("*").toString();
- j++;
- goto _L4
- }
- public static byte[] shortToByteArray(short word0)
- {
- byte abyte0[] = new byte[2];
- int i = 0;
- do
- {
- if (i >= 2)
- {
- return abyte0;
- }
- abyte0[i] = (byte)(0xff & word0 >>> 8 * ((-1 + abyte0.length) - i));
- i++;
- } while (true);
- }
- public void exchangeBytes()
- {
- int ai[] = new int[2];
- int i = 2;
- do
- {
- if (i >= 11)
- {
- return;
- }
- ai[0] = all[i];
- ai[1] = all[21 - i];
- exchangeInt(ai);
- all[i] = (byte)ai[0];
- all[21 - i] = (byte)ai[1];
- i++;
- } while (true);
- }
- public byte[] getAll()
- {
- return all;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement