예제 #1
0
파일: h4.c 프로젝트: 01org/zephyr
static void bt_uart_isr(struct device *unused)
{
	ARG_UNUSED(unused);

	while (uart_irq_update(h4_dev) && uart_irq_is_pending(h4_dev)) {
		if (uart_irq_tx_ready(h4_dev)) {
			process_tx();
		}

		if (uart_irq_rx_ready(h4_dev)) {
			process_rx();
		}
	}
}
예제 #2
0
/// Example application that opens a packet socket with rx_ring
int
main(int argc, char **argv)
{
  char *ring, pkt[100];
  int fd;

  fd = init_packetsock(&ring, PACKET_TX_RING);
  if (fd < 0)
    return 1;

  // TODO: make correct IP packet out of pkt
  process_tx(fd, ring, pkt, 100);

  if (exit_packetsock(fd, ring))
    return 1;

  printf("OK\n");
  return 0;
}