Hi Daniel, On Thu, Dec 16, 2010, Daniel Wagner wrote: > I'm reading a bit through the code and try to understand how the HF > role in HFP is implemented. I found following in audio/gateway.c: > > static gboolean sco_io_cb(GIOChannel *chan, GIOCondition cond, > struct audio_device *dev) > { > struct gateway *gw = dev->gateway; > > if (cond & G_IO_NVAL) > return FALSE; > > if (cond & (G_IO_ERR | G_IO_HUP)) { > DBG("sco connection is released"); > g_io_channel_shutdown(gw->sco, TRUE, NULL); > g_io_channel_unref(gw->sco); > gw->sco = NULL; > change_state(dev, GATEWAY_STATE_CONNECTED); > return FALSE; > } > > return TRUE; > } > > I don't really understand what's going on here, but just from the > naming I think the change_state call should be > GATEWAY_STATE_DISCONNECTED. If my assumation is correct I can spin a > patch. Actually the current code is correct. This is the callback for SCO (like the function name suggests) so when SCO gets closed there's a transition from PLAYING to CONNECTED (meaning RFCOMM but no SCO). You can see the full set of state values in audio/gateway.h. Johan -- 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