Files
GUI/src/ShimLib/ShimLib.h

52 lines
1.0 KiB
C
Raw Normal View History

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