App Entity

group AppEntity

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.

void app_execute(unsigned int *id, struct Result *result, int appNum, unsigned int 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.

Parameters
  • id: The id assigned by the create stem vi.

  • result: object, containing NO_ERROR or a non zero Error code.

  • appNum: Index of the App Entity.

  • appParam: The app parameter handed to the reflex.

void app_executeAndReturn(unsigned int *id, struct Result *result, int appNum, unsigned int appParam, unsigned int timeout = 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.

Parameters
  • id: The id assigned by the create stem vi.

  • result: object, containing NO_ERROR and return value from reflex routine if applicable or a non zero Error code.

  • appNum: Index of the App Entity.

  • appParam: The app parameter handed to the reflex.

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