|
@@ -73,7 +73,7 @@ void GetAllSELEntriesSorted(Webs *wp)
|
|
int wRet = 0;
|
|
int wRet = 0;
|
|
unsigned short nEntries = 0;
|
|
unsigned short nEntries = 0;
|
|
SELEventRecordWithSensorName_T *pSELBuff = NULL;
|
|
SELEventRecordWithSensorName_T *pSELBuff = NULL;
|
|
- int i;
|
|
|
|
|
|
+ int i,j;
|
|
IPMI20_UDS_SESSION_T UDSSession;
|
|
IPMI20_UDS_SESSION_T UDSSession;
|
|
uint8_t target_addr;
|
|
uint8_t target_addr;
|
|
SensorNumNameTab_T senNumNameTab[MAX_SENSOR_NUMBERS]; //之前获取到的传感器名称暂存在这里,避免反复获取,浪费总线带宽。
|
|
SensorNumNameTab_T senNumNameTab[MAX_SENSOR_NUMBERS]; //之前获取到的传感器名称暂存在这里,避免反复获取,浪费总线带宽。
|
|
@@ -142,6 +142,7 @@ void GetAllSELEntriesSorted(Webs *wp)
|
|
goto error_out;
|
|
goto error_out;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ printf("Reserve SEL, sel number %d\n", nEntries);
|
|
//Reserve SEL
|
|
//Reserve SEL
|
|
if(target_addr == 0x20)
|
|
if(target_addr == 0x20)
|
|
{
|
|
{
|
|
@@ -189,12 +190,15 @@ void GetAllSELEntriesSorted(Webs *wp)
|
|
// cJSON_AddNumberToObject(pJsonsub, "D10", SELEventData.EvtData2); //EventData2 -> D10
|
|
// cJSON_AddNumberToObject(pJsonsub, "D10", SELEventData.EvtData2); //EventData2 -> D10
|
|
// cJSON_AddNumberToObject(pJsonsub, "D11", SELEventData.EvtData3); //EventData3 -> D11
|
|
// cJSON_AddNumberToObject(pJsonsub, "D11", SELEventData.EvtData3); //EventData3 -> D11
|
|
|
|
|
|
|
|
+ if(i!=0)
|
|
|
|
+ {
|
|
|
|
+ websWrite(wp, ",");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ printf("Get sel i = %d\n", i);
|
|
if(SELEventData.hdr.Type == 0x02)
|
|
if(SELEventData.hdr.Type == 0x02)
|
|
{
|
|
{
|
|
- if(i!=0)
|
|
|
|
- {
|
|
|
|
- websWrite(wp, ",");
|
|
|
|
- }
|
|
|
|
|
|
+ printf("system sel\n");
|
|
websWrite(wp, "{\"D1\":%d,\"D2\":%d,\"D3\":%d,\"D4\":%d,\"D5\":%d,\"D6\":%d,\"D7\":%d,\"D8\":%d,\"D9\":%d,\"D10\":%d,\"D11\":%d,",
|
|
websWrite(wp, "{\"D1\":%d,\"D2\":%d,\"D3\":%d,\"D4\":%d,\"D5\":%d,\"D6\":%d,\"D7\":%d,\"D8\":%d,\"D9\":%d,\"D10\":%d,\"D11\":%d,",
|
|
SELEventData.hdr.ID, SELEventData.hdr.Type, SELEventData.hdr.TimeStamp,
|
|
SELEventData.hdr.ID, SELEventData.hdr.Type, SELEventData.hdr.TimeStamp,
|
|
SELEventData.body.sysEventRecord.GenID[0], SELEventData.body.sysEventRecord.GenID[1],
|
|
SELEventData.body.sysEventRecord.GenID[0], SELEventData.body.sysEventRecord.GenID[1],
|
|
@@ -207,15 +211,15 @@ void GetAllSELEntriesSorted(Webs *wp)
|
|
if(SELEventData.body.sysEventRecord.SensorNum != 0xff)
|
|
if(SELEventData.body.sysEventRecord.SensorNum != 0xff)
|
|
{
|
|
{
|
|
found_flag = 0;
|
|
found_flag = 0;
|
|
- for(i=0;i<MAX_SENSOR_NUMBERS;i++) //先从之前的缓存里查找传感器名称
|
|
|
|
|
|
+ for(j=0;j<MAX_SENSOR_NUMBERS;j++) //先从之前的缓存里查找传感器名称
|
|
{
|
|
{
|
|
- if(senNumNameTab[i].sensor_number == 0xff) //再往后没有内容了。
|
|
|
|
|
|
+ if(senNumNameTab[j].sensor_number == 0xff) //再往后没有内容了。
|
|
break;
|
|
break;
|
|
|
|
|
|
- if(senNumNameTab[i].sensor_number == SELEventData.body.sysEventRecord.SensorNum)
|
|
|
|
|
|
+ if(senNumNameTab[j].sensor_number == SELEventData.body.sysEventRecord.SensorNum)
|
|
{
|
|
{
|
|
//cJSON_AddStringToObject(pJsonsub, "D12", senNumNameTab[i].sensor_name); //SensorName -> D12
|
|
//cJSON_AddStringToObject(pJsonsub, "D12", senNumNameTab[i].sensor_name); //SensorName -> D12
|
|
- websWrite(wp, "\"D12\":\"%s\"}", senNumNameTab[i].sensor_name);
|
|
|
|
|
|
+ websWrite(wp, "\"D12\":\"%s\"}", senNumNameTab[j].sensor_name);
|
|
found_flag = 1;
|
|
found_flag = 1;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -233,16 +237,16 @@ void GetAllSELEntriesSorted(Webs *wp)
|
|
wRet = IPMC_GetSensorName(&UDSSession, target_addr,SELEventData.body.sysEventRecord.SensorNum, sensorName, DEFAULT_TIMEOUT);
|
|
wRet = IPMC_GetSensorName(&UDSSession, target_addr,SELEventData.body.sysEventRecord.SensorNum, sensorName, DEFAULT_TIMEOUT);
|
|
}
|
|
}
|
|
//cJSON_AddStringToObject(pJsonsub, "D12", senNumNameTab[i].sensor_name); //SensorName->D12
|
|
//cJSON_AddStringToObject(pJsonsub, "D12", senNumNameTab[i].sensor_name); //SensorName->D12
|
|
- websWrite(wp, "\"D12\":\"%s\"}", senNumNameTab[i].sensor_name);
|
|
|
|
|
|
+ websWrite(wp, "\"D12\":\"%s\"}", sensorName);
|
|
if(wRet == 0)
|
|
if(wRet == 0)
|
|
{
|
|
{
|
|
//将得到的传感器名称保存到缓存中
|
|
//将得到的传感器名称保存到缓存中
|
|
- for(i=0;i<MAX_SENSOR_NUMBERS;i++)
|
|
|
|
|
|
+ for(j=0;j<MAX_SENSOR_NUMBERS;j++)
|
|
{
|
|
{
|
|
- if(senNumNameTab[i].sensor_number == 0xff)
|
|
|
|
|
|
+ if(senNumNameTab[j].sensor_number == 0xff)
|
|
{
|
|
{
|
|
- senNumNameTab[i].sensor_number = SELEventData.body.sysEventRecord.SensorNum;
|
|
|
|
- strcpy(senNumNameTab[i].sensor_name, sensorName);
|
|
|
|
|
|
+ senNumNameTab[j].sensor_number = SELEventData.body.sysEventRecord.SensorNum;
|
|
|
|
+ strcpy(senNumNameTab[j].sensor_name, sensorName);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -257,7 +261,13 @@ void GetAllSELEntriesSorted(Webs *wp)
|
|
}
|
|
}
|
|
else if(SELEventData.hdr.Type == 0xC0)
|
|
else if(SELEventData.hdr.Type == 0xC0)
|
|
{
|
|
{
|
|
- //TODO:
|
|
|
|
|
|
+ printf("oem sel\n");
|
|
|
|
+ websWrite(wp, "{\"D1\":%d,\"D2\":%d,\"D3\":%d,\"D4\":%d,\"D5\":%d,\"D6\":%d,\"D7\":%d,\"D8\":%d,\"D9\":%d,\"D10\":0,\"D11\":0,\"D12\":0}",
|
|
|
|
+ SELEventData.hdr.ID, SELEventData.hdr.Type, SELEventData.hdr.TimeStamp,
|
|
|
|
+ SELEventData.body.oemEventRecord.OEMDefined[0], SELEventData.body.oemEventRecord.OEMDefined[1],
|
|
|
|
+ SELEventData.body.oemEventRecord.OEMDefined[2], SELEventData.body.oemEventRecord.OEMDefined[3],
|
|
|
|
+ SELEventData.body.oemEventRecord.OEMDefined[4], SELEventData.body.oemEventRecord.OEMDefined[5]);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
if(RecID == 0xffff) //last record
|
|
if(RecID == 0xffff) //last record
|