diff --git a/EmbAJAX.cpp b/EmbAJAX.cpp index 8c91e27..eb88704 100644 --- a/EmbAJAX.cpp +++ b/EmbAJAX.cpp @@ -156,13 +156,6 @@ void EmbAJAXConnectionIndicator::print() const { ////////////////////////////// EmbAJAXElement ///////////////////////////// -/** @param id: The id for the element. Note that the string is not copied. Do not use a temporary string in this place. Also, do keep it short. */ -EmbAJAXElement::EmbAJAXElement(const char* id) : EmbAJAXBase() { - _id = id; - _flags = 1 << EmbAJAXBase::Visibility | 1 << EmbAJAXBase::Enabledness; - revision = 1; -} - bool EmbAJAXElement::sendUpdates(uint16_t since, bool first) { if (!changed(since)) return false; if (!first) _driver->printContent(",\n"); @@ -209,13 +202,13 @@ void EmbAJAXElement::printTextInput(size_t SIZE, const char* _value) const { //////////////////////// EmbAJAXContainer //////////////////////////////////// -void EmbAJAXBase::printChildren(EmbAJAXBase** _children, size_t NUM) const { +void EmbAJAXBase::printChildren(EmbAJAXBase* const* _children, size_t NUM) const { for (size_t i = 0; i < NUM; ++i) { _children[i]->print(); } } -bool EmbAJAXBase::sendUpdates(EmbAJAXBase** _children, size_t NUM, uint16_t since, bool first) { +bool EmbAJAXBase::sendUpdates(EmbAJAXBase* const* _children, size_t NUM, uint16_t since, bool first) { for (size_t i = 0; i < NUM; ++i) { bool sent = _children[i]->sendUpdates(since, first); if (sent) first = false; @@ -223,7 +216,7 @@ bool EmbAJAXBase::sendUpdates(EmbAJAXBase** _children, size_t NUM, uint16_t sinc return !first; } -EmbAJAXElement* EmbAJAXBase::findChild(EmbAJAXBase** _children, size_t NUM, const char*id) const { +EmbAJAXElement* EmbAJAXBase::findChild(EmbAJAXBase* const* _children, size_t NUM, const char*id) const { for (size_t i = 0; i < NUM; ++i) { EmbAJAXElement* child = _children[i]->toElement(); if (child) { @@ -529,12 +522,13 @@ void EmbAJAXOptionSelectBase::updateFromDriverArg(const char* argname) { //////////////////////// EmbAJAXPage ///////////////////////////// -void EmbAJAXBase::printPage(EmbAJAXBase** _children, size_t NUM, const char* _title, const char* _header_add, uint16_t _min_interval) const { +void EmbAJAXPage::print() const { #if EMBAJAX_DEBUG > 2 time_t start = millis(); #endif + _driver->printHeader(true); - _driver->printFormatted("\n