l2cap_signaling: use packet boundary flags 0x00 for LE signaling packets

This commit is contained in:
Matthias Ringwald 2020-01-31 12:05:24 +01:00
parent 419abca300
commit 2a9f55d6f7
2 changed files with 10 additions and 4 deletions

View File

@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- GATT Client: set uuid16 to zero when deserializing uuid128 services, characteristics, and descriptors
- att_db_util: fix realloc of att db buffer for large attributes
- btstack_tlv_posix: only keep last value in memory, fix delete operation
- l2cap_signaling: use packet boundary flags 0x00 for LE signaling packets (ignoring hci_non_flushable_packet_boundary_flag_supported())
### Added
- att_db_util: provide GATT Database Hash via att_db_util_hash_calc

View File

@ -50,7 +50,7 @@
#include <string.h>
static uint16_t l2cap_create_signaling_internal(uint8_t * acl_buffer, hci_con_handle_t handle, uint16_t cid, L2CAP_SIGNALING_COMMANDS cmd, uint8_t identifier, va_list argptr){
static uint16_t l2cap_create_signaling_internal(uint8_t * acl_buffer, hci_con_handle_t handle, bool is_classic, uint16_t cid, L2CAP_SIGNALING_COMMANDS cmd, uint8_t identifier, va_list argptr){
static const char *l2cap_signaling_commands_format[] = {
"2D", // 0x01 command reject: reason {cmd not understood (0), sig MTU exceeded (2:max sig MTU), invalid CID (4:req CID)}, data len, data
@ -89,7 +89,12 @@ static uint16_t l2cap_create_signaling_internal(uint8_t * acl_buffer, hci_con_ha
return 0;
}
int pb = hci_non_flushable_packet_boundary_flag_supported() ? 0x00 : 0x02;
int pb = 0x00; // First non-automatically-flushable packet of a higher layer message
#ifdef ENABLE_CLASSIC
if (is_classic){
pb = hci_non_flushable_packet_boundary_flag_supported() ? 0x00 : 0x02;
}
#endif
// 0 - Connection handle : PB=pb : BC=00
little_endian_store_16(acl_buffer, 0, handle | (pb << 12) | (0 << 14));
@ -142,11 +147,11 @@ static uint16_t l2cap_create_signaling_internal(uint8_t * acl_buffer, hci_con_ha
}
uint16_t l2cap_create_signaling_classic(uint8_t * acl_buffer, hci_con_handle_t handle, L2CAP_SIGNALING_COMMANDS cmd, uint8_t identifier, va_list argptr){
return l2cap_create_signaling_internal(acl_buffer, handle, 1, cmd, identifier, argptr);
return l2cap_create_signaling_internal(acl_buffer, handle, true, 1, cmd, identifier, argptr);
}
#ifdef ENABLE_BLE
uint16_t l2cap_create_signaling_le(uint8_t * acl_buffer, hci_con_handle_t handle, L2CAP_SIGNALING_COMMANDS cmd, uint8_t identifier, va_list argptr){
return l2cap_create_signaling_internal(acl_buffer, handle, 5, cmd, identifier, argptr);
return l2cap_create_signaling_internal(acl_buffer, handle, false, 5, cmd, identifier, argptr);
}
#endif