Skip to content
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

feat: remove bufferAlgorithm param from the open command #1002

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

dido18
Copy link
Contributor

@dido18 dido18 commented Jan 10, 2025

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • Tests for the changes have been added (for bug fixes / features)
  • What kind of change does this PR introduce?
    Remove the bufferAlgorithm argument from the open command.
    Reasons: the Arduino projects use only the timed algorithm. No need for the other two options.
  • What is the current behavior?
    The open command accepts 3 different bufferAlgorithm.
    open <portName> <baud> [bufferAlgorithm: ({default}, timed, timedraw)]
  • What is the new behavior?
    The bufferAlgorithm argument is removed and it not possible to set the algorithm (the timed is always used)
    open <portName> <baud>.
    If the argument is specified, the following warn log is printed:
level=warning msg="Unexpected arguments for the open command. Ignored arguments: '[timed]'."
  • Does this PR introduce a breaking change?
  • Other information:

@codecov-commenter
Copy link

codecov-commenter commented Jan 10, 2025

Codecov Report

Attention: Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.

Project coverage is 20.84%. Comparing base (1b94ccc) to head (fb39e25).

Files with missing lines Patch % Lines
serialport.go 0.00% 8 Missing ⚠️
bufferflow_timed.go 0.00% 2 Missing ⚠️
hub.go 0.00% 2 Missing ⚠️
serial.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1002      +/-   ##
==========================================
+ Coverage   20.14%   20.84%   +0.69%     
==========================================
  Files          42       40       -2     
  Lines        3222     3114     -108     
==========================================
  Hits          649      649              
+ Misses       2488     2380     -108     
  Partials       85       85              
Flag Coverage Δ
unit 20.84% <0.00%> (+0.69%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jan 10, 2025
@dido18 dido18 changed the title chore(hub.go): remove bufferAlgorithm params in the open command remove bufferAlgorithm params in the open command Jan 10, 2025
@dido18 dido18 force-pushed the remove-open-not-used-buffer-algorithm branch from d3ec8c8 to 679a319 Compare January 10, 2025 13:59
@dido18 dido18 force-pushed the remove-open-not-used-buffer-algorithm branch from 786ac2b to 98b6376 Compare January 10, 2025 14:38
@dido18
Copy link
Contributor Author

dido18 commented Jan 13, 2025

TODO

  • Test on Linux: I provisioned successfully an Arduino UNO r4 board (on ubuntu 20.04)
  • Test on Windows
  • Test on mac
  • Update the WIKI page

@dido18 dido18 marked this pull request as ready for review January 13, 2025 11:36
@dido18 dido18 changed the title remove bufferAlgorithm params in the open command fix(open): remove bufferAlgorithm params Jan 13, 2025
@dido18 dido18 changed the title fix(open): remove bufferAlgorithm params fix(open): remove bufferAlgorithm param Jan 13, 2025
@dido18 dido18 self-assigned this Jan 13, 2025
Copy link
Member

@cmaglie cmaglie left a comment

Choose a reason for hiding this comment

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

Looks good!
Just added a comment for future reference.

hub.go Show resolved Hide resolved
@MatteoPologruto
Copy link
Contributor

Tested on Windows with an Arduino UNO r4. Everything works as expected 🚀

Copy link
Member

@cmaglie cmaglie left a comment

Choose a reason for hiding this comment

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

Tested on linux and mac and found this regression 😱

serial.go Outdated Show resolved Hide resolved
@dido18 dido18 requested a review from cmaglie January 17, 2025 11:25
Copy link
Member

@cmaglie cmaglie left a comment

Choose a reason for hiding this comment

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

Retested on Linux, and now seems working OK! ✅

@dido18 dido18 force-pushed the remove-open-not-used-buffer-algorithm branch from 9d2b0ab to 43bd6ea Compare January 21, 2025 08:59
@dido18 dido18 changed the title fix(open): remove bufferAlgorithm param feat(open): remove bufferAlgorithm param from the open command Jan 21, 2025
@dido18 dido18 changed the title feat(open): remove bufferAlgorithm param from the open command feat: remove bufferAlgorithm param from the open command Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants