|
@@ -77,7 +77,7 @@ int Storlead_GetSysInfo(uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
|
|
|
|
|
|
int Storlead_GetSensorInfo(uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
|
|
int Storlead_GetSensorInfo(uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
|
|
{
|
|
{
|
|
- printf("Storlead_GetSensorInfo\n" );
|
|
|
|
|
|
+// printf("Storlead_GetSensorInfo\n" );
|
|
|
|
|
|
StorleadGetSensorInfoRes_T *pGetSensorInfoRes = (StorleadGetSensorInfoRes_T *)pRes;
|
|
StorleadGetSensorInfoRes_T *pGetSensorInfoRes = (StorleadGetSensorInfoRes_T *)pRes;
|
|
uint8_t* pValidSensor = NULL;
|
|
uint8_t* pValidSensor = NULL;
|
|
@@ -282,47 +282,48 @@ int Storlead_GetSensorInfo(uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
|
|
|
|
|
|
int Storlead_GetSELEntires(uint8_t *pReq, uint8_t ReqLen, uint8_t *pRes)
|
|
int Storlead_GetSELEntires(uint8_t *pReq, uint8_t ReqLen, uint8_t *pRes)
|
|
{
|
|
{
|
|
- AMIGetSELEntriesReq_T *pAMIGetSelEntriesReq = (AMIGetSELEntriesReq_T *)pReq;
|
|
|
|
- AMIGetSELEntriesRes_T *pAMIGetSelEntiresRes = (AMIGetSELEntriesRes_T *)pRes;
|
|
|
|
- SELRepository_T *m_sel = NULL;
|
|
|
|
- uint16_t NumRecords = 0;
|
|
|
|
|
|
+ // AMIGetSELEntriesReq_T *pAMIGetSelEntriesReq = (AMIGetSELEntriesReq_T *)pReq;
|
|
|
|
+ // AMIGetSELEntriesRes_T *pAMIGetSelEntiresRes = (AMIGetSELEntriesRes_T *)pRes;
|
|
|
|
+ // SELRepository_T *m_sel = NULL;
|
|
|
|
+ // uint16_t NumRecords = 0;
|
|
|
|
|
|
|
|
|
|
- m_sel = (SELRepository_T*)g_BMCInfo.pSEL;
|
|
|
|
- NumRecords = m_sel->NumRecords;
|
|
|
|
|
|
+ // m_sel = (SELRepository_T*)g_BMCInfo.pSEL;
|
|
|
|
+ // NumRecords = m_sel->NumRecords;
|
|
|
|
|
|
- if(((NumRecords - pAMIGetSelEntriesReq->Noofentretrieved) * sizeof(SELRec_T)) < MAX_FULL_SEL_ENTRIES)
|
|
|
|
- {
|
|
|
|
- pAMIGetSelEntiresRes->Status = FULL_SEL_ENTRIES;
|
|
|
|
- pAMIGetSelEntiresRes->Noofentries = NumRecords - pAMIGetSelEntriesReq->Noofentretrieved;
|
|
|
|
- }
|
|
|
|
- else if(NumRecords == SEL_EMPTY_REPOSITORY)
|
|
|
|
- {
|
|
|
|
- pAMIGetSelEntiresRes->CompletionCode = OEMCC_SEL_EMPTY_REPOSITORY;
|
|
|
|
- return sizeof(*pRes);
|
|
|
|
- }
|
|
|
|
- else if (NumRecords < pAMIGetSelEntriesReq->Noofentretrieved)
|
|
|
|
- {
|
|
|
|
- pAMIGetSelEntiresRes->CompletionCode = OEMCC_SEL_CLEARED;
|
|
|
|
- return sizeof(*pRes);
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- pAMIGetSelEntiresRes->Status = PARTIAL_SEL_ENTRIES;
|
|
|
|
- pAMIGetSelEntiresRes->Noofentries = ((MAX_FULL_SEL_ENTRIES - sizeof(AMIGetSELEntriesRes_T))/sizeof(SELRec_T));
|
|
|
|
- }
|
|
|
|
|
|
+ // if(((NumRecords - pAMIGetSelEntriesReq->Noofentretrieved) * sizeof(SELRec_T)) < MAX_FULL_SEL_ENTRIES)
|
|
|
|
+ // {
|
|
|
|
+ // pAMIGetSelEntiresRes->Status = FULL_SEL_ENTRIES;
|
|
|
|
+ // pAMIGetSelEntiresRes->Noofentries = NumRecords - pAMIGetSelEntriesReq->Noofentretrieved;
|
|
|
|
+ // }
|
|
|
|
+ // else if(NumRecords == SEL_EMPTY_REPOSITORY)
|
|
|
|
+ // {
|
|
|
|
+ // pAMIGetSelEntiresRes->CompletionCode = OEMCC_SEL_EMPTY_REPOSITORY;
|
|
|
|
+ // return sizeof(*pRes);
|
|
|
|
+ // }
|
|
|
|
+ // else if (NumRecords < pAMIGetSelEntriesReq->Noofentretrieved)
|
|
|
|
+ // {
|
|
|
|
+ // pAMIGetSelEntiresRes->CompletionCode = OEMCC_SEL_CLEARED;
|
|
|
|
+ // return sizeof(*pRes);
|
|
|
|
+ // }
|
|
|
|
+ // else
|
|
|
|
+ // {
|
|
|
|
+ // pAMIGetSelEntiresRes->Status = PARTIAL_SEL_ENTRIES;
|
|
|
|
+ // pAMIGetSelEntiresRes->Noofentries = ((MAX_FULL_SEL_ENTRIES - sizeof(AMIGetSELEntriesRes_T))/sizeof(SELRec_T));
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- memcpy((uint8_t*)(pAMIGetSelEntiresRes + 1),(uint8_t*)&m_sel->SELRecord[pAMIGetSelEntriesReq->Noofentretrieved],
|
|
|
|
- sizeof(SELRec_T)*pAMIGetSelEntiresRes->Noofentries);
|
|
|
|
|
|
+ // memcpy((uint8_t*)(pAMIGetSelEntiresRes + 1),(uint8_t*)&m_sel->SELRecord[pAMIGetSelEntriesReq->Noofentretrieved],
|
|
|
|
+ // sizeof(SELRec_T)*pAMIGetSelEntiresRes->Noofentries);
|
|
|
|
|
|
|
|
|
|
- pAMIGetSelEntiresRes->LastRecID = m_sel->LastRecID;
|
|
|
|
|
|
+ // pAMIGetSelEntiresRes->LastRecID = m_sel->LastRecID;
|
|
|
|
|
|
- pAMIGetSelEntiresRes->CompletionCode = CC_NORMAL;
|
|
|
|
|
|
+ // pAMIGetSelEntiresRes->CompletionCode = CC_NORMAL;
|
|
|
|
|
|
- return sizeof(AMIGetSELEntriesRes_T) + (sizeof(SELRec_T) * pAMIGetSelEntiresRes->Noofentries);
|
|
|
|
|
|
+ // return sizeof(AMIGetSELEntriesRes_T) + (sizeof(SELRec_T) * pAMIGetSelEntiresRes->Noofentries);
|
|
|
|
+ return 1;
|
|
}
|
|
}
|
|
|
|
|
|
int Storlead_AuthorVerify(uint8_t *pReq, uint8_t ReqLen, uint8_t *pRes)
|
|
int Storlead_AuthorVerify(uint8_t *pReq, uint8_t ReqLen, uint8_t *pRes)
|
|
@@ -400,6 +401,12 @@ int Storlead_GetSensorHistory(uint8_t *pReq, uint8_t ReqLen, uint8_t *pRes)
|
|
int Storlead_GetFanInfo(uint8_t *pReq, uint8_t ReqLen, uint8_t *pRes)
|
|
int Storlead_GetFanInfo(uint8_t *pReq, uint8_t ReqLen, uint8_t *pRes)
|
|
{
|
|
{
|
|
*pRes = CC_NORMAL;
|
|
*pRes = CC_NORMAL;
|
|
|
|
+
|
|
|
|
+ //for test
|
|
|
|
+ int i;
|
|
|
|
+ for(i=0;i<FAN_NUMBERS;i++)
|
|
|
|
+ gFanInfo[i].speed++;
|
|
|
|
+
|
|
memcpy(pRes+1, (uint8_t*)gFanInfo, FAN_NUMBERS*sizeof(FanInfo_T));
|
|
memcpy(pRes+1, (uint8_t*)gFanInfo, FAN_NUMBERS*sizeof(FanInfo_T));
|
|
return FAN_NUMBERS*sizeof(FanInfo_T) + 1;
|
|
return FAN_NUMBERS*sizeof(FanInfo_T) + 1;
|
|
}
|
|
}
|
|
@@ -665,7 +672,7 @@ int Storlead_GetBladeInfo(uint8_t *pReq, uint8_t ReqLen, uint8_t *pRes)
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
- Req[0] : sensor name
|
|
|
|
|
|
+ Req[0] : sensor number
|
|
|
|
|
|
*/
|
|
*/
|
|
int Storlead_GetSensorName(uint8_t *pReq, uint8_t ReqLen, uint8_t *pRes)
|
|
int Storlead_GetSensorName(uint8_t *pReq, uint8_t ReqLen, uint8_t *pRes)
|