BrainBit for developers Subscribe for updates Visit website

Parameter description

Name

Name of device.

char name[SENSOR_NAME_LEN];
OpStatus outStatus;
readNameSensor(sensor, name, SENSOR_NAME_LEN, &outStatus);
            
String name = sensor.getName();
...
sensor.setName("NewName"); // <- this is throw an exeption, you cannot set device name
            
var name: String = sensor.name
...
sensor.name = "NewName" // <- this is throw an exeption, you cannot set device name
            
string name = sensor.Name;
...
sensor.Name = "newName"; // <- this is throw an exeption, you cannot set device name
            
var name: string = sensor.getName()
...
sensor.setName('new_name') // <- this is throw an exeption, you cannot set device name
            
name = sensor.name
...
sensor.name = "new_name" # <- this is throw an exeption, you cannot set device name
            
var name: String? = sensor?.name
...
sensor?.name = "newName"// <- this is throw an exeption, you cannot set device name
            
NSString* name = [sensor Name]; // or ... = sensor.Name;
...
[sensor setName:@"newName"]; // or sensor.Name = @"newName"; <- this is throw an exeption, you cannot set device name
            
String name = await sensor.name.value;
...
await sensor.name.set("newName").onError((error, stackTrace) => print(error)); // <- catch an exception
            

            

State

Information about the connection status of a device.

SensorState state;
OpStatus outStatus;
readStateSensor(sensor, &state, &outStatus);
if(state == SensorState::StateInRange){
    // connected
}
else {
    // disconnected
}
            
SensorState state = sensor.getState(); 
if(state == SensorState.StateInRange){
    // connected
}
else {
    // disconnected
}
            
var state: SensorState = sensor.state
if(state == SensorState.StateInRange){
    // connected
}
else {
    // disconnected
}
            
SensorState state = sensor.State;
if(state == SensorState.StateInRange){
    // connected
}
else {
    // disconnected
}
            
var state: SensorState = sensor.getState()
if(state == SensorState.InRange){
    console.log("connected")
}
else {
    console.log("disconnected")
}
            
sensorState = sensor.state
if sensorState == SensorState.StateInRange:
    print("connected")
else:
    print("Disconnected")
            
var state: NTSensorState? = sensor?.state
if(state == .inRange){
    print("connected")
} else {
    print("disconnected")
}
            
NTSensorState state = sensor.State;
if(state == NTSensorStateInRange){
    NSLog(@"Connected");
} else {
    NSLog(@"Disonnected");
}
            
SensorState state = await sensor.state.value;
if (state == SensorState.inRange) {
  print("connected");
} else {
  print("disconnected");
}
            

            

Can take two values:

- InRange - Device connected
- OutOfRange - The device is turned off or out of range

Address

MAC-address of device. For iOS/MacOS represents by UUID. String value.

char address[SENSOR_ADR_LEN];
OpStatus outStatus;
readAddressSensor(sensor, address, SENSOR_ADR_LEN, &outStatus);
            
String address = sensor.getAddress();
            
var address: String = sensor.address
            
string address = sensor.Address
            
var address: string = sensor.getAddress()
            
address = sensor.address
            
var address: String? = sensor?.address
            
NSString* address = sensor.Address;
            
String address = await sensor.address.value;
            

            

SerialNumber

Serial number of device. String value.

char serial[SENSOR_SN_LEN];
OpStatus outStatus;
readSerialNumberSensor(sensor, serial, SENSOR_SN_LEN, &outStatus);
            
String serial = sensor.getSerialNumber();
            
var serial: String = sensor.serialNumber
            
string serialNumber = sensor.SerialNumber;
            
var serialNumber: string = this._sensor.getSerialNumber()
            
serialNumber = sensor.serial_number
            
var serialNumber: String? = sensor?.serialNumber
            
NSString* serialNumber = sensor.SerialNumber;
            
String serialNumber = await sensor.serialNumber.value;
            

            

FirmwareMode

Information about the current mode of operation of the device firmware. It can be in two states:

- ModeBootloader - the device is in bootloader mode
- ModeApplication - normal operation

SensorFirmwareMode sensorFirmwareMode;
OpStatus outStatus;
readFirmwareModeSensor(sensor, &sensorFirmwareMode, &outStatus);
...
            
SensorFirmwareMode fwMode = sensor.getFirmwareMode();
            
val fwMode: SensorFirmwareMode = sensor.firmwareMode
            
SensorFirmwareMode fwMode = sensor.FirmwareMode;
            
var sensorFirmwareMode: SensorFirmwareMode = sensor.getFirmwareMode()
            
