Results

A module that provides a result class for returning results of UEI commands.

Results consist of an error attribute and a value attribute. If the error attribute is set to NO_ERROR, then the result value is the response to the UEI command that was sent.

For more information about return values for commands and UEI’s see the Acroname BrainStem Reference

class brainstem.result.Result(error, *args, **kwargs)[source]

Result class for returning results of commands

Instances of Result represent the response to a command. The Result class also contains constants for the error codes that Brainstem APIs may return, for example Result.aErrNone, result.aErrorMemory, etc. Refer to the C API Error Codes for a complete list.

property error

Return the error attribute

static getErrorDescription(error, buffer_length=256)[source]

Get the description of an error code.

Parameters:

error (int or Result object) – The error to decode.

Returns:

The error code in human readable form.

Return type:

string

static getErrorText(error)[source]

Get the string representation of an error code.

Parameters:

error (int or Result object) – The error to decode.

Returns:

The error code in human readable form.

Return type:

string

items()[source]

Return the key, value mapping for each result value

keys()[source]

Return a list of the names of each value in the result

property value

Return the value attribute(s)

values()[source]

Return a list of the values of each value in the result