首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

获得CPU电扇转速

2014-05-12 
获得CPU风扇转速目前想要得到电脑CPU风扇的转速。前提必须用程序实现请问有什么方法可以得到转速?有好的思

获得CPU风扇转速
目前想要得到电脑CPU风扇的转速。
前提必须用程序实现
请问有什么方法可以得到转速?
有好的思路没有?
求指点,有代码或思路的都可?
在我的机器上的到相应的转速可以单独加分。
[解决办法]
SMBIOS里取到Cooling Device这个结构,应该就有风扇的信息。不过现在的windows(XP以后)已经不能在用户态下映射物理内存了。你还可以试试window提供的WMI,看看有没有风扇速度。

linux下,SMBIOS拿。或者看看dmidecode能不能直接拿到风扇转速。
[解决办法]
http://msdn.microsoft.com/en-us/library/aa394146(VS.85).aspx
http://msdn.microsoft.com/en-us/library/aa387269(v=vs.85).aspx
http://stackoverflow.com/questions/485448/programmatically-access-cpu-fan-on-a-laptop-windows
[解决办法]
http://www.codeproject.com/Articles/17973/How-To-Get-Hardware-Information-CPU-ID-MainBoard-I
[解决办法]
class Win32_Fan : CIM_Fan
{
  boolean  ActiveCooling;
  uint16   Availability;
  string   Caption;
  uint32   ConfigManagerErrorCode;
  boolean  ConfigManagerUserConfig;
  string   CreationClassName;
  string   Description;
  uint64   DesiredSpeed;
  string   DeviceID;
  boolean  ErrorCleared;
  string   ErrorDescription;
  datetime InstallDate;
  uint32   LastErrorCode;
  string   Name;
  string   PNPDeviceID;
  uint16   PowerManagementCapabilities[];
  boolean  PowerManagementSupported;
  string   Status;
  uint16   StatusInfo;
  string   SystemCreationClassName;
  string   SystemName;
  boolean  VariableSpeed;
};

DesiredSpeed

    Data type: uint64
    Access type: Read/write

    Currently requested fan speed, defined in revolutions per minute, when a variable speed fan is supported (VariableSpeed is TRUE). The current speed is determined by a sensor (CIM_Tachometer) that is associated with the fan using the CIM_AssociatedSensor relationship. This property is inherited from CIM_Fan.

    For more information about using uint64 values in scripts, see Scripting in WMI.

这个不是么?网上看了下,好像有些主板也不支持WMI获取fan的接口。
不行就只有试试SMBIOS了。如果是windows xp系统,应该还可以在用户态下映射物理内存文件。

[解决办法]
DesiredSpeed

    Data type: uint64
    Access type: Read/write

    Currently requested fan speed, defined in revolutions per minute, when a variable speed fan is supported (VariableSpeed is TRUE). The current speed is determined by a sensor (CIM_Tachometer) that is associated with the fan using the CIM_AssociatedSensor relationship. This property is inherited from CIM_Fan.

这句话里的两个连接看下有没有用

[解决办法]
这里有源代码
http://www.oschina.net/code/snippet_222150_14129
[解决办法]

引用:
Quote: 引用:

DesiredSpeed

    Data type: uint64
    Access type: Read/write

    Currently requested fan speed, defined in revolutions per minute, when a variable speed fan is supported (VariableSpeed is TRUE). The current speed is determined by a sensor (CIM_Tachometer) that is associated with the fan using the CIM_AssociatedSensor relationship. This property is inherited from CIM_Fan.

这句话里的两个连接看下有没有用


CIM_Tachometer
CIM_AssociatedSensor
这两个类WMI都不实现,我应该怎么用啊?求指点

http://stackoverflow.com/questions/1310777/set-fan-speed-on-windows-in-c


这里有个通过com来获得的CIM_Fan,你可以试着用同样的方法来获得CIM_Tachometer


http://www.dmtf.org/standards/smbios  
你可以在这里下到smbios协议
[解决办法]
WMI中有一个Win32_Fan T-Balancer bigNG fan controller or http://www.alphacool.com/product_info.php/info/p999_Alphacool-Heatmaster-II.html? can work bacos 
[解决办法]
似乎就是调用API而已

热点排行