Skip to content

Commit

Permalink
sys/usb: Use luid_custom for stable USB serials
Browse files Browse the repository at this point in the history
This is useful when having multiple instances of the same board
connected via USB CDC ACM and telling the TTYs apart.
  • Loading branch information
maribu committed Oct 28, 2024
1 parent 089ae7c commit 78a6a5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sys/usb/usbus/usbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ static void *_usbus_thread(void *args)
"USB serial byte length must be at most 63 due to protocol "
"limitations");
uint8_t luid_buf[CONFIG_USB_SERIAL_BYTE_LENGTH];
luid_get(luid_buf, sizeof(luid_buf));
luid_custom(luid_buf, sizeof(luid_buf), LUID_CUSTOM_GEN_USBBUS);
fmt_bytes_hex(usbus->serial_str, luid_buf, sizeof(luid_buf));
usbus_add_string_descriptor(usbus, &usbus->serial, usbus->serial_str);
#endif
Expand Down

0 comments on commit 78a6a5b

Please sign in to comment.