Skip to content

Commit b6181cb

Browse files
committed
pybricks.pupdevices.Remote: Fix name() not setting name.
This was missed in 023d6f6. We dropped the value attribute, but length was set on the same line: msg.value.size = msg.length = len + 5;
1 parent 3885091 commit b6181cb

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
### Fixed
1010
- Fixed button `LEFT_DOWN` returning `LEFT_UP` in the method
1111
`ev3devices.InfraredSensor.keypad()` ([support#2724]).
12+
- Fixed `pybricks.pupdevices.Remote.name` not setting name ([support#2720]).
13+
14+
[support#2720]: https://github.com/pybricks/support/issues/2720
15+
[support#2724]: https://github.com/pybricks/support/issues/2724
1216

1317
## [4.0.0b11] - 2026-05-30
1418

pybricks/iodevices/pb_type_iodevices_lwp3device.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ static mp_obj_t pb_type_lwp3device_name(size_t n_args, const mp_obj_t *args) {
354354
char payload[LWP3_MAX_HUB_PROPERTY_NAME_SIZE];
355355
} __attribute__((packed)) msg;
356356

357+
msg.length = sizeof(msg) - sizeof(msg.payload) + len;
357358
msg.hub = 0;
358359
msg.type = LWP3_MSG_TYPE_HUB_PROPERTIES;
359360
msg.property = LWP3_HUB_PROPERTY_NAME;
@@ -366,7 +367,7 @@ static mp_obj_t pb_type_lwp3device_name(size_t n_args, const mp_obj_t *args) {
366367

367368
pb_assert(pbdrv_bluetooth_peripheral_write_characteristic(
368369
self->peripheral, self->lwp3_char_handle,
369-
(const uint8_t *)&msg, sizeof(msg) - sizeof(msg.payload) + len));
370+
(const uint8_t *)&msg, msg.length));
370371
return wait_or_await_operation(self_in);
371372
}
372373

0 commit comments

Comments
 (0)