libsensor.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* ***************************-*- andrew-c -*-****************************** */
  2. /* Filename: libsensor.h */
  3. /* Author: Andrew McCallum (andrewm@ami.com) */
  4. /* Format: Indent: 4 spaces, no tabs */
  5. /* Created: 09/21/2004 */
  6. /* Modified: 09/21/2004 */
  7. /* Description: Prototypes and defines for sensor helper functions */
  8. /* ************************************************************************* */
  9. #ifndef LIBSENSOR_H_
  10. #define LIBSENSOR_H_
  11. #include "libipmi_session.h"
  12. // /* IPMI threshold state definitions for monitoring */
  13. // #define THRESH_UNINITIALIZED ( (u16)0x00 )
  14. // #define THRESH_NORMAL ( (u16)0x01 )
  15. // #define THRESH_UP_NONCRIT ( (u16)0x02 )
  16. // #define THRESH_UP_CRITICAL ( (u16)0x04 )
  17. // #define THRESH_LOW_NONCRIT ( (u16)0x08 )
  18. // #define THRESH_LOW_CRITICAL ( (u16)0x10 )
  19. // #define THRESH_ACCESS_FAILED ( (u16)0x20 )
  20. // #define THRESH_UP_NON_RECOV ( (u16)0x40 )
  21. // #define THRESH_LOW_NON_RECOV ( (u16)0x80 )
  22. #pragma pack(1)
  23. struct sensor_data
  24. {
  25. /*
  26. sensor_name array length increased from 17 to 20.
  27. In some cases sensor_name length is more than 17 characters. webgo was giving some special character to web page in those cases and webpage was giving some weird behaviour when it found that special character.
  28. */
  29. uint8_t sensor_num;
  30. char sensor_name[ 20 ];
  31. uint8_t owner_id;
  32. uint8_t owner_lun;
  33. uint8_t sensor_type;
  34. uint8_t sensor_units[ 3 ];
  35. float sensor_reading;
  36. uint8_t raw_reading;
  37. uint16_t sensor_state;
  38. uint8_t discrete_state;
  39. float low_non_recov_thresh;
  40. float low_crit_thresh;
  41. float low_non_crit_thresh;
  42. float high_non_crit_thresh;
  43. float high_crit_thresh;
  44. float high_non_recov_thresh;
  45. float max_reading;
  46. float min_reading;
  47. int SensorAccessibleFlags;
  48. uint16_t Settable_Readable_ThreshMask;
  49. } ;
  50. #pragma pack()
  51. int getsensorcount( IPMI20_UDS_SESSION_T *pUDSSession );
  52. int getallsensorreadings( struct sensor_data *sensors, IPMI20_UDS_SESSION_T *pUDSSession );
  53. #endif