collin80 / SavvyCAN

QT based cross platform canbus tool
MIT License
1k stars 278 forks source link

Add support for hardware based resending configuration #227

Open collin80 opened 4 years ago

collin80 commented 4 years ago

Currently most CAN devices supported by SavvyCAN default to a mode where they will attempt to resend a frame over and over until it successfully sends and receives an ACK bit to confirm that at least one node accepted it. This causes what amounts to a bus avalanche if there is a misconfiguration or the bus has nothing that acknowledges a given frame. It would be nice if SavvyCAN could ask the connected hardware to change modes to a different resending scheme.

There tend to be three popular options:

  1. Unlimited resending. In case of bus trouble this will rapidly cause a BUS OFF condition and fault the bus
  2. Limited resending - usually around 3 attempts will be made and then the frame is thrown away
  3. No resending. If the frame fails to send it is immediately discarded.

So, SavvyCAN should allow those three options to be set (on a per-bus basis). The hardware may or may not honor this request. If the hardware doesn't support an option, for instance if it only has unlimited or no resending, then the hardware needs to choose the best option and set to that one.

exekutive commented 4 years ago

I’ve noticed that sometimes swcan traffic disappears. Maybe the vehicle halts it. It comes back after a restart.