Re: [Libphidget-devel] serial numbers
Status: Alpha
Brought to you by:
jstrohm
|
From: Jack S. <js...@ja...> - 2002-09-12 12:44:58
|
On Thu, 2002-09-12 at 02:33, Vadim Tkachenko wrote: > According to fit...@ph...: > > > > Then, the string serves as good as the number, though you can a) add more > > > significant information to it (like, the release variations, or specific > > > options included into an instance of a phidget), b) extend the address space > > > (though this is rather theoretical at this moment). > > > > > > How much of the existing code will break if the serial happens to be a > > > malformed number? > > > > Well, it doesn't bother me very much, because I just release a new Windows > > version and tell everyone to go use it. It's nice owning your own > > sandbox. I just try not to change it all the time.. As long as my > > library is smart enough to figure out all the old phidgets, I don't worry > > about broken code. > > > > I don't think it's really worth mucking with, because USB provides other > > mechanisms for device versioning, and so forth. Particularly with the HID > > devices. > > > > With the soft phidgets, all that data, including the serial number, > > version, .... extraneous information like programmable logic > > device firmware versions, get stored into a fat EEPROM. And it makes no > > sense to cram everything into the serial number when it can stay > > structured? > > True. My rationale, though, was: Occam's Razor. Why should I parse the > serial to number when it is *enough* to treat it as a string? treating it as a string might be fine, but if Chester will give us a heads up before he starts assigning alpha numeric serial numbers we can change the code before he starts selling phidgets with such. > > One reason I might think of: memory. But is this reason good enough? Not to > me - how many phidgets will I have on the adapter, and how many bytes will I > lose if I store serials as numbers? Definitely less than amount of code > necessary to parse it... Memory isn't an issue, you can only have 128 USB device (I think), so 128*256 (Max string length), what's that 32K, think I could spare that worse case. > > Performance - how often do I have to compare the serial with something? > Don't think more than once - at initialization. Actually, since this is the unique ID for all devices it is used QUITE a lot, but I don't think a string compare will be too expensive. > > Just thinking aloud... > |