I've been moving off of OS X to Ubuntu (18.04) and ran into problems when trying to compile v4.0. Some of the string functions used are specific to *BSD systems so LIBBSD is required. I added a compile pragma to test for Linux to set the correct include paths. Make sure you have the headers installed (LIBBSD-DEV).
I also ran into a problem with stream reads. When reading a response from the GPIB device (Prologix USB adapter) an extra line feed exists. Example: <string><LF><LF>. This didn't happen on BSD platforms. So display fields would be blank or have the wrong data.
Not sure what is doing this or if there's a setting to correct? Ideas welcome.
The workaround during a read is to ignore a null (LF only) string. Using the above example the behavior is now: read string to LF, process & return, leaving second LF in stream (unread). On next read call the LF is consumed & ignored, and reading continues until a non-null string is read or timeout value is reached. This seams to work well and shouldn't have any adverse consequences except in situations where a null (LF only) return is expected. So far I haven't run into this with my gear.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.