I have a litte problem to convert a hexadecimal value to the correct char value. So i had run a wireshark and everytime a catched a hexadecimal value. The value was this (in wireshark the raw data ).
00383700177a0102081c42000000000000018fffffff7f030201000a080000000000000000184802000007080444544235508001000002080104
So now i trying to send the same command to the device. I used this code to convert the hex to ascii
String hex4 = "00383700177a0102081c42000000000000018FFFFFFF7F030201000a080000000000000000184802000007080444544235508001000002080104";
StringBuilder output4 = new StringBuilder();
for (int i =0; i< hex4.length(); i +=2){
String str4 = hex4.substring(i, i+2);
System.out.println(str4);
output4.append((char)Integer.parseInt(str4, 16));
}
bw3.write(output4.toString());
log.info(output4.toString());
bw3.flush();
But the problem now is .. when i catch my own sended data in a wireshark i get this :
00383700177a0102081c4200000000000001c28fc3bfc3bfc3bf7f030201000a08000000000000000018480200000708044454423550c2800100
For some reasen my code send the 8f and ff data wrong ..
Can you help me to fix thing issue ? Thanks !