简体   繁体   English

睡眠时如何在OSX上安装USB设备?

[英]How to mount USB device on OSX while sleeping?

通常在计算机醒着时会挂载USB设备。我正在编写程序以通过USB设备唤醒计算机,但是计算机在睡眠时无法识别USB设备。如何解决此问题?

you can not mount a device while sleeping because the sleep state is a either SUSPEND_TO_MEMORY or SUSPEND_TO_DISK in that not all functions of the machine are available ( https://en.wikipedia.org/wiki/Sleep_mode ) 您无法在睡眠时挂载设备,因为睡眠状态为SUSPEND_TO_MEMORYSUSPEND_TO_DISK ,因为并非机器的所有功能都可用( https://en.wikipedia.org/wiki/Sleep_mode

you can wakeup the machine over USB ( wake up event ). 您可以通过USB唤醒机器(唤醒事件)。 the principle of USB wakeup is similar to WOL ( https://en.wikipedia.org/wiki/Wake-on-LAN ). USB唤醒的原理类似于WOL( https://en.wikipedia.org/wiki/Wake-on-LAN )。 a special interupt is send to the host what triggers the host to wake up. 将向主机发送特殊中断,从而触发主机唤醒。 not all USB devices are able to generate this interrupt, mass storage devices like USB sticks are not able, mice and keyboards and ... are ( https://msdn.microsoft.com/en-us/library/windows/hardware/ff537628(v=vs.85).aspx , https://msdn.microsoft.com/en-us/library/windows/hardware/ff551766(v=vs.85).aspx ). 并非所有USB设备都能够生成此中断,并非USB记忆棒等大容量存储设备,鼠标和键盘以及...是( https://msdn.microsoft.com/zh-cn/library/windows/hardware/ ff537628(v = vs.85).aspxhttps: //msdn.microsoft.com/en-us/library/windows/hardware/ff551766(v=vs.85).aspx )。 maybe it is possible to emulate this interrupt with a USB mass storage device however then you have to modify the firmware of the device and this close to impossible if you do not develop your own mass storage device 也许可以用USB大容量存储设备模拟此中断,但是随后您必须修改该设备的固件,如果您不开发自己的大容量存储设备,这几乎是不可能的

in http://bernaerts.dyndns.org/linux/74-ubuntu/220-ubuntu-resume-usb-hid is example for linux http://bernaerts.dyndns.org/linux/74-ubuntu/220-ubuntu-resume-usb-hid中是Linux的示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM