none
Recieving a signal/Notification in Windows application from the hardware to Host while hardware is in the D2 state(Suspended state) RRS feed

  • Question

  • Hi,

    I Have a hardware(a sensor) connected to host(windows machine(7/8)) via USB.The hardware goes into the suspended state(D2) while at rest.As soon as it is given motion it comes out of the D2 state to D0 state.I wanted to develop a windows application which polls the state(D2/D0) and return when the state is D0, but the problem is that as soon as I launch the application it starts polling the hardware for this state and hence never allows the hardware to go into the suspended state.

    What feature(lock,block) I have to implement in the application so as to return the D0 state if and only if the D0 state is attained.

    I hope i have put the corect wordings to describe my problem.Plz direct me to the approach(or any specific terms related to this phenomena, I can google).

    Thanks in advance !

    Softy


    • Edited by hcktester Wednesday, January 8, 2014 4:38 AM More appropriate Question statements
    Tuesday, January 7, 2014 8:13 AM

Answers

  • Thanks for sharing the details.

    D-states (and device power management in general) are meant to be transparent to applications. The recommended approach to detect motion state changes is for your application to subscribe to the sensor and receive events using the Sensor APIs.  This way, if the sensors do support going into a low power state between motion readings, this will happen transparent to your application.

    What's probably happening is that the query_pnp_capabilities IRP is triggering the sensor driver to wake the sensor up to process that IRP. Out of curiosity, what are the VID&PIDs and drivers for your sensor?

    Wednesday, January 8, 2014 8:23 PM

All replies

  • Hi Softy,

    What is your application doing to poll the D-state?  Also, what is your scenario?

    Regards,

    lisa

    Tuesday, January 7, 2014 6:13 PM
  • Hi Lisa,

    PLz see the comments below !

    Lisa:What is your application doing to poll the D-state?

    Softy:The application reads the power state of the hardware.(similair to what we see in the device manager>hardware device>properties>Device Description>power Data...plz see the attached picture)

    Power State

    Lisa : Also, what is your scenario?

    Softy: Making the host aware that hardware is awake from sleep(D2) by running a application on host to probe this.( I have changed the topic of the post to more relevant, I think modification i required is from the host side in application(OS))

    By polling the hardware like above the hardware never goes into D2 state and remains active always.

    I want to implement a mechanism in the above aplication which will do this :

    (1) Application Runs in background(may be like a service) on the host and gets notified only when the hardware resumes from D2->D0

    My point is what special type of application(what feature/implementation) can do this(polling yet not making the hardware awake).

    -S



    • Edited by hcktester Wednesday, January 8, 2014 6:25 AM
    Wednesday, January 8, 2014 4:36 AM
  • what bigger problem are you trying to solve by being notified of device power state transitions?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, January 8, 2014 7:42 AM
  • well its kind of acknowleding the host that the hardware motion state has been changed (can have multiple user application).

    -S

    Wednesday, January 8, 2014 8:51 AM
  • Thanks for sharing the details.

    D-states (and device power management in general) are meant to be transparent to applications. The recommended approach to detect motion state changes is for your application to subscribe to the sensor and receive events using the Sensor APIs.  This way, if the sensors do support going into a low power state between motion readings, this will happen transparent to your application.

    What's probably happening is that the query_pnp_capabilities IRP is triggering the sensor driver to wake the sensor up to process that IRP. Out of curiosity, what are the VID&PIDs and drivers for your sensor?

    Wednesday, January 8, 2014 8:23 PM
  • Thanks for the answer Lisa.

    Sorry for the delay in response to this forum post.

    The sensors are from ST, with a microcontroller which acts as a sensor device.

    Thanks

    S


    • Edited by hcktester Tuesday, January 14, 2014 1:25 PM
    Tuesday, January 14, 2014 1:24 PM