[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:
@@ -2,7 +2,7 @@
|
||||
#include <callback-connector.h>
|
||||
|
||||
KeyEmulator::~KeyEmulator() {
|
||||
onewire_slave->stop();
|
||||
stop();
|
||||
}
|
||||
|
||||
KeyEmulator::KeyEmulator(OneWireSlave* _onewire_slave)
|
||||
|
@@ -49,3 +49,6 @@ KeyWorker::KeyWorker(const GpioPin* one_wire_gpio)
|
||||
, key_emulator{&onewire_slave}
|
||||
, key_writer{&onewire_master} {
|
||||
}
|
||||
|
||||
KeyWorker::~KeyWorker() {
|
||||
}
|
@@ -23,6 +23,7 @@ public:
|
||||
void stop_write();
|
||||
|
||||
KeyWorker(const GpioPin* one_wire_gpio);
|
||||
~KeyWorker();
|
||||
|
||||
private:
|
||||
// one wire
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user