l2cap_signaling: use 0xffff as end-of-list for cid array

This commit is contained in:
Matthias Ringwald 2021-09-09 16:41:18 +02:00
parent 2017c6d2f8
commit 23d9c72139
2 changed files with 3 additions and 3 deletions

View File

@ -112,9 +112,9 @@ uint16_t l2cap_create_signaling_packet(uint8_t * acl_buffer, hci_con_handle_t ha
acl_buffer[pos++] = word & 0xffu;
acl_buffer[pos++] = word >> 8;
break;
case 'C': // list of cids != zero, last one is zero
case 'C': // list of cids != zero, last one is 0xffff
ptr_u16 = va_arg(argptr, uint16_t *); // LCOV_EXCL_BR_LINE
while (*ptr_u16 != 0){
while (*ptr_u16 != 0xffff){
little_endian_store_16(acl_buffer, pos, *ptr_u16);
ptr_u16++;
pos += 2;

View File

@ -48,7 +48,7 @@ TEST(L2CAP_LE_Signaling, l2cap_create_signaling_le_valid_cmd_2_format){
}
TEST(L2CAP_LE_Signaling, l2cap_create_signaling_le_valid_cmd_C_format){
uint16_t cids[2] = { 0x3333, 0 };
uint16_t cids[2] = { 0x3333, 0xffff };
uint16_t size = l2cap_send_le_signaling_packet((hci_con_handle_t) 0x01, L2CAP_CREDIT_BASED_RECONFIGURE_REQUEST, 1, 0x1111, 0x2222, cids);
CHECK_EQUAL(18, size);
}