xdrv_06_snfbridge: Remove whitespace from RfRaw

This commit is contained in:
andrethomas 2018-10-13 20:38:48 +02:00
parent fe26768103
commit 040d4c6ba2
1 changed files with 19 additions and 2 deletions

View File

@ -411,6 +411,22 @@ void SonoffBridgeLearn(uint8_t key)
Serial.write(0x55); // End of Text Serial.write(0x55); // End of Text
} }
char* charclean(char *in)
{
uint8_t i;
uint8_t x;
char *out = in;
for (i=0,x=0;i<strlen(in);i++,x++) {
if (in[i] != ' ') {
out[x] = in[i];
} else {
x--;
}
}
out[x] = 0; // null terminate the new char array
return out;
}
/*********************************************************************************************\ /*********************************************************************************************\
* Commands * Commands
\*********************************************************************************************/ \*********************************************************************************************/
@ -541,7 +557,9 @@ boolean SonoffBridgeCommand()
break; break;
} }
} else { } else {
SerialSendRaw(XdrvMailbox.data, XdrvMailbox.data_len); char rawsend[XdrvMailbox.data_len];
sprintf(rawsend,"%s",charclean(XdrvMailbox.data));
SerialSendRaw(rawsend, strlen(rawsend));
sonoff_bridge_receive_raw_flag = 1; sonoff_bridge_receive_raw_flag = 1;
} }
} }
@ -584,4 +602,3 @@ boolean Xdrv06(byte function)
} }
return result; return result;
} }