4#include "flashledcommand.h"
77 qCInfo(lc).noquote() <<
tr(
"Flashing Pokit device LED...");
90 std::cout << qUtf8Printable(
tr(
"flash_led_result\nsuccess\n"));
96 std::cout << qUtf8Printable(
tr(
"Done.\n"));
virtual QStringList supportedOptions(const QCommandLineParser &parser) const
Returns a list of CLI option names supported by this command.
OutputFormat format
Selected output format.
@ Text
Plain unstructured text.
@ Csv
RFC 4180 compliant CSV text.
@ Json
RFC 8259 compliant JSON text.
virtual QStringList processOptions(const QCommandLineParser &parser)
Processes the relevant options from the command line parser.
virtual QStringList requiredOptions(const QCommandLineParser &parser) const
Returns a list of CLI option names required by this command.
The AbstractPokitService class provides a common base for Pokit services classes.
The AbstractCommand class extends AbstractCommand to add a PokitDevice instance.
PokitDevice * device
Pokit Bluetooth device (if any) this command interracts with.
virtual void serviceDetailsDiscovered()
Handles service detail discovery events.
void disconnect(int exitCode=EXIT_SUCCESS)
Disconnects the underlying Pokit device, and sets exitCode to be return to the OS once the disconnect...
QStringList supportedOptions(const QCommandLineParser &parser) const override
Returns a list of CLI option names supported by this command.
QStringList requiredOptions(const QCommandLineParser &parser) const override
Returns a list of CLI option names required by this command.
StatusService * service
Bluetooth service this command interracts with.
FlashLedCommand(QObject *const parent=nullptr)
Construct a new FlashLedCommand object with parent.
QStringList processOptions(const QCommandLineParser &parser) override
Processes the relevant options from the command line parser.
AbstractPokitService * getService() override
Returns a Pokit service object for the derived command class.
void serviceDetailsDiscovered() override
Handles service detail discovery events.
void deviceLedFlashed()
Handles StatusService::deviceLedFlashed events, by outputting the result and exiting.
StatusService * status()
Returns a pointer to StatusService instance that uses this device's controller for access.
void deviceLedFlashed()
This signal is emitted when device's LED has flashed in response to a write of the Flash LED characte...
bool flashLed()
Flash the Pokit device's LED.
Declares the PokitDevice class.
void exit(int returnCode)
bool isEmpty() const const
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString tr(const char *sourceText, const char *disambiguation, int n)
Declares the StatusService class.