0

I am a student and as a project I'm developing some software to talk to a CAN that would read from that can through a serial over USB interface. I'm confused on what occurs when I receive these bytes. I'm receiving them in -127-128 format and then converting them to an int via the java operator & 0xFF.

From there, what is going on with these bytes? I want to be able to find the STX and ETX as well as the data in the packets I'm receiving. How do I do that? I can find these byte's integer values and that is about it. I'm receiving this data through JSSC's readBytes into a byte[].

The STX is 0x02, where do I find that and how in my byte array? I'm only receiving integers.

Am I doing something completely wrong on the receiving end, or is this data serialized and I don't know anything about it?

Please forgive my newbyness. I'm just trying to learn how to RX and TX to a CAN.

Thanks

branmg
  • 1
  • 1
    Your question is very general. If you have a problem on an elementary level maybe better to check in a text book first. You should try to keep your questions more precise. Also, it won't hurt if you throw in some code as well. – PiotrWolkowski Jul 03 '14 at 22:24
  • What is "-127-128 format"? – Swanand Jul 09 '14 at 18:39

0 Answers0