2.2 Messages
2.2 信息
Messages pass information between the tasks and are constructed in the form:
信息在任务之间传递报告并构建成以下形式:
Task t, MessageId id, Message payload
任务 t, 信息 Id id, 信息有效载荷
The elements of a message are described below:
各项信息要素说明如下:
Task t: Identifies the destination of the message i.e. it is a pointer to the
recipient task e.g. &AppTask.
任务 t:识别该信息的目的地,即它是接收任务的一个指示器,例如: &
AppTask 。
MessageId id: is the message label that allows the task receiving the
message to identify the appropriate function within the handler code.
信息 Id id: 是信息标签,它允许任务接收信息以识别管理编码中适当的
功能。
The MessageId id also implies the fields that can be expected in the
payload. This allows the required information to be extracted by casting
pointers to the payload fields.
MessageId id 同时意味着该领域在有效载荷内可以被预计。这使得所需的
资料被指针提取到有效载荷领域。
Note:
注:
By convention, a message’s structure is always enumerated as the
Message Id with a suffix of _T.
按照惯例,一个信息的结构总是列举有后缀 T 的信息 Id。
For example, the structure of the message CL_INIT_CFM is
enumerated as Type CL_INIT_CFM_T.
例如,信息结构 CL_INIT_CFM 的列举类型是 CL_INIT_CFM_T.
Message payload: The payload should contain any state data required by
the handler function to correctly react to the message. The payload is
freed after the message has been delivered.
评论7
最新资源