hardbyte / hardbyte/python-can

Query RX and TX buffer count

Ouverte
#1,451 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
enhancement
Langage dominant
Python
Étoiles
1.6k
Forks
697
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

### 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

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.