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