BITalinoController class

Constructors

BITalinoController(String address, CommunicationType communicationType)
Controls a BITalino device.

Properties

address String
Address of the device. Android: MAC address IOS: BITalino UUID
getter/setter pair
communicationType CommunicationType
Indicates the type of bluetooth communication: CommunicationType.BTH or CommunicationType.BLE.
getter/setter pair
connected bool
Indicates if the controller is connected to a device. Returns true if a device is connected and false if it's not.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
initialized bool
Indicates if the controller is initialized. Returns true if the controller is initialized and false if it's not.
getter/setter pair
recording bool
Indicates if the device is recording data. Returns true if it's recording and false if it's not.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

connect({OnConnectionLost? onConnectionLost}) Future<bool>
Connects to a BITalino device address. Returns true if the device is connected successfully, false otherwise.
disconnect() Future<bool>
Disconnects the controller from the connected device. Returns true if the device is disconnected successfully, false otherwise.
dispose() Future<bool>
Disposes the controller. Must be called to avoid memory leaks. Returns true if the controller is disposed successfully, false otherwise.
initialize() Future<void>
Initializes the BITalinoController. Throws BITalinoErrorType.CONTROLLER_FAILED_INITIALIZE if the controller fails to initialize.
isBITalino2() Future<bool>
Returns true if the connected device is BITalino2, false otherwise.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pwm(int pwmOutput) Future<bool>
Assigns the analog (PWM) output value. (BITalino 2 only) Returns true if the command is sent successfully, false otherwise.
setBatteryThreshold(int threshold) Future<bool>
Sets the battery threshold value of the connected device. Returns true if the battery threshold is set successfully, false otherwise.
setDigitalOutputs(List<int> digitalChannels) Future<bool>
Assigns the digital output states. Returns true if the command is sent successfully, false otherwise. An array with the digital channels to enable set as 1, and the digital channels to disable set as 0.
start(List<int> analogChannels, Frequency sampleRate, {int numberOfSamples = 50, OnBITalinoDataAvailable? onDataAvailable}) Future<bool>
Starts recording on the connected bluetooth device. Returns true if the acquisition started successfully, false otherwise.
state() Future<BITalinoState>
Returns the BITalinoState of the connected device. The BITalinoState object has properties:
stop() Future<bool>
Stops recording on the connected bluetooth device. Returns true if the acquisition was stopped successfully, false otherwise.
toString() String
A string representation of this object.
inherited
version() Future<String?>
Returns the BITalino device firmware.

Operators

operator ==(Object other) bool
The equality operator.
inherited