Home AMX User Forum Duet/Cafe Duet

sending hex to rs232 device

was trying to create a simple duet module but encounter this problem, how do i send hex from java to the device? please advice.

Thanks in advance
Alex

Comments

  • sonnysonny Posts: 208
    I'm assuming you mean you need to send binary data, as opposed to ASCII data,

    depends on how you need/want to build the packet, but I use a string buffer...

    StringBuffer packet = new StringBuffer();

    packet.append((char) 0x01);
    packet.append((char) 0x2B);
    packet.append((char) 0x0D);
    packet.append((char) 0x0A);

    // etc...then

    dv.sendString(packet.toString());

    you could also use a character array
  • alexhoalexho Posts: 7
    Hi sonny,

    thanks the above reply is of great help to me.
    thanks alot

    Alex
Sign In or Register to comment.