hardbyte / hardbyte/python-can

Query RX and TX buffer count

Đang mở
#1,451 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Python
Star
1.6k
Fork
697
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.