Home |
Function RTUIOWaitTimed |
Function RTUIOWaitTimedRTUIOWaitTimed waits for a transaction to complete on a given pipe: int RTUIOWaitTimed(RTUPipeHandle Pipe, void * * Data, int Timeout); ParametersPipeHandle to the pipe to wait on. DataPointer to a buffer pointer. *Data will be filled with the Data parameter passed to RTUStartIO when the transaction was created. This parameter may be NULL. TimeoutMaximum number of milliseconds to wait. return valueIf the function succeeds, the number of bytes transferred in the transaction is returned. For Isochronous endpoints with pipe option RTUIsoBufferList set, the return value is RTU_SUCCESS. For other Isochronous endpoints, the returned value reflects the Len parameters specified in the corresponding RTUStartIO call minus the maximum packet size plus the number of bytes received in the last [micro]frame. On error, a negative error code is returned. RTUIOWaitTimed can only be used on pipes in Asynch notification mode (which is the default mode). It implements a blocking wait. The calling thread consumes no CPU time during the wait. Note that for Isochronous RTUInput endpoints without pipe option RTUIsoBufferList, RTUIOWaitTimed returns no information about how many bytes have been transferred in [micro]frames other than the last [micro]frame. Unlike RTUIOWait, RTUIOWaitTimed can return error code RTU_TIMEOUT. However, RTU_TIMEOUT does not necessarily indicate an error, it merely means that no transaction has completed within the given time period. If any transactions are pending, they can still complete at a later time. RTUIOWaitTimed does not abort transactions. However, clients may choose to abort all pending transactions on a pipe using RTUCancelIO. The accuracy of the timeout period depends on the granularity of the clock of the underlying multitasking kernel. With RTKernel-32, the timer granularity can be set with function CLKSetTimerIntVal.
|