修复连续采集时没有时间间隔导致通讯失败从而导致无有法正常连续采集的问题 修改如下
This commit is contained in:
60
myis11/src/is11/IS11_INST.cpp
Normal file
60
myis11/src/is11/IS11_INST.cpp
Normal file
@ -0,0 +1,60 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : IS11_INST.cpp
|
||||
* @author : xin
|
||||
* @brief : None
|
||||
* @attention : None
|
||||
* @date : 2024/8/14
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
//
|
||||
// Created by xin on 2024/8/14.
|
||||
//
|
||||
#include "SensorIS11.h"
|
||||
#include "IS11_INST.h"
|
||||
#include "iostream"
|
||||
#include "cstring"
|
||||
|
||||
SensorIS11 *thissensorIS11;
|
||||
int IS11SensorInit()
|
||||
{
|
||||
std::cout<< "IS11SensorInit" << std::endl;
|
||||
thissensorIS11 = new SensorIS11();
|
||||
thissensorIS11->initSensor(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void Set_Serial_FUN(SERIALWRITE writefunc,SERIALWRITE readfunc)
|
||||
{
|
||||
InitFunction(writefunc,readfunc);
|
||||
}
|
||||
|
||||
STRsensorinfo_C Get_SensorInfo() {
|
||||
STRSensorInfo sensorinfo= thissensorIS11->SensorInfo;
|
||||
STRsensorinfo_C sensorinfo_c;
|
||||
//把sensorname 拷贝到sensorinfo_c
|
||||
strcpy_s(sensorinfo_c.SensorName,sensorinfo.SensorName.c_str());
|
||||
sensorinfo_c.BandNum = sensorinfo.BandNum;
|
||||
sensorinfo_c.maxValue = sensorinfo.maxValue;
|
||||
strcpy_s(sensorinfo_c.serialnumber,sensorinfo.serialnumber.c_str());
|
||||
sensorinfo_c.a1 = sensorinfo.a1;
|
||||
sensorinfo_c.a2 = sensorinfo.a2;
|
||||
sensorinfo_c.a3 = sensorinfo.a3;
|
||||
sensorinfo_c.a4 = sensorinfo.a4;
|
||||
sensorinfo_c.issensorinit= sensorinfo.isSensorInit;
|
||||
return sensorinfo_c;
|
||||
|
||||
|
||||
}
|
||||
|
||||
int IS11OptSnenser(int percent) {
|
||||
return thissensorIS11->OptSnenser(percent);
|
||||
}
|
||||
|
||||
int IS11GetData(uint16_t *outdata, int shuttertime) {
|
||||
thissensorIS11->GetOneDate(shuttertime);
|
||||
memcpy(outdata,thissensorIS11->DATABUFF, sizeof(int16_t)*thissensorIS11->SensorInfo.BandNum);
|
||||
return thissensorIS11->SensorInfo.BandNum;
|
||||
|
||||
}
|
Reference in New Issue
Block a user