Dokit
dev
v0.6.0
v0.5.8
v0.5.7
v0.5.6
v0.5.5
v0.5.4
v0.5.3
v0.5.2
v0.5.1
v0.5.0
v0.4.0
v0.3.0
v0.2.0
v0.1.2
v0.1.1
v0.1.0
User docs
Internal
Coverage
Internal development documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
loggerfetchcommand.h
1
// SPDX-FileCopyrightText: 2022-2026 Paul Colby <git@colby.id.au>
2
// SPDX-License-Identifier: LGPL-3.0-or-later
3
4
#include "devicecommand.h"
5
6
#include <
qtpokit/dataloggerservice.h
>
7
8
class
LoggerFetchCommand
:
public
DeviceCommand
9
{
10
Q_OBJECT
11
12
public
:
13
explicit
LoggerFetchCommand
(
QObject
*
const
parent
=
nullptr
);
14
15
protected
:
16
AbstractPokitService
*
getService
()
override
;
17
18
protected
slots:
19
void
serviceDetailsDiscovered
()
override
;
20
21
private
:
22
DataLoggerService
*
service
{
nullptr
};
///< Bluetooth service this command interacts with.
23
DataLoggerService::Metadata
metadata
;
///< Most recent data logging metadata.
24
qint32
samplesToGo
{ 0 };
///< Number of samples we're still expecting to receive.
25
quint64
timestamp
{ 0 };
///< Current sample's epoch milliseconds timestamp.
26
bool
showCsvHeader
{
true
};
///< Whether or not to show a header as the first line of CSV output.
27
28
private
slots:
29
void
metadataRead
(
const
DataLoggerService::Metadata
&data);
30
void
outputSamples
(
const
DataLoggerService::Samples
&samples);
31
32
QTPOKIT_BEFRIEND_TEST
(
LoggerFetchCommand
)
33
};
AbstractPokitService
The AbstractPokitService class provides a common base for Pokit services classes.
Definition
abstractpokitservice.h:27
DataLoggerService
The DataLoggerService class accesses the Data Logger service of Pokit devices.
Definition
dataloggerservice.h:23
DataLoggerService::Samples
QVector< qint16 > Samples
Raw samples from the Reading characteristic.
Definition
dataloggerservice.h:94
DeviceCommand::DeviceCommand
DeviceCommand(QObject *const parent=nullptr)
Construct a new DeviceCommand object with parent.
Definition
devicecommand.cpp:21
LoggerFetchCommand
The LoggerFetchCommand class implements the logger CLI command.
Definition
loggerfetchcommand.h:9
LoggerFetchCommand::samplesToGo
qint32 samplesToGo
Number of samples we're still expecting to receive.
Definition
loggerfetchcommand.h:24
LoggerFetchCommand::metadata
DataLoggerService::Metadata metadata
Most recent data logging metadata.
Definition
loggerfetchcommand.h:23
LoggerFetchCommand::service
DataLoggerService * service
Bluetooth service this command interacts with.
Definition
loggerfetchcommand.h:22
LoggerFetchCommand::showCsvHeader
bool showCsvHeader
Whether or not to show a header as the first line of CSV output.
Definition
loggerfetchcommand.h:26
LoggerFetchCommand::outputSamples
void outputSamples(const DataLoggerService::Samples &samples)
Outputs logger samples in the selected output format.
Definition
loggerfetchcommand.cpp:100
LoggerFetchCommand::getService
AbstractPokitService * getService() override
Returns a Pokit service object for the derived command class.
Definition
loggerfetchcommand.cpp:45
LoggerFetchCommand::LoggerFetchCommand
LoggerFetchCommand(QObject *const parent=nullptr)
Construct a new LoggerFetchCommand object with parent.
Definition
loggerfetchcommand.cpp:35
LoggerFetchCommand::serviceDetailsDiscovered
void serviceDetailsDiscovered() override
Handles service detail discovery events.
Definition
loggerfetchcommand.cpp:62
LoggerFetchCommand::timestamp
quint64 timestamp
Current sample's epoch milliseconds timestamp.
Definition
loggerfetchcommand.h:25
LoggerFetchCommand::metadataRead
void metadataRead(const DataLoggerService::Metadata &data)
Invoked when metadata has been received from the data logger.
Definition
loggerfetchcommand.cpp:82
dataloggerservice.h
Declares the DataLoggerService class.
QObject::QObject
QObject(QObject *parent)
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::parent
QObject * parent() const const
QTPOKIT_BEFRIEND_TEST
#define QTPOKIT_BEFRIEND_TEST(Class)
Macro for befriending a related unit test class, but only when QT_TESTLIB_LIB is defined.
Definition
qtpokit_global.h:118
DataLoggerService::Metadata
Attributes included in the Metadata characteristic.
Definition
dataloggerservice.h:84
dokit
dokit
src
cli
loggerfetchcommand.h
Generated by
1.18.0