Skip to content

Commit ac9b039

Browse files
committed
lib/btstack: update to v1.5.5
1 parent fc0a89b commit ac9b039

File tree

5 files changed

+39
-6
lines changed

5 files changed

+39
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
### Added
88
- Enabled builtin `set` type (except on BOOST Move hub) ([support#402]).
99

10+
### Changed
11+
- Updated BTStack to v1.5.5.
12+
1013
### Fixed
1114
- Fixed BLE broadcast not working on City hub.
1215

lib/btstack

Submodule btstack updated 1330 files

lib/pbio/drv/bluetooth/bluetooth_btstack.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "bluetooth_btstack_run_loop_contiki.h"
2323
#include "bluetooth_btstack.h"
2424
#include "genhdr/pybricks_service.h"
25+
#include "hci_transport_h4.h"
2526
#include "pybricks_service_server.h"
2627

2728
#ifdef PBDRV_CONFIG_BLUETOOTH_BTSTACK_HUB_KIND
@@ -252,10 +253,8 @@ static void handle_gatt_client_event(uint8_t packet_type, uint16_t channel, uint
252253

253254
case GATT_EVENT_QUERY_COMPLETE:
254255
if (handset.con_state == CON_STATE_WAIT_DISCOVER_SERVICES) {
255-
// TODO: remove cast on lwp3_characteristic_uuid after
256-
// https://github.com/bluekitchen/btstack/pull/359
257256
handset.btstack_error = gatt_client_discover_characteristics_for_service_by_uuid128(
258-
handle_gatt_client_event, handset.con_handle, &handset.lwp3_service, (uint8_t *)pbio_lwp3_hub_char_uuid);
257+
handle_gatt_client_event, handset.con_handle, &handset.lwp3_service, pbio_lwp3_hub_char_uuid);
259258
if (handset.btstack_error == ERROR_CODE_SUCCESS) {
260259
handset.con_state = CON_STATE_WAIT_DISCOVER_CHARACTERISTICS;
261260
} else {
@@ -463,7 +462,7 @@ void pbdrv_bluetooth_init(void) {
463462
btstack_memory_init();
464463
btstack_run_loop_init(pbdrv_bluetooth_btstack_run_loop_contiki_get_instance());
465464

466-
hci_init(hci_transport_h4_instance(pdata->uart_block_instance()), &config);
465+
hci_init(hci_transport_h4_instance_for_uart(pdata->uart_block_instance()), &config);
467466
hci_set_chipset(pdata->chipset_instance());
468467
hci_set_control(pdata->control_instance());
469468

lib/pbio/drv/bluetooth/pybricks_service_server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ void pybricks_service_server_init(
129129
// get service handle range
130130
uint16_t start_handle = 0;
131131
uint16_t end_handle = 0xffff;
132-
int service_found = gatt_server_get_get_handle_range_for_service_with_uuid128(pbio_pybricks_service_uuid, &start_handle, &end_handle);
132+
int service_found = gatt_server_get_handle_range_for_service_with_uuid128(pbio_pybricks_service_uuid, &start_handle, &end_handle);
133133
btstack_assert(service_found != 0);
134134
UNUSED(service_found);
135135

lib/pbio/test/drv/test_bluetooth.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,37 @@ static void handle_send(const uint8_t *buffer, uint16_t length) {
336336
case 0x200f: // LE Read White List Size
337337
queue_command_complete(opcode, 0x00, 0x01);
338338
break;
339+
case 0x2016: { // LE Read Remote Features
340+
uint16_t connection_handle = little_endian_read_16(buffer, 4);
341+
342+
{
343+
uint8_t buffer[7];
344+
345+
buffer[0] = 0x04; // packet type = Event
346+
buffer[1] = 0x0f; // HCI command status event
347+
buffer[2] = sizeof(buffer) - 3; // length
348+
buffer[3] = 0x00; // status
349+
buffer[4] = 1; // number of packets
350+
little_endian_store_16(buffer, 5, opcode);
351+
352+
queue_packet(buffer, sizeof(buffer));
353+
}
354+
{
355+
uint8_t buffer[15];
356+
357+
buffer[0] = 0x04; // packet type = Event
358+
buffer[1] = 0x3e; // LE Read Remote Features Complete event
359+
buffer[2] = sizeof(buffer) - 3; // length
360+
buffer[3] = 0x04; // Subevent code
361+
buffer[4] = 0x00; // Status
362+
little_endian_store_16(buffer, 5, connection_handle); // connection handle
363+
little_endian_store_32(buffer, 7, 0x00000000); // LE Features (low)
364+
little_endian_store_32(buffer, 11, 0x00000000); // LE Features (high)
365+
366+
queue_packet(buffer, sizeof(buffer));
367+
}
368+
}
369+
break;
339370
case 0x2017: // LE Encrypt - key 16, data 16
340371
queue_command_complete(opcode, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
341372
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);

0 commit comments

Comments
 (0)