Oh - I ran into multiple other problems, but finally I just got sending of file to work pretty much perfectly. I have limited size of block to 10000 bytes, but using high value like that might not be that fast after all, when there is a single mismatched byte in block, same block needs to be resent and sending 10000 bytes takes time. But I wanted to make this library public as there's a lot of work on this--
It propably could have even bigger blocks without problem, but I hit the limit on my test project where I had my virtual file
char [12000] vFile;
So couldn't test how far this can go as stable.. Limitations can be easily changed by changing defines..
And when completed, it can be used on numerous projects, and not just projects that use rs485 as this library can be used for serial protocol as well, for serial it just has few features that are not necessary (point-to-point connection support). But anyhow, this should help transfer all kinds of sensor data and even bigger data like files.
Library in its's self brings only few commands to the protocol, but brings features instead that user can map to protocol of his/her own..
So, I didn't want to limit this to suite only my needs, I'll rather let others to get a bit easier.. Ofcourse, I ain't a professional coder, I am a truck driver, time is always issue for me because of long days at work and I might find myself often tired- so my code propably ain't the best choice, but if I get this done- people can always fork my project to bring their own..
Anyway, sometimes I just feel that I hit the spot that I can't find what's wrong with my code- and I don't think that asking for help is a bad thing if you don't want to keep the code all by yourself.. And sometimes.. It's just that a small motivation or idea out of the box, even when very simple.. Get's you going.
Anyway, now it's time to start the work with receiving file- I've got a unit with tft display and I want to send a image file on it, so there must be bidirectional transmission support. And ofcourse, there's other people who might find it useful.. And then I need to start cleaning up and making my master code that is ran on a real computer- to bit better, now it's awful :) but it's just for testing purposes, so that doesn't matter..
---
Oh, I am using pointers again..