?? cb_sensor_bk.cpp
字號:
#include "CB_Sensor_bk.h"
#include "CB_Unit.h"
//##ModelId=40B434D0000C
int CB_Sensor_bk::getSensor(char *index, SENSOR &sensor_source)
{
FILE *pFile;
pFile = fopen("dat/sensor.dest","r");
if(pFile == NULL)
return -1;
SENSOR *sensor;
sensor = &sensor_source;
while(1==1){
if(fread(sensor,sizeof(SENSOR),1,pFile)< 1){
sensor = NULL;
break;
}
char *pIndex;
pIndex = sensor->index;
CB_Unit::trim(pIndex);
if(strcmp(pIndex,index) == 0){ //數(shù)據(jù)匹配
sensor_source = *sensor;
break;
}
//printf("index:%s\n",index);
//printf("pIndex:%s\n",pIndex);
}
if(pFile != NULL)
fclose(pFile);
//printf("WY:%s\n",m_search_sensor->index);
//printf("index:%s\n",m_search_sensor->index);
//printf("on_off:%s\n",m_search_sensor->on_off);
return 0;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -