我们可以捕获USB设备的功耗值吗? [英] Can we capture the power consumption value from USB devices??

查看:77
本文介绍了我们可以捕获USB设备的功耗值吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨〜我对USB设备(例如:蓝牙或USB磁盘)没什么问题.如果我想知道使用C#或C/C ++ API的USB设备的功耗,那是不可能的吗?请给我一些指导或建议. :doh:


谢谢:)

Hi~ i have little problem with USB devices (ex:Bluetooth or USB disk). If i want to know the power consumption of USB devices using C# or C/C++ API, is''t possible?? Please give me some guide or advice. :doh:


Thank you :)

推荐答案

USB设备在配置描述符(bMaxPower)中指定了以2mA为单位表示的功耗.
这显示了如何获取设备配置描述符.

http://msdn.microsoft.com/zh-CN /library/windows/hardware/ff540174(v=vs.85).aspx [ http://www.beyondlogic.org/usbnutshell/usb5.shtml#DeviceDescriptors [ ^ ]
A USB device specifies its power consumption expressed in 2mA units in the configuration descriptor (bMaxPower).

This shows how to obtain device configuration descriptor.

http://msdn.microsoft.com/en-us/library/windows/hardware/ff540174(v=vs.85).aspx[^]

About device configuration descriptors:

http://www.beyondlogic.org/usbnutshell/usb5.shtml#DeviceDescriptors[^]


我认为你不走运.
如果事情过度,您也许能够捕获OS级别的异常,但是我不认为报告了当前情况.
如果您需要它来测试东西,我建议您使用一个好的伏特表和一条短的USB A母头电缆.在电缆中的电源线上串联一个毫欧欧姆的高精度电阻器,并测量电阻器两端的压降以获得电流.
您也许可以通过串行输出(甚至USB)获得一个VOM,并使用它将电流读回计算机.
I think you are out of luck.
You might be able to catch an OS level exception if the thing over-draws, but I don''t think current is reported.
If you need it to test stuff, I''d recommend getting a good volt ohm meter and a short USB A male-female cable. Splice a milli Ohm high precision resister inline with the power wire in the cable and measure the voltage drop across the resister to get the current.
You may be able to get a VOM with a serial output (or even USB) and use it to read the current back into a computer.


严重的是,伏特表?我的想法是,如果Windows能够显示连接的USB设备的电源要求,则必须有一种使用C#/C ++的方法.有人吗?
Seriously, a volt-ohm meter? My thinking is if Windows is able to display the power requirements of an attached USB device, there must be a way to do it in C#/C++. Anyone?


这篇关于我们可以捕获USB设备的功耗值吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