hardbyte / hardbyte/python-can

Query RX and TX buffer count

オープン
#1,451 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Python
スター
1.6k
フォーク
697
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。