mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-05 00:40:19 +00:00
answer request for connectionsless mtu and fixed channels supported in l2cap information request
This commit is contained in:
parent
5ede1dd8ae
commit
3b0484b3ed
26
src/l2cap.c
26
src/l2cap.c
@ -386,13 +386,29 @@ void l2cap_run(void){
|
|||||||
l2cap_send_signaling_packet(handle, ECHO_RESPONSE, sig_id, 0, NULL);
|
l2cap_send_signaling_packet(handle, ECHO_RESPONSE, sig_id, 0, NULL);
|
||||||
break;
|
break;
|
||||||
case INFORMATION_REQUEST:
|
case INFORMATION_REQUEST:
|
||||||
if (infoType == 2) {
|
switch (infoType){
|
||||||
uint32_t features = 0;
|
case 1: { // Connectionless MTU
|
||||||
// extended features request supported, however no features present
|
uint16_t connectionless_mtu = hci_max_acl_data_packet_length();
|
||||||
l2cap_send_signaling_packet(handle, INFORMATION_RESPONSE, sig_id, infoType, 0, 4, &features);
|
l2cap_send_signaling_packet(handle, INFORMATION_RESPONSE, sig_id, infoType, 0, sizeof(connectionless_mtu), &connectionless_mtu);
|
||||||
} else {
|
break;
|
||||||
|
}
|
||||||
|
case 2: { // Extended Features Supported
|
||||||
|
// extended features request supported, only supporing fixed channel map
|
||||||
|
uint32_t features = 0x80;
|
||||||
|
l2cap_send_signaling_packet(handle, INFORMATION_RESPONSE, sig_id, infoType, 0, sizeof(features), &features);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 3: { // Fixed Channels Supported
|
||||||
|
uint8_t map[8];
|
||||||
|
memset(map, 0, 8);
|
||||||
|
map[0] = 0x01; // L2CAP Signaling Channel
|
||||||
|
l2cap_send_signaling_packet(handle, INFORMATION_RESPONSE, sig_id, infoType, 0, sizeof(map), &map);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
// all other types are not supported
|
// all other types are not supported
|
||||||
l2cap_send_signaling_packet(handle, INFORMATION_RESPONSE, sig_id, infoType, 1, 0, NULL);
|
l2cap_send_signaling_packet(handle, INFORMATION_RESPONSE, sig_id, infoType, 1, 0, NULL);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case COMMAND_REJECT:
|
case COMMAND_REJECT:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user