Tool/software: TI C/C++ Compiler
Hello
I have saved two files with High speed pro , one is the CSV used for comparisson and one in the bin file (I am attaching the two). Both contain the same captured data.
The following java code reads the bin file intu 16bit integers (shorts) , using LITTLE_ENDIAN byte order
path = Paths.get(file.getAbsolutePath());
inStream = Files.newInputStream(path, StandardOpenOption.READ);
buffer = new BufferedInputStream(inStream);
while (buffer.available() != 0) {
byte[] num = new byte[2];
int sig1=0
buffer.read(num);
sig1 = ((short) (ByteBuffer.wrap(num).order(ByteOrder.LITTLE_ENDIAN).get() & 0xffff))
System.out.println(sig1);
}
The code works fine up to the point that the number are in the range of (-127 , 127). For other numbers it produces wrong results compared to the CSV.
Any ides how to sove this.
Thanks,
Yaron
https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/73/8836.data.7z