Skip to content

Function calls

On this page we describe how an openOBD session can be used to run functions, and how function calls can be made. For a better understanding of the definition and use of an openOBD function, please read this page first.

Note

The states interrupted and failed are final states and do not allow any transitions anymore. They all indicate the end of an openOBD session. Therefore, we can leave those two states out of the diagrams described on this page.

Default function context

An openOBD session in its most simple form has one default function context. By function context we mean a piece of memory that is managed by the openOBD session.

Default context

Context

It is possible to create new function contexts. An openOBD session can stack multiple function contexts, and every function context follows the same state diagram with the two main operative states available and active.

Function context transitions

The following diagram shows which gRPC function calls are allowed in which state of the openOBD function context. It also indicates which function calls result in a state transition.

gRPC Call
Allowed in state \({c}^{n}_{\text{available}}\) Allowed in state \({c}^{n}_{\text{active}}\) Remarks
authenticate() yes no Transitions to state \({c}^{n}_{\text{active}}\)
assertAuthenticationPossible() yes yes Asserts that authenticate() is allowed (without actually authenticating)
openSessionTokenStream() no yes -
getConfigurationList() no yes -
finish() yes yes Transitions to state \(\begin{cases}{c}^{n-1}_{\text{available}} &\text{if } n > 0 \\\text{finished} &\text{if } n = 0\end{cases}\)
startFunctionContext() yes no Transitions to state \({c}^{n+1}_{\text{available}}\)
monitorFunctionContext() yes yes When context \({c}^{n}\) finishes (finish() is being called), this stream returns a fresh authentication token for \({c}^{n-1}_{\text{available}}\)
registerFunctionDetails() yes no Store function information in context \({c}^{n}\)
getFunctionDetails() yes yes -
setFunctionArgument() yes no Store arguments in context \({c}^{n}\)
setFunctionResult() no yes Store results in context \({c}^{n-1}\)
getVariableList() yes yes -
setVariable() yes yes -
getVariable() yes yes -
deleteVariable() yes yes -