hardbyte / hardbyte/python-can

Query RX and TX buffer count

Abierto
#1,451 0 comentarios 0 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
Python
Estrellas
1.6k
Forks
697
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.