don't send if aggregate flow is turned off

This commit is contained in:
matthias.ringwald@gmail.com 2014-01-11 20:42:51 +00:00
parent ee6be40e22
commit 7256b33ac8
2 changed files with 6 additions and 1 deletions

View File

@ -185,7 +185,7 @@ extern "C" {
// data: event (8), len(8), address(48), channel (8), rfcomm_cid (16) // data: event (8), len(8), address(48), channel (8), rfcomm_cid (16)
#define RFCOMM_EVENT_INCOMING_CONNECTION 0x82 #define RFCOMM_EVENT_INCOMING_CONNECTION 0x82
// data: event (8), len(8), rfcommid (16), ... // data: event (8), len(8), rfcomm_cid (16), line status (8)
#define RFCOMM_EVENT_REMOTE_LINE_STATUS 0x83 #define RFCOMM_EVENT_REMOTE_LINE_STATUS 0x83
// data: event(8), len(8), rfcomm_cid(16), credits(8) // data: event(8), len(8), rfcomm_cid(16), credits(8)
@ -267,6 +267,7 @@ extern "C" {
#define RFCOMM_MULTIPLEXER_STOPPED 0x70 #define RFCOMM_MULTIPLEXER_STOPPED 0x70
#define RFCOMM_CHANNEL_ALREADY_REGISTERED 0x71 #define RFCOMM_CHANNEL_ALREADY_REGISTERED 0x71
#define RFCOMM_NO_OUTGOING_CREDITS 0x72 #define RFCOMM_NO_OUTGOING_CREDITS 0x72
#define RFCOMM_AGGREGATE_FLOW_OFF 0x73
#define SDP_HANDLE_ALREADY_REGISTERED 0x80 #define SDP_HANDLE_ALREADY_REGISTERED 0x80
#define SDP_QUERY_INCOMPLETE 0x81 #define SDP_QUERY_INCOMPLETE 0x81

View File

@ -1868,6 +1868,10 @@ int rfcomm_send_internal(uint16_t rfcomm_cid, uint8_t *data, uint16_t len){
return RFCOMM_NO_OUTGOING_CREDITS; return RFCOMM_NO_OUTGOING_CREDITS;
} }
if ((channel->multiplexer-fcon & 1) == 0){
log_info("rfcomm_send_internal cid 0x%02x, aggregate flow off!\n", rfcomm_cid);
return RFCOMM_AGGREGATE_FLOW_OFF;
}
// log_info("rfcomm_send_internal: len %u... outgoing credits %u, l2cap credit %us, granted %u\n", // log_info("rfcomm_send_internal: len %u... outgoing credits %u, l2cap credit %us, granted %u\n",
// len, channel->credits_outgoing, channel->multiplexer->l2cap_credits, channel->packets_granted); // len, channel->credits_outgoing, channel->multiplexer->l2cap_credits, channel->packets_granted);