Hi Mikel, On Tue, May 15, 2012 at 11:03 AM, Mikel Astiz <mikel.astiz.oss@xxxxxxxxx> wrote: > Hi Lizardo, > > On Tue, May 15, 2012 at 4:15 PM, Anderson Lizardo > <anderson.lizardo@xxxxxxxxxxxxx> wrote: >> Hi Mikel, >> >> On Mon, May 14, 2012 at 11:34 AM, Mikel Astiz <mikel.astiz.oss@xxxxxxxxx> wrote: >>> From: Mikel Astiz <mikel.astiz@xxxxxxxxxxxx> >>> >>> MGMT_EV_DEVICE_DISCONNECTED should expose the disconnection reason to >>> userland. >> >> There is "getsockopt(sock, SOL_SOCKET, SO_ERROR, &sk_err, &len)". Why >> is it not enough? > > Could you please be more specific? Which socket type exposes this > disconnect reason? It's L2CAP. Not sure about other socket types (I didn't check them). BlueZ already uses it in some places (grep for "SO_ERROR"), and we use it on GATT code for exactly the same reason you describe (many GATT profiles describe specific behavior depending on disconnect reason being timeout or not) Regards, -- Anderson Lizardo Instituto Nokia de Tecnologia - INdT Manaus - Brazil -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html