28-4
IInter-Task Messaging Tools
Programmer’s Manual
All data that the sender wants to sent must be stored in the form of MESSAGE
structure. No protocol or data format is put on the message data. The sender
and receiver must have a mutual understanding of the data representation of
the message being sent. On the receiving side, IrptGetData() is where the
message received.
The data structure for the structure MESSAGE is:
typedef struct _MESSAGE
{
U16
U16
U32
P_VOID data;
U16
U16
messageType;
message;
misc;
/* message type */
/* message */
/* short data (32bit) */
/* associated data, if any */
/* size of data in bytes */
/* for future (broadcast, etc) */
size;
reserved;
} PPSM_MESSAGE, *P_MESSAGE;
If AppSwap(FALSE) is called before calling this function, the message will still
be sent but any form of task swapping action will be ignored.
If the system is in doze mode, calling this function will wake up the system.
Parameter
Corresponding values between SendMessage() and IrptGetData()
Name
Description
taskId
The receiver task’s identifier
msg
The message to send. All data to send are
stored in the PPSM_MESSAGE structure,
with the following representation:
messageType - Must set to
MESSAGE_IRPT.
message - The type of message
being sent to the receiver.
Normally set to IRPT_USER.
misc - 32-bit short data
data - data pointer pointing a buffer
that is storing the message
data
size - size of data buffer, in number
of bytes
reserved - not used
SendMessage
IrptGetData
STATUS
SendMessage
(U32 taskId P_MESSAGE msg)
STATUS
IrptGetData
(P_U32 sData, P_U32 *data P_U32 size)
msg.messageType
must be MESSAGE_IRPT
msg.message
returned value
msg.misc
*sData
Personal Portable System Manager
Programmer’s Manual
28-5
Return Value
msg.data
msg.size
msg.reserved
Name
Description
PPSM_OK
Message successfully sent
PPSM_ERR_TASK_ID
Invalid task identifier
PPSM_ERR_NO_MEMORY
Not enough memory
PPSM_ERROR
AppSwap(FALSE) is called before calling
this function
SendMessage
IrptGetData
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.