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

All read() methods mixing incomming data from multiple connection to one stream #15

Open
tprochazka opened this issue Jan 3, 2015 · 4 comments

Comments

@tprochazka
Copy link

ESP8266 support multiple incoming connection which is recognizable by "id" in "+IPD,id,length" string.
Problem is that main class directly import Stream interface which is designed handle only one stream.

Related discussion on fix proposal: #14
#14 (comment)

@Diaoul
Copy link
Owner

Diaoul commented Jan 3, 2015

You can subclass the ESP8266 class to achieve what you want or create a wrapper or use @lasselukkari's ESP8266Server class.
The ESP8266 class does not aim to abstract this behavior.

I don't see why you absolutely want the Stream interface to be bound to one id in particular in the low level library. At the low level we see only one Stream: the Serial one so ESP8266 reflects that.

@tprochazka
Copy link
Author

I only want to avoid mix two incoming requests and have possibility to reply to booth of them.
This is currently not possible.
But if you are OK with it, I will keep my fork. My changes are small so I think that I'm able to live with this and keep it updated by changes from you.

@lasselukkari's ESP8266Server class has this some problem, it doesn't solve this problem.

@Diaoul
Copy link
Owner

Diaoul commented Jan 3, 2015

Why no add a readPacket method that reads exactly one IPD block?

@tprochazka
Copy link
Author

I already wrote, that new method like availablePacket() should be enough.
Rename current available to availablePacket() and original available will simply call _serial->available()
So available() will be in sync with data() and for waiting for next block will be used new method.

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