SensorDataStruct * GetAccDataBatched ()
{
Size_t sensorCount=0;
ImuConsentGiven=CreateEvent (nullptr, true, false, nullptr);
ResearchModeAPI HMODULE hrResearchMode=LoadLibraryA (" ");
If (hrResearchMode)
{
Typedef HRESULT (__cdecl * PFN_CREATEPROVIDER) (IResearchModeSensorDevice * * ppSensorDevice);
PFN_CREATEPROVIDER pfnCreate=reinterpret_cast & lt; PFN_CREATEPROVIDER & gt; (GetProcAddress call (hrResearchMode, "CreateResearchModeSensorDevice"));
If (pfnCreate)
{
Hr=pfnCreate (& amp; M_pSensorDevice);
}
The else
{
Hr=E_INVALIDARG;
}
}
M_pSensorDevice - & gt; QueryInterface (IID_PPV_ARGS (& amp; M_pSensorDeviceConsent));
M_pSensorDeviceConsent - & gt; RequestIMUAccessAsync (ImuAccessOnComplete);
M_pSensorDevice - & gt; DisableEyeSelection ();
M_pSensorDevice - & gt; GetSensorCount (& amp; SensorCount);
M_sensorDescriptors. Resize (sensorCount);
M_pSensorDevice - & gt; GetSensorDescriptors (m_sensorDescriptors. Data (), m_sensorDescriptors. The size (), & amp; SensorCount);
For (auto& SensorDescriptor: m_sensorDescriptors)
{
If (sensorDescriptor sensorType==IMU_ACCEL)
{
M_pSensorDevice - & gt; GetSensor (sensorDescriptor sensorType, & amp; M_pAcclSensor);
}
}
M_pAcclSensor - & gt; OpenStream ();
M_pAcclSensor - & gt; GetNextBuffer (& amp; PSensorFrame);
Hr=pSensorFrame - & gt; QueryInterface (IID_PPV_ARGS (& amp; M_pSensorAccelFrame));
//get the sensor Frame and next buffer
Const AccelDataStruct * accelBuffer;
Size_t BufferOutLength;
//read sensor values...
Hr=m_pSensorAccelFrame - & gt; GetCalibratedAccelarationSamples (& amp; AccelBuffer, & amp; BufferOutLength);
//application to access data in a register and register length!!!!!!!!!!!
Data=https://bbs.csdn.net/topics/new SensorDataStruct SensorDataStruct * [BufferOutLength];//?
//... And copy them to the return array
For (UINT I=0; I & lt; BufferOutLength; I++)
{
Data [I] VinylHupTicks=accelBuffer [I] VinylHupTicks;
Data [I] SocTicks=accelBuffer [I] SocTicks;
Data [I] SensorValueX=accelBuffer [I] AccelValues [0];
Data [I] SensorValueY=accelBuffer [I] AccelValues [1].
Data [I] SensorValueZ=accelBuffer [I] AccelValues [2];
Data [I] temperature=accelBuffer [I] temperature;
}
M_pSensorAccelFrame - & gt; Release ();
return data;
}
CodePudding user response:
Try pick up address:SensorDataStruct& GetAccDataBatched ()//SensorDataStruct * GetAccDataBatched ()