Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Provide very bare-bones minimal success/error codes for CAN API.#237

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
aentinger wants to merge1 commit intomaster
base:master
Choose a base branch
Loading
fromcan/minimal-error-codes

Conversation

aentinger
Copy link
Contributor

This is related toarduino/ArduinoCore-mbed#956 as well as toarduino/ArduinoCore-mbed#924 .

The underlying problem is that different HALs provide different errors and different error codes when it comes to any peripheral usage (though we concern ourselves with CAN in this PR).

I propose to add at least those two very generic error codes at this very moment with the aim to expand error codes (i.e.CAN_TX_FIFO_FULL) further in the future.

@aentingeraentinger marked this pull request as ready for reviewSeptember 20, 2024 07:59
@aentinger
Copy link
ContributorAuthor

Thoughts@facchinm ?

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.53%. Comparing base(4a02bfc) to head(6c411fe).

Additional details and impacted files
@@           Coverage Diff           @@##           master     #237   +/-   ##=======================================  Coverage   95.53%   95.53%           =======================================  Files          16       16             Lines        1075     1075           =======================================  Hits         1027     1027             Misses         48       48

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

@facchinm
Copy link
Member

Definitely agree on the concept. On the numbering, it really depends on the expected pattern to consume these values. Eg:
while (!can.write()) could mean "keep trying until the error disappears", soCAN_ERROR_GENERIC should be0 (which is also consistent with thePrint.write API (returns the number of bytes actually written, so 0 bytes in case of error).

Copy link
Member

@facchinmfacchinm left a comment

Choose a reason for hiding this comment

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

See comment in thread

@aentinger
Copy link
ContributorAuthor

Ciao@facchinm ☕ 👋

That's allright with me. It is a little bit at odds with thecurrent error definition but I'd say we have a chance right now to create a clean API. What do you think (concerning possible API breakage)?

@facchinm
Copy link
Member

What about adoptingPrint strategy and addsetWriteError/getWriteError while returning0 on failure?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@facchinmfacchinmfacchinm requested changes

Assignees

@aentingeraentinger

Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@aentinger@codecov-commenter@facchinm

[8]ページ先頭

©2009-2025 Movatter.jp