Msg_cancel( ) built-in function, Syntax, Example – Echelon Neuron C User Manual
Page 133: Msg_free( ) built-in function
Neuron C Reference Guide
113
}
}
msg_cancel( )
Built-in Function
The msg_cancel( ) built-in function cancels the message currently being built and
frees the associated buffer, allowing another message to be constructed.
If a message is constructed but not sent before the critical section (for example, a
task) is exited, the message is automatically cancelled. This function is used to
cancel both priority and nonpriority messages.
See Chapter 6,
How Devices Communicate Using Application Messages,
in the
Neuron C Programmer's Guide
for more information about application messages.
Syntax
void
msg_cancel (void);
Example
void f(void)
{
if (msg_alloc()) {
...
if (offline()) {
// Requested to go offline
msg_cancel();
} else {
msg_send();
}
}
}
msg_free( )
Built-in Function
The msg_free( ) built-in function frees the msg_in object for an incoming
message.
See Chapter 6,
How Devices Communicate Using Application Messages,
in the
Neuron C Programmer's Guide
for more information about application messages.
Syntax
void
msg_free (void);
Example
void f(void)
{
...
if (msg_receive()) {
// Process message
...
msg_free();