Import Stream RTU - #269
Conversation
|
We can still keep the HardwareSerial constructors and cast the hwserial reference inside the constructor. It's not really necessary for me but the less technical users might benefit from backwards compatability. EDIT: This remark is completely up to you. I'm totally fine with "leaving it up to the user". I've got no other remarks. |
|
Thanks for the reading and comments. I considered offering the I will think again... |
|
what do you mean with |
|
Forget my last remark. The user already calls |
|
Surprise, surprise. I modified the RTU sources again to have different constructors for Did not work. I first got a division by zero reboot loop because the baud rate was zero at the time I called the interval calculation (huh?), but just safeguarded that with a default interval value without thinking further. And now got lots of errors with RTU... Reason is, the constructor for the RTU object gets called very early, if the objects are declared global. The Too bad, it would have been very convenient to only have a different constructor. The The final idea was to give the Would you like that better? It would open the opportunity to switch interfaces at run time, since every new |
|
I now have a version with the proposed shift of the I do not know how to judge the result. Positive:
Negative:
So we have two options:
Neither of both is appealing me much. |
|
I now created a static utility function But still we must require the users to call it correctly before the serial |
|
I'd say that is the cleanest solution (for now?). |
|
Thanks for checking. I did not find a better solution and at least it does require less diligence from the users. |
Preparing next release