C++ API
Loading...
Searching...
No Matches
Plux::BITalinoDev Class Reference

Base class for Plux BITalino devices. More...

#include <plux.h>

Inheritance diagram for Plux::BITalinoDev:
Plux::SignalsDev Plux::BaseDev

Classes

struct  State
 Current device state returned by BITalinoDev::getState() More...
 

Public Member Functions

 BITalinoDev (const String &path)
 Connects to a BITalino device.
 
 BITalinoDev (BaseDev &baseDev)
 Promotes a BaseDev instance to BITalinoDev.
 
void setDOut (const Bools &output)
 Assigns the digital outputs states.
 
void setBatThreshold (int threshold)
 Sets the battery voltage threshold for the low-battery LED.
 
void setPWM (int value)
 Assigns the analog (PWM) output value (BITalino 2 only).
 
State getState (void)
 Returns current device state (BITalino 2 only).
 
- Public Member Functions inherited from Plux::SignalsDev
 SignalsDev (const String &path)
 Connects to a PLUX device.
 
 SignalsDev (BaseDev &baseDev)
 Promotes a BaseDev instance to SignalsDev.
 
void getSensors (Sensors &sensors)
 Returns information about attached sensors and internal sensors.
 
void start (float freq, int portMask, int nBits)
 Starts a real-time acquisition session.
 
void start (float freq, const Ints &ports, int nBits)
 Starts a real-time acquisition session.
 
void start (float baseFreq, const Sources &sources)
 Starts a real-time acquisition session.
 
void stop (void)
 Stops a real-time acquisition session.
 
int getNumChannels (void)
 Returns the total number of acquisition channels.
 
void setDOut (bool state)
 Sets the digital output state.
 
virtual bool onRawFrame (int nSeq, const int data[])
 Raw frames callback.
 
- Public Member Functions inherited from Plux::BaseDev
virtual void onFoundDevice (const char *path, const char *description)
 
DevInfos findDevicesWithCallback (void)
 
 BaseDev (const String &path)
 Connects to a PLUX device.
 
virtual ~BaseDev (void)
 Disconnects from the device.
 
Properties getProperties (void)
 Returns the device properties.
 
void setParameter (int port, int index, const void *data, int dataLen)
 Sets a system or sensor parameter value.
 
float getBattery (void)
 Returns the remaining battery charge as a percentage of full capacity.
 
void setTimeout (int timeout=-1)
 Sets the receiving timeout value for loop().
 
void loop (void)
 Runs the device message loop.
 
void interrupt (void *param=NULL)
 Sends an interrupt signal to loop().
 
virtual bool onEvent (const Event &evt)
 Event callback.
 
virtual bool onTimeout (void)
 Timeout callback.
 
virtual bool onInterrupt (void *param)
 Interrupt signal callback.
 

Additional Inherited Members

- Public Types inherited from Plux::BaseDev
enum  ProductId {
  PID_BioPlux = 0x0101 , PID_BiosignalsPlux = 0x0201 , PID_BiosignalsPluxPRO = 0x0205 , PID_MotionPlux = 0x020A ,
  PID_OpenBan = 0x0214 , PID_OpenBanV2_DDME = 0x0215 , PID_OpenBanV2 = 0x0216 , PID_fNIRS = 0x021E ,
  PID_StimPlux = 0x0301 , PID_MuscleBan = 0x0502 , PID_BITalino = 0x0601 , PID_BITalinoRev = 0x0602 ,
  PID_scoliosis = 0x0701 , PID_MuscleBanWearable = 0x0801 , PID_CardioBanWearable = 0x0802 , PID_RespiBanWearable = 0x0803
}
 Product ID enumeration. More...
 
- Static Public Member Functions inherited from Plux::BaseDev
static DevInfos findDevices (const String &domain="")
 Finds PLUX devices within the given domain.
 

Detailed Description

Base class for Plux BITalino devices.

Constructor & Destructor Documentation

◆ BITalinoDev() [1/2]

Plux::BITalinoDev::BITalinoDev ( const String path)

Connects to a BITalino device.

Parameters
pathPath to the BITalino device. It has the same meaning as in BaseDev::BaseDev().

◆ BITalinoDev() [2/2]

Plux::BITalinoDev::BITalinoDev ( BaseDev baseDev)

Promotes a BaseDev instance to BITalinoDev.

Parameters
baseDevInstance to be promoted. If promotion is successful, baseDev is no longer valid.

Member Function Documentation

◆ setDOut()

void Plux::BITalinoDev::setDOut ( const Bools output)

Assigns the digital outputs states.

Parameters
[in]outputVector of booleans to assign to digital outputs, starting at first output (O1). On each vector element, false sets the output to low level and true sets the output to high level. The vector must contain exactly 4 elements for original BITalino (4 digital outputs) or exactly 2 elements for BITalino 2 (2 digital outputs).
Remarks
This method must be called only during an acquisition on original BITalino. On BITalino 2 there is no restriction.

◆ setBatThreshold()

void Plux::BITalinoDev::setBatThreshold ( int  threshold)

Sets the battery voltage threshold for the low-battery LED.

Parameters
[in]thresholdBattery voltage threshold.
Parameter value Voltage Threshold
0 3.4 V
... ...
63 3.8 V
Remarks
This method cannot be called during an acquisition.

◆ setPWM()

void Plux::BITalinoDev::setPWM ( int  value)

Assigns the analog (PWM) output value (BITalino 2 only).

Parameters
[in]valueAnalog output value to set (0...255). The analog output voltage is given by: V (in Volts) = 3.3 * (value+1)/256

◆ getState()

State Plux::BITalinoDev::getState ( void  )

Returns current device state (BITalino 2 only).

Remarks
This method cannot be called during an acquisition.

The documentation for this class was generated from the following file: