set_sched_policy_and_prio(SCHED_FIFO, 99);
#define SEND() \
- do { printf("send\n"); \
+ do { printf("send\n"); \
ret = send_frame(pfd[0].fd); \
if (ret != sizeof(struct can_frame)) \
- error(1, errno, "send_frame"); \
+ error(1, errno, "send_frame %d", __LINE__); \
+ count++; \
msg_in_progress++; \
} while (0)
break;
case 0: // Timeout
if (opt.period_us) {
- if (opt.count == 0 || count++ < opt.count) {
+ if (opt.count == 0 || count < opt.count) {
SEND();
} else {
error(1, 0, "poll timeout");
process_tx(pfd[0].fd);
}
if (pfd[0].revents & POLLOUT) {
- if (opt.count == 0 || count++ < opt.count)
+ if (opt.count == 0 || count < opt.count)
SEND();
}
pfd[0].revents = 0;
process_final_rx(pfd[i].fd);
msg_in_progress--;
pfd[i].revents = 0;
- if ((opt.count == 0 || count++ < opt.count) &&
+ if ((opt.count == 0 || count < opt.count) &&
opt.oneattime) {
SEND();
}