hardbyte / hardbyte/python-can

Query RX and TX buffer count

Offen
#1,451 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Python
Sterne
1.6k
Forks
697
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Is your feature request related to a problem? Please describe.
I am trying to test, whether my embedded device can handle a full bus at a certain baudrate. So I wanted to write a script to constantly send messages onto the bus. I used pretty much the example code, but with an infinite loop around the `bus.send(...)` (and some extras to see which messages arrive, but that's not relevant to the issue).
This is obviously a problem, since the script can execute the loop faster than the bus can send messages. So I wanted to add a conditonal statement along the lines of:
```
if bus.tx_buf_count() < bus.tx_buf_size:
bus.send(...)
```

but I could not find any functions to achieve this kind of functionality (flush does not help really me, since then I won't know how many messages have been sent/discarded and I need that to determine if my controller has missed any).

### Describe the solution you'd like
A function for getting the current amount of elements in the buffer (or anything similar)?

Or did I miss anything obvious to solve my issue?

Regards

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.