Resp_free( ) built-in function, Syntax, Example – Echelon Neuron C User Manual

Page 144: Resp_receive( ) built-in function

Advertising
background image

124

Functions

if (offline()) {

// Requested to go offline

resp_cancel();

} else {

resp_send();

}

}
}

resp_free( )

Built-in Function

The resp_free( ) built-in function frees the resp_in object for a response. See
Chapter 6,

How Devices Communicate Using Application Messages,

of the

Neuron C Programmer's Guide

.

Syntax

void resp_free (void);

Example

void f(void)
{
...
if (resp_receive()) {
// Process message
...
resp_free();
}
...
}

resp_receive( )

Built-in Function

The resp_receive( ) built-in function receives a response into the resp_in object.

The function returns TRUE if a new response is received, otherwise it returns

FALSE. If no response is received, this function does not wait for one. A
program might need to use this function if it receives more than one response in a

single task, as in bypass mode. If there already is a received response when the
resp_receive( ) function is called, the earlier one is discarded (that is, its buffer

space is freed).
Note: Because this function defines a critical section boundary, it should never
be used in a when clause expression (that is, it

can

be used within a task, but

not

within the when

clause

itself). Using it in a when clause expression could result

in events being processed incorrectly.

See Chapter 6,

How Devices Communicate Using Application Messages,

of the

Neuron C Programmer's Guide

for more information.

Syntax

boolean

resp_receive (void);

Advertising