pyftdi
pyftdi copied to clipboard
Add support for integer serial number in device URL
How about leaving specifier[2] as it is now (serial or device number), but add support for specifier[3] being serial number only. I'd open it with bitbang.open_bitbang_from_url("ftdi://vid:pid::0025/1")
instead.
Resolved #209
~~The issue is that this syntax breaks backward compatibility...~~
Sorry I misread the code.
I need to check it does not break the bus:address
code though
I intended to leave support for current styles (but sort-of deprecate using index field for serial number, since it is unreliable anyway).
Maybe it is time to break compatibility with index-based syntax, (re-)using your proposed syntax:
URL scheme: ftdi://[vendor[:product[:serial]]]/interface
URL scheme: ftdi://[vendor[:product[:bus:address]]]/interface
URL scheme: ftdi://[vendor[:product[::@index]]]/interface
?
That would certainly work for me, as I don't need the backwards compatibility. And it's much simpler overall.
Ok, as index
is not really reliable anyway - and that the new bus:address
syntax is a far better way to refer to S/N-less devices, I think it is worth reworking this.
I just need to find some spare time to implement it (and test & document it...)
I would also prefer prioritizing serial number over index :) I have till now used this field as a serial number, in my organization we use integer serial numbers so I had to add literal prefix to use pyftdi. This causes an inconsistencies with other platforms which do not have such an issue, and questions why devices which work with "python apps" must be marked differently.
I'm ok with that. I think I will remove the index support for now...