93 lines
2.5 KiB
C
93 lines
2.5 KiB
C
#ifndef I_CONFGI_H
|
|
#define I_CONFGI_H
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
#define SD_LOOP_ENABLE (1)
|
|
#define RESET_ENABLE (1)
|
|
#define RESET_DISABLE (0)
|
|
#define DCF_FILE_NAME_PREFIX SF_DCF_FILE_NAME_PREFIX
|
|
typedef enum PARAM_NAME
|
|
{
|
|
PARAM_NAME_ACM_IP = 0,
|
|
PARAM_NAME_MULTI_SHOT,
|
|
PARAM_NAME_WEB_IP,
|
|
PARAM_NAME_APP_VERSION,
|
|
PARAM_SD_LOOP,
|
|
PARAM_RESET_FLAG,
|
|
PARAM_GPS_ENTER_RESET_MODE_FLAG,
|
|
PARAM_PIR_SWITCH,
|
|
PARAM_GPRS_MODE,
|
|
PARAM_TIMELAPSE_SWITCH,
|
|
PARAM_TIMELAPSE_TIME,
|
|
PARAM_PIR_DELAY_SWITCH,
|
|
PARAM_PIR_DELAY_TIME,
|
|
PARAM_PIR_SENSITIVITY,
|
|
PARAM_GPRS_SWITCH,
|
|
PARAM_DIGIT_PIR_SENSITIVITY,
|
|
PARAM_GPS_WAIT_RESTART_FLAG,
|
|
PARAM_DAILY_REPORT_TIME,
|
|
PARAM_WORK_MODE,
|
|
PARAM_TIME_SEND_1,
|
|
PARAM_WORK_TIME_1_SWITCH,
|
|
PARAM_WORK_TIME_2_SWITCH,
|
|
PARAM_WORK_TIME,
|
|
PARAM_CAMERA_MODE,
|
|
PARAM_DID,
|
|
PARAM_BATTERY_TYPE,
|
|
PARAM_STAMP_SWITCH,
|
|
PARAM_IMAGE_SIZE,
|
|
PARAM_FLASH_LED,
|
|
PARAM_VIDEO_SIZE,
|
|
PARAM_VIDEO_LENGTH,
|
|
PARAM_DAILY_REPORT_SWITCH,
|
|
PARAM_LATITUDE,
|
|
PARAM_LONGITUDE,
|
|
PARAM_GPS_FLAG,
|
|
PARAM_PARAM_SYNC,
|
|
PARAM_P2P_ID,
|
|
PARAM_P2P_NAME,
|
|
PARAM_P2P_SECRET,
|
|
PARAM_MQTT_IP,
|
|
PARAM_MQTT_PORT,
|
|
PARAM_DCF_FILE_NAME_PREFIX,
|
|
PARAM_NAME_END
|
|
} PARAM_NAME;
|
|
typedef struct SF_PARAM_TIME_S
|
|
{
|
|
unsigned short Year;
|
|
unsigned short Mon;
|
|
unsigned short Day;
|
|
unsigned short Hour;
|
|
unsigned short Min;
|
|
unsigned short Sec;
|
|
} PARAM_TIME_S;
|
|
typedef struct PARAM_WORKTIME_S
|
|
{
|
|
PARAM_TIME_S StartTime;
|
|
PARAM_TIME_S StopTime;
|
|
} PARAM_WORKTIME_S;
|
|
#define PARAM_STRING_LENGTH 160
|
|
#define WORK_TIME_MAX 2
|
|
typedef struct Param
|
|
{
|
|
char str[PARAM_STRING_LENGTH];
|
|
int numberInt;
|
|
unsigned int numberUInt;
|
|
PARAM_TIME_S time;
|
|
PARAM_WORKTIME_S workTime[WORK_TIME_MAX];
|
|
} Param;
|
|
void ConfigInit(const char *FilePath, const char *StstaticsticsFilePath);
|
|
void ConfigInitV2(void);
|
|
void ConfigUnInit(void);
|
|
Param NewConfigParam(void);
|
|
void SetParam(const Param param, const PARAM_NAME name);
|
|
const Param GetParam(PARAM_NAME name);
|
|
void ResetParam(void);
|
|
void SaveConfig(void);
|
|
int CreateConfig(void);
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif // !I_CONFGI_H
|