Lucky Luke, please direct your messages to use...@jna.dev.java.net.
On Mar 18, 2008, at 9:25 AM, LUCKY LUCKE wrote:
Then i modified the System.out......(newByte[j]+" ") so as to be
System.out........((char)newByte[j]+" ") and got
x ? x ?
which is the same as the output of the Native.toString(newByte) thus
meaning that x equals 120, = 1 or 2, and ? = -5.
Sometimes i have the solution before my eyes, however im not able to
just see it.
Try "man ascii" on a linux box to see character mappings for the ASCII
set.
I still have crashes every time i try to write to the card. Is '\n'
identifying the end of a string am i right?
Native strings are terminated with '\0' (a zero byte). '\n' is a
newline. I don't know what your native library is expecting as a
terminating character; it may be expecting \n between multiple
commands, or some zany C programmer may have decided that '\n' was a
better terminator than '\0'.
JNA automatically appends a zero byte to any String converted to a
native string.