完善做EMC实验方便查看的log日志文件,图片暂存路径改为由外部传入

serial
huyizhong 11 months ago
parent 17321d0545
commit c7d3455d3c

@ -14,6 +14,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <math.h>
#include <termios.h>
#include <asm/termbits.h>
#include <time.h>
@ -853,7 +854,7 @@ void Gm_InitSerialComm_Test()
//sprintf(devparam[0].stopbit, "1");
sensorParam[0].stopbit = 1;
sensorParam[0].parity = 'n';
sensorParam[0].IsNoInsta = 0;
sensorParam[0].IsNoInsta = 1;
sensorParam[0].devaddr = 4;
memset(sensorParam[0].pathname, 0, sizeof(sensorParam[0].pathname));
sprintf(sensorParam[0].pathname, "/dev/ttysWK3");
@ -865,7 +866,7 @@ void Gm_InitSerialComm_Test()
//sprintf(devparam[1].stopbit, "1");
sensorParam[1].stopbit = 1;
sensorParam[1].parity = 0;
sensorParam[1].IsNoInsta = 0;
sensorParam[1].IsNoInsta = 1;
sensorParam[1].devaddr = 1;
memset(sensorParam[1].pathname, 0, sizeof(sensorParam[1].pathname));
sprintf(sensorParam[1].pathname, "/dev/ttysWK3");
@ -877,7 +878,7 @@ void Gm_InitSerialComm_Test()
//sprintf(devparam[2].stopbit, "1");
sensorParam[2].stopbit = 1;
sensorParam[2].parity = 0;
sensorParam[2].IsNoInsta = 0;
sensorParam[2].IsNoInsta = 1;
//sensorParam[2].PowerPort = 3;
//sensorParam[2].devaddr = 13;
sensorParam[2].devaddr = 13;
@ -891,7 +892,7 @@ void Gm_InitSerialComm_Test()
//sprintf(devparam[2].stopbit, "1");
sensorParam[5].stopbit = 1;
sensorParam[5].parity = 0;
sensorParam[5].IsNoInsta = 0;
sensorParam[5].IsNoInsta = 1;
sensorParam[5].devaddr = 10;
memset(sensorParam[5].pathname, 0, sizeof(sensorParam[3].pathname));
sprintf(sensorParam[5].pathname, "/dev/ttysWK1");
@ -903,7 +904,7 @@ void Gm_InitSerialComm_Test()
//sprintf(devparam[2].stopbit, "1");
sensorParam[4].stopbit = 1;
sensorParam[4].parity = 0;
sensorParam[4].IsNoInsta = 0;
sensorParam[4].IsNoInsta = 1;
//sensorParam[2].PowerPort = 3;
//sensorParam[2].devaddr = 13;
sensorParam[4].devaddr = 12;
@ -932,7 +933,7 @@ void Gm_InitSerialComm_Test()
sensorParam[7].stopbit = 1;
sensorParam[7].parity = 0;
//devparam[13].PowerPort = 4;
sensorParam[7].IsNoInsta = 0;
sensorParam[7].IsNoInsta = 1;
sensorParam[7].devaddr = 3;
memset(sensorParam[7].pathname, 0, sizeof(sensorParam[7].pathname));
sprintf(sensorParam[7].pathname, "/dev/ttysWK0");
@ -945,7 +946,7 @@ void Gm_InitSerialComm_Test()
sensorParam[13].stopbit = 1;
sensorParam[13].parity = 0;
//devparam[13].PowerPort = 4;
sensorParam[13].IsNoInsta = 0;
sensorParam[13].IsNoInsta = 1;
sensorParam[13].devaddr = 5;
memset(sensorParam[13].pathname, 0, sizeof(sensorParam[13].pathname));
sprintf(sensorParam[13].pathname, "/dev/ttysWK0");
@ -977,18 +978,18 @@ void Gm_InitSerialComm_Test()
sensorParam[3].databit = 8;
sensorParam[3].stopbit = 1;
sensorParam[3].parity = 0;
sensorParam[3].IsNoInsta = 0;
sensorParam[3].IsNoInsta = 1;
//devparam[3].PowerPort = 15;
sensorParam[3].CameraChannel = 1;
sensorParam[3].devaddr = 0;
memset(sensorParam[3].pathname, 0, sizeof(sensorParam[3].pathname));
sprintf(sensorParam[3].pathname, "/dev/ttyS1");
//#endif
Gm_InitSerialComm(sensorParam);
Gm_InitSerialComm(sensorParam, "/sdcard/photo/");
}
// 初始化所有串口及所接传感器的配置
void Gm_InitSerialComm(SENSOR_PARAM *sensorParam)
void Gm_InitSerialComm(SENSOR_PARAM *sensorParam, char *filedir)
{
int i;
char szbuf[128];
@ -1073,6 +1074,10 @@ void Gm_InitSerialComm(SENSOR_PARAM *sensorParam)
DebugLog(8, szbuf, 'I');
}
}
if(NULL == filedir)
return;
memset(srdt.filedir, 0, sizeof(srdt.filedir));
memmove(srdt.filedir, filedir, min(sizeof(srdt.filedir), strlen(filedir)));
FindDevUseSerialCommNo();
#if 0
//Collect_sensor_data();
@ -1112,13 +1117,13 @@ void testComm()
//memset(sensorParam, 0, sizeof(sensorParam));
Gm_InitSerialComm_Test();
#if COLLECT_DATA
for(;;)
Collect_sensor_data();
#else
for(;;)
{
#if COLLECT_DATA
Collect_sensor_data();
#else
sleep(15);
CameraPhotoCmd(time(NULL), 1, 0, 6, 1);
sleep(5);
@ -1141,9 +1146,9 @@ void testComm()
sleep(5);
CameraPhotoCmd(time(NULL), 1, 0, 6, 1);
sleep(5);
}
#endif
#endif
}
#if 1
//******************** 端口基本信息 ************************
/*for(i=0; i<MAX_SERIAL_DEV_NUM; i++)
@ -1392,7 +1397,7 @@ void GM_StartSerialComm()
{
//LOGE("12V state=%d", getInt(CMD_SET_12V_EN_STATE));
DebugLog(8, "退出采样流程!", 'V');
sleep(15);
sleep(5);
//GM_StartSerialComm();
break;
}
@ -1833,7 +1838,7 @@ int SaveImageDataTofile(int devno)
u_char *image=NULL, *tempphoto=NULL;
int i, status;
size_t len;
char filename[512], filedir[512], szbuf[128];
char filename[512]/*, filedir[512]*/, szbuf[128];
FILE *fp=NULL;
SERIAL_DEV_DEF *pPortParam;
@ -1848,23 +1853,23 @@ int SaveImageDataTofile(int devno)
}
memset(szbuf, 0, sizeof(szbuf));
memset(filedir, 0, sizeof(filedir));
sprintf(filedir, "/sdcard/photo/");
//memset(filedir, 0, sizeof(filedir));
//sprintf(filedir, "/sdcard/photo/");
if(access(filedir, 0)==0)
if(access(srdt.filedir, 0)==0)
{
sprintf(szbuf,"文件路径%s已经存在", filedir);
sprintf(szbuf,"文件路径%s已经存在", srdt.filedir);
DebugLog(devparam[devno].commid, szbuf, 'I');
}
else
{
status = mkdir(filedir, S_IRWXU | S_IRWXG | S_IRWXO);
status = mkdir(srdt.filedir, S_IRWXU | S_IRWXG | S_IRWXO);
if(status < 0)
return -1;
}
// 写入文件到sdcard
memset(pPortParam->image.photoname, 0, sizeof(pPortParam->image.photoname));
sprintf(pPortParam->image.photoname, "%s%d-%d-%d.jpg", filedir,devparam[devno].CameraChannel, pPortParam->image.presetno, pPortParam->image.phototime);
sprintf(pPortParam->image.photoname, "%s%d-%d-%d.jpg", srdt.filedir,devparam[devno].CameraChannel, pPortParam->image.presetno, pPortParam->image.phototime);
fp = fopen(pPortParam->image.photoname, "wb+");
if(NULL == fp)
return -1;
@ -2917,7 +2922,7 @@ void MakeShxyProtocolPollCommand(int portno, BYTE cmdidx)
sendbuf = serialport[devparam[portno].commid].PollCmd;
/* 测试变量*/
cmdidx =2;
cmdidx =cmdidx;
i = 0;
sendbuf[i++] = 0x00; // 强制等待时间
@ -3364,6 +3369,54 @@ void ShxyProtocolDataProcess( int devno)
}
}
void delete_old_files(const char *path, int days)
{
struct stat file_stat;
struct tm *file_tm;
time_t now = time(NULL);
DIR *dir = opendir(path);
struct dirent *entry;
char szbuf[1024];
char fullpath[256];
memset(szbuf, 0, sizeof(szbuf));
if (!dir)
{
sprintf(szbuf, "delete_old_files opendir %s error ", path);
DebugLog(8, szbuf, 'E');
return;
}
while ((entry = readdir(dir)))
{
memset(szbuf, 0, sizeof(szbuf));
if (entry->d_type == DT_REG)
{ // 只处理普通文件
snprintf(fullpath, sizeof(fullpath), "%s/%s", path, entry->d_name);
if (stat(fullpath, &file_stat) == -1)
{
perror("stat");
sprintf(szbuf, "stat");
DebugLog(8, szbuf, 'E');
continue;
}
localtime_r(&(file_stat.st_mtime), file_tm);
//file_tm = localtime(&(file_stat.st_mtime));
if (difftime(now, mktime(file_tm)) > days * 24 * 60 * 60)
{
if (unlink(fullpath) == -1)
{ // 删除文件
perror("unlink");
}
}
}
}
closedir(dir);
}
/*********************************************************************************
1610ASCIIint
*********************************************************************************/
@ -3462,6 +3515,23 @@ void Collect_sensor_data()
devparam[i].CameraChannel = sensorParam[i].CameraChannel;
devparam[i].Phase = sensorParam[i].Phase;
}
#endif
#if 1
static int ideletefile =0;
time_t now;
struct tm t0;
const char *path = "/sdcard/log"; // 指定目录路径
int days = 15; // 删除15天前的log文件
now = time(NULL);
localtime_r(&now, &t0);
if((0 == t0.tm_hour) && (0 == ideletefile))
{
delete_old_files(path, days);
ideletefile++;
}
if(0 < t0.tm_hour)
ideletefile = 0;
#endif
GM_StartSerialComm();
}

