Hi,
I recently joined the email list. I hope you can help me out with a
programming issue.
I am having trouble connecting two laptops using sockets. They seem to be
configured properly.
However, when I run the program to enumerate the devices that a laptop sees
using
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.
Below is the code from the client:
fd = socket (AF_IRDA, SOCK_STREAM, 0)
if (fd < 0) {
perror...
}
while (1) {
if (discover_devices(fd) == 0)
break;
}
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));
And in function discover_devices:
len = sizeof (struct irda_device_list) + sizeof(struct irda_device_info) *
MAX_DEVICES;
buf = malloc (len)
list = (struct irda_device_list *) buf;
while (1) {
if (getsockopt (fd, SOL_IRLMP, IRLMP_ENUMDEVICES, buf, &len)) {
sleep (1);
else
break;
}
I manipulated the discovery_timeout, fast_poll_increase and slot_timeout
values.
It helped a little in discovering the remote device faster (getsockopt), but
not enough.
And, I am still not able to connect with the"connect"/"accept" command.
I am running two compaq laptops (1 has SMC IrCC device, the other I don't
know).
However, lsmod shows that irda and irtty are loaded and running on both.
Irdadump seems
to produce a dump showing address of remote device every 6th or so packet.
Would appreciate any suggestions.
regards,
Hassan
_______________________________________________
Linux-IrDA mailing list - [EMAIL PROTECTED]
http://www.pasta.cs.UiT.No/mailman/listinfo/linux-irda