Skip to main content

MobjMessageRead

Reads data from a message sent to the message mailbox.

Syntax

AIL_INT64 MobjMessageRead(
AIL_ID MessageId, //in
void * MessagePtr, //out
AIL_INT64 MessageInSize, //in
AIL_INT64 * MessageOutSizePtr, //out
AIL_INT64 * MessageTagPtr, //out
AIL_INT64 * StatusPtr, //out
AIL_INT64 OperationFlag //in
)

Description

This function reads the data from a message sent to the message mailbox.

Parameters

MessageId (in, AIL_ID)

Specifies the identifier of the message mailbox.

MessagePtr *(out, void)

Specifies the address of the variable in which the message is to be written. If M_NULL is specified, this function will return the length of the message.

MessageInSize (in, AIL_INT64)

Specifies the size of the array pointed to by MessagePtr, in bytes. You must set this value to 0 if MessagePtr is set to M_NULL.

MessageOutSizePtr *(out, AIL_INT64)

Specifies the address of the variable in which the size of the message to be read will be written. If unused, set toM_NULL.

MessageTagPtr *(out, AIL_INT64)

Specifies the address of the variable in which the message tag associated with the message will be written. If unused, set toM_NULL.

StatusPtr *(out, AIL_INT64)

Specifies the address of the variable in which the status of the read operation will be written.

For specifying the status of the operation

ValueDescription
M_BUFFER_TOO_SMALLSpecifies the current message is not copied or deleted. The returned message length will be the required length in bytes.
M_READ_TIMEOUTSpecifies the read timeout has been attained. The returned message length will be 0.
M_SUCCESSSpecifies the message is copied to MessagePtr.

OperationFlag (in, AIL_INT64)

Specifies additional options for the read operation.

For specifying the operation

ValueDescription
M_DEFAULTSpecifies the default behavior.
M_KEEP_IN_QUEUESpecifies that if the mailbox is of type M_QUEUE, the message will not be deleted after the read operation.
M_NO_TIMEOUTSpecifies to not use the read operation timeout. This will return a status of M_SUCCESS and return 0 if no messages are ready to be read.
M_REMOVESpecifies to remove the current message without reading it.

Return Value

Type: AIL_INT64

The returned value is the same as the value written in MessageOutSizePtr.

Copyright © 2026 Zebra Technologies.