I am not actually using ad arduino but an atmel chip. but my question is c microprocessor related
I am reading an uart which returns data in the form uint8_t [100] I can print the return just fine, the return is "OK"
but when I try to use strcmp(read, "OK") I do not get the expected value, I get a mismatch ( strcmp returns 13, not 0)
uint8_t sigfox_rd_buf[100] = {0};
uint8_t sig_rd = 0;
io_sigfox->read(io_sigfox,&sig_rd, 1);
while(sig_rd != 10) // read until end char
{
sigfox_rd_buf[i] = sig_rd;
i++;
io_sigfox->read(io_sigfox,&sig_rd, 1);
}
if(strcmp((char *)sigfox_rd_buf,"OK") == 0 )
{
do_something()
}
else
{
complain();
}
and I always end up in complain for some reason.. please help!! :)
13not give it away?