Hello technical team, I am working with slim2s. I got raw image data from Sim2s device but I do not know way to convert this raw image data to bmp image.
Thank you for your support.
I used command to get raw image data.
unsigned char buf[64];
buf[0] = 0x02;
buf[1] = 0x02;
buf[2] = 0x0a;
buf[3] = 0x00;
buf[4] = 0x01;
hid_write(handle, buf, 64);
int res = hid_read_timeout(handle, buf, sizeof(buf),5000);
Hieunt
Hello technical team, I am working with slim2s. I got raw image data from Sim2s device but I do not know way to convert this raw image data to bmp image.
Thank you for your support.
I used command to get raw image data.
unsigned char buf[64];
buf[0] = 0x02;
buf[1] = 0x02;
buf[2] = 0x0a;
buf[3] = 0x00;
buf[4] = 0x01;
hid_write(handle, buf, 64);
int res = hid_read_timeout(handle, buf, sizeof(buf),5000);
if(res <=0)
{
printf("\nUnenable read");
goto _finished;
return -1;
}
else
{
memset(tmp,0,sizeof(tmp));
for(int i=0; i<res ; i++)
{
//sprintf(tmp + i*3,"%02hhx ",buf[i]);
printf("%.2X ",buf[i]);
}
printf("\nTmp: %s",tmp);
printf("\n");
}
printf("\nCapture ((spac_hid_std*)buf)->report.pac.s3_err = %d\n", ((spac_hid_std*)buf)->report.pac.s3_err);
if(((spac_hid_std*)buf)->report.pac.s3_err != 0)
{
printf("Capture Fail/Error: %d", ((spac_hid_std*)buf)->report.pac.s3_err);
//goto _finished;
return -1;
}
memset(buf,0x00,64);
buf[0] = 0x02;
buf[1] = 0x01;
buf[2] = 0x06;
buf[3] = 0x00;
buf[4] = 0x11;
buf[10] = 0xf4;
hid_write(handle, buf, 64);
res = hid_read_timeout(handle, buf, sizeof(buf),5000);
printf("\nRes: %d", res);
printf("\n");
if(res <=0)
{
printf("\nUnenable read");
goto _finished;
return -1;
}