.NET API Reference

Welcome to the BrainStem .NET API reference documentation. This documentation covers the .NET Acroname BrainStem library. This reference assumes that you understand the BrainStem system. If you would like to get started using BrainStem, please see the following sections of the Reference documentation.

The Getting started guide is particularly useful for learning how to use the application tools we provide to communicate with your hardware.


class AnalogClass

The AnalogClass is the interface to analog entities on BrainStem modules. Analog entities may be configured as a input or output depending on hardware capabilities. Some modules are capable of providing actual voltage readings, while other simply return the raw analog-to-digital converter (ADC) output value. The resolution of the voltage or number of useful bits is also hardware dependent.

class AppClass

The AppClass is 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

class ClockClass

ClockClass. Provides an interface to a real-time clock entity on a BrainStem module. The clock entity may be used to get and set the real time of the system. The clock entity has a one second resolution.


Clock time must be reset if power to the BrainStem module is lost.

class DigitalClass

The DigitalClass is the interface to digital entities on BrainStem modules. Digital entities have the following 5 possabilities: Digital Input, Digital Output, RCServo Input, RCServo Output, and HighZ. Other capabilities may be available and not all pins support all configurations. Please see the product datasheet.

class EqualizerClass

EqualizerClass. Provides receiver and transmitter gain/boost/emphasis settings for some of Acroname’s products. Please see product documentation for further details.

class I2CClass

The I2CClass is the interface the I2C busses on BrainStem modules. The class provides a way to send read and write commands to I2C devices on the entitie’s bus.

class ModuleClass

ModuleClass. Provides a generic interface to a BrainStem hardware module. The Module class is the parent class for all BrainStem modules. Each module inherits from Module and implements its hardware specific features.

class MuxClass

MuxClass. A MUX is a multiplexer that takes one or more similar inputs (bus, connection, or signal) and allows switching to one or more outputs. An analogy would be the switchboard of a telephone operator. Calls (inputs) come in and by re-connecting the input to an output, the operator (multiplexor) can direct that input to on or more outputs.

One possible output is to not connect the input to anything which essentially disables that input’s connection to anything.

Not every MUX has multiple inputs. Some may simply be a single input that can be enabled (connected to a single output) or disabled (not connected to anything).

class PointerClass

PointerClass. Access the reflex scratchpad from a host computer.

The Pointers access the pad which is a shared memory area on a BrainStem module. The interface allows the use of the brainstem scratchpad from the host, and provides a mechanism for allowing the host application and brainstem relexes to communicate.

The Pointer allows access to the pad in a similar manner as a file pointer accesses the underlying file. The cursor position can be set via setOffset. A read of a character short or int can be made from that cursor position. In addition the mode of the pointer can be set so that the cursor position automatically increments or set so that it does not this allows for multiple reads of the same pad value, or reads of multi-record values, via and incrementing pointer.

class RailClass

RailClass. Provides power rail functionality on certain modules. This entity is only available on certain modules. The RailClass can be used to control power to downstream devices, I has the ability to take current and voltage measurements, and depending on hardware, may have additional modes and capabilities.

class RCServoClass

The RCServoClass is the interface to servo entities on BrainStem modules. Servo entities are built upon the digital input/output pins and therefore can also be inputs or outputs. Please see the product datasheet on the configuration limitations.

class RelayClass

The RelayClass is the interface to relay entities on BrainStem modules. Relay entities can be set, and the voltage read. Other capabilities may be available, please see the product datasheet.

class SignalClass

SignalClass is the interface to digital pins configured to produce square wave signals.

This class is designed to allow for square waves at various frequencies and duty cycles. Control is defined by specifying the wave period as (T3Time) and the active portion of the cycle as (T2Time). See the entity overview section of the reference for more detail regarding the timing.

class StoreClass

StoreClass. The store provides a flat file system on modules that have storage capacity. Files are referred to as slots and they have simple zero-based numbers for access. Store slots can be used for generalized storage and commonly contain compiled reflex code (files ending in .map) or templates used by the system. Slots simply contain bytes with no expected organization but the code or use of the slot may impose a structure. Stores have fixed indices based on type. Not every module contains a store of each type. Consult the module datasheet for details on which specific stores are implemented, if any, and the capacities of implemented stores.

class SystemClass

SystemClass. The System class provides access to the core settings, configuration and system information of the BrainStem module. The class provides access to the model type, serial number and other static information as well as the ability to set boot reflexes, toggle the user LED, as well as affect module and router addresses etc. The most common brainstem example uses the system entity to blink the User LED.

class TemperatureClass

TemperatureClass. This entitiy is only available on certain modules, and provides a temperature reading in microcelsius.

class TimerClass

TimerClass. The Timer Class provides access to a simple scheduler. Reflex routines can be written which will be executed upon expiration of the timer entity. The timer can be set to fire only once, or to repeat at a certain interval.

class UARTClass

UARTClass. A UART is a “Universal Asynchronous Receiver/Transmitter. Many times referred to as a COM (communication), Serial, or TTY (teletypewriter) port.

The UART Class allows the enabling and disabling of the UART data lines.

class USBClass

USBClass. The USB class provides methods to interact with a USB hub and USB switches. Different USB hub products have varying support; check the datasheet to understand the capabilities of each product.


enum class Acroname::BrainStem2CLI::aErr


enumerator aErrNone

0 - Success, no error.

enumerator aErrMemory

1 - Memory allocation.

enumerator aErrParam

2 - Invalid parameter.

enumerator aErrNotFound

3 - Not found.

enumerator aErrFileNameLength

4 - File name too long.

enumerator aErrBusy

5 - Resource busy.

enumerator aErrIO

6 - Input/Output error.

enumerator aErrMode

7 - Invalid Mode.

enumerator aErrWrite

8 - Write error.

enumerator aErrRead

9 - Read error.

enumerator aErrEOF

10 - End of file.

enumerator aErrNotReady

11 - Not ready, no bytes available.

enumerator aErrPermission

12 - Insufficient permissions.

enumerator aErrRange

13 - Value out of range.

enumerator aErrSize

14 - Invalid Size.

enumerator aErrOverrun

15 - Buffer/queue overrun.

enumerator aErrParse

16 - Parse error.

enumerator aErrConfiguration

17 - Configuration error.

enumerator aErrTimeout

18 - Timeout occurred.

enumerator aErrInitialization

19 - Initialization error.

enumerator aErrVersion

20 - Invalid version.

enumerator aErrUnimplemented

21 - Functionality unimplemented.

enumerator aErrDuplicate

22 - Duplicate request.

enumerator aErrCancel

23 - Cancelation occured, or did not complete.

enumerator aErrPacket

24 - Packet unsigned char invalid.

enumerator aErrConnection

25 - Connection error.

enumerator aErrIndexRange

26 - Index out of range.

enumerator aErrShortCommand

27 - BrainStem command to short.

enumerator aErrInvalidEntity

28 - Invalid entity error.

enumerator aErrInvalidOption

29 - Invalid option code.

enumerator aErrResource

30 - Resource unavailable.

enumerator aErrMedia

31 - Media error.

enumerator aErrAsyncReturn

32 - Asynchronous return.

enumerator aErrStreamStale

33 - Stream value is stale.

enumerator aErrUnknown

34 - Unknown error.