InertiaSDK

Loading...
Searching...
No Matches
Inertia.h
1#pragma once
2
7
8#include "dll/InertiaExport.h"
9#include "platform.h"
10#include "version.h"
11#include "dll/DebugLog.h"
12#include "dll/Quaternion.h"
13
14#include "dll/StreamListener.h"
15#include "dll/LogColumns.h"
16#include "dll/ConnectionSettings.h"
17#include "dll/LogSettings.h"
18#include "dll/SocketSettings.h"
19#include "dll/CalibrationSettings.h"
20#include "dll/ConvertSettings.h"
21#include "dll/ChannelSpec.h"
22#include "dll/OrientationSettings.h"
23#include "dll/FirmwareSettings.h"
24
25#include "data/InertiaConfig.h"
26#include "data/InertiaCommands.h"
27#include "data/InertiaService.h"
28#include "data/Sample.h"
29#include "data/DeviceInfo.h"
30
31
33 namespace inertia
34{
38 INERTIA_API std::wstring GetLibraryVersion();
39
43 INERTIA_API std::wstring GetLibraryVersionFull();
44
49 INERTIA_API std::vector<std::wstring> SplitCommandLine(std::wstring const& cmdLine);
50
54 INERTIA_API const std::map<std::wstring, std::wstring> GetSerialPortList();
55
60 INERTIA_API const std::map<std::wstring, std::wstring> GetBluetoothPortList();
61
65 INERTIA_API const std::map<std::wstring, std::wstring> GetNetworkAdapterList();
66
72 INERTIA_API unsigned GetSerialDriverVersion();
73
79 INERTIA_API void GetPcapAvailable(bool& installed, bool& enabled);
80
84 INERTIA_API std::vector<LogFileType> GetSupportedFileTypes();
85
86
87
92 INERTIA_API bool ConnectionUpdate(ConnectionSettings const& settings);
93
98 INERTIA_API bool ConnectionRemove(std::wstring const& connection);
99
107 INERTIA_API void ConnectionAddListener(StreamListenerPtr const& listener, std::wstring const& connection = std::wstring());
108
113 INERTIA_API void ConnectionRemoveListener(StreamListenerPtr const& listener, std::wstring const& connection = std::wstring());
114
119 INERTIA_API bool ConnectionFind(std::wstring const& connection);
120
121
122
128 INERTIA_API bool LoggingUpdate(std::wstring const& connection, LogWriterSettings const& logSettings);
129
135 INERTIA_API std::wstring LoggingCheckFileName(std::wstring const& connection, LogWriterSettings const& settings);
136
137
138
143 INERTIA_API bool ReplayUpdate(LogReaderSettings const& settings);
144
148 INERTIA_API void ReplayRemove(std::wstring const& filename);
149
157 INERTIA_API void ReplayAddListener(StreamListenerPtr const& listener, std::wstring const& filename = std::wstring());
158
163 INERTIA_API void ReplayRemoveListener(StreamListenerPtr const& listener, std::wstring const& filename = std::wstring());
164
169 INERTIA_API bool ReplayIsActive(std::wstring const& filename);
170
175 INERTIA_API unsigned ReplayGetProgress(std::wstring const& filename);
176
182 INERTIA_API std::map<unsigned, std::vector<Sample> > const ReplayGetSamples(std::wstring const& filename, const unsigned maxItems);
183
188 INERTIA_API LogWriterSourceInfo const ReplayGetSourceInfo(std::wstring const& filename);
189
190
191
199 INERTIA_API std::vector<Sample> const DataGetSamples(std::wstring const& connection, const unsigned addrID, const unsigned maxItems, const bool newest = false);
200
207 INERTIA_API void DataGetStats(std::wstring const& connection, const unsigned addrID, unsigned long& lost, unsigned long& received);
208
213 INERTIA_API void DataClearStats(std::wstring const& connection, const unsigned addrID = 0);
214
221 INERTIA_API bool DataGetValue(Sample const& sample, ChannelSpec const& spec, double& value);
222
223
224
229 INERTIA_API const std::vector<unsigned> GetNodeIDs(std::wstring const& connection);
230
236 INERTIA_API void ClearNodeIDs(std::wstring const& connection, std::vector<unsigned>& addrIDs, const bool onlyInvalidate);
237
247 INERTIA_API double GetSamplingFrequency(std::wstring const& connection, const unsigned addrID, const ConfigType type = CONFIG_GLOBAL_SAMPLING, const unsigned index = 0, const int instance = -1);
248
254 INERTIA_API const InertiaConfig GetConfiguration(std::wstring const& connection, const unsigned addrID);
255
261 INERTIA_API const DeviceInfo GetDeviceInfo(std::wstring const& connection, const unsigned addrID);
262
269 INERTIA_API bool SendConfiguration(std::wstring const& connection, InertiaConfig const& config, const unsigned addrID = ADDRESS_BROADCAST);
270
277 INERTIA_API bool SendCommand(std::wstring const& connection, InertiaCommands const& command, const unsigned addrID = ADDRESS_BROADCAST);
278
285 INERTIA_API bool SendServiceRequest(std::wstring const& connection, ServiceRequest const& service, const unsigned addrID = ADDRESS_BROADCAST);
286
291 INERTIA_API void SetAutoUpdateSensorSamplingRate(const bool enable);
292
297 INERTIA_API void SetUseRawADCSamples(const bool enable);
298
299
305 INERTIA_API std::set<unsigned> CalibrateUpdate(CalibrationSettings const& settings);
306
311 INERTIA_API bool CalibrateRemove(std::wstring const& filename);
312
319 INERTIA_API const CalibrationResults CalibrateGetResults(std::wstring const& filename, unsigned const addrID, ValueType const valueType);
320
329 INERTIA_API void CalibrateGetData(std::wstring const& filename, unsigned const addrID, CalibrationResults const& calibration,
330 std::vector<double>& timestamp, std::vector<double>& norm, std::vector<double>& appliedNorm);
331
332
333
335 enum FFTWindowFunction : unsigned
336 {
337 FFT_RECTANGULAR = 0,
338 FFT_TRIANGULAR,
339 FFT_HAMMING,
340 FFT_HANNING,
341 FFT_BLACKMAN,
342 FFT_END
343 };
344
351 INERTIA_API void FFTInit(const unsigned points, const unsigned interval, const FFTWindowFunction window, const bool removeDC);
352
356 INERTIA_API void FFTStart(ChannelSpec const& channel);
357
360 INERTIA_API void FFTStop();
361
365 INERTIA_API StreamListenerPtr FFTGetListener();
366
373 INERTIA_API std::map<unsigned, std::vector<double> > const FFTGet(std::wstring const& connection, ChannelSpec const& channel, const bool erase = false);
374
375
376
384 INERTIA_API bool DownloadFlashStart(std::wstring const& connection, const unsigned addrID, std::wstring const& flashname, LogWriterSettings const& logSettings);
385
392 INERTIA_API bool DownloadFlashStop(std::wstring const& connection, const unsigned addrID, std::wstring const& flashname);
393
399 INERTIA_API std::vector<std::wstring> DownloadFlashGetActive(std::wstring const& connection, const unsigned addrID);
400
408 INERTIA_API bool UploadFlashStart(std::wstring const& connection, const unsigned addrID, std::wstring const& flashname, std::wstring const& filename);
409
416 INERTIA_API bool UploadFlashStop(std::wstring const& connection, const unsigned addrID, std::wstring const& flashname);
417
423 INERTIA_API std::vector<std::wstring> UploadFlashGetActive(std::wstring const& connection, const unsigned addrID);
424
425
426
433 INERTIA_API bool ConvertFileStart(std::wstring const& filename, ConvertFileSettings const& convertSettings, std::wstring& createdFile);
434
438 INERTIA_API void ConvertFileStop(std::wstring const& filename);
439
444 INERTIA_API bool ConvertFileIsActive(std::wstring const& filename);
445
446
447
457 INERTIA_API void FillLossUpdateSettings(const unsigned retries, const bool keepBackup,
458 const unsigned slots = 0, const unsigned maxFlashDiff = 60, const bool speedStatistics = true);
459
465 INERTIA_API bool FillLossStart(std::wstring const& filename, std::wstring const& connection);
466
470 INERTIA_API void FillLossStop(std::wstring const& filename);
471
476 INERTIA_API bool FillLossIsActive(std::wstring const& filename);
477
478
479
486 INERTIA_API bool MergeFilesStart(LogWriterSettings const& logSettings, std::vector<std::wstring> const& filenames, std::wstring& createdFile);
487
491 INERTIA_API void MergeFilesStop(std::wstring const& filename);
492
497 INERTIA_API bool MergeFilesIsActive(std::wstring const& filename);
498
499
500
505 INERTIA_API void OrientationUpdate(std::wstring const& connection, const unsigned addrID);
506
511 INERTIA_API void OrientationRemove(std::wstring const& connection = std::wstring(), const unsigned addrID = 0);
512
516 INERTIA_API void OrientationEnable(const bool enable);
517
521 INERTIA_API bool OrientationIsEnabled();
522
528 INERTIA_API OrientationSettings OrientationGetSettings(std::wstring const& connection = std::wstring(), const unsigned addrID = 0);
529
537 INERTIA_API void OrientationUpdateSettings(OrientationSettings const& settings, std::wstring const& connection = std::wstring(), const unsigned addrID = 0, const bool reset = true);
538
544 INERTIA_API void OrientationSet(std::wstring const& connection, const unsigned addrID, inertia::Quaternion const& quat);
545
551 INERTIA_API void OrientationCalculate(std::wstring const& connection, const unsigned addrID, inertia::Sample& sample);
552
553
554
561 INERTIA_API StreamListenerPtr NetworkUpdateConnection(SocketSettings const& settings, StreamFilter const& filter);
562
568 INERTIA_API bool NetworkFindConnection(std::wstring const& hostname, const unsigned port);
569
575 INERTIA_API bool NetworkRemoveConnection(std::wstring const& hostname, const unsigned port);
576
577
578
584 INERTIA_API void FirmwareValidate(std::wstring const& connection, unsigned const addrID, FirmwareSettings const& settings);
585
591 INERTIA_API void FirmwareReprogram(std::wstring const& connection, unsigned const addrID, FirmwareSettings const& settings);
592
593
594
600 INERTIA_API void CustomChannelAdd(uint64_t const serialNr, const int samplingChannel, Channel const& customChannel);
601
606 INERTIA_API void CustomChannelRemove(uint64_t const serialNr, const int samplingChannel = -1);
607
612 INERTIA_API ChannelMap CustomChannelGet(uint64_t const serialNr);
613
614
615
619 INERTIA_API void Destruct();
620
621} // namespace inertia
inertia
Definition FlashCommands.h:6
inertia::GetNodeIDs
INERTIA_API const std::vector< unsigned > GetNodeIDs(std::wstring const &connection)
inertia::GetSupportedFileTypes
INERTIA_API std::vector< LogFileType > GetSupportedFileTypes()
inertia::ConvertFileIsActive
INERTIA_API bool ConvertFileIsActive(std::wstring const &filename)
inertia::LoggingUpdate
INERTIA_API bool LoggingUpdate(std::wstring const &connection, LogWriterSettings const &logSettings)
inertia::ReplayRemove
INERTIA_API void ReplayRemove(std::wstring const &filename)
inertia::SetUseRawADCSamples
INERTIA_API void SetUseRawADCSamples(const bool enable)
inertia::ConvertFileStart
INERTIA_API bool ConvertFileStart(std::wstring const &filename, ConvertFileSettings const &convertSettings, std::wstring &createdFile)
inertia::ValueType
ValueType
Definition ChannelSpec.h:7
inertia::DataGetSamples
INERTIA_API std::vector< Sample > const DataGetSamples(std::wstring const &connection, const unsigned addrID, const unsigned maxItems, const bool newest=false)
inertia::MergeFilesStop
INERTIA_API void MergeFilesStop(std::wstring const &filename)
inertia::CustomChannelGet
INERTIA_API ChannelMap CustomChannelGet(uint64_t const serialNr)
inertia::DownloadFlashStop
INERTIA_API bool DownloadFlashStop(std::wstring const &connection, const unsigned addrID, std::wstring const &flashname)
inertia::GetConfiguration
INERTIA_API const InertiaConfig GetConfiguration(std::wstring const &connection, const unsigned addrID)
inertia::DataGetStats
INERTIA_API void DataGetStats(std::wstring const &connection, const unsigned addrID, unsigned long &lost, unsigned long &received)
inertia::SendServiceRequest
INERTIA_API bool SendServiceRequest(std::wstring const &connection, ServiceRequest const &service, const unsigned addrID=ADDRESS_BROADCAST)
inertia::FillLossIsActive
INERTIA_API bool FillLossIsActive(std::wstring const &filename)
inertia::GetSerialPortList
INERTIA_API const std::map< std::wstring, std::wstring > GetSerialPortList()
inertia::FFTStop
INERTIA_API void FFTStop()
inertia::OrientationGetSettings
INERTIA_API OrientationSettings OrientationGetSettings(std::wstring const &connection=std::wstring(), const unsigned addrID=0)
inertia::GetLibraryVersionFull
INERTIA_API std::wstring GetLibraryVersionFull()
inertia::DataGetValue
INERTIA_API bool DataGetValue(Sample const &sample, ChannelSpec const &spec, double &value)
inertia::MergeFilesStart
INERTIA_API bool MergeFilesStart(LogWriterSettings const &logSettings, std::vector< std::wstring > const &filenames, std::wstring &createdFile)
inertia::NetworkRemoveConnection
INERTIA_API bool NetworkRemoveConnection(std::wstring const &hostname, const unsigned port)
inertia::NetworkFindConnection
INERTIA_API bool NetworkFindConnection(std::wstring const &hostname, const unsigned port)
inertia::SetAutoUpdateSensorSamplingRate
INERTIA_API void SetAutoUpdateSensorSamplingRate(const bool enable)
inertia::ReplayUpdate
INERTIA_API bool ReplayUpdate(LogReaderSettings const &settings)
inertia::SendConfiguration
INERTIA_API bool SendConfiguration(std::wstring const &connection, InertiaConfig const &config, const unsigned addrID=ADDRESS_BROADCAST)
inertia::FFTStart
INERTIA_API void FFTStart(ChannelSpec const &channel)
inertia::OrientationUpdate
INERTIA_API void OrientationUpdate(std::wstring const &connection, const unsigned addrID)
inertia::GetSerialDriverVersion
INERTIA_API unsigned GetSerialDriverVersion()
inertia::NetworkUpdateConnection
INERTIA_API StreamListenerPtr NetworkUpdateConnection(SocketSettings const &settings, StreamFilter const &filter)
inertia::ReplayIsActive
INERTIA_API bool ReplayIsActive(std::wstring const &filename)
inertia::ConnectionUpdate
INERTIA_API bool ConnectionUpdate(ConnectionSettings const &settings)
inertia::GetNetworkAdapterList
INERTIA_API const std::map< std::wstring, std::wstring > GetNetworkAdapterList()
inertia::GetPcapAvailable
INERTIA_API void GetPcapAvailable(bool &installed, bool &enabled)
inertia::ConfigType
ConfigType
Definition ConfigChannel.h:7
inertia::CONFIG_GLOBAL_SAMPLING
@ CONFIG_GLOBAL_SAMPLING
Global Sampling Configuration, see GlobalSamplingConfig.
Definition ConfigChannel.h:9
inertia::CalibrateGetResults
INERTIA_API const CalibrationResults CalibrateGetResults(std::wstring const &filename, unsigned const addrID, ValueType const valueType)
inertia::CalibrateRemove
INERTIA_API bool CalibrateRemove(std::wstring const &filename)
inertia::GetLibraryVersion
INERTIA_API std::wstring GetLibraryVersion()
inertia::CustomChannelAdd
INERTIA_API void CustomChannelAdd(uint64_t const serialNr, const int samplingChannel, Channel const &customChannel)
inertia::CalibrateGetData
INERTIA_API void CalibrateGetData(std::wstring const &filename, unsigned const addrID, CalibrationResults const &calibration, std::vector< double > &timestamp, std::vector< double > &norm, std::vector< double > &appliedNorm)
inertia::UploadFlashGetActive
INERTIA_API std::vector< std::wstring > UploadFlashGetActive(std::wstring const &connection, const unsigned addrID)
inertia::FirmwareReprogram
INERTIA_API void FirmwareReprogram(std::wstring const &connection, unsigned const addrID, FirmwareSettings const &settings)
inertia::CalibrateUpdate
INERTIA_API std::set< unsigned > CalibrateUpdate(CalibrationSettings const &settings)
inertia::ConnectionFind
INERTIA_API bool ConnectionFind(std::wstring const &connection)
inertia::FirmwareValidate
INERTIA_API void FirmwareValidate(std::wstring const &connection, unsigned const addrID, FirmwareSettings const &settings)
inertia::ConvertFileStop
INERTIA_API void ConvertFileStop(std::wstring const &filename)
inertia::SplitCommandLine
INERTIA_API std::vector< std::wstring > SplitCommandLine(std::wstring const &cmdLine)
inertia::DownloadFlashStart
INERTIA_API bool DownloadFlashStart(std::wstring const &connection, const unsigned addrID, std::wstring const &flashname, LogWriterSettings const &logSettings)
inertia::CustomChannelRemove
INERTIA_API void CustomChannelRemove(uint64_t const serialNr, const int samplingChannel=-1)
inertia::ReplayGetSamples
INERTIA_API std::map< unsigned, std::vector< Sample > > const ReplayGetSamples(std::wstring const &filename, const unsigned maxItems)
inertia::FillLossUpdateSettings
INERTIA_API void FillLossUpdateSettings(const unsigned retries, const bool keepBackup, const unsigned slots=0, const unsigned maxFlashDiff=60, const bool speedStatistics=true)
inertia::OrientationIsEnabled
INERTIA_API bool OrientationIsEnabled()
inertia::ReplayRemoveListener
INERTIA_API void ReplayRemoveListener(StreamListenerPtr const &listener, std::wstring const &filename=std::wstring())
inertia::UploadFlashStop
INERTIA_API bool UploadFlashStop(std::wstring const &connection, const unsigned addrID, std::wstring const &flashname)
inertia::ReplayGetProgress
INERTIA_API unsigned ReplayGetProgress(std::wstring const &filename)
inertia::GetSamplingFrequency
INERTIA_API double GetSamplingFrequency(std::wstring const &connection, const unsigned addrID, const ConfigType type=CONFIG_GLOBAL_SAMPLING, const unsigned index=0, const int instance=-1)
inertia::OrientationSet
INERTIA_API void OrientationSet(std::wstring const &connection, const unsigned addrID, inertia::Quaternion const &quat)
inertia::GetBluetoothPortList
INERTIA_API const std::map< std::wstring, std::wstring > GetBluetoothPortList()
inertia::OrientationRemove
INERTIA_API void OrientationRemove(std::wstring const &connection=std::wstring(), const unsigned addrID=0)
inertia::StreamListenerPtr
std::shared_ptr< StreamListener > StreamListenerPtr
Pointer to a SteamListener.
Definition platform.h:38
inertia::DataClearStats
INERTIA_API void DataClearStats(std::wstring const &connection, const unsigned addrID=0)
inertia::OrientationUpdateSettings
INERTIA_API void OrientationUpdateSettings(OrientationSettings const &settings, std::wstring const &connection=std::wstring(), const unsigned addrID=0, const bool reset=true)
inertia::FFTWindowFunction
FFTWindowFunction
Available FFT window function.
Definition Inertia.h:336
inertia::FFT_TRIANGULAR
@ FFT_TRIANGULAR
Triangular window.
Definition Inertia.h:338
inertia::FFT_BLACKMAN
@ FFT_BLACKMAN
Blackman window.
Definition Inertia.h:341
inertia::FFT_HANNING
@ FFT_HANNING
Hanning window.
Definition Inertia.h:340
inertia::FFT_HAMMING
@ FFT_HAMMING
Hamming window.
Definition Inertia.h:339
inertia::FFT_RECTANGULAR
@ FFT_RECTANGULAR
Rectangular window.
Definition Inertia.h:337
inertia::ConnectionAddListener
INERTIA_API void ConnectionAddListener(StreamListenerPtr const &listener, std::wstring const &connection=std::wstring())
inertia::OrientationCalculate
INERTIA_API void OrientationCalculate(std::wstring const &connection, const unsigned addrID, inertia::Sample &sample)
inertia::ClearNodeIDs
INERTIA_API void ClearNodeIDs(std::wstring const &connection, std::vector< unsigned > &addrIDs, const bool onlyInvalidate)
inertia::UploadFlashStart
INERTIA_API bool UploadFlashStart(std::wstring const &connection, const unsigned addrID, std::wstring const &flashname, std::wstring const &filename)
inertia::MergeFilesIsActive
INERTIA_API bool MergeFilesIsActive(std::wstring const &filename)
inertia::FFTGet
INERTIA_API std::map< unsigned, std::vector< double > > const FFTGet(std::wstring const &connection, ChannelSpec const &channel, const bool erase=false)
inertia::ConnectionRemoveListener
INERTIA_API void ConnectionRemoveListener(StreamListenerPtr const &listener, std::wstring const &connection=std::wstring())
inertia::FillLossStop
INERTIA_API void FillLossStop(std::wstring const &filename)
inertia::Destruct
INERTIA_API void Destruct()
inertia::ReplayAddListener
INERTIA_API void ReplayAddListener(StreamListenerPtr const &listener, std::wstring const &filename=std::wstring())
inertia::ReplayGetSourceInfo
INERTIA_API LogWriterSourceInfo const ReplayGetSourceInfo(std::wstring const &filename)
inertia::FillLossStart
INERTIA_API bool FillLossStart(std::wstring const &filename, std::wstring const &connection)
inertia::ConnectionRemove
INERTIA_API bool ConnectionRemove(std::wstring const &connection)
inertia::DownloadFlashGetActive
INERTIA_API std::vector< std::wstring > DownloadFlashGetActive(std::wstring const &connection, const unsigned addrID)
inertia::OrientationEnable
INERTIA_API void OrientationEnable(const bool enable)
inertia::FFTInit
INERTIA_API void FFTInit(const unsigned points, const unsigned interval, const FFTWindowFunction window, const bool removeDC)
inertia::ChannelMap
std::map< unsigned, Channel > ChannelMap
Map with Channel information per samplingChannel.
Definition platform.h:58
inertia::FFTGetListener
INERTIA_API StreamListenerPtr FFTGetListener()
inertia::SendCommand
INERTIA_API bool SendCommand(std::wstring const &connection, InertiaCommands const &command, const unsigned addrID=ADDRESS_BROADCAST)
inertia::LoggingCheckFileName
INERTIA_API std::wstring LoggingCheckFileName(std::wstring const &connection, LogWriterSettings const &settings)
inertia::GetDeviceInfo
INERTIA_API const DeviceInfo GetDeviceInfo(std::wstring const &connection, const unsigned addrID)
inertia::CalibrationResults
Calibration Results.
Definition CalibrationSettings.h:12
inertia::CalibrationSettings
Calibration Settings.
Definition CalibrationSettings.h:38
inertia::ChannelSpec
Channel Specification.
Definition ChannelSpec.h:65
inertia::Channel
Definition ConfigChannel.h:47
inertia::ConnectionSettings
Connection Settings.
Definition ConnectionSettings.h:26
inertia::ConvertFileSettings
Convert Settings.
Definition ConvertSettings.h:13
inertia::DeviceInfo
Device Info.
Definition DeviceInfo.h:32
inertia::FirmwareSettings
Firmware Update Settings.
Definition FirmwareSettings.h:11
inertia::InertiaCommands
Commands.
Definition InertiaCommands.h:18
inertia::InertiaConfig
Sensor Configuration.
Definition InertiaConfig.h:48
inertia::LogReaderSettings
Log Reader Settings.
Definition LogSettings.h:469
inertia::LogWriterSettings
Log Writer Settings.
Definition LogSettings.h:394
inertia::LogWriterSourceInfo
LogWriter Source Settings.
Definition LogSettings.h:94
inertia::OrientationSettings
Orientation Settings.
Definition OrientationSettings.h:235
inertia::Quaternion
Quaternion.
Definition Quaternion.h:12
inertia::Sample
Sensor data.
Definition Sample.h:73
inertia::ServiceRequest
Definition InertiaService.h:417
inertia::SocketSettings
Socket Settings.
Definition SocketSettings.h:31
inertia::StreamFilter
Stream Filter.
Definition SocketSettings.h:75