App

class brainstem.entity.App(module, index)[source]

AppClass: Used to send a cmdAPP packet to the BrainStem network. These commands are used for either host-to-stem or stem-to-stem interactions. BrainStem modules can implement a reflex origin to complete an action when a cmdAPP packet is addressed to the module.

execute(appParam)[source]

Execute the app reflex on the module. Don’t wait for a return value from the execute call; this call returns immediately upon execution of the module’s reflex. aErrNone success. aErrTimeout The request timed out waiting to start execution. aErrConnection No active link connection. aErrNotFound the app reflex was not found or not enabled on the module.

Parameters:

appParam (const unsigned int) – The app parameter handed to the reflex.

Returns:

An error result from the list of defined error codes in brainstem.result

Return type:

unsigned byte

executeAndReturn(appParam, msTimeout)[source]

Execute the app reflex on the module. Wait for a return from the reflex execution for msTimoue milliseconds. This method will block for up to msTimeout. The return value filled in from the result of executing the reflex routine. aErrNone success. aErrTimeout The request timed out waiting for a response. aErrConnection No active link connection. aErrNotFound the app reflex was not found or not enabled on the module.

Parameters:
  • appParam (const unsigned int) – The app parameter handed to the reflex.

  • msTimeout (const unsigned int) – The amount of time to wait for the return value from the reflex routine. The default value is 1000 milliseconds if not specified.

Returns:

Result object containing the requested value when the results error is set to NO_ERROR(0)

Return type:

Result