-
Notifications
You must be signed in to change notification settings - Fork 192
feat(api): abstract barcode scanner driver. #20713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
sfoster1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The structure of this looks good I think but please add a longer PR description - in particular, why we need these prefixes and suffixes
| ... | ||
|
|
||
| @abstractmethod | ||
| async def set_sufix(self, suffix: str) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| async def set_sufix(self, suffix: str) -> None: | |
| async def set_suffix(self, suffix: str) -> None: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## edge #20713 +/- ##
==========================================
+ Coverage 56.54% 56.74% +0.20%
==========================================
Files 3916 3916
Lines 323256 323261 +5
Branches 45766 45766
==========================================
+ Hits 182773 183441 +668
+ Misses 140267 139604 -663
Partials 216 216
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
sfoster1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you!
Overview
Abstract driver that encapsulates all of the common things supported by the various barcode scanners we are looking at supporting.
Supports the following interface
Used by the controller to add/remove a device
Standard barcode scanners tend to automatically add a suffix usually
\cr\lfdepending on the type of workflow that a user may be replacing with our barcode scanner their system may expect a certain type of suffix/prefix in the data. This will also allow users to add a little extra metadata into their scans if they want. I have seen other systems that add a prefix for when something gets scanned before an action and then a different prefix when it gets scanned after an action. this way whatever system can check that a barcode is scanned twice and has one of each prefixes.most barcode scanners have buzzers and led, we don't know exactly which and/or how many types of scanners we want to support so lets have some standard profiles that we can apply to give them a uniform behavior
Tell the device how long to stay active while attempting to decode a barcode before timing out.
Bread and butter of the project, turn on the detector and return data if something is found otherwise none
We will need to know some amount of info about the device, at a minimum the serial number.