CAN Frame: `is_remote_frame()` and `new_remote()`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 65/100
- Tipo di issue
- Refactoring
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- rust
- Ambito
- embedded-iot
Direzione di ricerca
Search the repository for is_remote_frame() and new_remote() and inspect the CAN Frame implementation and their call sites. Rename the methods to is_request_frame() and new_request(), update references and documentation, then run the relevant Rust tests and checks to confirm the old names are gone.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The CAN Frame method is_remote_frame() returns:
trueif the frame is a Remote Transmission Request (RTRbit is set)falseif the frame is a Data Frame (RTRbit is clear)
In other words, it allows to distinguish between:
- a frame which contains actual data, and
- a frame which contains no data, but requests that data be sent back
Calling the latter a "remote frame" is terribly misleading:
- It's no more "remote" than a data frame: both come from another device on the bus
- It does not convey that it contains no data, nor that it wants data to be sent back
- it's not the exclusive opposite to its boolean alternative (the opposite of "remote" is "local" ―not "data", and the opposite of "data" is "no data" ―not "remote"), leading to confusing code like this:
/// Returns true if this frame is a data frame.
fn is_data_frame(&self) -> bool {
!self.is_remote_frame()
}
- Lastly, in device testing mode (we receive the frames we send), it's not even "remote" anymore! Now this unfortunate name has lost any and all connection to whatever meaning it was trying to convey to begin with…
If one wants to shorten "Remote Transmission Request", the only important word in there is: request. Therefore, I'm suggesting that:
is_remote_frame()be renamed intois_request_frame()new_remote()be renamed intonew_request()
This way, it makes it clear that we're in a "transactional" context, where each frame is either a request or a reply/broadcast:
/// Returns true if this frame is a data frame.
fn is_data_frame(&self) -> bool {
!self.is_request_frame()
}
Thank you!
- Lingua principale
- Rust
- Stelle
- 2.7k
- Fork
- 283
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rust-embedded/embedded-hal
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
rust-embedded/embedded-hal#742 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
rust-embedded/embedded-hal#747 · 5 commenti · 1 reazione ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
rust-embedded/embedded-hal#746 · 2 commenti · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
rust-embedded/embedded-hal#745 · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
rust-embedded/embedded-hal#744 · 1 commento ·
Tutte le issue di rust-embedded/embedded-hal
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 67/100
rust-bitcoin/rust-bitcoin#7089 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
-
area/tools bug session-analysis
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Python OpenTelemetrySectionConfig has no file_sinksForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
NVIDIA/NeMo-Relay#1514 ·
I maintainer di solito rispondono entro 1 giorno
-
prompting proposal tool triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
can1357/oh-my-pi#17041 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
nix-community/fenix#262 ·