App¶
See the App Entity for generic information.
- class brainstem.entity.App(module, index)[source]¶
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(app_param)[source]¶
Execute the app reflex on the module. Doesn’t wait for a return value from the execute call; this call returns immediately upon execution of the module’s reflex.
- Parameters:
app_param (unsigned int) – The app parameter handed to the reflex.
- Returns:
An error result from the list of defined error codes in brainstem.result.Result
- Return type:
unsigned byte
- executeAndReturn(app_param, ms_timeout=1000)[source]¶
Execute the app reflex on the module. Waits for a return from the reflex execution for msTimeout milliseconds. This method will block for up to msTimeout.
- Parameters:
app_param (unsigned int) – The app parameter handed to the reflex.
ms_timeout (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:
- Object containing error code and returned value on success.
- errorunsigned byte
An error result from the list of defined error codes
- valueunsigned int
The return value filled in from the result of executing the reflex routine.
- Return type: