get rid of particular compile-time designations by UART index. just hand out the next free index of hardware UARTs, or indicate that none is available any more. use names as keys to register and free UARTs.
20 lines
516 B
C++
20 lines
516 B
C++
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
#pragma once
|
|
|
|
#include "Battery.h"
|
|
|
|
class VictronSmartShunt : public BatteryProvider {
|
|
public:
|
|
bool init(bool verboseLogging) final;
|
|
void deinit() final;
|
|
void loop() final;
|
|
std::shared_ptr<BatteryStats> getStats() const final { return _stats; }
|
|
|
|
private:
|
|
static char constexpr _serialPortOwner[] = "SmartShunt";
|
|
|
|
uint32_t _lastUpdate = 0;
|
|
std::shared_ptr<VictronSmartShuntStats> _stats =
|
|
std::make_shared<VictronSmartShuntStats>();
|
|
};
|