Remove autoReconnect function from core #410 #407

This commit is contained in:
Robert Strouse 2024-07-10 21:40:55 -07:00
parent 0b985c0880
commit 75928b4ac8
7 changed files with 152 additions and 73 deletions

View file

@ -161,7 +161,7 @@ void UPNPDeviceType::setChipId(uint32_t chipId) {
(uint16_t)chipId & 0xff);
}
SSDPClass::SSDPClass():sendQueue{false, INADDR_NONE, 0, nullptr, false, 0, "", response_types_t::root} {}
SSDPClass::~SSDPClass() { end(); }
SSDPClass::~SSDPClass() { end(); this->isStarted = false; }
bool SSDPClass::begin() {
for(int i = 0; i < SSDP_QUEUE_SIZE; i++) {
this->sendQueue[i].waiting = false;
@ -209,6 +209,7 @@ void SSDPClass::end() {
if(this->_server.connected()) {
this->_sendByeBye();
this->_server.close();
Serial.println("Disconnected from SSDP...");
}
this->isStarted = false;
// Clear out the last notified so if the user starts us up again it will notify
@ -216,8 +217,6 @@ void SSDPClass::end() {
for(uint8_t i = 0; i < this->m_cdeviceTypes; i++) {
this->deviceTypes[i].lastNotified = 0;
}
Serial.println("Disconnected from SSDP...");
}
UPNPDeviceType* SSDPClass::getDeviceType(uint8_t ndx) { if(ndx < this->m_cdeviceTypes) return &this->deviceTypes[ndx]; return nullptr; }
UPNPDeviceType* SSDPClass::findDeviceByType(char *devType) {