-
Notifications
You must be signed in to change notification settings - Fork 7
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
startStreaming() using Stream class #9
Comments
Thinking about this more: I think the code/ideas from option 2 should be integrated into Commander, so when streaming mode is enabled, the code using streaming can use |
It was surprisingly easy to add this feature. I barely used any of the code I wrote over the last day and a half, but used plenty of the knowledge I had gained by doing that otherwise useless exercise. I can now use I deleted a lot of |
THanks, that looks great. I will try and find some time over the next week to have a good look through and make sure I've understood it all properly, then look at how to integrate it all. Incidentally, I have just figured out a way of adding an extra help system, I'm just testing it out. I added a char array pointer so you can add an array of strings and changed how internal help commands are handled. If the internal handler sees that the help command has a payload it will check if the payload is a command and if so it will try and print out the contents of the extra help array, at the index that matches the command. The extra help array needs to have the same number of elements as the command list, and I haven't made it work with multiple command sets yet, but if gives users a way of adding more detailed help text - if you have a command called 'configure', you can send 'help configure' to get the detailed help file for that command. |
The extra help system seems like a great feature. In the meantime while you look at my prototype code I'll clean up my prefab and share it so you can see how a prefab (with streaming) would look and work with the new structure |
I pushed an unfinished (but working) PrefabFileExplorerFS example to my branch, showing how a prefab might look with the new structure Next up is to see if I can integrate support for navigating two filesystems just by adding two instances of the same class to the sketch |
What development board did you use for creating your PrefabFileExplorer example? |
I think it was probably an Adafruit Feather M0 Adalogger. |
I've been playing with your new version that inherits from Stream. It works perfectly so I will probably go ahead and integrate that into a new release along with the extended help system before anything else. |
Glad it's working for you. Making the array non-const does open up more possibilities but we'd want to make sure it doesn't cause extra RAM usage by putting const strings into RAM or using extra RAM/Flash for strings in a class that is instantiated multiple times. I should mention BTW I see from your LinkedIn profile we're not too far away, I'm in Cambridge. (I have no idea what my profile says, I don't keep it up to date) |
Yes - Its an option for people to use if they want and probably best for top end microcontrollers with lots of RAM, and I'm putting these examples in a folder called 'advanced'. |
I've just pushed some of these updates to the repo. I'm not issuing it as a release yet, but let me know what you think. I have included a working example of a dynamically created command list. |
I skimmed your commit but didn't have time to really look at any examples over the last few days. I'm focusing on adding LittleFS compatibility to my premod with the little free time I have right now. LMK if there's any specific example you want me to check out. |
I'm finally taking a look at your latest commits and examples in a bit more detail. Some questions and comments as they arise:
|
Yes - I need to be better at removing my own ideosyncracies from finished code. |
I'm trying to add YMODEM receive to my project using this library (my fork which allows for setting the Stream port instead of using hardcoded Serial). I can't use the existing streaming options in Commander directly, as the library depends on receiving data via a Stream. I don't really want to modify the library just to work with Commander. I imagine there are more libraries using Stream that could be included in future prefabs, so I'd rather find a good solution to this problem than hack together support for one library to solve my immediate problem.
I see two options here:
inPort
, and lets other code use it untilstopStreaming()
is called!dataStreamMode
as the other code could read from the Stream before Commander gets a chance to look for 0x04PairedPipedStream
from this library (my fork where I modified it to optionally output to a Stream on one end automatically). Commander can inspect each byte, and load it into one end of aPairedPipedStream
. The other code can read from the other end as if it were reading directly frominPort
(though Commander decides when to stop streaming data), and whatever it writes gets automatically written tooutPort
.PairedPipedStream
has a fixed buffer, but with a little extra code we could dynamically resize the buffer.I only thought of the much simpler option 1 after doing all the work upgrading
PairedPipedStream
and prototyping option 2 and getting YMODEM receive to work. At this point I think the remaining work for option 1 and 2 are about the same.LMK if you have some thoughts on these options, or want more details on anything
The text was updated successfully, but these errors were encountered: