i am using freertos sdk and i am sending "ASD" over tcp and its working. but , i am sending "testpart" and its not working. what am i missing?
/* working part*/
char *recv_buf = (char *)zalloc(128);
while ((recbytes = read(client_sock , recv_buf, 128)) > 0) {
recv_buf[recbytes] = 0;
printf("S > read data success %d!\nS > %s\n", recbytes, recv_buf);
if(recv_buf[0] == 'A' && recv_buf[1] == 'S' && recv_buf[2] == 'D'){
gpio_output_set(BIT2, 0, BIT2, 0);
}
/*unworking part*/
char *pbuf = (char *)zalloc(128);
sprintf(pbuf, "%s\n", recv_buf);
if(strcmp(pbuf, "testpart") == 0)
{
gpio_output_set(0,BIT2, 0, BIT2);
}
Lets get the party started and +1
[url=https://www.banggood.com/custlink/KvGGhGF4wG[/url]
I like ESP8266 and ESP8285 and ESP32