Compare commits
No commits in common. "57b9a1036cb8ed49395f023f8b1de0f521435abb" and "b4b748c042849b4d7d025b1728503e7baf5872ef" have entirely different histories.
57b9a1036c
...
b4b748c042
@ -118,8 +118,6 @@ void read_can(Tel *t, int soc) {
|
|||||||
struct can_frame frame;
|
struct can_frame frame;
|
||||||
int nbytes = read(soc, &frame, sizeof(struct can_frame));
|
int nbytes = read(soc, &frame, sizeof(struct can_frame));
|
||||||
|
|
||||||
if (nbytes < 0) return; // -1 EAGAIN means empty
|
|
||||||
|
|
||||||
if (nbytes > 0) {
|
if (nbytes > 0) {
|
||||||
|
|
||||||
switch (frame.can_id) {
|
switch (frame.can_id) {
|
||||||
@ -138,9 +136,6 @@ void read_can(Tel *t, int soc) {
|
|||||||
void read_uart(Tel *t, int fd, SerialParser *uart_str) {
|
void read_uart(Tel *t, int fd, SerialParser *uart_str) {
|
||||||
char buf[128];
|
char buf[128];
|
||||||
int n = read(fd, buf, sizeof(buf));
|
int n = read(fd, buf, sizeof(buf));
|
||||||
|
|
||||||
if (n < 0) return; // -1 EAGAIN means empty
|
|
||||||
|
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
for (int i = 0; i < n; i++) {
|
for (int i = 0; i < n; i++) {
|
||||||
char c = buf[i];
|
char c = buf[i];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user