fwMode = sensor.firmware_mode
            
var mode: NTSensorFirmwareMode? = sensor?.firmwareMode
            
NTSensorFirmwareMode mode = sensor.FirmwareMode;
            
SensorFirmwareMode mode = await sensor.firmwareMode.value;
            

            

SamplingFrequency

A parameter that is used to set or get the sample rate of a physiological signal.

It is unchanged for BrainBit and BrainBitBlack and is 250 Hz.

// get
SensorSamplingFrequency sensorSamplingFrequency;
OpStatus outStatus;
readSamplingFrequencySensor(sensor, &sensorSamplingFrequency, &outStatus);
            
// get
SensorSamplingFrequency sf = sensor.getSamplingFrequency();
            
var sf: SensorSamplingFrequency = sensor.samplingFrequency
            
SensorSamplingFrequency sf = sensor.SamplingFrequency;
            
var sensorSamplingFrequency: SensorSamplingFrequency = sensor.getSamplingFrequency()
...
            
sensorSamplingFrequency = sensor.sampling_frequency
...
            
var samplingFrequency: NTSensorSamplingFrequency? = sensor?.samplingFrequency;
            
NTSensorSamplingFrequency samplingFrequency = sensor.SamplingFrequency;
            
SensorSamplingFrequency samplingFrequency = await sensor.samplingFrequency.value;
            

            

Gain

Gain of an ADC signal. The higher the gain of the input signal, the less noise in the signal, but also the lower the maximum amplitude of the input signal.

The device uses a 24-bit ADC, but the last 3 bits are not used (discarded) to optimize the data flow over the radio channel. The weight of one bit is calculated using the following formula Wbit = (2*2.4) / ( (pow(2,21) - 1) * Gain ) Volt

Available values for BrainBit:

  • 1
  • 2
  • 3
  • 4
  • 6
  • 8
  • 12
SensorGain sensorGain;
OpStatus outStatus;
readGainSensor(sensor, &sensorGain, &outStatus);
...
								   
auto sensorGain = SensorGain::SensorGain3;
OpStatus outStatus;
writeGainSensor(sensor, sensorGain, &outStatus);
            
SensorGain gain = sensor.getGain();
...
sensor.setGain(SensorGain.Gain3);
            
var gain: SensorGain = sensor.gain
...
sensor.gain = SensorGain.Gain3
            
SensorGain gain = sensor.Gain
...
sensor.Gain = SensorGain.SensorGain3
            
// get
var sensorGain: SensorGain = sensor.getGain()
...
								   
sensor.setGain(SensorGain.Gain3);
            
gain = sensor.gain
...
								  
sensor.gain = SensorGain.Gain3
            
var sensorGain: NTSensorGain? = sensor?.gain;
...
								   
sensor?.gain = .gain3
            
NTSensorGain gain = sensor.Gain;
...
								   
sensor.Gain = NTSensorGain3;
            
SensorGain gain = await sensor.gain.value;
...
await sensor.gain.set(SensorGain.gain3);
            

            

If you try to set an unsupported value to the device, an exception will be thrown.

Offset

Signal offset.

It is unchanged for BrainBit and BrainBitBlack and is 0.

SensorDataOffset sensorDataOffset;
OpStatus outStatus;
readDataOffsetSensor(sensor, &sensorDataOffset, &outStatus);
            
SensorDataOffset offset = sensor.getDataOffset();
            
var offset: SensorDataOffset = sensor.dataOffset
            
var offset: SensorDataOffset = sensor.dataOffset;
            
var sensorDataOffset: SensorDataOffset = sensor.getDataOffset()
            
sensorDataOffset = sensor.data_offset
            
var offset: NTSensorDataOffset? = sensor?.dataOffset;
            
NTSensorDataOffset offset = sensor.DataOffset;
            
SensorDataOffset offset = await sensor.dataOffset.value;
            

            

FirmwareVersion

Information about the device firmware version. You can check updates and update firmware by our app.

// get
SensorVersion versionOut;
OpStatus outStatus;
readVersionSensor(sensor, &versionOut, &outStatus);


**SensorVersion:**

| Field | Type | Description |
|--|--|--|
|FwMajor|uint32_t|firmware major|
|FwMinor|uint32_t|firmware minor|
|FwPatch|uint32_t|firmware patch|
|HwMajor|uint32_t|hardware major|
|HwMinor|uint32_t|hardware minor|
|HwPatch|uint32_t|hardware patch|
|ExtMajor|uint32_t|extension major|
            
