Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

async transfer() method #28

Open
stephanbrunner opened this issue Jun 27, 2019 · 0 comments
Open

async transfer() method #28

stephanbrunner opened this issue Jun 27, 2019 · 0 comments

Comments

@stephanbrunner
Copy link

stephanbrunner commented Jun 27, 2019

It would be cool to have an async way to work with the bridge library to be able to use it in time sensitive application.
=> Ask for data, do something else, check if data arrived, get data.
=> or send command, return immediately.

My troubles solving the issue

I tried to implement something useful that could be pulled, but stumbled over too many problems. The major one was, that there seems to be a hard-coded 100ms latency in line 175 of Bridge.cpp if I get that right:

for ( ; retries < max_retries; retries++, delay(100), dropAll() /* Delay for retransmission */)

If I avoided that delay, the Bridge.begin() method seemed to have problems (because the 100ms after the execution of transfer() is missing?) and crashed. I might be completely wrong. All pretty unclear to me. Anyway, I run out of time and as transfer() is kind of the core method, had to write a Bridge independent solution (custom .py script sending data over serial).

Adding parameters for retry and delay

Adding more parameters wasn't an issue, but didn't really help, as the transfer() method is called from too many places that would have needed the extra parameters.

Maybe better like that?

It might need adjustable vars in specific libraries (for example the FileIO lib) that would speed up all transfer() calls through that library, while calls (for example through Bridge directly) would use the retry and delay features. Not sure if that's the best way to handle the issue...

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

No branches or pull requests

2 participants