|
@@ -6,6 +6,7 @@
|
|
#include "SensorMonitor.h"
|
|
#include "SensorMonitor.h"
|
|
#include "Sensor.h"
|
|
#include "Sensor.h"
|
|
#include "com_IPMI_SDRRecord.h"
|
|
#include "com_IPMI_SDRRecord.h"
|
|
|
|
+#include "SDR.h"
|
|
|
|
|
|
int Storlead_GetSysInfo(uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
|
|
int Storlead_GetSysInfo(uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
|
|
{
|
|
{
|
|
@@ -77,9 +78,9 @@ int Storlead_GetSensorInfo(uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
|
|
{
|
|
{
|
|
printf("Storlead_GetSensorInfo\n" );
|
|
printf("Storlead_GetSensorInfo\n" );
|
|
|
|
|
|
- AMIGetSensorInfoRes_T *pAMIGetSensorInfoRes = (AMIGetSensorInfoRes_T *)pRes;
|
|
|
|
|
|
+ StorleadGetSensorInfoRes_T *pGetSensorInfoRes = (StorleadGetSensorInfoRes_T *)pRes;
|
|
uint8_t* pValidSensor = NULL;
|
|
uint8_t* pValidSensor = NULL;
|
|
- uint16_t SensorIndex = 0;
|
|
|
|
|
|
+ uint16_t SensorIndex = pReq[0];
|
|
SensorInfo_T pSensor ;
|
|
SensorInfo_T pSensor ;
|
|
SenInfo_T SensorInfo;
|
|
SenInfo_T SensorInfo;
|
|
uint8_t SensorIsSigned = FALSE;
|
|
uint8_t SensorIsSigned = FALSE;
|
|
@@ -89,175 +90,183 @@ int Storlead_GetSensorInfo(uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
|
|
FullSensorRec_T* FullSDR;
|
|
FullSensorRec_T* FullSDR;
|
|
CompactSensorRec_T* CompSDR;
|
|
CompactSensorRec_T* CompSDR;
|
|
int i = 0;
|
|
int i = 0;
|
|
|
|
+ int totalsize;
|
|
|
|
|
|
/* Get the Sensor Shared Memory */
|
|
/* Get the Sensor Shared Memory */
|
|
pSMSharedMem = (SensorSharedMem_T*)&g_BMCInfo.SensorSharedMem;
|
|
pSMSharedMem = (SensorSharedMem_T*)&g_BMCInfo.SensorSharedMem;
|
|
|
|
|
|
if(g_BMCInfo.SenConfig.ValidSensorCnt == 0)
|
|
if(g_BMCInfo.SenConfig.ValidSensorCnt == 0)
|
|
{
|
|
{
|
|
- pAMIGetSensorInfoRes->CompletionCode = OEMCC_SENSOR_INFO_EMPTY;
|
|
|
|
|
|
+ pGetSensorInfoRes->CompletionCode = OEMCC_SENSOR_INFO_EMPTY;
|
|
printf("ValidSensorCnt is 0\n");
|
|
printf("ValidSensorCnt is 0\n");
|
|
- return sizeof(*pRes);
|
|
|
|
|
|
+ return 1;
|
|
}
|
|
}
|
|
|
|
|
|
- pValidSensor = (uint8_t*)(pAMIGetSensorInfoRes+1);
|
|
|
|
- for(i = 0; i < g_BMCInfo.SenConfig.ValidSensorCnt; i++)
|
|
|
|
|
|
+ if(SensorIndex >= g_BMCInfo.SenConfig.ValidSensorCnt)
|
|
{
|
|
{
|
|
- SensorIndex = g_BMCInfo.SenConfig.ValidSensorList[i];
|
|
|
|
|
|
+ pGetSensorInfoRes->CompletionCode = CC_PARAM_OUT_OF_RANGE;
|
|
|
|
+ printf("Invalid SenosrIndex %d\n", SensorIndex);
|
|
|
|
+ return 1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //pValidSensor = (uint8_t*)(pAMIGetSensorInfoRes+1);
|
|
|
|
+ // for(i = 0; i < g_BMCInfo.SenConfig.ValidSensorCnt; i++)
|
|
|
|
+ // {
|
|
|
|
+ //SensorIndex = g_BMCInfo.SenConfig.ValidSensorList[i];
|
|
pSensor = pSMSharedMem->SensorInfo[SensorIndex];
|
|
pSensor = pSMSharedMem->SensorInfo[SensorIndex];
|
|
|
|
|
|
/*Copy the SDR Header*/
|
|
/*Copy the SDR Header*/
|
|
- memcpy(&SensorInfo.hdr,pSensor.SDRRec,sizeof(SDRRecHdr_T));
|
|
|
|
|
|
+ memcpy(&pGetSensorInfoRes->SensorInfo.hdr,pSensor.SDRRec,sizeof(SDRRecHdr_T));
|
|
|
|
|
|
- SensorInfo.SensorNumber = pSensor.SensorNumber;
|
|
|
|
- SensorInfo.SensorTypeCode = pSensor.SensorTypeCode;
|
|
|
|
- SensorInfo.EventTypeCode = pSensor.EventTypeCode;
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.SensorNumber = pSensor.SensorNumber;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.SensorTypeCode = pSensor.SensorTypeCode;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.EventTypeCode = pSensor.EventTypeCode;
|
|
|
|
|
|
- SensorInfo.Units1 = pSensor.Units1;
|
|
|
|
- SensorInfo.Units2 = pSensor.Units2;
|
|
|
|
- SensorInfo.Units3 = pSensor.Units3;
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.Units1 = pSensor.Units1;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.Units2 = pSensor.Units2;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.Units3 = pSensor.Units3;
|
|
|
|
|
|
- SensorInfo.M_LSB = pSensor.M_LSB;
|
|
|
|
- SensorInfo.M_MSB_Tolerance = pSensor.M_MSB_Tolerance;
|
|
|
|
- SensorInfo.B_LSB = pSensor.B_LSB;
|
|
|
|
- SensorInfo.B_MSB_Accuracy = pSensor.B_MSB_Accuracy;
|
|
|
|
- SensorInfo.Accuracy_MSB_Exp = pSensor.Accuracy_MSB_Exp;
|
|
|
|
- SensorInfo.RExp_BExp = pSensor.RExp_BExp;
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.M_LSB = pSensor.M_LSB;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.M_MSB_Tolerance = pSensor.M_MSB_Tolerance;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.B_LSB = pSensor.B_LSB;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.B_MSB_Accuracy = pSensor.B_MSB_Accuracy;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.Accuracy_MSB_Exp = pSensor.Accuracy_MSB_Exp;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.RExp_BExp = pSensor.RExp_BExp;
|
|
|
|
|
|
- SensorInfo.LowerNonCritical = pSensor.LowerNonCritical;
|
|
|
|
- SensorInfo.LowerCritical = pSensor.LowerCritical;
|
|
|
|
- SensorInfo.LowerNonRecoverable = pSensor.LowerNonRecoverable;
|
|
|
|
- SensorInfo.UpperNonCritical = pSensor.UpperNonCritical;
|
|
|
|
- SensorInfo.UpperCritical = pSensor.UpperCritical;
|
|
|
|
- SensorInfo.UpperNonRecoverable= pSensor.UpperNonRecoverable;
|
|
|
|
- SensorInfo.Settable_Readable_ThreshMask= pSensor.SettableThreshMask;
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.LowerNonCritical = pSensor.LowerNonCritical;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.LowerCritical = pSensor.LowerCritical;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.LowerNonRecoverable = pSensor.LowerNonRecoverable;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.UpperNonCritical = pSensor.UpperNonCritical;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.UpperCritical = pSensor.UpperCritical;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.UpperNonRecoverable= pSensor.UpperNonRecoverable;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.Settable_Readable_ThreshMask= pSensor.SettableThreshMask;
|
|
|
|
|
|
- SensorInfo.Flags = pSensor.EventFlags & 0xe0;
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.Flags = pSensor.EventFlags & 0xe0;
|
|
if((pSensor.EventFlags & BIT5) != 0)
|
|
if((pSensor.EventFlags & BIT5) != 0)
|
|
{
|
|
{
|
|
- SensorInfo.SensorReading = 0;
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.SensorReading = 0;
|
|
}
|
|
}
|
|
|
|
|
|
SensorReading = pSensor.SensorReading;
|
|
SensorReading = pSensor.SensorReading;
|
|
- SensorInfo.SensorReading = 0;
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.SensorReading = 0;
|
|
SensorIsSigned = ( 0 != (pSensor.InternalFlags & BIT1));
|
|
SensorIsSigned = ( 0 != (pSensor.InternalFlags & BIT1));
|
|
|
|
|
|
if (THRESHOLD_SENSOR_CLASS == pSensor.EventTypeCode)
|
|
if (THRESHOLD_SENSOR_CLASS == pSensor.EventTypeCode)
|
|
{
|
|
{
|
|
- SensorInfo.SensorReading = (SensorReading & 0x00FF);
|
|
|
|
- SensorInfo.ComparisonStatus = 0;
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.SensorReading = (SensorReading & 0x00FF);
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.ComparisonStatus = 0;
|
|
if((pSensor.DeassertionEventEnablesByte2 & BIT6) == BIT6 )
|
|
if((pSensor.DeassertionEventEnablesByte2 & BIT6) == BIT6 )
|
|
{
|
|
{
|
|
- if (CompareValues(SensorIsSigned, SensorInfo.SensorReading, pSensor.UpperNonRecoverable) >= 0)
|
|
|
|
|
|
+ if (CompareValues(SensorIsSigned, pGetSensorInfoRes->SensorInfo.SensorReading, pSensor.UpperNonRecoverable) >= 0)
|
|
{
|
|
{
|
|
- SensorInfo.ComparisonStatus |= BIT5;
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.ComparisonStatus |= BIT5;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if((pSensor.DeassertionEventEnablesByte2 & BIT5) == BIT5 )
|
|
if((pSensor.DeassertionEventEnablesByte2 & BIT5) == BIT5 )
|
|
{
|
|
{
|
|
- if (CompareValues(SensorIsSigned, SensorInfo.SensorReading, pSensor.UpperCritical) >= 0)
|
|
|
|
|
|
+ if (CompareValues(SensorIsSigned, pGetSensorInfoRes->SensorInfo.SensorReading, pSensor.UpperCritical) >= 0)
|
|
{
|
|
{
|
|
- SensorInfo.ComparisonStatus |= BIT4;
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.ComparisonStatus |= BIT4;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if((pSensor.DeassertionEventEnablesByte2 & BIT4) == BIT4 )
|
|
if((pSensor.DeassertionEventEnablesByte2 & BIT4) == BIT4 )
|
|
{
|
|
{
|
|
- if (CompareValues(SensorIsSigned, SensorInfo.SensorReading, pSensor.UpperNonCritical) >= 0)
|
|
|
|
|
|
+ if (CompareValues(SensorIsSigned, pGetSensorInfoRes->SensorInfo.SensorReading, pSensor.UpperNonCritical) >= 0)
|
|
{
|
|
{
|
|
- SensorInfo.ComparisonStatus |= BIT3;
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.ComparisonStatus |= BIT3;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if((pSensor.AssertionEventEnablesByte2 & BIT6) == BIT6 )
|
|
if((pSensor.AssertionEventEnablesByte2 & BIT6) == BIT6 )
|
|
{
|
|
{
|
|
- if (CompareValues(SensorIsSigned, SensorInfo.SensorReading, pSensor.LowerNonRecoverable) <= 0)
|
|
|
|
|
|
+ if (CompareValues(SensorIsSigned, pGetSensorInfoRes->SensorInfo.SensorReading, pSensor.LowerNonRecoverable) <= 0)
|
|
{
|
|
{
|
|
- SensorInfo.ComparisonStatus |= BIT2;
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.ComparisonStatus |= BIT2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if((pSensor.AssertionEventEnablesByte2 & BIT5) == BIT5 )
|
|
if((pSensor.AssertionEventEnablesByte2 & BIT5) == BIT5 )
|
|
{
|
|
{
|
|
- if (CompareValues(SensorIsSigned, SensorInfo.SensorReading, pSensor.LowerCritical) <= 0)
|
|
|
|
|
|
+ if (CompareValues(SensorIsSigned, pGetSensorInfoRes->SensorInfo.SensorReading, pSensor.LowerCritical) <= 0)
|
|
{
|
|
{
|
|
- SensorInfo.ComparisonStatus |= BIT1;
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.ComparisonStatus |= BIT1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if((pSensor.AssertionEventEnablesByte2 & BIT4) == BIT4 )
|
|
if((pSensor.AssertionEventEnablesByte2 & BIT4) == BIT4 )
|
|
{
|
|
{
|
|
- if (CompareValues(SensorIsSigned, SensorInfo.SensorReading, pSensor.LowerNonCritical) <= 0)
|
|
|
|
|
|
+ if (CompareValues(SensorIsSigned, pGetSensorInfoRes->SensorInfo.SensorReading, pSensor.LowerNonCritical) <= 0)
|
|
{
|
|
{
|
|
- SensorInfo.ComparisonStatus |= BIT0;
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.ComparisonStatus |= BIT0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- SensorInfo.ComparisonStatus &= ((pSensor.SettableThreshMask >> 8) & 0xFF);
|
|
|
|
- SensorInfo.OptionalStatus = 0;
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.ComparisonStatus &= ((pSensor.SettableThreshMask >> 8) & 0xFF);
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.OptionalStatus = 0;
|
|
// For Threshold sensor, [7:6] - reserved. Returned as 1b. Ignore on read.
|
|
// For Threshold sensor, [7:6] - reserved. Returned as 1b. Ignore on read.
|
|
- SensorInfo.ComparisonStatus |= THRESHOLD_RESERVED_BIT;
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.ComparisonStatus |= THRESHOLD_RESERVED_BIT;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- SensorInfo.ComparisonStatus = (((uint8_t) (SensorReading & 0x00FF)) & ((uint8_t) (pSensor.SettableThreshMask & 0x00FF)) );
|
|
|
|
- SensorInfo.OptionalStatus = (((uint8_t) (SensorReading >> 8)) & ((uint8_t) (pSensor.SettableThreshMask >> 8)) );
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.ComparisonStatus = (((uint8_t) (SensorReading & 0x00FF)) & ((uint8_t) (pSensor.SettableThreshMask & 0x00FF)) );
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.OptionalStatus = (((uint8_t) (SensorReading >> 8)) & ((uint8_t) (pSensor.SettableThreshMask >> 8)) );
|
|
// For Discrete sensor, [7] - reserved. Returned as 1b. Ignore on read.
|
|
// For Discrete sensor, [7] - reserved. Returned as 1b. Ignore on read.
|
|
- SensorInfo.OptionalStatus |= DISCRETE_RESERVED_BIT;
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.OptionalStatus |= DISCRETE_RESERVED_BIT;
|
|
}
|
|
}
|
|
|
|
|
|
if((pSensor.EventFlags & BIT7) == 0)
|
|
if((pSensor.EventFlags & BIT7) == 0)
|
|
{
|
|
{
|
|
- SensorInfo.AssertionEventByte1 = 0;
|
|
|
|
- SensorInfo.AssertionEventByte2 = 0;
|
|
|
|
- SensorInfo.DeassertionEventByte1 = 0;
|
|
|
|
- SensorInfo.DeassertionEventByte2 = 0;
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.AssertionEventByte1 = 0;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.AssertionEventByte2 = 0;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.DeassertionEventByte1 = 0;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.DeassertionEventByte2 = 0;
|
|
}
|
|
}
|
|
if((pSensor.SensorCaps & BIT6) == 0)
|
|
if((pSensor.SensorCaps & BIT6) == 0)
|
|
{
|
|
{
|
|
- SensorInfo.AssertionEventByte1 = (pSensor.AssertionHistoryByte1 & pSensor.AssertionEventEnablesByte1);
|
|
|
|
- SensorInfo.AssertionEventByte2 = (pSensor.AssertionHistoryByte2 & pSensor.AssertionEventEnablesByte2);
|
|
|
|
- SensorInfo.DeassertionEventByte1 = (pSensor.DeassertionHistoryByte1 & pSensor.DeassertionEventEnablesByte1);
|
|
|
|
- SensorInfo.DeassertionEventByte2 = (pSensor.DeassertionHistoryByte2 & pSensor.DeassertionEventEnablesByte2);
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.AssertionEventByte1 = (pSensor.AssertionHistoryByte1 & pSensor.AssertionEventEnablesByte1);
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.AssertionEventByte2 = (pSensor.AssertionHistoryByte2 & pSensor.AssertionEventEnablesByte2);
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.DeassertionEventByte1 = (pSensor.DeassertionHistoryByte1 & pSensor.DeassertionEventEnablesByte1);
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.DeassertionEventByte2 = (pSensor.DeassertionHistoryByte2 & pSensor.DeassertionEventEnablesByte2);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- SensorInfo.AssertionEventByte1 = (pSensor.AssertionEventOccuredByte1 & pSensor.AssertionEventEnablesByte1);
|
|
|
|
- SensorInfo.AssertionEventByte2 = (pSensor.AssertionEventOccuredByte2 & pSensor.AssertionEventEnablesByte2);
|
|
|
|
- SensorInfo.DeassertionEventByte1 = (pSensor.DeassertionEventOccuredByte1 & pSensor.DeassertionEventEnablesByte1);
|
|
|
|
- SensorInfo.DeassertionEventByte2 = (pSensor.DeassertionEventOccuredByte2 & pSensor.DeassertionEventEnablesByte2);
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.AssertionEventByte1 = (pSensor.AssertionEventOccuredByte1 & pSensor.AssertionEventEnablesByte1);
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.AssertionEventByte2 = (pSensor.AssertionEventOccuredByte2 & pSensor.AssertionEventEnablesByte2);
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.DeassertionEventByte1 = (pSensor.DeassertionEventOccuredByte1 & pSensor.DeassertionEventEnablesByte1);
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.DeassertionEventByte2 = (pSensor.DeassertionEventOccuredByte2 & pSensor.DeassertionEventEnablesByte2);
|
|
}
|
|
}
|
|
pSDRRec = GetSDRRec(pSensor.SDRRec->ID);
|
|
pSDRRec = GetSDRRec(pSensor.SDRRec->ID);
|
|
if(pSensor.SDRRec->Type == FULL_SDR_REC) /*Full SDR*/
|
|
if(pSensor.SDRRec->Type == FULL_SDR_REC) /*Full SDR*/
|
|
{
|
|
{
|
|
FullSDR = (FullSensorRec_T *)pSDRRec;
|
|
FullSDR = (FullSensorRec_T *)pSDRRec;
|
|
- SensorInfo.OwnerID = FullSDR->OwnerID;
|
|
|
|
- SensorInfo.OwnerLUN= FullSDR->OwnerLUN;
|
|
|
|
- SensorInfo.MaxReading = FullSDR->MaxReading;
|
|
|
|
- SensorInfo.MinReading = FullSDR->MinReading;
|
|
|
|
- SensorInfo.Linearization = FullSDR->Linearization;
|
|
|
|
- memset(SensorInfo.SensorName,0,MAX_ID_STR_LEN);
|
|
|
|
- strncpy(SensorInfo.SensorName,FullSDR->IDStr, MAX_ID_STR_LEN - (sizeof(FullSensorRec_T) - sizeof(SDRRecHdr_T) - FullSDR->hdr.Len));
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.OwnerID = FullSDR->OwnerID;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.OwnerLUN= FullSDR->OwnerLUN;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.MaxReading = FullSDR->MaxReading;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.MinReading = FullSDR->MinReading;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.Linearization = FullSDR->Linearization;
|
|
|
|
+ memset(pGetSensorInfoRes->SensorInfo.SensorName,0,MAX_ID_STR_LEN);
|
|
|
|
+ strncpy(pGetSensorInfoRes->SensorInfo.SensorName,FullSDR->IDStr, MAX_ID_STR_LEN - (sizeof(FullSensorRec_T) - sizeof(SDRRecHdr_T) - FullSDR->hdr.Len));
|
|
}
|
|
}
|
|
else if(pSensor.SDRRec->Type == COMPACT_SDR_REC) /*Compact SDR*/
|
|
else if(pSensor.SDRRec->Type == COMPACT_SDR_REC) /*Compact SDR*/
|
|
{
|
|
{
|
|
CompSDR = (CompactSensorRec_T *)pSDRRec;
|
|
CompSDR = (CompactSensorRec_T *)pSDRRec;
|
|
- SensorInfo.OwnerID = CompSDR->OwnerID;
|
|
|
|
- SensorInfo.OwnerLUN= CompSDR->OwnerLUN;
|
|
|
|
- SensorInfo.MaxReading = 0;
|
|
|
|
- SensorInfo.MinReading = 0;
|
|
|
|
- SensorInfo.Linearization = 0;
|
|
|
|
- memset(SensorInfo.SensorName,0,MAX_ID_STR_LEN);
|
|
|
|
- strncpy(SensorInfo.SensorName,CompSDR->IDStr, MAX_ID_STR_LEN - (sizeof(CompactSensorRec_T) - sizeof(SDRRecHdr_T) - CompSDR->hdr.Len));
|
|
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.OwnerID = CompSDR->OwnerID;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.OwnerLUN= CompSDR->OwnerLUN;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.MaxReading = 0;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.MinReading = 0;
|
|
|
|
+ pGetSensorInfoRes->SensorInfo.Linearization = 0;
|
|
|
|
+ memset(pGetSensorInfoRes->SensorInfo.SensorName,0,MAX_ID_STR_LEN);
|
|
|
|
+ strncpy(pGetSensorInfoRes->SensorInfo.SensorName,CompSDR->IDStr, MAX_ID_STR_LEN - (sizeof(CompactSensorRec_T) - sizeof(SDRRecHdr_T) - CompSDR->hdr.Len));
|
|
}
|
|
}
|
|
- memcpy(pValidSensor,(uint8_t *)&SensorInfo,sizeof(SenInfo_T));
|
|
|
|
- pValidSensor = pValidSensor + sizeof(SenInfo_T);
|
|
|
|
- }
|
|
|
|
|
|
+ //memcpy(pValidSensor,(uint8_t *)&SensorInfo,sizeof(SenInfo_T));
|
|
|
|
+ //pValidSensor = pValidSensor + sizeof(SenInfo_T);
|
|
|
|
+ //}
|
|
|
|
|
|
- pAMIGetSensorInfoRes->CompletionCode = CC_NORMAL;
|
|
|
|
- pAMIGetSensorInfoRes->Noofentries = g_BMCInfo.SenConfig.ValidSensorCnt;
|
|
|
|
|
|
+ pGetSensorInfoRes->CompletionCode = CC_NORMAL;
|
|
|
|
+ //pAMIGetSensorInfoRes->Noofentries = g_BMCInfo.SenConfig.ValidSensorCnt;
|
|
|
|
|
|
- // printf("return %d :", sizeof(AMIGetSensorInfoRes_T) + (sizeof(SenInfo_T) * g_BMCInfo.SenConfig.ValidSensorCnt));
|
|
|
|
|
|
+ //totalsize = sizeof(AMIGetSensorInfoRes_T) + (sizeof(SenInfo_T) * 11/*g_BMCInfo.SenConfig.ValidSensorCnt*/);
|
|
|
|
+ // printf("return %d :", totalsize);
|
|
// for(i=0;i<sizeof(AMIGetSensorInfoRes_T) + (sizeof(SenInfo_T) * g_BMCInfo.SenConfig.ValidSensorCnt);i++)
|
|
// for(i=0;i<sizeof(AMIGetSensorInfoRes_T) + (sizeof(SenInfo_T) * g_BMCInfo.SenConfig.ValidSensorCnt);i++)
|
|
// printf("%#x ", pRes[i]);
|
|
// printf("%#x ", pRes[i]);
|
|
// printf("\n");
|
|
// printf("\n");
|
|
|
|
|
|
- return sizeof(AMIGetSensorInfoRes_T) + (sizeof(SenInfo_T) * g_BMCInfo.SenConfig.ValidSensorCnt);
|
|
|
|
-
|
|
|
|
|
|
+ return sizeof(StorleadGetSensorInfoRes_T);
|
|
}
|
|
}
|