mirror of
https://github.com/eddyem/eddys_snippets.git
synced 2026-03-21 17:20:57 +03:00
added some settings changes
This commit is contained in:
@@ -294,7 +294,7 @@ void tty_init(char *comdev){
|
||||
* @param length - buffer len
|
||||
* @return amount of readed bytes
|
||||
*/
|
||||
size_t read_tty(char *buff, size_t length){
|
||||
size_t read_tty(uint8_t *buff, size_t length){
|
||||
ssize_t L = 0;
|
||||
fd_set rfds;
|
||||
struct timeval tv;
|
||||
@@ -309,3 +309,12 @@ size_t read_tty(char *buff, size_t length){
|
||||
}
|
||||
return (size_t)L;
|
||||
}
|
||||
|
||||
int write_tty(uint8_t *buff, size_t length){
|
||||
ssize_t L = write(comfd, buff, length);
|
||||
if((size_t)L != length){
|
||||
WARN("Write error!");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user