SensorEvent.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /*
  2. * Brief: The header file of MsgHndlr_SensorEvent packet.
  3. * Author: Jimbo_Zhang@outlook.com
  4. * Date: 2019-9-16
  5. */
  6. #ifndef __MSG_HNDLR_SENSOR_EVENT_H__
  7. #define __MSG_HNDLR_SENSOR_EVENT_H__
  8. #include "MsgHndlr.h"
  9. //#include "SensorMonitor.h"
  10. /**
  11. * @var g_SensorEvent_CmdHndlr
  12. * @brief Sensor event command handler map.
  13. **/
  14. extern const CmdHndlrMap_T g_SensorEvent_CmdHndlr [];
  15. /*** External Definitions ***/
  16. /*** Global definitions ***/
  17. /* SEL Sensor */
  18. #define EVENT_LOG_AREA_RESET 0x2
  19. #define EVENT_SEL_ALMOST_FULL 0x5
  20. #define EVENT_SEL_IS_FULL 0x4
  21. /* Watchdog Sensor */
  22. #define EVENT_TIMER_EXPIRED 0x00
  23. #define EVENT_HARD_RESET 0x01
  24. #define EVENT_POWER_DOWN 0x02
  25. #define EVENT_POWER_CYCLE 0x03
  26. #define EVENT_TIMER_INT 0x08
  27. //typedef struct
  28. //{
  29. // uint8_t SensorTypeCode; /* Sensor Type code */
  30. // uint16_t SensorReading; /* Sensor Reading */
  31. // uint8_t SensorNum; /* Sensor Number */
  32. // uint16_t u16AssertionHistory;/* Assertion tracking */
  33. // uint8_t u8TmrUse; /* WDT use */
  34. // uint8_t u8TmrActions; /* WDT actions */
  35. // uint8_t u8Restarted; /* WDT restarted */
  36. // pPDK_SensorInitHook_T pInitSensor; /* Init Sensor hook */
  37. // pPDK_MonitorHook_T pPreMonitor; /* Pre monitor hook */
  38. // pPDK_MonitorHook_T pPostMonitor; /* Post monitor hook */
  39. // pPDK_MonitorExtHook_T pPostMonitorExt; /* Post monitor Ext hook */
  40. // uint8_t EntityID; /* Entity ID */
  41. // uint8_t EntityInst; /* Entity Instance */
  42. // uint32_t FeatureSupport; /* Feature Supported or not*/
  43. // uint8_t SensorOwnerLun; /* OwnerLUN */
  44. //} InternalSensorTbl_T;
  45. ///*** Prototype Declaration ***/
  46. ///* Functions for SEL Sensor Implementation */
  47. //int SELSensorInit (void* pSensorInfo);
  48. //int SELMonitor (void* pSenInfo, uint8_t* pReadFlags);
  49. //int SELEventLog (void* pSenInfo, uint8_t* pReadFlags);
  50. //int SELEventLogExt (void* pSenInfo, uint8_t* pReadFlags);
  51. ///* Functions for Watchdog Sensor Implementation */
  52. //int WD2SensorInit (void* pSensorInfo);
  53. //int WD2Monitor (void* pSenInfo, uint8_t* pReadFlags);
  54. //int WD2DummyEventLog (void* pSenInfo, uint8_t* pReadFlags);
  55. //int WD2EventLog (void* pSenInfo, uint8_t* pReadFlags);
  56. //int WD2EventLogExt (void* pSenInfo, uint8_t* pReadFlags);
  57. ///* Functions for SSI Compute Blade Operational State Sensor Implementation */
  58. //int OpStateSensorInit (void* pSenInfo);
  59. //int OpStateMonitor (void *pSenInfo, uint8_t* pReadFlags);
  60. //int OpStateEventLog (void *pSenInfo, uint8_t* pReadFlags);
  61. //int OpStateEventLogExt (void* pSenInfo, uint8_t* pReadFlags);
  62. ///* Functions for SSI Compute Blade Aggregated Thermal Sensor Implementation */
  63. //int AggregateThermalSensorInit (void* pSenInfo);
  64. //int AggregateThermalMonitor (void *pSenInfo, uint8_t* pReadFlags);
  65. //int AggregateThermalEventLog (void *pSenInfo, uint8_t* pReadFlags);
  66. //int AggregateThermalEventLogExt (void* pSenInfo, uint8_t* pReadFlags);
  67. ///* Functions for SSI Compute Blade Aggregated Fault Sensor Implementation */
  68. //int AggregateFaultSensorInit (void* pSenInfo);
  69. //int AggregateFaultMonitor (void *pSenInfo, uint8_t* pReadFlags);
  70. //int AggregateFaultEventLog (void *pSenInfo, uint8_t* pReadFlags);
  71. //int AggregateFaultEventLogExt (void* pSenInfo, uint8_t* pReadFlags);
  72. ///* Functions for SSI Compute Blade Service State Sensor Implementation */
  73. //int ServiceStateSensorInit (void* pSenInfo);
  74. //int ServiceStateMonitor (void *pSenInfo, uint8_t* pReadFlags);
  75. //int ServiceStateEventLog (void *pSenInfo, uint8_t* pReadFlags);
  76. //int ServiceStateEventLogExt (void* pSenInfo, uint8_t* pReadFlags);
  77. /*-----------------------------------------
  78. * GetSELFullPercentage
  79. *-----------------------------------------*/
  80. extern uint8_t GetSELFullPercentage(void);
  81. /**
  82. * @brief GetSensorNumFromSensorType.
  83. * @param SensorType - Sensor Type of the sensor.
  84. * @return SensorInfo if success, 0xFF if error.
  85. **/
  86. extern void* GetSensorInfoFromSensorType(uint8_t SensorType);
  87. ///**
  88. // * @brief SetSELSensorReading.
  89. // * @param Res - Sensor reading to be set.
  90. // * @return 0 if success, -1 if error.
  91. //**/
  92. //extern int SetSELSensorReading (uint16_t Reading);
  93. ///**
  94. // * @brief SetWD2SensorReading.
  95. // * @param Res - Sensor reading to be set.
  96. // * @return 0 if success, -1 if error.
  97. //**/
  98. //extern int SetWD2SensorReading (uint16_t Reading, uint8_t u8TmrUse, uint8_t u8TmrActions);
  99. //extern int RestartWD2Sensor(int BMCInst);
  100. //extern int WD2SELLog (uint8_t Action);
  101. #endif /* __MSG_HNDLR_SENSOR_EVENT_H__ */