Putting computer to sleep through USB.

Status
Not open for further replies.

alphacat

New Member
Hello,
my microcontroller is connected to the PC through the USB, and they both communicating through a USB-to-UART bridge.
I'd like the MCU to put the PC into sleep (standby mode), and wanted to ask you please, how is it done?
What command should the microcontroller issue for that?

Thank you very much.
 
The OS installed in my computer is Microsoft XP 2002 (Service Pack 3).
Generally, I'd like to be able to put into sleep any OS.
 
Its as simple as picking a OS. You can have the PIC send a command to PC and in your program have it determine the OS and send the correct Sleep Instruction.

What are you using to program the PC side application?
 
There is a load of info on the net on how you can cause XP to sleep programmaticly.

One way is to have the program on the PC run this.

rundll32.exe powrprof.dll,SetSuspendState
 
yeah you can also from VB6:
Code:
Private Declare Function SetSuspendState Lib "Powrprof" (ByVal Hibernate As Long, ByVal ForceCritical As Long, ByVal DisableWakeEvent As Long) As Long
Private Sub Form_Load()
    'KPD-Team 2001
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@allapi.net
    'start hibernating, but don't force it and don't disable all wake events
    SetSuspendState 1, 0, 0
End Sub
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…