hci_pd_set_result_code code

This communicates an operation’s completion status to the system. code is an integer that is passed to the engine when the current operation completes, when the state transitions back to IDLE or DEAD.

In general, non-zero values denote error conditions, and 0 denotes a successful operation.

Use this command to clear (set to zero) the result code when a low-level error happens. The PDL runtime sets the result code to a non-zero value when a low-level error happens. When this happens, the default sends an error to the engine.

Example

A typical use for this function is to set a non-zero completion code when an operation fails.

In this example, the system interprets a result code of three (3) when an output error happens.

...
hci_pd_send some_phrase {...} {... {error oops}}
...
proc oops {info} {
hci_pd_set_result_code 3 
# returning here completes the operation, in 
# this case with a completion code of 3 
}