App Class

class AppClass : public Acroname::BrainStem::EntityClass

AppClass. Used to send a cmAPP 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.

Public Functions

AppClass(void)

Constructor.

~AppClass(void)

Destructor.

void init(Module *pModule, const uint8_t index)

Initialize the class.

Parameters
  • pModule: The module.

  • index: The cmdAPP reflex index to be addressed.

aErr execute(const uint32_t appParam)

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.

Return

aErrNone - success.

Return

aErrTimeout - The request timed out waiting to start execution.

Return

aErrConnection - No active link connection.

Return

aErrNotFound - the app reflex was not found or not enabled on the module.

Parameters
  • appParam: The app parameter handed to the reflex.

aErr execute(const uint32_t appParam, uint32_t *returnVal, const uint32_t msTimeout = 1000)

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.

Return

aErrNone - success.

Return

aErrTimeout - The request timed out waiting for a response.

Return

aErrConnection - No active link connection.

Return

aErrNotFound - the app reflex was not found or not enabled on the module.

Parameters
  • appParam: The app parameter handed to the reflex.

  • returnVal: The return value filled in from the result of executing the reflex routine.

  • msTimeout: The amount of time to wait for the return value from the reflex routine. The default value is 1000 milliseconds if not specified.