[FL-1419] new iButton cli (#521)

* iButton, helpers: add destructor
* iButton app: new approach to cli commands, cli read
* iButton app: cli write
* iButton app: cli emulate
* iButton app: remove old cli commands
* iButton app: use unique_ptr for worker
* iButton app: remove obsolete cli help
* iButton app: fix help and key type parsing
This commit is contained in:
SG
2021-06-17 21:13:37 +10:00
committed by GitHub
parent 9943c93189
commit 89dd1ff925
14 changed files with 247 additions and 500 deletions

View File

@@ -2,7 +2,7 @@
#include <callback-connector.h>
KeyEmulator::~KeyEmulator() {
onewire_slave->stop();
stop();
}
KeyEmulator::KeyEmulator(OneWireSlave* _onewire_slave)

View File

@@ -49,3 +49,6 @@ KeyWorker::KeyWorker(const GpioPin* one_wire_gpio)
, key_emulator{&onewire_slave}
, key_writer{&onewire_master} {
}
KeyWorker::~KeyWorker() {
}

View File

@@ -23,6 +23,7 @@ public:
void stop_write();
KeyWorker(const GpioPin* one_wire_gpio);
~KeyWorker();
private:
// one wire

View File

@@ -5,6 +5,10 @@ KeyWriter::KeyWriter(OneWireMaster* _onewire_master) {
onewire_master = _onewire_master;
}
KeyWriter::~KeyWriter() {
stop();
}
KeyWriter::Error KeyWriter::write(iButtonKey* key) {
return write_internal(key);
}