Function sc_pipe_read2

Function Documentation

int sc_pipe_read2(const int dev_desc, const int pipe_id, void **buffer, unsigned int timeout)

Read data from pipe.

This function allocates memory with allocator callback from pipe parameters structure if callback function was installed or allocates memory internally. Then copies data from the last exposure and returns the memory block in buffer. If memory was allocated internally it will be deallocated when next call to the function will be performed or pipe will be closed. If memory allocation callback function was installed in the pipe parameters no any deallocation of the memory will be performed. User must manage memory by him-/her- self.

Function returns when: data is available or timeout or pipe is closed.

Parameters
  • dev_desc – Device descriptor.

  • pipe_id – Pipe id.

  • buffer – Pointe to pointer where data block must be stored.

  • timeout – Timeout in millisecond.