比较老的红外驱动是模拟串口,现在一般都是用Socket进行访问.<br> <br> int fd;<br> struct sockaddr_irda peer<br><br> /* Create socket */<br> fd = socket(AF_IRDA, SOCK_STREAM, 0);<br> peer.irdaAddressFamily = AF_IRDA;<br>#ifndef WIN32<br> peer.sir_lsap_sel = LSAP_ANY;<br>#endif<br> connect(fd, (struct sockaddr *)&peer, sizeof(peer));<br><br> <br>