PxSysInfoGetMsgsInMbx()
Get the ids of the messages stored in a mailbox.
- APPLIES TO
-
1.0.0
- SYNOPSIS
-
int PxSysInfoGetMsgsInMbx (PxMbx_t mbxId, PxMsgType_t Type, PxObjId_t *MsgArray, int Max); - ARGUMENTS
|
|
|
|
|
|
|
- RETURN VALUES
-
-
Number of message ids stored in the array
-
-1 if
mbxIdis not a valid mailbox or if an inconsistency is detected
-
- DESCRIPTION
-
PxSysInfoGetMsgsInMbxcounts the messages of type Type available in the mailboxmbxId. The message ids are stored inMsgArrayuntil the maximum number of messages, which can be stored in this array, is reached. Max represents this number. The function returns the number of messages in the mailbox, or -1 ifmbxIdis not a valid mailbox object, or if an inconsistency is detected. Such an inconsistency may occur if messages are received from this mailbox when counting these messages.
- IMPLEMENTATION GUIDELINES
-
- Before call
-
-
MsgArraymust be a pointer to a valid data area containing space forMaxobject ids. -
The parameter
mbxIdmust be a valid mailbox object id. This id may be-
the calling task’s own mailbox (V)
-
the return value of a
PxTaskGetMbx()call (V) -
the result of a
nameserverquery (V) -
part of a message sent by another task (V)
-
-
The PXROS-HR message type given in
Typemust be of typePxMsgType_tand may have one of the following values (V):-
PXMsgAnyMsg -
PXMsgNormalMsg -
PXMsgPrioMsg
-
-
- After call
-
-
The function returns -1 if the number of messages in a mailbox could not be determined (C).
-
- Best Practice
-
-
No restrictions
-
- SEE ALSO
- USAGE
-
#include "pxdef.h" int num = PxSysInfoGetMsgsInMbx(mbxId, PXMsgNormalMsg, MsgArray, MAX); if (num == -1) { // Report Error }