@ -34,6 +34,7 @@ typedef long long LONG;
#define LOWORD(l) ((WORD)(l))
#define HIWORD(l) ((WORD)((DWORD)(l) >> 16))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define MAX_STRING_LEN 32
#define IOT_PARAM_WRITE 0xAE
#define IOT_PARAM_READ 0xAF
@ -133,7 +134,7 @@ typedef long long LONG;
#define SPEED_DOME_CAMERA 0 /* 球机摄像机*/
#define SERIAL_CAMERA 2 /* 串口摄像机a*/
#define COLLECT_DATA 1 /* 调试使用*/
#define COLLECT_DATA 0 /* 调试使用*/
#define LOGE(fmt, args...) __android_log_print(ANDROID_LOG_ERROR, "serial_port_comm", fmt, ##args) /* 红色*/
#define LOGI(fmt, args...) __android_log_print(ANDROID_LOG_INFO, "Sensors_Protocol", fmt, ##args) /* 草绿色*/
@ -313,6 +314,7 @@ typedef struct
int iLastGetPhotoNo; /* 设置串口摄像机参数时暂存拍照命令序号*/
u_char bImageSize; /* 用于临时存储接收上层命令的图片大小*/
u_char presetno; /* 用于临时存储接收上层命令的预置点*/
char filedir[512]; /* 用于摄像机拍照之后暂时存放的路径*/
#endif
u_char errorPhotoNoCnt; /* 串口摄像机拍照时回应错误包号计数(如:召第6包回应第3包)*/
u_char RephotographCnt; /* 串口摄像机重拍计数(只在读照片数据应答出错时才重拍)*/
@ -347,11 +349,12 @@ void DebugLog(int commid, char *szbuf, char flag);
int SaveLogTofile(int commid, char *szbuf);
// 功能说明:串口发送数据 返回实际发送的字节数
int GM_SerialComSend(const unsigned char * cSendBuf, LONG nSendLen, int commid);
void Gm_InitSerialComm(SENSOR_PARAM *sensorParam);
void Gm_InitSerialComm(SENSOR_PARAM *sensorParam, char *filedir);
// 启动串口通讯
void GM_StartSerialComm();
// 启动使用串口拍照
void GM_StartSerialCameraPhoto(BYTE channel, int cmdidx);
void delete_old_files(const char *path, int days);
// 串口轮询通讯定时器
int GM_SerialTimer();

