[one_wire] allow changing address at runtime (#12150)

This commit is contained in:
Massimo Antonello
2026-03-12 01:52:58 -07:00
committed by GitHub
parent 657890695f
commit fe2d60ccec
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -13,6 +13,11 @@ const std::string &OneWireDevice::get_address_name() {
return this->address_name_;
}
void OneWireDevice::set_address(uint64_t address) {
this->address_ = address;
this->address_name_.clear();
}
bool OneWireDevice::send_command_(uint8_t cmd) {
if (!this->bus_->select(this->address_))
return false;
+1 -1
View File
@@ -15,7 +15,7 @@ class OneWireDevice {
public:
/// @brief store the address of the device
/// @param address of the device
void set_address(uint64_t address) { this->address_ = address; }
void set_address(uint64_t address);
void set_index(uint8_t index) { this->index_ = index; }