add usbprinter device_id string

This commit is contained in:
wp
2025-08-08 21:53:16 -05:00
parent 19ff9151a7
commit 47654338b1
3 changed files with 28 additions and 1 deletions

View File

@@ -48,6 +48,16 @@ print(f"Dymo 450 string result as bytes: {usb.control.get_descriptor(dymott,254,
The Twin-Turbo serial is supposed to be 006103010161575. Due to the extra 0 byte `b'\x30'`, the rest of the return data becomes shifted and is interpreted like
`b'\x30\x30\x00\x36\x00\x31\x00\x30\x00\x33\x00\x30\x00\x31\x00\x30\x00\x31\x00\x36\x00\x31\x00\x35\x00\x37\x00\x35'.decode('utf-16-le')` or literally unicode values `\x3500\x3700\x3500\x3100\x3600\x3100\x3000\x3100\x3000\x3300\x3000\x3100\x3600\x3030`
Dymo 450 GET_DEVICE_ID example string:
```
'MFG:DYMO;CMD: ;MDL:LabelWriter 450;CLASS:PRINTER;DESCRIPTION:DYMO LabelWriter 450;SERN:01010112345600;'
```
Dymo Twin Turbo GET_DEVICE_ID example string (note the null byte before ERN:):
```
'MFG:DYMO;CMD: ;MDL:LabelWriter Twin Turbo;CLASS:PRINTER;DESCRIPTION:DYMO LabelWriter Twin Turbo;\x00ERN:006103010161575'
```
Note: Linux Mint 22.1 <- Ubuntu 24.04 Noble <- Debian Trixie/sid <- Kernel 6.8.0-71-generic; pyusb version 1.3.1; python version 3.12.3
References
@@ -66,3 +76,5 @@ https://kernel.org/category/faq.html
https://bugzilla.kernel.org/show_bug.cgi?id=220422
https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/LegacyCollaterals/01233a.pdf