cross-platform library for reading sensor output

Gabis1207

Awkward moment when...
Messages
252
Location
Tennessee
Greetings, fellow techies! As a follow-up to this thread, I am looking for a C/C++ library that allows me to read the hardware sensors within my system, in a similar way to everyone's favorite, HWMonitor.

I have done several googles for such libraries, and have only found one, named "ACPI". As far as I can tell, though, it is no longer being maintained.

Since writing my own library is beyond the scope of my abilities, can someone point me towards a (free, of course) C/C++ library, similar to ACPI, that will allow me to read the output of various sensors within my system? I need access to, as a bare minimum, temperature sensors and case fan RPMs, but the more, the merrier.

Thanks in advance,
Gabis
 
Last edited:
Based on that SO post, I'm guessing getting hardware sensor information is a lot more involved than I originally anticipated, huh?

Guess that means that finding a library where, for example, "double cpuTemp = temperature.get.CPU(0);" is just wishful thinking. xD
 
Based on that SO post, I'm guessing getting hardware sensor information is a lot more involved than I originally anticipated, huh?

Guess that means that finding a library where, for example, "double cpuTemp = temperature.get.CPU(0);" is just wishful thinking. xD

If you find the right library, or make a wrapper-library around existing libraries then yeah it could be that easy :p.

Doesn't look like the one I posted was cross-platform though - looked like it was through WMI, which is a Windows library.
 
Well, that is the only OS I use, but if I end up distributing the program, I'd like to ship to more than just windows users. If that's not feasible, then I guess it'll have to be just windows.

You'll have to forgive me though, I'm very green when it comes to dealing with libraries. I don't know if making a 'wrapper' library is something I have the know-how to do.
 
Well, that is the only OS I use, but if I end up distributing the program, I'd like to ship to more than just windows users. If that's not feasible, then I guess it'll have to be just windows.

You'll have to forgive me though, I'm very green when it comes to dealing with libraries. I don't know if making a 'wrapper' library is something I have the know-how to do.

All it would be doing, would be implementing your own functions that call the other library's functions. Basically making your own getters/setters and other utility functions that you can just call that do all the background work so that you don't have to do all the complicated stuff everytime.
 
That sounds simple enough, but then again, so did "Get X Sensor's output, and write it to a file". XD
 
That sounds simple enough, but then again, so did "Get X Sensor's output, and write it to a file". XD

Well making the wrapper depends on how complicated using one of the external libraries would be :p.

For example... If using the WMI library to get the CPU temp was complicated, such as setting up pointers, initializing objects, calling several functions, and then building the temp, etc... Then you could make 1 function inside of a separate library (or header file/CPP file) called "GetCPUTemp" and have it call that all of the ugly code. That way your main application interface's code would be nice and clean.
 
COM objects, pointers, objects, wrapper libraries...

I think the scale of this project is finally starting to sink in... :sick:
 
Last edited:
Back
Top Bottom