Im working on a Terminal program which is overall working fine. One weird thing coming up to me is that: SerialConnection1.Baud = 9600 is working fine on Windows and Mac but not on Linux (Ubuntu 18.04)
Linux seems only to accept :
SerialConnection1.Baud = SerialConnection.Baud9600
or
SerialConnection1.Baud = 8 (as defined by Xojos list)
This is sad and will not allow using the same code on all 3 OSs.
[quote=483271:@Farai Aschwanden]
Im working on a Terminal program which is overall working fine. One weird thing coming up to me is that: SerialConnection1.Baud = 9600 is working fine on Windows and Mac but not on Linux (Ubuntu 18.04)
[/code]
I’m surprised setting it to 9600 works at all anywhere
Use the symbolic constants - it will save you from wondering what the heck 8 means later on
And IF Xojo should ever change those to something else then your code would update and use whatever they redefine it as instead of just breaking because you stuck 8 in there
ie/ suppose they change SerialConnection.Baud9600 to 9600 instead of 8
if Baud actually is the baud rate (and not an index into a list like it is now) then your app, when recompiled, might run at 8 baud if you use a hard coded 8 instead of the symbolic value
[quote=483271:@Farai Aschwanden]
Can someone confirm this and why this is so?[/quote]
No idea why Ubuntu would be out to lunch here
Tnx for the answer and I completely agree! The “problem” I have by the symbolic constants (which is working on all 3 OSs) is that in my program you can choose/change the Baud rate in a Popup list in which I have all supported Baud rates listed.
Now the sad point: How do I come from the chosen Popup list value (i.e. 9600) value to the symbolic constant (Baud9600) in order to set it?
Sure, I could create a SELECT/CASE statement over all 16 possible values in order to set the constant value. But this would be a joke.
Currently Im filling up the Popup list with Tags representing the values (0-15).
This would all be obsolete if Linux would support SerialConnection1.Baud = 9600 (could then assign the value from the Popup list).
I was not aware of Serial != ConnectionSerial as the documentation says:
This item was deprecated in version 2019r2.
Please use SerialConnection as a replacement.
Tbh whenever there is a deprecation of a function I try to remove it by it’s replacement - asap. Otherwise I forget it and any other day compiling the code wont work as the deprecated function was removed.
I do get error messages/codes back with SeriallConnect, so (so far) it’s fine for me, all good. Nevertheless good to know there are open issues, tnx!