From 67a687294cd3a91e781c604a7c577aaa52fa2c75 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 31 Mar 2016 14:57:21 +0200 Subject: [PATCH] rfcomm: don't send rfcomm channel open failed on remote disconnect --- src/classic/rfcomm.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/classic/rfcomm.c b/src/classic/rfcomm.c index 8f0526d47..5470aef5c 100644 --- a/src/classic/rfcomm.c +++ b/src/classic/rfcomm.c @@ -768,10 +768,16 @@ static void rfcomm_multiplexer_finalize(rfcomm_multiplexer_t * multiplexer){ rfcomm_channel_t * channel = (rfcomm_channel_t *) it->next; if (channel->multiplexer == multiplexer) { // emit appropriate events - if (channel->state == RFCOMM_CHANNEL_OPEN) { - rfcomm_emit_channel_closed(channel); - } else { - rfcomm_emit_channel_opened(channel, RFCOMM_MULTIPLEXER_STOPPED); + switch(channel->state){ + case RFCOMM_CHANNEL_OPEN: + rfcomm_emit_channel_closed(channel); + break; + case RFCOMM_CHANNEL_SEND_UA_AFTER_DISC: + // remote didn't wait until we send the UA disc + break; + default: + rfcomm_emit_channel_opened(channel, RFCOMM_MULTIPLEXER_STOPPED); + break; } // remove from list it->next = it->next->next;