-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add: Automatic function generation for get,set and control #31
Conversation
build/parser.rs
Outdated
} | ||
} | ||
impl Device { | ||
pub fn new(port: tokio_serial::SerialStream) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not use serial, but an abstraction over io. This should work with serial, tcp, udp and file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check proposal
…heir required associate methods
5f34b08
to
34ff863
Compare
…r Ping1D and Ping360
@patrickelectric @joaoantoniocardoso |
@patrickelectric |
Requirements:
This PR adds an enum 'category' to make it easier to compose each kind of function.
All the functions related to ping1d/ping360 are now auto-generated.
The functions' set has the parameters exactly as "Set-any-structures". Each set function has a subscriber which waits until receiving its corresponding Ack code or error.
Each setting function simply sends the corresponding request (Ack codes after setting request weren't observed). Each get function has its own subscriber that waits to match the corresponding structure. Functions also have their descriptions.
All the logic towards sending, subscribing, receiving with ack check, and timeout remains the same and is defined in PingDevice.
The Ping1D has been moved to a builder and is now ping1d::Device. ping1D::Device is reimported as Ping1D, as is Ping360 which actually has all functions attached to it.
Next steps: