saleae / SaleaeSocketApi

The Saleae software includes a socket based interface for scripting and automation applications.
73 stars 35 forks source link

Documentation out of date? #4

Open jcwren opened 7 years ago

jcwren commented 7 years ago

The 'Logic Socket API Users Guide' states that all commands must be terminated with 0x00, but this appears not to be the case with 1.2.14. I'm unable to compile the test program, but telnetting to port 10429, I find that commands need to be terminated with 0x0d.

The 'GET_PERFORMANCE' command is returning NAK, rather than 100, 50, 33, 25, or 20.

The index does not have an entry for is_analyzer_complete.

It also appears there's no 'GET_VERSION' command to allow an application to determine what version of Logic is running.

Marcus10110 commented 7 years ago

1.2.14 does still require all commands to be null terminated. Reviewing the Logic software source, it shouldn't do anything until it receives a null character. I'm not sure how it's working. If you need help compiling this, feel free to post issues here or write into support.

Which device are you using? GET_PERFORMANCE only applies to the new Logic 8, Logic Pro 8, and Logic Pro 16. The original Logic, Logic16, and the new Logic 4 will all return NAK when they are the active device.

Also, performance settings only have an effect when both digital and analog channels are enabled at the same time. When only analog or only digital channels are enabled, all possible sample rates are available regardless of performance level. Performance is used as a filter for sample rates when analog and digital channels are enabled at the same time.

The idea is that for any given performance level (measured as a percentage of maximum USB throughput), the sample rate options should represent a tradeoff between analog priority or digital priority. However due the significantly higher bandwidth requirements of analog, this is not obvious, and something we want to re-tool.

The documentation is out of date, it's missing some of the newer commands, including is_analyzer_complete, stop_capture, close_all_tabs, and exit. We need to get this updated. Tim, who's working on support, is tied up with a board change for several of our products right now, but we're getting this in the backlog.

jcwren commented 7 years ago

I don't know why it works, either. I'm using TeraTerm's telnet client, and typing a command terminated with only a CR is executing it. I don't do the C# thing, so I'm not too worried about being able to compile.

I am curious why the original implementation would have chosen NUL as a terminator, instead of CR or LF. If that was actually enforced, it would pretty much prohibit using a telnet client for simple testing. It's also asymmetric, in that the reply from the socket is not NUL terminated. Not that I'm advocating changing it at this point, I can code to accommodate the behavior.

I have a Logic 16, so that explains why '''GET_PERFORMANCE''' doesn't work. It'd probably break other software at this point, but if a command isn't supported by a particular device, returning UNSUPPORTEDNAK would be nice.

Marcus10110 commented 7 years ago

Our plan is to replace the socket API with a new solution rather than change how it works significantly, since as it stands currently it doesn't support versioning. It has a lot of shortcomings, but to modify the existing one would break a lot of existing socket API implementations. Some of the socket commands will print out details to Logic's standard out when errors occur, which can be helpful for debugging, but it's not complete, and Logic's standard output is highly polluted with other debug information. We can't make public commitments yet to when new functionality will be complete - it's still pretty early stages right now. Feel free to check back for updates - contacting Saleae support has the fastest response.