mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 10:46:31 +00:00
Change once tickers
This commit is contained in:
parent
9baa1bd9f4
commit
8d6f8f505f
@ -158,13 +158,13 @@ void PollUdp(void)
|
|||||||
#ifdef USE_EMULATION_WEMO
|
#ifdef USE_EMULATION_WEMO
|
||||||
if (EMUL_WEMO == Settings.flag2.emulation) {
|
if (EMUL_WEMO == Settings.flag2.emulation) {
|
||||||
if (strstr_P(packet_buffer, URN_BELKIN_DEVICE) != nullptr) { // type1 echo dot 2g, echo 1g's
|
if (strstr_P(packet_buffer, URN_BELKIN_DEVICE) != nullptr) { // type1 echo dot 2g, echo 1g's
|
||||||
TickerMSearch.attach_ms(response_delay, WemoRespondToMSearch, 1);
|
TickerMSearch.once_ms(response_delay, WemoRespondToMSearch, 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if ((strstr_P(packet_buffer, UPNP_ROOTDEVICE) != nullptr) || // type2 Echo 2g (echo & echo plus)
|
else if ((strstr_P(packet_buffer, UPNP_ROOTDEVICE) != nullptr) || // type2 Echo 2g (echo & echo plus)
|
||||||
(strstr_P(packet_buffer, SSDPSEARCH_ALL) != nullptr) ||
|
(strstr_P(packet_buffer, SSDPSEARCH_ALL) != nullptr) ||
|
||||||
(strstr_P(packet_buffer, SSDP_ALL) != nullptr)) {
|
(strstr_P(packet_buffer, SSDP_ALL) != nullptr)) {
|
||||||
TickerMSearch.attach_ms(response_delay, WemoRespondToMSearch, 2);
|
TickerMSearch.once_ms(response_delay, WemoRespondToMSearch, 2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -176,7 +176,7 @@ void PollUdp(void)
|
|||||||
(strstr_P(packet_buffer, UPNP_ROOTDEVICE) != nullptr) ||
|
(strstr_P(packet_buffer, UPNP_ROOTDEVICE) != nullptr) ||
|
||||||
(strstr_P(packet_buffer, SSDPSEARCH_ALL) != nullptr) ||
|
(strstr_P(packet_buffer, SSDPSEARCH_ALL) != nullptr) ||
|
||||||
(strstr_P(packet_buffer, SSDP_ALL) != nullptr)) {
|
(strstr_P(packet_buffer, SSDP_ALL) != nullptr)) {
|
||||||
TickerMSearch.attach_ms(response_delay, HueRespondToMSearch);
|
TickerMSearch.once_ms(response_delay, HueRespondToMSearch);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,6 +164,9 @@ String EthernetMacAddress(void);
|
|||||||
#endif
|
#endif
|
||||||
#ifdef USE_ZIGBEE
|
#ifdef USE_ZIGBEE
|
||||||
#define USE_UNISHOX_COMPRESSION // Add support for string compression
|
#define USE_UNISHOX_COMPRESSION // Add support for string compression
|
||||||
|
#endif
|
||||||
|
#ifdef USE_EMULATION_HUE
|
||||||
|
#define USE_UNISHOX_COMPRESSION // Add support for string compression
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// See https://github.com/esp8266/Arduino/pull/4889
|
// See https://github.com/esp8266/Arduino/pull/4889
|
||||||
|
@ -80,7 +80,6 @@ void HueRespondToMSearch(void)
|
|||||||
{
|
{
|
||||||
char message[TOPSZ];
|
char message[TOPSZ];
|
||||||
|
|
||||||
TickerMSearch.detach();
|
|
||||||
if (PortUdp.beginPacket(udp_remote_ip, udp_remote_port)) {
|
if (PortUdp.beginPacket(udp_remote_ip, udp_remote_port)) {
|
||||||
char response[320];
|
char response[320];
|
||||||
snprintf_P(response, sizeof(response), HUE_RESPONSE, WiFi.localIP().toString().c_str(), HueBridgeId().c_str());
|
snprintf_P(response, sizeof(response), HUE_RESPONSE, WiFi.localIP().toString().c_str(), HueBridgeId().c_str());
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(USE_WEBSERVER) && defined(USE_EMULATION) && defined (USE_EMULATION_WEMO_SINGLE)
|
#if defined(USE_WEBSERVER) && defined(USE_EMULATION) && defined(USE_EMULATION_WEMO_SINGLE)
|
||||||
/*********************************************************************************************\
|
/*********************************************************************************************\
|
||||||
* Belkin WeMo emulation
|
* Belkin WeMo emulation
|
||||||
\*********************************************************************************************/
|
\*********************************************************************************************/
|
||||||
@ -58,7 +58,6 @@ void WemoRespondToMSearch(int echo_type)
|
|||||||
{
|
{
|
||||||
char message[TOPSZ];
|
char message[TOPSZ];
|
||||||
|
|
||||||
TickerMSearch.detach();
|
|
||||||
if (PortUdp.beginPacket(udp_remote_ip, udp_remote_port)) {
|
if (PortUdp.beginPacket(udp_remote_ip, udp_remote_port)) {
|
||||||
char type[24];
|
char type[24];
|
||||||
if (1 == echo_type) { // type1 echo 1g & dot 2g
|
if (1 == echo_type) { // type1 echo 1g & dot 2g
|
||||||
|
@ -419,8 +419,6 @@ WemoSwitch *wemoDevice[MAX_FRIENDLYNAMES] = {};
|
|||||||
int numOfWemoSwitch = 0;
|
int numOfWemoSwitch = 0;
|
||||||
|
|
||||||
void WemoRespondToMSearch(int echo_type) {
|
void WemoRespondToMSearch(int echo_type) {
|
||||||
TickerMSearch.detach();
|
|
||||||
|
|
||||||
for (uint32_t i = 0; i < numOfWemoSwitch; i++) {
|
for (uint32_t i = 0; i < numOfWemoSwitch; i++) {
|
||||||
wemoDevice[i]->WemoRespondToMSearch(echo_type);
|
wemoDevice[i]->WemoRespondToMSearch(echo_type);
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,6 @@ struct SNFL1 {
|
|||||||
Ticker SnfL1StartDelay;
|
Ticker SnfL1StartDelay;
|
||||||
|
|
||||||
void SnfL1SendDelayed(void) {
|
void SnfL1SendDelayed(void) {
|
||||||
SnfL1StartDelay.detach();
|
|
||||||
SnfL1Send();
|
SnfL1Send();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -276,7 +275,7 @@ bool SnfL1SetChannels(void)
|
|||||||
|
|
||||||
static bool first_call = true;
|
static bool first_call = true;
|
||||||
if (first_call) {
|
if (first_call) {
|
||||||
SnfL1StartDelay.attach_ms(900, SnfL1SendDelayed); // Allow startup time for Nuvotron microcontroller
|
SnfL1StartDelay.once_ms(900, SnfL1SendDelayed); // Allow startup time for Nuvotron microcontroller
|
||||||
first_call = false;
|
first_call = false;
|
||||||
} else {
|
} else {
|
||||||
SnfL1Send();
|
SnfL1Send();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user