dacs_recv

NAME

dacs_recv - receive a message from another process

SYNOPSIS

DACS_ERR_T dacs_recv ( void *dst_data, uint32_t size, de_id_t src_de, dacs_process_id_t src_pid, uint32_t stream, dacs_wid_t wid, DACS_BYTE_SWAP_T swap )

Call parameters  
*dst_data A pointer to the beginning of the destination (receive) data buffer.
size The size of the message buffer.
src_de The message source DE.
src_pid The message source process.
stream The stream on which to receive the message, or DACS_STREAM_ALL.
wid A wait identifier.
swap The little-endian or big-endian byte-swapping flag.Possible values are:
  • DACS_BYTE_SWAP_DISABLE,
  • DACS_BYTE_SWAP_HALF_WORD,
  • DACS_BYTE_SWAP_WORD or
  • DACS_BYTE_SWAP_DOUBLE_WORD.
See Data communication for details.
Return parameter  
*dst_data The pointer to the received data buffer.

DESCRIPTION

The dacs_recv service asynchronously receives a message from another process. Upon successful return a receive operation is either pending or in progress. You should use dacs_test() or dacs_wait() to test for completion.

The number of bytes sent by the source process must be less than or equal to the local buffer size, otherwise the receive operation fails.

Stream identifiers are used to select messages for reception. A message will be received if the stream identifier of the message matches the stream identifier specified to dacs_recv(), or if DACS_STREAM_ALL is specified. Stream identifier values must be between 0 and DACS_STREAM_UB inclusive.

The swap flag must be the same at both ends of the transfer. If not the completion test (dacs_test() or dacs_wait()) will fail with DACS_ERR_BYTESWAP_MISMATCH, and no data is transferred.

RETURN VALUE

The dacs_recv service returns an error indicator defined as:
  • DACS_SUCCESS: normal return.
  • DACS_ERR_INVALID_ADDR: the pointer is invalid.
  • DACS_ERR_INVALID_ATTR: the flag or enumerated constant is invalid.
  • DACS_ERR_NO_RESOURCE: unable to allocate required resources.
  • DACS_ERR_INVALID_DE: the specified DE is either invalid or not reserved.
  • DACS_ERR_INVALID_PID: the specified PID does not refer to an active process.
  • DACS_ERR_INVALID_TARGET: this operation is not allowed for the target process.
  • DACS_ERR_NOT_ALIGNED: the buffer is not aligned properly for the size of the transfer.
  • DACS_ERR_INVALID_SIZE: the size is zero or not supported by the platform.
  • DACS_ERR_INVALID_WID: the wait identifier is invalid.
  • DACS_ERR_INVALID_STREAM: the stream identifier is invalid.

SEE ALSO

dacs_send(3), dacs_wait(3), dacs_test(3)