Introduce ShimLib to project.

This commit is contained in:
Krad
2021-10-12 17:43:36 +08:00
parent 14169b3072
commit 76fc231b39
3 changed files with 60 additions and 2 deletions

56
src/ShimLib/ShimLib.h Normal file
View File

@@ -0,0 +1,56 @@
//
// Created by Krad on 2021/10/12.
//
#ifndef GUI_SHIMLIB_H
#define GUI_SHIMLIB_H
#ifdef __CPLUSPLUS
extern "C"{
#endif
typedef enum
{
BUSY,// device is preparing for scan
READY,// device is ready for scan
SCANING,// device is doing scan
ERROR// some device inner error are occured
}DeviceStatus;
typedef struct StatusInfo
{
DeviceStatus status;// a enum represent device current status
float progress;// percent value of operation
}StatusInfo;
//3 kinds of scan action
typedef enum
{
SCAN,// Start scan action
PREVIEW_SCAN,// Start preview scan action
STOP,// Stop current scan
}ScanAction;
//kinds of device information
typedef enum
{
MEAN_TEMPERATURE
}DeviceInfo;
int InitLib(void(*)(const char * msg));
int ScanControl(ScanAction actionType);
StatusInfo GetStatus();
int SetScanInf(const char * jsonString);
const char * GetPreviewData();
const char * GetDeviceInf(DeviceInfo infoType);
#ifdef __CPLUSPLUS
}
#endif
#endif //GUI_SHIMLIB_H