添加项目文件。
This commit is contained in:
+70
@@ -0,0 +1,70 @@
|
||||
@echo off
|
||||
setlocal EnableExtensions
|
||||
rem ===========================================================================
|
||||
rem 用 MinGW (g++) 编译 ARIS 桥接 DLL:aris_bridge.dll
|
||||
rem
|
||||
rem 为什么要它:
|
||||
rem 厂商的 libaris.dll 是 GCC 编的 C++ 库(GCC 名字修饰 + std::string/vector
|
||||
rem 接口 + 要求继承 SpectrometerCallback),MSVC 程序无法直接调用。
|
||||
rem 本脚本把它包成纯 C 接口(见 src\aris_bridge.h),MSVC 主程序用
|
||||
rem LoadLibrary 调用即可。
|
||||
rem
|
||||
rem 依赖:Strawberry Perl 自带的 MinGW g++ 8.3(本机已具备)
|
||||
rem third_party\aris-bridge\vendor\libaris.dll(厂商原件)
|
||||
rem third_party\aris\include(SDK 头文件)
|
||||
rem third_party\libusb-1.0\include(libusb 头文件)
|
||||
rem
|
||||
rem 产物:third_party\aris-bridge\bin\aris_bridge.dll
|
||||
rem third_party\aris-bridge\lib\libaris.a(libaris.dll 的导入库)
|
||||
rem ===========================================================================
|
||||
|
||||
set "GPP=C:\Strawberry\c\bin\g++.exe"
|
||||
set "GENDEF=C:\Strawberry\c\bin\gendef.exe"
|
||||
set "DLLTOOL=C:\Strawberry\c\bin\dlltool.exe"
|
||||
|
||||
rem 工程根目录 = 本脚本所在目录的上一级的上一级
|
||||
pushd "%~dp0..\.."
|
||||
set "ROOT=%CD%"
|
||||
popd
|
||||
|
||||
set "BRIDGE=%ROOT%\third_party\aris-bridge"
|
||||
set "SRC=%BRIDGE%\src"
|
||||
set "OUT=%BRIDGE%\bin"
|
||||
set "IMPLIB=%BRIDGE%\lib"
|
||||
set "VENDOR=%BRIDGE%\vendor\libaris.dll"
|
||||
|
||||
if not exist "%GPP%" (
|
||||
echo [ERR] 找不到 MinGW g++: %GPP%
|
||||
echo 本机可用 Strawberry Perl 自带的 g++,或安装 MinGW-w64 后修改本脚本。
|
||||
exit /b 1
|
||||
)
|
||||
if not exist "%VENDOR%" (
|
||||
echo [ERR] 找不到厂商库: %VENDOR%
|
||||
echo 请把厂商提供的 libaris.dll 放到 third_party\aris-bridge\vendor\
|
||||
exit /b 1
|
||||
)
|
||||
if not exist "%SRC%\aris_bridge.cpp" (
|
||||
echo [ERR] 找不到桥接源码: %SRC%\aris_bridge.cpp
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
if not exist "%OUT%" mkdir "%OUT%"
|
||||
if not exist "%IMPLIB%" mkdir "%IMPLIB%"
|
||||
|
||||
echo === 1/3 生成导入库 libaris.a ===
|
||||
pushd "%IMPLIB%"
|
||||
"%GENDEF%" "%VENDOR%" >nul
|
||||
if errorlevel 1 (echo [ERR] gendef 失败 & popd & exit /b 1)
|
||||
"%DLLTOOL%" -d libaris.def -l libaris.a -D libaris.dll
|
||||
if errorlevel 1 (echo [ERR] dlltool 失败 & popd & exit /b 1)
|
||||
popd
|
||||
|
||||
echo === 2/3 编译 aris_bridge.dll ===
|
||||
"%GPP%" -std=c++17 -O2 -shared -o "%OUT%\aris_bridge.dll" ^
|
||||
"%SRC%\aris_bridge.cpp" "%IMPLIB%\libaris.a" ^
|
||||
-I"%SRC%" -I"%ROOT%\third_party\aris\include" -I"%ROOT%\third_party\libusb-1.0\include"
|
||||
if errorlevel 1 (echo [ERR] 编译失败 & exit /b 1)
|
||||
|
||||
echo === 3/3 完成 ===
|
||||
dir /b "%OUT%"
|
||||
exit /b 0
|
||||
BIN
Binary file not shown.
+73
@@ -0,0 +1,73 @@
|
||||
;
|
||||
; Definition file of libaris.dll
|
||||
; Automatic generated by gendef
|
||||
; written by Kai Tietz 2008
|
||||
;
|
||||
LIBRARY "libaris.dll"
|
||||
EXPORTS
|
||||
_ZN15ZioLinkProtocol10TARGET_PIDE DATA
|
||||
_ZN15ZioLinkProtocol10TARGET_VIDE DATA
|
||||
_ZN15ZioLinkProtocol13connectDeviceEv
|
||||
_ZN15ZioLinkProtocol14getTriggerModeEi
|
||||
_ZN15ZioLinkProtocol14setTriggerModeE11TriggerMode
|
||||
_ZN15ZioLinkProtocol15setSubtractDarkEbi
|
||||
_ZN15ZioLinkProtocol15stopMeasurementEv
|
||||
_ZN15ZioLinkProtocol16disconnectDeviceEv
|
||||
_ZN15ZioLinkProtocol16startMeasurementEP20SpectrometerCallbackiiii
|
||||
_ZN15ZioLinkProtocol16takeDarkSpectrumEiii
|
||||
_ZN15ZioLinkProtocol17setExposureParamsEiii
|
||||
_ZN15ZioLinkProtocol20checkStatusAndNotifyEP20SpectrometerCallbackiNSt6chrono10time_pointINS2_3_V212steady_clockENS2_8durationIxSt5ratioILx1ELx1000000000EEEEEENS3_INS4_12system_clockES9_EEii
|
||||
_ZN15ZioLinkProtocol21startBatchMeasurementEP20SpectrometerCallbackiiii
|
||||
_ZN15ZioLinkProtocol21stopDeviceMeasurementEi
|
||||
_ZN15ZioLinkProtocol9getDeviceEi
|
||||
_ZN15ZioLinkProtocolC1Ev
|
||||
_ZN15ZioLinkProtocolC2Ev
|
||||
_ZN15ZioLinkProtocolD1Ev
|
||||
_ZN15ZioLinkProtocolD2Ev
|
||||
_ZN18SpectrometerDevice10disconnectEv
|
||||
_ZN18SpectrometerDevice10initializeEv
|
||||
_ZN18SpectrometerDevice11getEndPixelEv
|
||||
_ZN18SpectrometerDevice11getSpectrumERjS0_
|
||||
_ZN18SpectrometerDevice11getSpectrumERjS0_S0_S0_
|
||||
_ZN18SpectrometerDevice11getSpectrumEv
|
||||
_ZN18SpectrometerDevice11stopMeasureEv
|
||||
_ZN18SpectrometerDevice12readBulkDataEy
|
||||
_ZN18SpectrometerDevice12startMeasureEi
|
||||
_ZN18SpectrometerDevice12startMeasureEv
|
||||
_ZN18SpectrometerDevice13getPixelCountEv
|
||||
_ZN18SpectrometerDevice13getStartPixelEv
|
||||
_ZN18SpectrometerDevice13getStatusInfoEv
|
||||
_ZN18SpectrometerDevice13getWavelengthEv
|
||||
_ZN18SpectrometerDevice14cancelExposureEv
|
||||
_ZN18SpectrometerDevice14getTriggerModeEv
|
||||
_ZN18SpectrometerDevice14setDelayParamsEi
|
||||
_ZN18SpectrometerDevice14setTriggerModeE11TriggerMode
|
||||
_ZN18SpectrometerDevice15discardSpectrumEv
|
||||
_ZN18SpectrometerDevice15getSerialNumberB5cxx11Ev
|
||||
_ZN18SpectrometerDevice15setSubtractDarkEb
|
||||
_ZN18SpectrometerDevice16takeDarkSpectrumEv
|
||||
_ZN18SpectrometerDevice17setExposureParamsEii
|
||||
_ZN18SpectrometerDevice18getAllSpectrumDataEv
|
||||
_ZN18SpectrometerDevice18sendReceiveMessageEj
|
||||
_ZN18SpectrometerDevice18sendReceiveMessageEjRKSt6vectorIhSaIhEE
|
||||
_ZN18SpectrometerDevice18sendReceiveMessageEjj
|
||||
_ZN18SpectrometerDevice18updateTimeInDeviceEv
|
||||
_ZN18SpectrometerDevice19readSoftwareVersionEv
|
||||
_ZN18SpectrometerDevice21setFreeRunningTriggerEv
|
||||
_ZN18SpectrometerDevice22generateRandomFilenameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_
|
||||
_ZN18SpectrometerDevice22sendBulkReceiveMessageERKSt6vectorIhSaIhEE
|
||||
_ZN18SpectrometerDevice25readWavelengthsFromDeviceEv
|
||||
_ZN18SpectrometerDevice26ensureIdleForConfigurationEv
|
||||
_ZN18SpectrometerDevice28setHardwareRisingEdgeTriggerEv
|
||||
_ZN18SpectrometerDevice34saveSpectrumWithDarkSubtractionCSVERKSt6vectorIfSaIfEE
|
||||
_ZN18SpectrometerDevice7setGainEi
|
||||
_ZN18SpectrometerDevice7standByEv
|
||||
_ZN18SpectrometerDevice9getStatusEv
|
||||
_ZN18SpectrometerDeviceC1ESt10unique_ptrI15LibusbInterfaceSt14default_deleteIS1_EE
|
||||
_ZN18SpectrometerDeviceC2ESt10unique_ptrI15LibusbInterfaceSt14default_deleteIS1_EE
|
||||
_ZN4ArisC1Ev
|
||||
_ZN4ArisC2Ev
|
||||
_ZNK15ZioLinkProtocol23getConnectedDeviceCountEv
|
||||
_ZNK18SpectrometerDevice13getParametersEv
|
||||
_ZTI20SpectrometerCallback DATA
|
||||
_ZTV20SpectrometerCallback DATA
|
||||
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
+266
@@ -0,0 +1,266 @@
|
||||
// ===========================================================================
|
||||
// aris_bridge.cpp —— 用 MinGW(GCC) 编译,把 ARIS SDK 封成纯 C 接口
|
||||
//
|
||||
// 编译:见同目录 build-bridge.bat(g++ + 由 gendef/dlltool 生成的 libaris.a)
|
||||
// 产物:aris_bridge.dll(依赖 libaris.dll、libusb-1.0.dll 和 MinGW 运行库)
|
||||
//
|
||||
// 设计要点:
|
||||
// * 所有 C++/STL 对象只在本 DLL 内部流转,绝不跨 DLL 边界;
|
||||
// * 对外只有 aris_bridge.h 里的 C 函数和一次数据回调;
|
||||
// * 回调线程由 SDK 内部创建,调用方的回调必须自己保证线程安全。
|
||||
// ===========================================================================
|
||||
|
||||
#include "aris_bridge.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include <cstdarg>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "ziolinkprotocol.h"
|
||||
#include "spectrometerdevice.h"
|
||||
|
||||
#define ARIS_BRIDGE_EXPORT extern "C" __declspec(dllexport)
|
||||
|
||||
namespace {
|
||||
|
||||
// 日志:把 UTF-8 转成本地代码页再写 stderr,中文控制台才不会乱码
|
||||
void logLocal(const char *utf8Text)
|
||||
{
|
||||
const int wideLength = MultiByteToWideChar(CP_UTF8, 0, utf8Text, -1, nullptr, 0);
|
||||
if (wideLength <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
std::wstring wide(static_cast<size_t>(wideLength), L'\0');
|
||||
MultiByteToWideChar(CP_UTF8, 0, utf8Text, -1, &wide[0], wideLength);
|
||||
|
||||
UINT codePage = GetConsoleOutputCP();
|
||||
if (codePage == 0)
|
||||
{
|
||||
codePage = GetACP();
|
||||
}
|
||||
const int localLength = WideCharToMultiByte(codePage, 0, wide.c_str(), -1,
|
||||
nullptr, 0, nullptr, nullptr);
|
||||
if (localLength <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
std::string local(static_cast<size_t>(localLength), '\0');
|
||||
WideCharToMultiByte(codePage, 0, wide.c_str(), -1, &local[0], localLength, nullptr, nullptr);
|
||||
|
||||
std::fputs(local.c_str(), stderr);
|
||||
std::fflush(stderr);
|
||||
}
|
||||
|
||||
void logFormat(const char *format, ...)
|
||||
{
|
||||
char buffer[1024] = {0};
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
std::vsnprintf(buffer, sizeof(buffer), format, args);
|
||||
va_end(args);
|
||||
logLocal(buffer);
|
||||
}
|
||||
|
||||
// 每台设备的静态信息(连接时取一次,之后不再访问 SDK 对象)
|
||||
struct DeviceInfo {
|
||||
std::string serialNumber;
|
||||
int startPixel = 0;
|
||||
int endPixel = 0;
|
||||
int pixelCount = 0;
|
||||
std::vector<float> wavelengths;
|
||||
};
|
||||
|
||||
ZioLinkProtocol *g_zio = nullptr;
|
||||
std::vector<DeviceInfo> g_devices;
|
||||
aris_data_callback g_dataCallback = nullptr;
|
||||
|
||||
// SDK 的数据回调实现(虚函数必须在 GCC 侧实现,vtable 才与 libaris.dll 一致)
|
||||
class BridgeCallback : public SpectrometerCallback
|
||||
{
|
||||
public:
|
||||
void onDataReceived(std::string serialNumber,
|
||||
const std::vector<float> &wavelength,
|
||||
const std::vector<float> &spectrum) override
|
||||
{
|
||||
if (!g_dataCallback)
|
||||
{
|
||||
return;
|
||||
}
|
||||
g_dataCallback(serialNumber.c_str(),
|
||||
wavelength.empty() ? nullptr : wavelength.data(),
|
||||
static_cast<int>(wavelength.size()),
|
||||
spectrum.empty() ? nullptr : spectrum.data(),
|
||||
static_cast<int>(spectrum.size()));
|
||||
}
|
||||
|
||||
void onDataReceivedBanch(std::string serialNumber,
|
||||
const std::vector<float> &wavelength,
|
||||
const std::vector<std::vector<float>> &spectrum) override
|
||||
{
|
||||
for (const auto &frame : spectrum)
|
||||
{
|
||||
onDataReceived(serialNumber, wavelength, frame);
|
||||
}
|
||||
}
|
||||
|
||||
void onError(std::string serialNumber, const std::string &error) override
|
||||
{
|
||||
logFormat("[ARIS-BRIDGE] 设备 %s 报错: %s\n",
|
||||
serialNumber.c_str(), error.c_str());
|
||||
}
|
||||
};
|
||||
|
||||
BridgeCallback g_callback;
|
||||
|
||||
void cacheDevices()
|
||||
{
|
||||
g_devices.clear();
|
||||
if (!g_zio)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const size_t count = g_zio->getConnectedDeviceCount();
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
SpectrometerDevice *device = g_zio->getDevice(static_cast<int>(i)).get();
|
||||
if (!device)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const SpectrometerParameters params = device->getParameters();
|
||||
DeviceInfo info;
|
||||
info.serialNumber = params.serialNumber;
|
||||
info.startPixel = params.startPixel;
|
||||
info.endPixel = params.endPixel;
|
||||
info.pixelCount = static_cast<int>(params.pixelCount);
|
||||
info.wavelengths.assign(params.wavelengths.begin(), params.wavelengths.end());
|
||||
|
||||
logFormat("[ARIS-BRIDGE] 设备 %u: 序列号=%s 像素=%d 波长点=%u\n",
|
||||
static_cast<unsigned>(i), info.serialNumber.c_str(),
|
||||
info.pixelCount, static_cast<unsigned>(info.wavelengths.size()));
|
||||
g_devices.push_back(info);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
ARIS_BRIDGE_EXPORT const char * ARIS_BRIDGE_CALL aris_bridge_version(void)
|
||||
{
|
||||
return "ARIS bridge 1.0 (MinGW/GCC, C ABI)";
|
||||
}
|
||||
|
||||
ARIS_BRIDGE_EXPORT void ARIS_BRIDGE_CALL aris_bridge_set_data_callback(aris_data_callback cb)
|
||||
{
|
||||
g_dataCallback = cb;
|
||||
}
|
||||
|
||||
ARIS_BRIDGE_EXPORT int ARIS_BRIDGE_CALL aris_bridge_connect(void)
|
||||
{
|
||||
if (g_zio)
|
||||
{
|
||||
return static_cast<int>(g_devices.size());
|
||||
}
|
||||
|
||||
g_zio = new ZioLinkProtocol();
|
||||
g_zio->connectDevice();
|
||||
cacheDevices();
|
||||
return static_cast<int>(g_devices.size());
|
||||
}
|
||||
|
||||
ARIS_BRIDGE_EXPORT void ARIS_BRIDGE_CALL aris_bridge_disconnect(void)
|
||||
{
|
||||
if (!g_zio)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
g_zio->stopMeasurement();
|
||||
g_zio->disconnectDevice();
|
||||
delete g_zio;
|
||||
g_zio = nullptr;
|
||||
g_devices.clear();
|
||||
}
|
||||
|
||||
ARIS_BRIDGE_EXPORT int ARIS_BRIDGE_CALL aris_bridge_device_count(void)
|
||||
{
|
||||
return static_cast<int>(g_devices.size());
|
||||
}
|
||||
|
||||
ARIS_BRIDGE_EXPORT int ARIS_BRIDGE_CALL aris_bridge_device_info(int index,
|
||||
char *serial, int serialCap,
|
||||
int *startPixel, int *endPixel,
|
||||
int *pixelCount)
|
||||
{
|
||||
if (index < 0 || index >= static_cast<int>(g_devices.size()))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
const DeviceInfo &info = g_devices[static_cast<size_t>(index)];
|
||||
if (serial && serialCap > 0)
|
||||
{
|
||||
std::strncpy(serial, info.serialNumber.c_str(), static_cast<size_t>(serialCap) - 1);
|
||||
serial[serialCap - 1] = '\0';
|
||||
}
|
||||
if (startPixel) { *startPixel = info.startPixel; }
|
||||
if (endPixel) { *endPixel = info.endPixel; }
|
||||
if (pixelCount) { *pixelCount = info.pixelCount; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
ARIS_BRIDGE_EXPORT int ARIS_BRIDGE_CALL aris_bridge_device_wavelengths(int index,
|
||||
float *out, int capacity)
|
||||
{
|
||||
if (index < 0 || index >= static_cast<int>(g_devices.size()) || !out || capacity <= 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
const DeviceInfo &info = g_devices[static_cast<size_t>(index)];
|
||||
int count = static_cast<int>(info.wavelengths.size());
|
||||
if (count > capacity)
|
||||
{
|
||||
count = capacity;
|
||||
}
|
||||
if (count > 0)
|
||||
{
|
||||
std::memcpy(out, info.wavelengths.data(), sizeof(float) * static_cast<size_t>(count));
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
ARIS_BRIDGE_EXPORT void ARIS_BRIDGE_CALL aris_bridge_set_software_trigger(void)
|
||||
{
|
||||
if (g_zio)
|
||||
{
|
||||
g_zio->setTriggerMode(TriggerMode::SOFTWARE);
|
||||
}
|
||||
}
|
||||
|
||||
ARIS_BRIDGE_EXPORT int ARIS_BRIDGE_CALL aris_bridge_start_measure(int integrationTimeUs,
|
||||
int averaging)
|
||||
{
|
||||
if (!g_zio)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
g_zio->startMeasurement(&g_callback, integrationTimeUs,
|
||||
averaging > 0 ? averaging : 1, 0, 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ARIS_BRIDGE_EXPORT void ARIS_BRIDGE_CALL aris_bridge_stop_measure(void)
|
||||
{
|
||||
if (g_zio)
|
||||
{
|
||||
g_zio->stopMeasurement();
|
||||
}
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
// ===========================================================================
|
||||
// aris_bridge.h —— ARIS 光谱仪 SDK 的纯 C 接口
|
||||
//
|
||||
// 背景:
|
||||
// 厂商只提供 MinGW/GCC 编译的 libaris.dll,导出的是 GCC 名字修饰的 C++
|
||||
// 符号,并且要求调用方继承它的 SpectrometerCallback 纯虚类(参数是
|
||||
// std::string / std::vector)。这种 C++ 二进制接口无法被 MSVC 编出来的
|
||||
// 程序链接或调用(名字修饰、vtable 布局、STL 布局都不同)。
|
||||
//
|
||||
// 做法:
|
||||
// 用 MinGW g++ 编译 aris_bridge.dll:所有 SDK 类型和 STL 对象都封在 DLL
|
||||
// 内部,对外只暴露本文件里的纯 C 函数(无 C++ 类型、无 STL、无异常),
|
||||
// 这样 VS2026/MSVC 主程序可以用 LoadLibrary + GetProcAddress 调用。
|
||||
//
|
||||
// 注意:数组指针只在回调期间有效,回调返回后不能再访问。
|
||||
// ===========================================================================
|
||||
|
||||
#ifndef ARIS_BRIDGE_H
|
||||
#define ARIS_BRIDGE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
# define ARIS_BRIDGE_CALL __cdecl
|
||||
#else
|
||||
# define ARIS_BRIDGE_CALL
|
||||
#endif
|
||||
|
||||
// 光谱数据回调
|
||||
// serial 设备序列号(以 '\0' 结尾)
|
||||
// wavelengths 波长数组(可能为 NULL)
|
||||
// wavelengthCount 波长点数
|
||||
// intensities 强度数组(与波长一一对应)
|
||||
// intensityCount 强度点数
|
||||
typedef void (ARIS_BRIDGE_CALL *aris_data_callback)(
|
||||
const char *serial,
|
||||
const float *wavelengths, int wavelengthCount,
|
||||
const float *intensities, int intensityCount);
|
||||
|
||||
// 查找并初始化所有光谱仪,返回设备数量;失败返回 -1。
|
||||
// 重复调用时直接返回已连接的数量。
|
||||
int ARIS_BRIDGE_CALL aris_bridge_connect(void);
|
||||
|
||||
// 停止测量并断开所有设备
|
||||
void ARIS_BRIDGE_CALL aris_bridge_disconnect(void);
|
||||
|
||||
// 已连接设备数量
|
||||
int ARIS_BRIDGE_CALL aris_bridge_device_count(void);
|
||||
|
||||
// 取第 index 台设备的参数:序列号写入 serial(最多 serialCap 字节,含结尾 0),
|
||||
// 其余参数可为 NULL。成功返回 0,索引非法返回 -1。
|
||||
int ARIS_BRIDGE_CALL aris_bridge_device_info(int index, char *serial, int serialCap,
|
||||
int *startPixel, int *endPixel, int *pixelCount);
|
||||
|
||||
// 取第 index 台设备的波长表,写入 out(最多 capacity 个 float),返回实际写入点数。
|
||||
int ARIS_BRIDGE_CALL aris_bridge_device_wavelengths(int index, float *out, int capacity);
|
||||
|
||||
// 注册光谱数据回调(可在 connect 之前调用)
|
||||
void ARIS_BRIDGE_CALL aris_bridge_set_data_callback(aris_data_callback cb);
|
||||
|
||||
// 设置软件触发模式
|
||||
void ARIS_BRIDGE_CALL aris_bridge_set_software_trigger(void);
|
||||
|
||||
// 启动一次测量:integrationTimeUs 积分时间(微秒),averaging 平均次数。
|
||||
// 数据通过回调送回。成功返回 0,未连接返回 -1。
|
||||
int ARIS_BRIDGE_CALL aris_bridge_start_measure(int integrationTimeUs, int averaging);
|
||||
|
||||
// 停止测量
|
||||
void ARIS_BRIDGE_CALL aris_bridge_stop_measure(void);
|
||||
|
||||
// 桥接库版本字符串(静态,无需释放)
|
||||
const char * ARIS_BRIDGE_CALL aris_bridge_version(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // ARIS_BRIDGE_H
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user