Skip to content
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

Request/Response model #23

Open
ysinsane opened this issue May 24, 2022 · 3 comments
Open

Request/Response model #23

ysinsane opened this issue May 24, 2022 · 3 comments

Comments

@ysinsane
Copy link

Hi, it is possible to publish a API for request/response communication model?

@genemars
Copy link
Member

Can you explain further what you mean?

@ysinsane
Copy link
Author

ysinsane commented Jun 9, 2022

For example, I want to turn on a lightbulb. I send some bytes to a serial port.

bool TurnOn(){
    _serialportInput.send(...);
    // I need a response from serialport device
    var somebytes = _serialportInput.read();
    bool result = ParseBytes(somebytes);
    return result; 
}

Each command I send, I need a response. While I find it difficult to do so with this lib. Thanks for your kind reply and sorry for the vague description.

@genemars
Copy link
Member

genemars commented Jun 9, 2022

You can find an example in the README:

https://github.com/genielabs/serialport-lib-dotnet#example-usage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants