質問

I'm programming some code with the mentioned library in JAVA. The problem is that, because the buffer receibed could be of variable long, as limit 512 bytes, when it is long enough I received the message fragmented. I thought that the serial event activated with the arrived of the first character, and when the program take the buffer it's not complete. In others language, there is a way to say to the library that only activate that event when specifics characters arrived, There is something like this in the metioned library? Thanks.-

役に立ちましたか?

解決

No, there is no such functionality in RXTX. You will have to code it yourself by polling bytes from the buffer and re-assembling your message.

Note that this is not a limitation of the library but the way RS-232 works: Single bytes are transmitted without any notion of higher-level context; it's only Layer 1.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top