colinmollenhour/usb_scale — pull request #1 by rhdoenges (2013-02-10 21:42:38+00:00)
Title: Timeouts and Command-Line Arguments

- Accept a command line argument for which scale to select. 0 selects the first scale, 1 selects the 2nd, etc.. E.g. "UsbScale.exe 1" to get reading of 2nd scale.
- If the first byte read is 3 the reading is not yet stable. Re-check the reading every 100ms until the reading is stable (1st byte is 4). If the reading still is not stable after 3 seconds, print an error message "Could not get stable reading.". These parameters could be overridden with command line arguments like "--retry=100" and "--fail=3000".
- Format the output in JSON. E.g. `{"success":true,"weight":1.15,"units":"lbs"}` or `{"success":false,"error":"Could not get stable reading."}`

There are 2 different vendor ids for the scales, so they are numbered Scales.com scales first and Metler Toledo scales second.