2011-05-17 10:48 PM
I'm trying to acces the FW Version & BufferUsage information of iNEMO .
Please have a look at attached .cpp file (works for streaming data from iNEMO) .
The BufferUsage function is very important for me since, I'm going to use iNEMO in Visual studio VC+ MFC environment.
( It would have been good if DLL generates a message & gives a single frame of data to application )
I also would like to know, when program running if I Reset ( SW1) the iNEMO, I can see no data coming. How to know that the device has been Reset ?
Thanks
#inemo #visual-studio #inemo-sdk-visual-studio #sdk2011-05-23 02:32 AM
Hi Hanirath,
The SDK has been conceived to work with the board only from software side, without interacting with the hardware.
This means that the SDK is not able to detect a HW Reset on the board, and if occurs after you need to disconnect and reconnect the board via software.
(Only V2 allow
SW reset functionality with command: INEMO2_CMD_RESET_BOARD)
Here below, some suggestions for .ccp file:
Regarding the Get version it is better something like:
char sVersion[256];
int iSize = 256;
memset(sVersion, 0, 256);
INEMO_SDK_GetVersion = (DLLPROC_GFWV)GetProcAddress(hinstDLL,'' INEMO_SDK_GetVersion'');
if (INEMO_SDK_GetVersion != NULL)
iNEMO_Return = INEMO_SDK_GetVersion(sVersion, &iSize);
if(iNEMO_Return==0)
printf(''\n iNEMO Firmware: %s '',sVersion);
Regarding the get Sample function, please check the return value of INEMO_SDK_GetSampleFunction before use the values in the frame structure:
iNEMO_Return = INEMO_SDK_GetSampleFunction(&frame);
if (iNEMO_Return == INEMO_ERROR_NONE)
{
printf(''\n T:%5d'',frame.TimeStamp);
printf('' Ac:%5d %5d %5d '',frame.Accelometer.X,frame.Accelometer.Y,frame.Accelometer.Z);
printf('' Gy:%5d %5d %5d '',frame.Gyroscope.X,frame.Gyroscope.Y1,frame.Gyroscope.Y2,frame.Gyroscope.Z);
printf('' Mg:%5d %5d %5d'',frame.Magnetic.X,frame.Magnetic.Y,frame.Magnetic.Z);
}
Best Regards
iNEMOâ„¢ Team2011-05-23 07:22 PM
Hi Fabio,
Regarding the get FW version info , I tried what you said ,though it is not very important for me, but it returns iNEMO_Return :1.
I would like to know one thing regarding get sample function.
when it succeeds (iNEMO_Return =0) , do we have complete frame data ? or incomplete(partially complete) frame ?
Because the INEMO_SDK_GetBufferUsage function gives only percentage of filled FIFO, we cannot depend on this to check if there is enough data(one complete frame) to read the FIFO buffer.
Thanks
Harinath
2011-05-26 01:15 AM
Hi Harinath,
Below some suggestions:
1)
Check the .h for error code meaning.
2)
Yes, only when the function return INEMO_ERROR_NONE the data is valid (else skip it)
3)
The GetBufferUsage function is only a test function. If the value grows it means that your application is not enough fast to read all data from the device.
Bye
iNEMOâ„¢ Team