Skip to content

Conversation

@ryanthecoder
Copy link
Contributor

@ryanthecoder ryanthecoder commented Jan 27, 2026

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

  • Connect/Disconnect/is_connected
    Used by the controller to add/remove a device
  • set_prefix/set_suffix
    Standard barcode scanners tend to automatically add a suffix usually \cr\lf depending 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.
  • set_sound_profile/set_led_profile
    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
  • set_scan_timeout
    Tell the device how long to stay active while attempting to decode a barcode before timing out.
  • scan_barcode
    Bread and butter of the project, turn on the detector and return data if something is found otherwise none
  • get_device_info
    We will need to know some amount of info about the device, at a minimum the serial number.

Copy link
Member

@sfoster1 sfoster1 left a 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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
async def set_sufix(self, suffix: str) -> None:
async def set_suffix(self, suffix: str) -> None:

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.74%. Comparing base (964eec3) to head (2439798).
⚠️ Report is 3 commits behind head on edge.

Additional details and impacted files

Impacted file tree graph

@@            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              
Flag Coverage Δ
robot-server 83.86% <ø> (+5.86%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 125 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you!

@ryanthecoder ryanthecoder merged commit 83699c0 into edge Jan 29, 2026
86 of 88 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants