> getsockopt, I have to run that command about 40 times (with 1 second
> interval). Sometimes
> it can be 100 times before the other device is recognized.
> Once it is recognized, it prints out the correct machine name of the remote
> device, but
> when I try to connect to it, I can't connect to it. Even though, the
> "accept" command is running on the other machine.

i've occasionally had the same problem with discovery - sometimes it
just doesn't seem to work as fast as it should. without running you
program, you could check for discovery initially, by attaching the irda
stacks and checking /proc/net/irda/discovery. all discovered devices
will be listed there. i can't say why it takes so long to discover
though. something in the beam? driver issue? beats me.

>
> peer.sir_family = AF_IRDA;
> strncpy (peer.sir_name, list->dev[0].info, 15);
> peer.sir_lsap_sel = LSAP_ANY;
> peer.sir_addr = (__u32) list->dev[0].daddr;
>
> connect (fd, (struct sockaddr *) &peer, sizeof(struct sockaddr_irda));
> 

there's actually a problem here. the peer.sir_name is not the name of
the device found in dev[0].info. the sir_name attribute will be the name
of the service that you gave the server socket when you bind() it. if
you don't know what services are available on the server, you can check
(on the server) /proc/net/irda/irias.

hope that helps a little. have fun ;)

----------------
Andrew Sutton
[EMAIL PROTECTED]
_______________________________________________
Linux-IrDA mailing list  -  [EMAIL PROTECTED]
http://www.pasta.cs.UiT.No/mailman/listinfo/linux-irda

Reply via email to