6 * Blocking call to print a string.
8 * @param cmd_io cmd_io structure.
9 * @param str Zero terminated string to print.
11 * @return Upon successful completion, puts() shall return a
12 * non-negative number. In case of error, negative number is returned.
14 int cmd_io_puts(cmd_io_t *cmd_io, const char *str)
21 ret = cmd_io_write(cmd_io, str, len);
26 } while (ret>=0 && len>0);
30 int cmd_io_write_bychar(cmd_io_t *cmd_io,const void *buf,int count)
33 uint8_t* p=(uint8_t*)buf;
34 while(count--&&(*cmd_io->putc)(cmd_io,*p++)>=0){
40 int cmd_io_read_bychar(cmd_io_t *cmd_io,void *buf,int count)
44 uint8_t* p=(uint8_t*)buf;
45 while(count--&&(ch=(*cmd_io->getc)(cmd_io))>=0){