C++ API
Loading...
Searching...
No Matches
plux.h
Go to the documentation of this file.
1
23#ifndef _PLUXHEADER_
24#define _PLUXHEADER_
25
26#include <map>
27#include <string>
28#include <vector>
29#include <time.h>
30
31#define PLUX_API_VERSION "1.11"
32#define PLUX_API_BUILD_DATE __DATE__
33//const char *PLUX_API_BUILD_DATE = __DATE__ " " __TIME__; ///< Compile API timedate
34
35#define DEBUG_MSG(msg) \
36 fprintf(stderr, "[DEBUG]>> %s (%s:%d - %s)\n", msg, \
37 __FILE__, \
38 __LINE__, \
39 __FUNCTION__);
40
41#define DEBUG_PRINT(fmt, ...) \
42 fprintf(stderr, "[DEBUG]>> " fmt " (%s:%d %s())\n", ##__VA_ARGS__, \
43 __FILE__, \
44 __LINE__, \
45 __FUNCTION__);
46
48namespace Plux
49{
50 typedef std::string String;
51 typedef std::vector<int> Ints;
52 typedef std::vector<bool> Bools;
53
55 struct DevInfo
56 {
60
64 };
65 typedef std::vector<DevInfo> DevInfos;
66
69 class Variant
70 {
71 public:
81
82 const Type type;
83
84 union
85 {
86 bool b;
87 int i;
88 float f;
89 String *s;
90 };
91
92 Variant(void) : type(TypeNone) , i(0) {}
93 Variant(bool _b) : type(TypeBool) , b(_b) {}
94 Variant(int _i) : type(TypeInt) , i(_i) {}
95 Variant(float _f) : type(TypeFloat), f(_f) {}
96 Variant(const char *_s) : type(TypeString), s(new String(_s)) {}
97 Variant(const String &_s) : type(TypeString), s(new String(_s)) {}
98
100 Variant(const Variant &v) : type(v.type)
101 {
102 if (v.type == TypeString)
103 s = new String(*v.s);
104 else
105 i = v.i;
106 }
107
108 ~Variant(void) {if (type==TypeString) delete s;}
109 };
110
113 typedef std::map<String, Variant> Properties;
114
120 {
121 public:
122 String dbgInfo;
123
124 Exception(const String &_info) : dbgInfo(_info) {}
125
127 virtual String getDescription(void) const
128 {
129 return "Generic PLUX exception.";
130 }
131 };
132
137 {
138 public:
139 NotifException(const String &_info) : Exception(_info) {}
140 };
141
146 namespace Notification
147 {
150 {
151 public:
152 OpeningPort(const String &_info) : NotifException(_info) {}
153
155 {
156 return "The communication port does not exist or it is already being used.";
157 }
158 };
159
162 {
163 public:
164 InitializingPort(const String &_info) : NotifException(_info) {}
165
167 {
168 return "The communication port could not be initialized.";
169 }
170 };
171
174 {
175 public:
176 AdapterNotFound(const String &_info) : NotifException(_info) {}
177
179 {
180 return "No Bluetooth adapter was found.";
181 }
182 };
183
186 {
187 public:
188 DeviceNotFound(const String &_info) : NotifException(_info) {}
189
191 {
192 return "The device could not be found.";
193 }
194 };
195
198 {
199 public:
200 ContactingDevice(const String &_info) : NotifException(_info) {}
201
203 {
204 return "The communication with the device was lost.";
205 }
206 };
207 };
208
213 {
214 public:
215 ErrorException(const String &_info) : Exception(_info) {}
216 };
217
222 namespace Error
223 {
226 {
227 public:
228 InvalidParameter(const String &_info) : ErrorException(_info) {}
229
231 {
232 return "Invalid parameter.";
233 }
234 };
235
238 {
239 public:
241 const int code;
242 InvalidOperation(const String &_info, int _code = 0) : ErrorException(_info), code(_code) {}
244
246 {
247 return "Invalid operation on current device state (code " + std::to_string(code) + ").";
248 }
249 };
250
253 {
254 public:
255 NotSupported(const String &_info) : ErrorException(_info) {}
256
258 {
259 return "Operation not supported by the device.";
260 }
261 };
262
268 {
269 public:
270 InvalidInstance(const String &_info) : ErrorException(_info) {}
271
273 {
274 return "The object instance is invalid.";
275 }
276 };
277
280 {
281 public:
282 const String module;
283 MissingModule(const String &_info, const String &_module = "") :
284 ErrorException(_info), module(_module) {}
285
287 {
288 return "The API module " + module + " is missing or invalid.";
289 }
290 };
291 };
292
294 struct Clock
295 {
298 {
304 //DigAccel,
306 };
307
309 int value;
310 };
311
313 struct Event
314 {
316 enum Type
317 {
318 // BaseDev events
319
320 // SignalsDev events
332
333
334 // internal use only
336 TypeTest = 0x70,
338 };
339
341 };
342
343 // BaseDev events
344
345 // SignalsDev events
347 struct EvtDigInUpdate : public Event
348 {
351 bool state;
352 };
353
368
370 struct EvtSync : public Event
371 {
372 std::vector<Clock> timestamps;
373 };
374
377 struct EvtGestFeatures : public Event
378 {
380 int seq, length, zcrossht, macc, mean90hb, acczorientation;
382 };
383
385 struct EvtDisconnect : public Event
386 {
389 {
393 };
394
396 };
397
399 struct EvtSignalGood : public Event
400 {
401 int port;
402 bool isGood;
403 };
404
406 struct EvtBattery : public Event
407 {
408 float voltage,
410 };
411
413 struct EvtSensorTrack : public Event
414 {
415 int port;
416 bool connect;
418 };
419
420 // Acquisition send data frames event class
421 struct EvtFrameData : public Event
422 {
423 int len;
424 const void *data;
425 };
426
428 struct EvtDeviceState : public Event
429 {
431 enum State
432 {
433 PowerDown = 0,
434 SensorUnplugged = 1,
435 SensorPlugged = 2,
436 LeadsOn = 3,
437 Biocal = 4,
438 Ready = 5,
439 Acquiring = 6,
440 Stop = 7,
441 BiocalStop = 8,
442 };
443
445 };
446
447 // Calibration send data frames event class
448 struct EvtCalibrationData : public Event
449 {
450 int len;
451 const void *data;
452 };
453
454 // internal use only
456 struct EvtTest : public Event
457 {
458 int subtype, len;
459 const void *data;
460 };
462
474 {
475 public:
496
502 static DevInfos findDevices(const String &domain = "");
503
504 virtual void onFoundDevice(const char* path, const char* description);
505 DevInfos findDevicesWithCallback(void);
506
507 BaseDev();
508
520 BaseDev(const String &path);
521
525 virtual ~BaseDev(void);
526
544
557 void setParameter(int port, int index, const void *data, int dataLen);
558
560 int getParameter(int port, int index, void *data, int maxLen);
561
562 void reset(void);
564
568 float getBattery(void);
569
576 void setTimeout(int timeout = -1);
577
583 void loop(void);
584
591 void interrupt(void *param = NULL);
592
600 virtual bool onEvent(const Event &evt) {return false;}
601
609 virtual bool onTimeout(void) {return false;}
610
618 virtual bool onInterrupt(void *param) {return false;}
619
620
621 // internal use only
623 struct X;
624 X *x;
625
626 protected:
627 BaseDev(BaseDev &original);
628
629 private:
630 BaseDev& operator=(const BaseDev&); // assignments are not allowed
632 };
633
637 struct Sensor
638 {
640 enum Class
641 {
642 UNKNOWN_CLASS = 0,
643 EMG = 1,
644 ECG = 2,
645 LIGHT = 3,
646 EDA = 4,
647 BVP = 5,
648 RESP = 6,
649 XYZ = 7,
650 SYNC = 8,
651 EEG = 9,
652 SYNC_ADAP = 10,
653 SYNC_LED = 11,
654 SYNC_SW = 12,
655 USB = 13,
656 FORCE = 14,
657 TEMP = 15,
658 VPROBE = 16,
659 BREAKOUT = 17,
660 OXIMETER = 18,
661 GONI = 19,
662 ACT = 20,
663 EOG = 21,
664 EGG = 22,
665 ANSA = 23,
666 OSL = 26
667 };
668
670 enum Color
671 {
672 UNKNOWN_COLOR,
673 BLACK,
674 GRAY,
675 WHITE,
676 DARKBLUE,
677 LIGHTBLUE,
678 RED,
679 GREEN,
680 YELLOW,
681 ORANGE
682 };
683
684 uint64_t uid;
688 int type;
693 };
694
698 typedef std::map<int, Sensor> Sensors;
699
707 struct Source
708 {
709 int port;
711 int nBits;
712 int chMask;
713
718 Source(int _port=0, int _freqDivisor=1, int _nBits=16, int _chMask=0x01) :
719 port(_port), freqDivisor(_freqDivisor), nBits(_nBits), chMask(_chMask) {}
720 };
721
725 typedef std::vector<Source> Sources;
726
728 class SignalsDev : public BaseDev
729 {
730 public:
734 SignalsDev(const String &path);
735
740
743 void getSensors(Sensors &sensors);
744
754 void start(float freq, int portMask, int nBits);
755
764 void start(float freq, const Ints &ports, int nBits);
765
771 void start(float baseFreq, const Sources &sources);
772
776 void stop(void);
777
782 int getNumChannels(void);
783
789 void setDOut(bool state);
790
807 virtual bool onRawFrame(int nSeq, const int data[]) {return false;}
808 };
809
845 typedef std::vector<Schedule> Schedules;
846
855 typedef std::vector<SessionSource> SessionSources;
856
878 typedef std::vector<Session> Sessions;
879
881 class MemoryDev : public SignalsDev
882 {
883 public:
887 MemoryDev(const String &path);
888
893
897 void setTime(time_t t=0);
898
901
910
917 void addSchedule(const Schedule &sch);
918
923 void deleteSchedule(time_t startTime);
924
929
933 void stopSessionAcq(void);
934
939 void getSessions(Sessions &sessions);
940
950 void replaySession(time_t startTime, int iniFrame=0);
951
956
961 int getMemoryUsed(void);
962
971 virtual bool onSessionRawFrame(int nSeq, const int data[]) {return false;}
972
980 virtual bool onSessionEvent(const Event &evt) {return false;}
981
982 private:
991 int getSchedules_ext(Schedules &schs);
992
1000 void addSchedule_ext(const Schedule &sch);
1001 };
1002
1005 {
1006 public:
1008 struct State
1009 {
1010 int analog[6],
1015 bool digital[4];
1016 };
1017
1021 BITalinoDev(const String &path);
1022
1027
1035 void setDOut(const Bools &output);
1036
1046 void setBatThreshold(int threshold);
1047
1052 void setPWM(int value);
1053
1058 };
1059
1061 class StimDev : public BaseDev
1062 {
1064 public:
1065 StimDev(const String &path);
1066 StimDev(BaseDev &baseDev);
1067
1068 void startSession(int stateChanges = 0);
1069 void stop(void);
1070 void startMode(int mode, float time = 0);
1071 void setWaveOnMode(const float *wave, int mode, bool isVoltage = false);
1072 void setFrequencyOnMode(int freq, int mode);
1073 void setTimeOnState(float time, int state);
1074 void setModeOnState(int state, int mode);
1075 void setMaxStateChanges(int maxChanges);
1076 void setNextStateOnState(int state, int nextState);
1077 void assignTriggerToMode(int mode);
1078 void outputUnitPulse(int mode);
1079 void setHVoltageState(bool HV);
1080 void setCalib(int comID, int dacID, int calibVal);
1082 };
1083}
1084
1085#endif // _PLUXHEADER_
Base class for Plux BITalino devices.
Definition plux.h:1005
void setPWM(int value)
Assigns the analog (PWM) output value (BITalino 2 only).
void setDOut(const Bools &output)
Assigns the digital outputs states.
State getState(void)
Returns current device state (BITalino 2 only).
BITalinoDev(BaseDev &baseDev)
Promotes a BaseDev instance to BITalinoDev.
void setBatThreshold(int threshold)
Sets the battery voltage threshold for the low-battery LED.
BITalinoDev(const String &path)
Connects to a BITalino device.
Base class for all PLUX devices.
Definition plux.h:474
void setTimeout(int timeout=-1)
Sets the receiving timeout value for loop().
ProductId
Product ID enumeration.
Definition plux.h:478
@ PID_MuscleBan
MuscleBan device (PID: 5.02)
Definition plux.h:488
@ PID_RespiBanWearable
RespiBan device - Wearable version with SD card (PID: 8.03)
Definition plux.h:494
@ PID_BITalino
Original BITalino device (PID: 6.01)
Definition plux.h:489
@ PID_OpenBanV2_DDME
OpenBan v2 device - DDME (PID: 2.21)
Definition plux.h:484
@ PID_MotionPlux
Motionplux (PID: 2.10)
Definition plux.h:482
@ PID_BiosignalsPlux
biosignalsplux device (PID: 2.01)
Definition plux.h:480
@ PID_OpenBan
OpenBan device (PID: 2.20)
Definition plux.h:483
@ PID_BITalinoRev
BITalino (r)evolution device (PID: 6.02)
Definition plux.h:490
@ PID_BioPlux
BioPlux device (PID: 1.01)
Definition plux.h:479
@ PID_StimPlux
StimPlux device (PID: 3.01)
Definition plux.h:487
@ PID_CardioBanWearable
CardioBan device - Wearable version with SD card (PID: 8.02)
Definition plux.h:493
@ PID_fNIRS
fNIRS device (PID: 2.30)
Definition plux.h:486
@ PID_OpenBanV2
OpenBan v2 device (PID: 2.22)
Definition plux.h:485
@ PID_MuscleBanWearable
MuscleBan device v2 - Wearable version with SD card (PID: 8.01)
Definition plux.h:492
@ PID_BiosignalsPluxPRO
biosignalsplux PRO+ device (PID: 2.05)
Definition plux.h:481
@ PID_scoliosis
EastCoast Scoliosis (PID: 7.01)
Definition plux.h:491
static DevInfos findDevices(const String &domain="")
Finds PLUX devices within the given domain.
void interrupt(void *param=NULL)
Sends an interrupt signal to loop().
void setParameter(int port, int index, const void *data, int dataLen)
Sets a system or sensor parameter value.
virtual ~BaseDev(void)
Disconnects from the device.
void loop(void)
Runs the device message loop.
Properties getProperties(void)
Returns the device properties.
BaseDev(const String &path)
Connects to a PLUX device.
virtual bool onInterrupt(void *param)
Interrupt signal callback.
Definition plux.h:618
float getBattery(void)
Returns the remaining battery charge as a percentage of full capacity.
virtual bool onTimeout(void)
Timeout callback.
Definition plux.h:609
virtual bool onEvent(const Event &evt)
Event callback.
Definition plux.h:600
Exception thrown if an invalid object instance method was called.
Definition plux.h:268
String getDescription(void) const
Returns the exception description string.
Definition plux.h:272
Exception thrown if the requested operation cannot be completed due to current device state.
Definition plux.h:238
String getDescription(void) const
Returns the exception description string.
Definition plux.h:245
Exception thrown if a method call has an invalid parameter value.
Definition plux.h:226
String getDescription(void) const
Returns the exception description string.
Definition plux.h:230
Exception thrown if an API module is missing or invalid (DLL or .so file).
Definition plux.h:280
const String MissingModule(const String &_info, const String &_module="")
< Filename of the missing module.
Definition plux.h:283
String getDescription(void) const
Returns the exception description string.
Definition plux.h:286
Exception thrown if the requested operation is not supported by the device.
Definition plux.h:253
String getDescription(void) const
Returns the exception description string.
Definition plux.h:257
Base class for all error exceptions.
Definition plux.h:213
Generic PLUX C++ API exception.
Definition plux.h:120
virtual String getDescription(void) const
Returns the exception description string.
Definition plux.h:127
Base class for PLUX signal-acquiring devices with internal memory.
Definition plux.h:882
void stopSessionAcq(void)
Stops an internal acquisition session.
void deleteAllSessions(void)
Deletes all sessions stored on the device.
void deleteAllSchedules(void)
Deletes all session schedules from the device.
time_t getTime(void)
Returns the device current real-time clock.
void getSessions(Sessions &sessions)
Returns the headers of all sessions stored on the device.
void deleteSchedule(time_t startTime)
Deletes a session schedule from the device.
virtual bool onSessionRawFrame(int nSeq, const int data[])
Raw frames callback for stored sessions replay.
Definition plux.h:971
MemoryDev(const String &path)
Connects to a PLUX device.
virtual bool onSessionEvent(const Event &evt)
Event callback for stored sessions replay.
Definition plux.h:980
MemoryDev(BaseDev &baseDev)
Promotes a BaseDev instance to MemoryDev.
void replaySession(time_t startTime, int iniFrame=0)
Replays a session stored on the device.
int getMemoryUsed(void)
Returns the amount of memory used by all sessions stored on the device in kBytes.
int getSchedules(Schedules &schs)
Returns all session schedules stored on the device.
void setTime(time_t t=0)
Sets the device real-time clock.
void addSchedule(const Schedule &sch)
Adds a session schedule to the device.
Base class for all notification exceptions.
Definition plux.h:137
Exception thrown if no Bluetooth adapter was found while trying to connect to a Bluetooth device.
Definition plux.h:174
String getDescription(void) const
Returns the exception description string.
Definition plux.h:178
Exception thrown if the connection with the device was lost.
Definition plux.h:198
String getDescription(void) const
Returns the exception description string.
Definition plux.h:202
Exception thrown if the requested device path was not found.
Definition plux.h:186
String getDescription(void) const
Returns the exception description string.
Definition plux.h:190
Exception thrown if there was a problem while initializing the communication port.
Definition plux.h:162
String getDescription(void) const
Returns the exception description string.
Definition plux.h:166
Exception thrown if there was a problem while opening the communication port.
Definition plux.h:150
String getDescription(void) const
Returns the exception description string.
Definition plux.h:154
Base class for PLUX signal-acquiring devices.
Definition plux.h:729
void stop(void)
Stops a real-time acquisition session.
virtual bool onRawFrame(int nSeq, const int data[])
Raw frames callback.
Definition plux.h:807
void getSensors(Sensors &sensors)
Returns information about attached sensors and internal sensors.
void setDOut(bool state)
Sets the digital output state.
SignalsDev(BaseDev &baseDev)
Promotes a BaseDev instance to SignalsDev.
void start(float freq, int portMask, int nBits)
Starts a real-time acquisition session.
void start(float baseFreq, const Sources &sources)
Starts a real-time acquisition session.
SignalsDev(const String &path)
Connects to a PLUX device.
int getNumChannels(void)
Returns the total number of acquisition channels.
void start(float freq, const Ints &ports, int nBits)
Starts a real-time acquisition session.
This class is not covered in this documentation.
Definition plux.h:1062
This class encapsulates a value of one of following data types: bool, int, float and String.
Definition plux.h:70
const Type type
Data type.
Definition plux.h:82
Variant(void)
Constructs an empty Variant.
Definition plux.h:92
Variant(bool _b)
Constructs a Variant with a bool value.
Definition plux.h:93
Variant(float _f)
Constructs a Variant with a float value.
Definition plux.h:95
Variant(int _i)
Constructs a Variant with an int value.
Definition plux.h:94
Variant(const Variant &v)
Constructs a Variant as a copy of another Variant.
Definition plux.h:100
Variant(const char *_s)
Constructs a Variant with a String value from a const char*.
Definition plux.h:96
Type
Data type enumeration.
Definition plux.h:74
@ TypeNone
No data.
Definition plux.h:75
@ TypeString
String data type
Definition plux.h:79
@ TypeFloat
float data type
Definition plux.h:78
@ TypeBool
bool data type
Definition plux.h:76
@ TypeInt
int data type
Definition plux.h:77
Variant(const String &_s)
Constructs a Variant with a String value.
Definition plux.h:97
The PLUX C++ API namespace.
Definition plux.h:49
std::string String
String type.
Definition plux.h:50
std::vector< int > Ints
Vector of int type.
Definition plux.h:51
std::vector< DevInfo > DevInfos
Vector of DevInfo type.
Definition plux.h:65
std::vector< SessionSource > SessionSources
Vector of SessionSource type.
Definition plux.h:855
std::map< String, Variant > Properties
Map from String keywords to Variant types.
Definition plux.h:113
std::map< int, Sensor > Sensors
Map of sensor port indexes to Sensor information.
Definition plux.h:698
std::vector< Session > Sessions
Vector of Session type.
Definition plux.h:878
std::vector< Schedule > Schedules
Vector of Schedule type.
Definition plux.h:845
std::vector< bool > Bools
Vector of bool type.
Definition plux.h:52
std::vector< Source > Sources
Vector of Source type.
Definition plux.h:725
Current device state returned by BITalinoDev::getState()
Definition plux.h:1009
int analog[6]
Array of analog inputs values (0...1023).
Definition plux.h:1010
bool digital[4]
Array of digital ports states (false for low level or true for high level).
Definition plux.h:1015
int battery
Battery voltage value (0...1023).
Definition plux.h:1011
int batThreshold
Low-battery LED threshold (last value set with BITalinoDev::setBatThreshold()).
Definition plux.h:1012
Event timestamp class.
Definition plux.h:295
Source
Clock source type enumeration.
Definition plux.h:298
@ None
No timestamp value.
Definition plux.h:299
@ RTC
Device real-time clock timestamp.
Definition plux.h:300
@ FrameCount
Acquisition frame counter timestamp.
Definition plux.h:301
@ Bluetooth
Bluetooth piconet clock.
Definition plux.h:302
Source source
Clock source for this timestamp.
Definition plux.h:308
int value
Timestamp value.
Definition plux.h:309
Information about a device found by BaseDev::findDevices().
Definition plux.h:56
String path
Device path (the path to be passed to the device class constructor).
Definition plux.h:59
String description
Device description as returned in its description property.
Definition plux.h:63
Event base class.
Definition plux.h:314
Type type
Event type.
Definition plux.h:340
Type
Event type enumeration.
Definition plux.h:317
@ TypeFrameData
Event is a EvtFrameData object.
Definition plux.h:329
@ TypeBattery
Event is a EvtBattery object.
Definition plux.h:327
@ TypeSignalGood
Event is a EvtSignalGood object.
Definition plux.h:326
@ TypeCalibrationData
Event is a EvtCalibrationData object.
Definition plux.h:331
@ TypeSync
Event is a EvtSync object.
Definition plux.h:323
@ TypeGestFeatures
Event is a EvtGestFeatures object.
Definition plux.h:324
@ TypeDigInUpdate
Event is a EvtDigInUpdate object.
Definition plux.h:321
@ TypeDisconnect
Event is a EvtDisconnect object.
Definition plux.h:325
@ TypeSensorTrack
Event is a EvtSensorTrack object.
Definition plux.h:328
@ TypeSchedChange
Event is a EvtSchedChange object.
Definition plux.h:322
@ TypeDeviceState
Event is a EvtDeviceState object.
Definition plux.h:330
Battery state event class.
Definition plux.h:407
float percentage
Remaining battery charge as a percentage of full capacity.
Definition plux.h:409
float voltage
Battery voltage in Volts.
Definition plux.h:408
Definition plux.h:449
Device state change event class.
Definition plux.h:429
State state
Device state.
Definition plux.h:444
State
Device state enumeration.
Definition plux.h:432
Digital port input change event class.
Definition plux.h:348
int channel
The digital input which changed state, starting at zero.
Definition plux.h:350
bool state
New state of digital port input. If true, new state is High, otherwise it is Low.
Definition plux.h:351
Clock timestamp
Event timestamp.
Definition plux.h:349
Device disconnect event class.
Definition plux.h:386
Reason
Disconnect reason enumeration.
Definition plux.h:389
@ Timeout
Idle connection timeout (15 min) has elapsed.
Definition plux.h:390
@ BatDischarged
Device battery is discharged.
Definition plux.h:392
@ ButtonPressed
Device button was pressed.
Definition plux.h:391
Reason reason
Reason for the device disconnection.
Definition plux.h:395
Definition plux.h:422
Gesture features event class.
Definition plux.h:378
Session schedule change event class.
Definition plux.h:356
Action action
Change that occurred in a session schedule.
Definition plux.h:365
Action
Schedule action enumeration.
Definition plux.h:359
@ SchedCannotStart
A scheduled session could not start.
Definition plux.h:362
@ SchedEnded
A scheduled session has ended.
Definition plux.h:361
@ SchedStarted
A scheduled session has started.
Definition plux.h:360
time_t schedStartTime
Schedule::startTime attribute value of the schedule (unique schedule identifier).
Definition plux.h:366
Sensor connection/disconnection tracking event class.
Definition plux.h:414
bool idChanged
True if a different sensor was connected on the port, according to port-sensor map defined at acquisi...
Definition plux.h:417
int port
Sensor port.
Definition plux.h:415
bool connect
True if sensor was connected, false otherwise.
Definition plux.h:416
Sensor signal good event class.
Definition plux.h:400
int port
Sensor port.
Definition plux.h:401
bool isGood
True if the sensor signal is valid; false otherwise.
Definition plux.h:402
Synchronization event class.
Definition plux.h:371
std::vector< Clock > timestamps
Synchronized timestamps.
Definition plux.h:372
Session schedule class.
Definition plux.h:815
Schedule(void)
Initializes all structure fields.
Definition plux.h:843
String text
Optional user text to store in Session::text attribute of saved sessions (maximum of 70 characters).
Definition plux.h:837
int nSessions
Number of sessions to be recorded. Default value is one.
Definition plux.h:833
time_t startTime
Scheduled session start time or condition (1 or a time_t value).
Definition plux.h:825
int repeatPeriod
Repetition period in seconds. Default value is zero.
Definition plux.h:834
Sources sources
Scheduled session sources.
Definition plux.h:836
int duration
Scheduled session duration limit in seconds.
Definition plux.h:832
float baseFreq
Acquisition base sampling frequency in Hertz. Default value is 1000.
Definition plux.h:835
Sensor information class.
Definition plux.h:638
int type
Sensor interface type bitmask
Definition plux.h:688
int hwVersion
Sensor hardware version number
Definition plux.h:687
Class clas
Sensor class
Definition plux.h:685
Color color
Sensor sleeve color
Definition plux.h:690
time_t productionTime
Sensor production timestamp
Definition plux.h:689
int serialNum
Sensor serial number within its class
Definition plux.h:686
Class
Sensor class enumeration
Definition plux.h:641
Properties characteristics
Sensor characteristics. See Sensor properties
Definition plux.h:691
Properties measurCalib
Sensor measurements or calibration data. See Sensor properties
Definition plux.h:692
Color
Sensor sleeve color enumeration
Definition plux.h:671
uint64_t uid
Sensor 48-bit unique identifier
Definition plux.h:684
Stored session header class.
Definition plux.h:861
int nFrames
Total number of frames in the stored session.
Definition plux.h:872
float baseFreq
Session acquisition base sampling frequency in Hertz.
Definition plux.h:873
String text
Optional user text from the Schedule::text attribute of the schedule associated with this session.
Definition plux.h:875
Properties properties
Additional session properties.
Definition plux.h:876
time_t startTime
Session start time.
Definition plux.h:866
SessionSources sources
Session sources.
Definition plux.h:874
time_t schedStartTime
The Schedule::startTime attribute value of the schedule associated with this session,...
Definition plux.h:871
Saved acquisition source class with sensor information.
Definition plux.h:851
Properties properties
Additional source properties.
Definition plux.h:853
Sensor sensor
Information about the Sensor associated with the source.
Definition plux.h:852
Acquisition source class.
Definition plux.h:708
int nBits
Source sampling resolution in bits (8, 16 or 24). The value 24 is accepted for SpO2 / fNIRS sensors o...
Definition plux.h:711
int port
Source port (1...8 for analog ports). Default value is zero.
Definition plux.h:709
int freqDivisor
Source frequency divisor from acquisition base frequency (>= 1). Default value is 1.
Definition plux.h:710
int chMask
Bitmask of source channels to sample (bit 0 is channel 0, etc). Default value is 1 (channel 0 only).
Definition plux.h:712
Source(int _port=0, int _freqDivisor=1, int _nBits=16, int _chMask=0x01)
Initializes all structure fields.
Definition plux.h:718
some_integer time_t
Number of seconds since 1970-01-01 00:00:00 UTC (not counting leap seconds).
Definition time.h:9