l2cap: drop reason arg for l2cap_decline_connection - only 'no resources' expected

This commit is contained in:
Matthias Ringwald 2016-07-17 22:49:15 +02:00
parent 7e8856ebfd
commit 7ef6a7bbd9
7 changed files with 11 additions and 11 deletions

View File

@ -1012,7 +1012,7 @@ static int btstack_command_handler(connection_t *connection, uint8_t *packet, ui
case L2CAP_DECLINE_CONNECTION:
cid = little_endian_read_16(packet, 3);
reason = packet[7];
l2cap_decline_connection(cid, reason);
l2cap_decline_connection(cid);
break;
case RFCOMM_CREATE_CHANNEL:
reverse_bd_addr(&packet[3], addr);

View File

@ -145,7 +145,7 @@ OPCODE(OGF_BTSTACK, L2CAP_ACCEPT_CONNECTION), "2"
/**
* @param source_cid (16)
* @param reason
* @param reason (deprecated)
*/
const hci_cmd_t l2cap_decline_connection_cmd = {
OPCODE(OGF_BTSTACK, L2CAP_DECLINE_CONNECTION), "21"

View File

@ -1193,7 +1193,7 @@ static int bnep_hci_event_handler(uint8_t *packet, uint16_t size)
if (channel) {
log_error("INCOMING_CONNECTION (l2cap_cid 0x%02x) for PSM_BNEP => decline - channel already exists", l2cap_cid);
l2cap_decline_connection(l2cap_cid, 0x04); // no resources available
l2cap_decline_connection(l2cap_cid);
return 1;
}
@ -1202,7 +1202,7 @@ static int bnep_hci_event_handler(uint8_t *packet, uint16_t size)
if (!channel) {
log_error("INCOMING_CONNECTION (l2cap_cid 0x%02x) for PSM_BNEP => decline - no memory left", l2cap_cid);
l2cap_decline_connection(l2cap_cid, 0x04); // no resources available
l2cap_decline_connection(l2cap_cid);
return 1;
}

View File

@ -932,7 +932,7 @@ static int rfcomm_hci_event_handler(uint8_t *packet, uint16_t size){
if (multiplexer) {
log_info("INCOMING_CONNECTION (l2cap_cid 0x%02x) for PSM_RFCOMM => decline - multiplexer already exists", l2cap_cid);
l2cap_decline_connection(l2cap_cid, 0x04); // no resources available
l2cap_decline_connection(l2cap_cid);
return 1;
}
@ -940,7 +940,7 @@ static int rfcomm_hci_event_handler(uint8_t *packet, uint16_t size){
multiplexer = rfcomm_multiplexer_create_for_addr(event_addr);
if (!multiplexer){
log_info("INCOMING_CONNECTION (l2cap_cid 0x%02x) for PSM_RFCOMM => decline - no memory left", l2cap_cid);
l2cap_decline_connection(l2cap_cid, 0x04); // no resources available
l2cap_decline_connection(l2cap_cid);
return 1;
}

View File

@ -495,7 +495,7 @@ static void sdp_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *p
case L2CAP_EVENT_INCOMING_CONNECTION:
if (l2cap_cid) {
// CONNECTION REJECTED DUE TO LIMITED RESOURCES
l2cap_decline_connection(channel, 0x04);
l2cap_decline_connection(channel);
break;
}
// accept

View File

@ -1131,15 +1131,15 @@ void l2cap_accept_connection(uint16_t local_cid){
l2cap_run();
}
void l2cap_decline_connection(uint16_t local_cid, uint8_t reason){
log_info("L2CAP_DECLINE_CONNECTION local_cid 0x%x, reason %x", local_cid, reason);
void l2cap_decline_connection(uint16_t local_cid){
log_info("L2CAP_DECLINE_CONNECTION local_cid 0x%x", local_cid);
l2cap_channel_t * channel = l2cap_get_channel_for_local_cid( local_cid);
if (!channel) {
log_error( "l2cap_decline_connection called but local_cid 0x%x not found", local_cid);
return;
}
channel->state = L2CAP_STATE_WILL_SEND_CONNECTION_RESPONSE_DECLINE;
channel->reason = reason;
channel->reason = 0x04; // no resources available
l2cap_run();
}

View File

@ -244,7 +244,7 @@ void l2cap_accept_connection(uint16_t local_cid);
/**
* @brief Deny incoming L2CAP connection.
*/
void l2cap_decline_connection(uint16_t local_cid, uint8_t reason);
void l2cap_decline_connection(uint16_t local_cid);
/**
* @brief Check if outgoing buffer is available and that there's space on the Bluetooth module