Tomas Carlsson <[EMAIL PROTECTED]> writes:
> I use the following to make a discovery each time before I send something:
>
> getsockopt(self->fd, SOL_IRLMP, IRLMP_ENUMDEVICES, buf, &len)
How are you sending something? In most cases, the sending will initiate a
discovery by itself so you don't have to do this stuff yourself. OBEX is
however not fixed yet. Are you using OBEX?
> and that call works just fine, i can see it with irdadump. The problem is
> that the getsockopt() returns with "Resource temporarily unavailable" even
> though I can see that the discovery is performed ok. But if I loop over
> the getsockopt call a few times it works eventually (after 3-4 times).
>
> Anyoune got a clue about this?
Yes, Thomas pointet out that getsockopt should probably not block, and
since a discovery operations takes some amount of time to complete (if
discovery is not running and the cache is therefore empty), it will only
initiate the discovery and not wait for the result. You will have to call
it multiple times to read the result. The cache is flushed after 3 seconds,
so you must do the next discovery within that timeframe.
The error value returned is -EAGAIN which should tell the app to try
again. The docs for IrSock (Win) states the same!
-- Dag
--
/ Dag Brattli | The Linux-IrDA Project /
// University of Tromsoe, Norway | Infrared communication for Linux //
/// http://www.cs.uit.no/~dagb | http://www.cs.uit.no/linux-irda/ ///
_______________________________________________
Linux-IrDA mailing list - [EMAIL PROTECTED]
http://www.pasta.cs.UiT.No/mailman/listinfo/linux-irda