Hi all,
This might sound like a philosophic question but it’s not meant to be, I just want to do the right thing as I develop my next app.
I am thinking about the design of my second ASOC app that will be using data from a connected USB-serial port device, and thought I would ask some advice from the MacScripter gurus before I decide on my approach. From days of Googling and study of the various options, there seem to be 3 options for me to integrate serial port functionality into my app:
- Using Serialport X , which would involve adding it as scripting addition in my app’s bundle and possible ongoing maintenance if/when it breaks with new OS releases. I would also need to seamlessly handle basic notifications such as the device unplugged, or added though, that I don’t see in SPX, and I know this can stop things in their tracks when not handled in code properly.
- Use the AMserialport wrapper classes by adding them to my project and calling the Cocoa functions from my app
- Installing the pythong-oblective-C bridge and using pyserial from a python script/app, or possibly writing in ASOC and calling the pyserial functions from ASOC if that can even be done. (I can’t see me learning another language (python) though just to accomplish this.
The app will only write to the device in initial setup and when the user changes the config of the device, but the data coming from the device is what has me concerned with stability/reliability, in that it sends an ascii string from once per second to dozens of times per second, although only 30-50 characters per string.
Although the easiest of the 3 at first glance seems to be Sp X, the best design might be to use AMSerial and call the functions straight from Cocoa keeping in mind memory and error handling that seems to be automated somewhat with the latter… I would also need to learn to incorporate those function calls into ASOC. Being only my second app I would like to continue to work in ASOC and use the experience I gained before, and since the GUI is going to a huge challenge, I want to make sure I am taking the best approach with the underlying serial port functionality.
Any advice is much appreciated.
Jim