Comments (4)
The polling should be non-blocking (that's why it's designed to have 0 bytes returned).
The scheme was designed to fit into simple embedded main loop programs where the whole program is run periodically at (say) 10ms. Or in a task in an RTOS where some part of the application runs periodically.
Typically you would have a UART interrupt handler to pick up bytes and put them into a buffer, then poll the buffer. The polling periodicity needed is derived from a combination of buffer size and baud rate, so that the polling is fast enough for the buffer not to overflow. So you can make the buffer big enough to fit a convenient polling period, or you can make a polling period fast enough to empty the buffer before overflow. I would shoot for something like a 10ms polling period and see how that fits.
from min.
Thanks,
Another question,
If the read serial port fails, min_poll will poll the last data frame, but if the underlying serial port interface called by internal on_wire_bytes fails to send data, will this affect the internal state machine? Since the library does not have an error handling mechanism, I want to know this What should be done, such as calling min_transport_reset to reset the state machine
from min.
If the read fails then just have it produce no bytes. The protocol should catch that: the frame will fail its CRC because it will be missing data, the byte stuffing will cause a resync. The transport layer will spot the missing frame and retransmit.
from min.
Thanks , will do some more tests.
from min.
Related Issues (20)
- MIN protocol not working properly on TI MCUs but works on STM HOT 2
- Escape 0x03 (CTRL-C)
- Question regarding the signal layer json HOT 2
- Question: Is Data-Streaming Supported? HOT 2
- Ability to calculate CRC in HW HOT 1
- Time-based frame-delimiting HOT 4
- A Rust library for MIN. HOT 1
- Any port for C#? HOT 2
- STM32Cube USB VCP HOT 9
- Review Comments
- Received spurious ACK HOT 2
- Testing MIN with serial monitor HOT 2
- How to include in C++ project? HOT 1
- Possible bug in the code
- Multiple Ports HOT 2
- Memory conflict: Multiple MIN ports access the same payloads_ring_buffer HOT 2
- Time variable not initialized in transport_fifo_reset HOT 1
- Python package
- Python host vs target C implementations
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from min.