I need to know how to convert this function so that I can send hex or decimal, so that STM receives it as a frame. Ready bt terminal from the android store after sending the hex number does it correct and the plate responds, but I would like to do it in my application.
private void sendData(String message) {
byte[] msgBuffer = message.getBytes();
try {
outStream.write(msgBuffer);
System.out.println(msgBuffer);
} catch (IOException e) {
String msg = "Nie udało się wysłać danych" + e.getMessage();
errorExit("Fatal Error", msg);
}
}
After printing those bytes in the console, it gets something like the following string, so probably why it doesn't work if it converts it to bytes?
[B@a560d15