Introduced HoymilesRadio property to determine if a configuration attempt was done
This commit is contained in:
parent
1416efc6f9
commit
af3a277e30
@ -66,6 +66,11 @@ bool HoymilesRadio::isInitialized()
|
||||
return _isInitialized;
|
||||
}
|
||||
|
||||
bool HoymilesRadio::isConfigured()
|
||||
{
|
||||
return _isConfigured;
|
||||
}
|
||||
|
||||
bool HoymilesRadio::isIdle()
|
||||
{
|
||||
return !_busyFlag;
|
||||
|
||||
@ -13,6 +13,7 @@ public:
|
||||
|
||||
bool isIdle();
|
||||
bool isInitialized();
|
||||
bool isConfigured();
|
||||
|
||||
template <typename T>
|
||||
T* enqueCommand()
|
||||
@ -33,5 +34,6 @@ protected:
|
||||
serial_u _dtuSerial;
|
||||
std::queue<std::shared_ptr<CommandAbstract>> _commandQueue;
|
||||
bool _isInitialized = false;
|
||||
bool _isConfigured = false;
|
||||
bool _busyFlag = false;
|
||||
};
|
||||
@ -63,6 +63,7 @@ void HoymilesRadio_CMT::init(int8_t pin_sdio, int8_t pin_clk, int8_t pin_cs, int
|
||||
|
||||
cmtSwitchDtuFreq(_inverterTargetFrequency); // start dtu at work freqency, for fast Rx if inverter is already on and frequency switched
|
||||
|
||||
_isConfigured = true;
|
||||
if (!_radio->isChipConnected()) {
|
||||
Hoymiles.getMessageOutput()->println("CMT: Connection error!!");
|
||||
return;
|
||||
|
||||
@ -23,6 +23,7 @@ void HoymilesRadio_NRF::init(SPIClass* initialisedSpiBus, uint8_t pinCE, uint8_t
|
||||
_radio->setAddressWidth(5);
|
||||
_radio->setRetries(0, 0);
|
||||
_radio->maskIRQ(true, true, false); // enable only receiving interrupts
|
||||
_isConfigured = true;
|
||||
if (!_radio->isChipConnected()) {
|
||||
Hoymiles.getMessageOutput()->println("NRF: Connection error!!");
|
||||
return;
|
||||
|
||||
@ -69,11 +69,11 @@ void WebApiSysstatusClass::onSystemStatus(AsyncWebServerRequest* request)
|
||||
|
||||
root["uptime"] = esp_timer_get_time() / 1000000;
|
||||
|
||||
root["nrf_configured"] = Hoymiles.getRadioNrf()->isInitialized();
|
||||
root["nrf_configured"] = Hoymiles.getRadioNrf()->isConfigured();
|
||||
root["nrf_connected"] = Hoymiles.getRadioNrf()->isConnected();
|
||||
root["nrf_pvariant"] = Hoymiles.getRadioNrf()->isPVariant();
|
||||
|
||||
root["cmt_configured"] = Hoymiles.getRadioCmt()->isInitialized();
|
||||
root["cmt_configured"] = Hoymiles.getRadioCmt()->isConfigured();
|
||||
root["cmt_connected"] = Hoymiles.getRadioCmt()->isConnected();
|
||||
|
||||
response->setLength();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user