~phablet-team/libiphb/master

« back to all changes in this revision

Viewing changes to src/libiphb.h

  • Committer: Simo Piiroinen
  • Date: 2014-03-24 09:19:48 UTC
  • mfrom: (35.1.3)
  • Revision ID: git-v1:4c532acaf7243b9fa952aeaf7c1f0dce1d77f3b3
Merge pull request #7 from spiiroin/32bit_iphb_ranges

Support 32bit iphb wakeup ranges

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
iphb_wait(iphb_t iphbh, unsigned short mintime, unsigned short maxtime, int must_wait);
97
97
 
98
98
 
 
99
/**
 
100
   Wait for the next heartbeat.
 
101
 
 
102
   There can be only one wakeup / iphb handle. Calling this function cancels
 
103
   any previously programmed wakeup. Using zero for both mintime and maxtime
 
104
   can be used to cancel without programming a new wakeup.
 
105
 
 
106
   If mintime == maxtime, a global wakeup slot is used rather than ranged
 
107
   wakeup. To maximize changes of synchronous wakeups the predefined
 
108
   IPHB_GS_WAIT_* values should be used.
 
109
 
 
110
   @param iphbh         Handle got from iphb_open
 
111
 
 
112
   @param mintime       Time in seconds that MUST be waited before heartbeat
 
113
                        is reacted to.
 
114
 
 
115
   @param maxtime       Time in seconds when the wait SHOULD end. It is wise to
 
116
                        have maxtime-mintime quite big to maximize chances that
 
117
                        other iphb clients can be woken up in sync.
 
118
 
 
119
   @param must_wait     If non-zero, this functions waits for the wakeup before
 
120
                        returning. Zero value means you need to use select/poll
 
121
                        and wait for the socket to become readable. The file
 
122
                        descriptor to wait for can be queried via iphb_get_fd().
 
123
                        Once the socket comes readable, the incoming data must
 
124
                        be flushed - iphb_discard_wakeups can be used for this.
 
125
 
 
126
   @param resume        If nonzero, the device is woken from suspend to end the
 
127
                        wait period. Use zero value if the client process can
 
128
                        wait until the device gets out of suspend for some other
 
129
                        reason.
 
130
 
 
131
   @return              Time waited, (time_t)-1 if error (check errno)
 
132
*/
 
133
time_t
 
134
iphb_wait2(iphb_t iphbh, unsigned mintime, unsigned maxtime, int must_wait,
 
135
           int resume);
99
136
 
100
137
 
101
138