|
@@ -158,6 +158,20 @@ void sendNexaCode(uint32_t data, bool send_dim, uint8_t dim_level ) {
|
|
|
// Public interface for sending a NEXA Code in string format. For example: <NT4C90AD91>
|
|
|
void sendNexaCodeStr(char *str) {
|
|
|
|
|
|
+ const uint32_t now = millis();
|
|
|
+ static char oldData[40];
|
|
|
+ static uint32_t oldDataTime = 0;
|
|
|
+
|
|
|
+ // Check if we have a retransmission of exactly the same data within 250mS
|
|
|
+ // If we have a identical re-transmission, then skip that one
|
|
|
+ if( ((now - oldDataTime) < 250) && strncmp(str,oldData,40)==0 ) {
|
|
|
+ ESP_LOGW("NEXA TX", "Retransm: %10d mS",now - oldDataTime);
|
|
|
+ oldDataTime = now;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ strncpy(oldData,str,40);
|
|
|
+ oldDataTime = now;
|
|
|
+
|
|
|
char diffLevel = '\0'; // 0-F = 0-15 Dim-level
|
|
|
|
|
|
if( strlen(str) == 13 && str[0] == '<' && str[12] == '>' ) {
|