Thanks again Inflex.
Unfortunately the frame.data file size is 0. I haven't touched c in about 20 years but I think the buf85 object isn't being written to the file for some reason.
This is what I added into flir8p1.c
uint32_t StatusSize = buf85[20] + (buf85[21] << 8) + (buf85[22] << 16) + (buf85[23] << 24);
printf("FrameSize= %d (+28=%d), ThermalSize %d, JPG %d, StatusSize %d, Pointer %d\n",FrameSize,FrameSize+28, ThermalSize, JpgSize,StatusSize,buf85pointer);
if ( (FrameSize+28) > (buf85pointer) )
{
// wait for next chunk
return;
}
// Write a framsize block of code to a file called frame.data
//
{
int fo;
fo = open("frame.data", O_CREAT, O_WRONLY);
if (fo) {
printf("Frame size is: %d\n", FrameSize);
printf("Buffer is: %d\n", buf85);
write(fo, buf85, FrameSize );
close(fo);
}
}
int i,v;
// get a full frame, first print the status
t1=t2;
and this is what I got out
Frame size is: 80412
Buffer is: 148308
FrameSize= 80540 (+28=80568), ThermalSize 10332, JPG 70040, StatusSize 168, Pointer 28
FrameSize= 80540 (+28=80568), ThermalSize 10332, JPG 70040, StatusSize 168, Pointer 10360
FrameSize= 80540 (+28=80568), ThermalSize 10332, JPG 70040, StatusSize 168, Pointer 80568
Frame size is: 80540
Buffer is: 148308
FrameSize= 80683 (+28=80711), ThermalSize 10332, JPG 70184, StatusSize 167, Pointer 28
FrameSize= 80683 (+28=80711), ThermalSize 10332, JPG 70184, StatusSize 167, Pointer 10360
FrameSize= 80683 (+28=80711), ThermalSize 10332, JPG 70184, StatusSize 167, Pointer 80711
Frame size is: 80683
Buffer is: 148308
FrameSize= 80484 (+28=80512), ThermalSize 10332, JPG 69984, StatusSize 168, Pointer 28
FrameSize= 80484 (+28=80512), ThermalSize 10332, JPG 69984, StatusSize 168, Pointer 10360
^C
root@raspberrypi:/home/pi/temp/flir8p1-gpl# ls -lrt frame.data
---------x 1 root root 0 May 16 12:45 frame.data