Takahide Higuchi reported: " I have been debugging IrCOMM with a printer ( Canon BJC-80v ) with IrDA port and IrCOMM protocol (not IrLPT). I can print a short e-mail text though, it easily causes dead lock when I try to print a postscript with gs."
From the page of Thomas Davis http://www.jps.net/tadavis/irda : To use the IrLPT server, you need to perform the following steps:
/sbin/modprobe irlpt_server /sbin/mknod /dev/irlptd c 10 `grep irlptd /proc/misc|cut -f 1` |
#/bin/sh # while (true) do cat /dev/irlptd | lpr done |
int discover_devices(int fd) { struct irda_device_list *list; unsigned char buf[sizeof(struct irda_device_list) + sizeof(struct irda_device_info) * MAX_DEVICES]; int len; int daddr; int i; len = sizeof(struct irda_device_list) + sizeof(struct irda_device_info) * MAX_DEVICES; list = (struct irda_device_list *) buf; if (getsockopt(sfd, SOL_IRLMP, IRLMP_ENUMDEVICES, buf, &len)) { perror("getsockopt"); exit(-1); } if (len > 0) { /* |
Just pick the first one, but we should really ask the user
*/ daddr = list->dev[0].daddr; printf("Discovered: (list len=%d)\n", list->len); for (i=0;i<list->len;i++) { printf(" name: %s\n", list->dev[i].info); printf(" daddr: %08x\n", list->dev[i].daddr); printf(" saddr: %08x\n", list->dev[i].saddr); printf("\n"); } } return daddr; } void client() { struct sockaddr_irda peer; int addrlen = sizeof(struct sockaddr_irda); int daddr, actual; char buf[1024]; fd = socket(AF_IRDA, SOCK_STREAM, 0); daddr = discover_devices(fd); peer.sir_family = AF_IRDA; strcpy(peer.sir_name, "P1284"); peer.sir_addr = daddr; connect(fd, (struct sockaddr *) &daddr, sizeof(struct sockaddr_irda)); /* Try to send something */ actual = send(fd, "Testing", 8, 0); /* Try to read reply */ actual = recv(fd, buf, 1024, 0); } |