@ -14,6 +14,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <math.h>
#include <termios.h>
#include <asm/termbits.h>
#include <time.h>
@ -853,7 +854,7 @@ void Gm_InitSerialComm_Test()
//sprintf(devparam[0].stopbit, "1");
sensorParam[0].stopbit = 1;
sensorParam[0].parity = 'n';
sensorParam[0].IsNoInsta = 0;
sensorParam[0].IsNoInsta = 1;
sensorParam[0].devaddr = 4;
memset(sensorParam[0].pathname, 0, sizeof(sensorParam[0].pathname));
sprintf(sensorParam[0].pathname, "/dev/ttysWK3");
@ -865,7 +866,7 @@ void Gm_InitSerialComm_Test()
//sprintf(devparam[1].stopbit, "1");
sensorParam[1].stopbit = 1;
sensorParam[1].parity = 0;
sensorParam[1].IsNoInsta = 0;
sensorParam[1].IsNoInsta = 1;
sensorParam[1].devaddr = 1;
memset(sensorParam[1].pathname, 0, sizeof(sensorParam[1].pathname));
sprintf(sensorParam[1].pathname, "/dev/ttysWK3");
@ -877,7 +878,7 @@ void Gm_InitSerialComm_Test()
//sprintf(devparam[2].stopbit, "1");
sensorParam[2].stopbit = 1;
sensorParam[2].parity = 0;
sensorParam[2].IsNoInsta = 0;
sensorParam[2].IsNoInsta = 1;
//sensorParam[2].PowerPort = 3;
//sensorParam[2].devaddr = 13;
sensorParam[2].devaddr = 13;
@ -891,7 +892,7 @@ void Gm_InitSerialComm_Test()
//sprintf(devparam[2].stopbit, "1");
sensorParam[5].stopbit = 1;
sensorParam[5].parity = 0;
sensorParam[5].IsNoInsta = 0;
sensorParam[5].IsNoInsta = 1;
sensorParam[5].devaddr = 10;
memset(sensorParam[5].pathname, 0, sizeof(sensorParam[3].pathname));
sprintf(sensorParam[5].pathname, "/dev/ttysWK1");
@ -903,7 +904,7 @@ void Gm_InitSerialComm_Test()
//sprintf(devparam[2].stopbit, "1");
sensorParam[4].stopbit = 1;
sensorParam[4].parity = 0;
sensorParam[4].IsNoInsta = 0;
sensorParam[4].IsNoInsta = 1;
//sensorParam[2].PowerPort = 3;
//sensorParam[2].devaddr = 13;
sensorParam[4].devaddr = 12;
@ -932,7 +933,7 @@ void Gm_InitSerialComm_Test()
sensorParam[7].stopbit = 1;
sensorParam[7].parity = 0;
//devparam[13].PowerPort = 4;
sensorParam[7].IsNoInsta = 0;
sensorParam[7].IsNoInsta = 1;
sensorParam[7].devaddr = 3;
memset(sensorParam[7].pathname, 0, sizeof(sensorParam[7].pathname));
sprintf(sensorParam[7].pathname, "/dev/ttysWK0");
@ -945,7 +946,7 @@ void Gm_InitSerialComm_Test()
sensorParam[13].stopbit = 1;
sensorParam[13].parity = 0;
//devparam[13].PowerPort = 4;
sensorParam[13].IsNoInsta = 0;
sensorParam[13].IsNoInsta = 1;
sensorParam[13].devaddr = 5;
memset(sensorParam[13].pathname, 0, sizeof(sensorParam[13].pathname));
sprintf(sensorParam[13].pathname, "/dev/ttysWK0");
@ -977,18 +978,18 @@ void Gm_InitSerialComm_Test()
sensorParam[3].databit = 8;
sensorParam[3].stopbit = 1;
sensorParam[3].parity = 0;
sensorParam[3].IsNoInsta = 0;
sensorParam[3].IsNoInsta = 1;
//devparam[3].PowerPort = 15;
sensorParam[3].CameraChannel = 1;
sensorParam[3].devaddr = 0;
memset(sensorParam[3].pathname, 0, sizeof(sensorParam[3].pathname));
sprintf(sensorParam[3].pathname, "/dev/ttyS1");
//#endif
Gm_InitSerialComm(sensorParam);
Gm_InitSerialComm(sensorParam, "/sdcard/photo/");
}
// 初始化所有串口及所接传感器的配置
void Gm_InitSerialComm(SENSOR_PARAM *sensorParam)
void Gm_InitSerialComm(SENSOR_PARAM *sensorParam, char *filedir)
{
int i;
char szbuf[128];
@ -1073,6 +1074,10 @@ void Gm_InitSerialComm(SENSOR_PARAM *sensorParam)
DebugLog(8, szbuf, 'I');
}
}
if(NULL == filedir)
return;
memset(srdt.filedir, 0, sizeof(srdt.filedir));
memmove(srdt.filedir, filedir, min(sizeof(srdt.filedir), strlen(filedir)));
FindDevUseSerialCommNo();
#if 0
//Collect_sensor_data();
@ -1112,13 +1117,13 @@ void testComm()
//memset(sensorParam, 0, sizeof(sensorParam));
Gm_InitSerialComm_Test();
#if COLLECT_DATA
for(;;)
Collect_sensor_data();
#else
for(;;)
{
#if COLLECT_DATA
Collect_sensor_data();
#else
sleep(15);
CameraPhotoCmd(time(NULL), 1, 0, 6, 1);
sleep(5);
@ -1141,9 +1146,9 @@ void testComm()
sleep(5);
CameraPhotoCmd(time(NULL), 1, 0, 6, 1);
sleep(5);
}
#endif
#endif
}
#if 1
//******************** 端口基本信息 ************************
/*for(i=0; i<MAX_SERIAL_DEV_NUM; i++)
@ -1392,7 +1397,7 @@ void GM_StartSerialComm()
{
//LOGE("12V state=%d", getInt(CMD_SET_12V_EN_STATE));
DebugLog(8, "退出采样流程!", 'V');
sleep(15);
sleep(5);
//GM_StartSerialComm();
break;
}
@ -1833,7 +1838,7 @@ int SaveImageDataTofile(int devno)
u_char *image=NULL, *tempphoto=NULL;
int i, status;
size_t len;
char filename[512], filedir[512], szbuf[128];
char filename[512]/*, filedir[512]*/, szbuf[128];
FILE *fp=NULL;
SERIAL_DEV_DEF *pPortParam;
@ -1848,23 +1853,23 @@ int SaveImageDataTofile(int devno)
}
memset(szbuf, 0, sizeof(szbuf));
memset(filedir, 0, sizeof(filedir));
sprintf(filedir, "/sdcard/photo/");
//memset(filedir, 0, sizeof(filedir));
//sprintf(filedir, "/sdcard/photo/");
if(access(filedir, 0)==0)
if(access(srdt.filedir, 0)==0)
{
sprintf(szbuf,"文件路径%s已经存在", filedir);
sprintf(szbuf,"文件路径%s已经存在", srdt.filedir);
DebugLog(devparam[devno].commid, szbuf, 'I');
}
else
{
status = mkdir(filedir, S_IRWXU | S_IRWXG | S_IRWXO);
status = mkdir(srdt.filedir, S_IRWXU | S_IRWXG | S_IRWXO);
if(status < 0)
return -1;
}
// 写入文件到sdcard
memset(pPortParam->image.photoname, 0, sizeof(pPortParam->image.photoname));
sprintf(pPortParam->image.photoname, "%s%d-%d-%d.jpg", filedir,devparam[devno].CameraChannel, pPortParam->image.presetno, pPortParam->image.phototime);
sprintf(pPortParam->image.photoname, "%s%d-%d-%d.jpg", srdt.filedir,devparam[devno].CameraChannel, pPortParam->image.presetno, pPortParam->image.phototime);
fp = fopen(pPortParam->image.photoname, "wb+");
if(NULL == fp)
return -1;
@ -2917,7 +2922,7 @@ void MakeShxyProtocolPollCommand(int portno, BYTE cmdidx)
sendbuf = serialport[devparam[portno].commid].PollCmd;
/* 测试变量*/
cmdidx =2;
cmdidx =cmdidx;
i = 0;
sendbuf[i++] = 0x00; // 强制等待时间
@ -3364,6 +3369,54 @@ void ShxyProtocolDataProcess( int devno)
}
}
void delete_old_files(const char *path, int days)
{
struct stat file_stat;
struct tm *file_tm;
time_t now = time(NULL);
DIR *dir = opendir(path);
struct dirent *entry;
char szbuf[1024];
char fullpath[256];
memset(szbuf, 0, sizeof(szbuf));
if (!dir)
{
sprintf(szbuf, "delete_old_files opendir %s error ", path);
DebugLog(8, szbuf, 'E');
return;
}
while ((entry = readdir(dir)))
{
memset(szbuf, 0, sizeof(szbuf));
if (entry->d_type == DT_REG)
{ // 只处理普通文件
snprintf(fullpath, sizeof(fullpath), "%s/%s", path, entry->d_name);
if (stat(fullpath, &file_stat) == -1)
{
perror("stat");
sprintf(szbuf, "stat");
DebugLog(8, szbuf, 'E');
continue;
}
localtime_r(&(file_stat.st_mtime), file_tm);
//file_tm = localtime(&(file_stat.st_mtime));
if (difftime(now, mktime(file_tm)) > days * 24 * 60 * 60)
{
if (unlink(fullpath) == -1)
{ // 删除文件
perror("unlink");
}
}
}
}
closedir(dir);
}
/*********************************************************************************
1610ASCIIint
*********************************************************************************/
@ -3462,6 +3515,23 @@ void Collect_sensor_data()
devparam[i].CameraChannel = sensorParam[i].CameraChannel;
devparam[i].Phase = sensorParam[i].Phase;
}
#endif
#if 1
static int ideletefile =0;
time_t now;
struct tm t0;
const char *path = "/sdcard/log"; // 指定目录路径
int days = 15; // 删除15天前的log文件
now = time(NULL);
localtime_r(&now, &t0);
if((0 == t0.tm_hour) && (0 == ideletefile))
{
delete_old_files(path, days);
ideletefile++;
}
if(0 < t0.tm_hour)
ideletefile = 0;
#endif
GM_StartSerialComm();
}

