Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Question about CAN abstractions

Aperta
#657 0 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
20/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
embedded-iot

Direzione di ricerca

Start by reading the CAN frame trait, especially its constructors and Frame::is_extended, then inspect the device-driver transmit and reception APIs. Compare the current abstractions with the proposed CanTx and CanRx split. Done would require an agreed API design and corresponding implementation scope, which the issue does not yet define.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I have a few question and possibly improvement suggestions for the CAN library

  1. Is there a special reasons why the CAN frame trait contains constructors? How would those be used, and be better than more explicit custom constructors for the actual frame types inside libraries?

  2. For device drivers, the transmit function already assumes a constructed frame, and for reception.. Wouldn't an API just expect the user to somehow take care of polling CAN frames and pass them to the driver? Maybe it would make more sense to have something like CanTx trait which only provided transmit functions, and possibly a specialized CanRx? I still think it is easier for device drivers to just assume the user takes care of polling CAN frames, and offer an API which consumes frames (probably re-using the CAN frame trait to remain generic)

  3. Any reason not to provide a default implementation for Frame::is_extended?

    /// Returns true if this frame is an extended frame.
    fn is_extended(&self) -> bool {
        match self.id() {
            Id::Standard(_) => false,
            Id::Extended(_) => true,
        }
    }
    
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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rust-embedded/embedded-hal

Tutte le issue di rust-embedded/embedded-hal

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.