Skip to content

Commit

Permalink
update: spinet-linux打印一下tun设备输入的IP包数据头
Browse files Browse the repository at this point in the history
  • Loading branch information
wendal committed Nov 21, 2024
1 parent f2e527a commit a3cd0ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion project/spinet/linux/src/airspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,10 @@ static int main_loop(void) {
}

if (pfds[0].revents & POLLIN) {
int len = read(g_tun_fd, g_tun_tx, sizeof(g_tun_tx));
int len = read(g_tun_fd, g_tun_rx, sizeof(g_tun_rx));
if (len > 0) {
SPINET_LOG("read tun fd %d bytes\n", len);
SPINET_LOG("pkg dump %02X%02X%02X%02X\n", g_tun_rx[0], g_tun_rx[1], g_tun_rx[2],g_tun_rx[3]);
// TODO 发送数据到SPI设备
}
}
Expand Down

0 comments on commit a3cd0ef

Please sign in to comment.