Dokit
Internal development documentation
Loading...
Searching...
No Matches
loggerfetchcommand.h
1// SPDX-FileCopyrightText: 2022-2023 Paul Colby <git@colby.id.au>
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4#include "devicecommand.h"
5
7
9{
11
12public:
13 explicit LoggerFetchCommand(QObject * const parent = nullptr);
14
15protected:
17
18protected slots:
19 void serviceDetailsDiscovered() override;
20
21private:
22 DataLoggerService * service { nullptr }; ///< Bluetooth service this command interracts 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
28private slots:
30 void outputSamples(const DataLoggerService::Samples &samples);
31
32 friend class TestLoggerFetchCommand;
33};
The AbstractPokitService class provides a common base for Pokit services classes.
The DataLoggerService class accesses the Data Logger service of Pokit devices.
The AbstractCommand class extends AbstractCommand to add a PokitDevice instance.
The LoggerFetchCommand class implements the logger CLI command.
qint32 samplesToGo
Number of samples we're still expecting to receive.
DataLoggerService::Metadata metadata
Most recent data logging metadata.
DataLoggerService * service
Bluetooth service this command interracts with.
bool showCsvHeader
Whether or not to show a header as the first line of CSV output.
void outputSamples(const DataLoggerService::Samples &samples)
Outputs logger samples in the selected ouput format.
AbstractPokitService * getService() override
Returns a Pokit service object for the derived command class.
LoggerFetchCommand(QObject *const parent=nullptr)
Construct a new LoggerFetchCommand object with parent.
void serviceDetailsDiscovered() override
Handles service detail discovery events.
quint64 timestamp
Current sample's epoch milliseconds timestamp.
void metadataRead(const DataLoggerService::Metadata &data)
Invoked when metadata has been received from the data logger.
Declares the DataLoggerService class.
Q_OBJECTQ_OBJECT
QObject * parent() const const
Attributes included in the Metadata characterstic.