SensorVersion version = sensor.getVersion();


**SensorVersion:**

| Field | Type | Description |
|--|--|--|
|FwMajor|int|firmware major|
|FwMinor|int|firmware minor|
|FwPatch|int|firmware patch|
|HwMajor|int|hardware major|
|HwMinor|int|hardware minor|
|HwPatch|int|hardware patch|
|ExtMajor|int|extension major|
            
var version: SensorVersion = sensor.version;

**SensorVersion:**

| Field | Type | Description |
|--|--|--|
|FwMajor|Int|firmware major|
|FwMinor|Int|firmware minor|
|FwPatch|Int|firmware patch|
|HwMajor|Int|hardware major|
|HwMinor|Int|hardware minor|
|HwPatch|Int|hardware patch|
|ExtMajor|Int|extension major|
            
SensorVersion version = sensor.Version;

**SensorVersion:**

| Field | Type | Description |
|--|--|--|
|FwMajor|uint|firmware major|
|FwMinor|uint|firmware minor|
|FwPatch|uint|firmware patch|
|HwMajor|uint|hardware major|
|HwMinor|uint|hardware minor|
|HwPatch|uint|hardware patch|
|ExtMajor|uint|extension major|
            
// get
var version: SensorVersion = sensor.getVersion()

**SensorVersion:**

| Field | Type | Description |
|--|--|--|
|FwMajor|number|firmware major|
|FwMinor|number|firmware minor|
|FwPatch|number|firmware patch|
|HwMajor|number|hardware major|
|HwMinor|number|hardware minor|
|HwPatch|number|hardware patch|
|ExtMajor|number|extension major|
            
version = sensor.version

**SensorVersion:**

| Field | Type | Description |
|--|--|--|
|FwMajor|int|firmware major|
|FwMinor|int|firmware minor|
|FwPatch|int|firmware patch|
|HwMajor|int|hardware major|
|HwMinor|int|hardware minor|
|HwPatch|int|hardware patch|
|ExtMajor|int|extension major|
            
var version: NTSensorVersion? = sensor?.version

**NTSensorVersion:**

| Field | Type | Description |
|--|--|--|
|fwMajor|UInt32?|firmware major|
|fwMinor|UInt32?|firmware minor|
|fwPatch|UInt32?|firmware patch|
|hwMajor|UInt32?|hardware major|
|hwMinor|UInt32?|hardware minor|
|hwPatch|UInt32?|hardware patch|
|extMajor|UInt32?|extension major|
            
NTSensorVersion* version = sensor.Version;

**NTSensorVersion:**

| Field | Type | Description |
|--|--|--|
|FwMajor|UInt32|firmware major|
|FwMinor|UInt32|firmware minor|
|FwPatch|UInt32|firmware patch|
|HwMajor|UInt32|hardware major|
|HwMinor|UInt32|hardware minor|
|HwPatch|UInt32|hardware patch|
|ExtMajor|UInt32|extension major|
            
SensorVersion version = await sensor.version.value;

**SensorVersion:**

| Field | Type | Description |
|--|--|--|
|fwMajor|int|firmware major|
|fwMinor|int|firmware minor|
|fwPatch|int|firmware patch|
|hwMajor|int|hardware major|
|hwMinor|int|hardware minor|
|hwPatch|int|hardware patch|
|extMajor|int|extension major|
            

            

The value is stored and changed in the `Version` parameter.

Battery power

Battery power value. Integer value.

int32_t battPowerOut;
OpStatus outStatus;
readBattPowerSensor(sensor, &battPowerOut, &outStatus);
            
int battery = sensor.getBattPower();
            
var battery: Int = sensor.battPower
            
int battery = sensor.BattPower;
            
var battery: number = sensor.getBattPower()
            
battery = sensor.batt_power
            
var battery: NSNumber? = sensor?.battPower
            
NSNumber* battery = sensor.BattPower;
            
int battery = await sensor.battPower.value;
            

            

SensorFamily

Type of device. Enumeration.

SensorFamily sensFamily = getFamilySensor(sensor);
            
SensorFamily sensFamily = sensor.getSensFamily();
            
var sensFamily: SensorFamily = sensor.sensFamily
            
SensorFamily sensFamily = sensor.SensFamily;
            
var sensFamily: SensorFamily = sensor.getSensFamily()
            
sensFamily = sensor.sens_family
            
var sensFamily: NTSensorFamily? = sensor?.sensFamily
            
NTSensorFamily sensFamily = sensor.SensFamily;
            
SensorFamily sensFamily = await sensor.sensFamily.value;