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

It's not clear when can::ErrorKind::Acknowledge should be returned #387

Open
jonas-schievink opened this issue May 25, 2022 · 3 comments
Open

Comments

@jonas-schievink
Copy link
Contributor

Its docs say "An ACK error shall be detected by a transmitter whenever it does not monitor a dominant bit during the ACK slot.", but Can::transmit only enqueues a frame for transmission, so it's impossible to detect this condition for the frame passed there. Can::transmit could check if any previous frame caused an ACK error and return an error, but then its return value indicates whether a different frame was transmitted successfully.

@eldruin eldruin added this to the v1.0.0 milestone Jun 6, 2022
@eldruin
Copy link
Member

eldruin commented Jun 6, 2022

cc: @timokroeger

@timokroeger
Copy link
Contributor

I fully agree with jonas here.
The error kinds were chosen to map to the error conditions defined by the CAN spec (same wording in the doc strings as the description in the spec).
For our transmit() interface returning an ACK error does not make sense as those should be handled internally by the controller.

@eldruin
Copy link
Member

eldruin commented Jul 5, 2022

We discussed in the WG meeting that we could keep the variant but improve its documentation.
Any change suggestions?

bors bot added a commit that referenced this issue Sep 26, 2022
394: Split nb and can traits to separate crates. r=eldruin a=Dirbaio

Following up from #177 (comment), this PR splits `nb` and `can` traits to separate crates.

I propose keeping these crates (and `embedded-hal-async`) separate forever. (instead of merging EHA into EH when stable as we originally planned when we created EHA).

Reasons for splitting `nb`:
- its future is unclear. Some people who would like to see `nb` deprecated. By splitting, if we do deprecate it, we won't get stuck with it in the main `embedded-hal` crate forever.
- It makes the module paths in the main crate cleaner.
- Traits tied to a particular "execution model" in their own crates, which make the overall structure easier to understand IMO.

Reasons for splitting `can`:
- It has some open concerns: #381 #387 
- Even if we do solve these, it's nice to have separate crates for the "more specialized" traits so that they can be major-bumped in the future if more concerns arise, without having to major-bump the main `embedded-hal` crate.

TODO:

- [x] Name it `embedded-can`, not `embedded-hal-can`.
- [x] Move/remove docs/examples from the main crate that mention `nb`.
- [x] Mention the subcrates from the main crate's docs.
- [x] Add CI
- [x] move `embedded-hal` to a subdir as well
- [x] What should the nb, can crate versions be? 1.0? (no opinion on this from me).
   - [x] can: 0.4
   - [x] nb: 1.0

Co-authored-by: Dario Nieuwenhuis <[email protected]>
bors bot added a commit that referenced this issue Sep 26, 2022
394: Split nb and can traits to separate crates. r=eldruin a=Dirbaio

Following up from #177 (comment), this PR splits `nb` and `can` traits to separate crates.

I propose keeping these crates (and `embedded-hal-async`) separate forever. (instead of merging EHA into EH when stable as we originally planned when we created EHA).

Reasons for splitting `nb`:
- its future is unclear. Some people who would like to see `nb` deprecated. By splitting, if we do deprecate it, we won't get stuck with it in the main `embedded-hal` crate forever.
- It makes the module paths in the main crate cleaner.
- Traits tied to a particular "execution model" in their own crates, which make the overall structure easier to understand IMO.

Reasons for splitting `can`:
- It has some open concerns: #381 #387 
- Even if we do solve these, it's nice to have separate crates for the "more specialized" traits so that they can be major-bumped in the future if more concerns arise, without having to major-bump the main `embedded-hal` crate.

TODO:

- [x] Name it `embedded-can`, not `embedded-hal-can`.
- [x] Move/remove docs/examples from the main crate that mention `nb`.
- [x] Mention the subcrates from the main crate's docs.
- [x] Add CI
- [x] move `embedded-hal` to a subdir as well
- [x] What should the nb, can crate versions be? 1.0? (no opinion on this from me).
   - [x] can: 0.4
   - [x] nb: 1.0

Co-authored-by: Dario Nieuwenhuis <[email protected]>
Co-authored-by: Diego Barrios Romero <[email protected]>
@eldruin eldruin removed this from the v1.0.0 milestone Apr 1, 2023
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

No branches or pull requests

3 participants