@ -34,6 +34,7 @@ typedef long long LONG;
#define LOWORD(l) ((WORD)(l))
#define HIWORD(l) ((WORD)((DWORD)(l) >> 16))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define MAX_STRING_LEN 32
#define IOT_PARAM_WRITE 0xAE
#define IOT_PARAM_READ 0xAF
@ -133,7 +134,7 @@ typedef long long LONG;
#define SPEED_DOME_CAMERA 0 /* 球机摄像机*/
#define SERIAL_CAMERA 2 /* 串口摄像机a*/
#define COLLECT_DATA 1 /* 调试使用*/
#define COLLECT_DATA 0 /* 调试使用*/
#define LOGE(fmt, args...) __android_log_print(ANDROID_LOG_ERROR, "serial_port_comm", fmt, ##args) /* 红色*/
#define LOGI(fmt, args...) __android_log_print(ANDROID_LOG_INFO, "Sensors_Protocol", fmt, ##args) /* 草绿色*/
@ -313,6 +314,7 @@ typedef struct
int iLastGetPhotoNo; /* 设置串口摄像机参数时暂存拍照命令序号*/
u_char bImageSize; /* 用于临时存储接收上层命令的图片大小*/
u_char presetno; /* 用于临时存储接收上层命令的预置点*/
char filedir[512]; /* 用于摄像机拍照之后暂时存放的路径*/
#endif
u_char errorPhotoNoCnt; /* 串口摄像机拍照时回应错误包号计数(如:召第6包回应第3包)*/
u_char RephotographCnt; /* 串口摄像机重拍计数(只在读照片数据应答出错时才重拍)*/
@ -347,11 +349,12 @@ void DebugLog(int commid, char *szbuf, char flag);
int SaveLogTofile(int commid, char *szbuf);
// 功能说明:串口发送数据 返回实际发送的字节数
int GM_SerialComSend(const unsigned char * cSendBuf, LONG nSendLen, int commid);
void Gm_InitSerialComm(SENSOR_PARAM *sensorParam);
void Gm_InitSerialComm(SENSOR_PARAM *sensorParam, char *filedir);
// 启动串口通讯
void GM_StartSerialComm();
// 启动使用串口拍照
void GM_StartSerialCameraPhoto(BYTE channel, int cmdidx);
void delete_old_files(const char *path, int days);
// 串口轮询通讯定时器
int GM_SerialTimer();

Loading…
Cancel
Save