The Protocol Analyzer SDK is used to create custom plugins for the Saleae Logic software. These plugins are used to decode protocol data from captured waveforms.
For this setup example, we will build the Sample Analyzer located here: https://github.com/saleae/SampleAnalyzer
The libraries required to build a custom analyzer are stored in the following git repo: https://github.com/saleae/AnalyzerSDK
You may either fork, clone, or download this repository. Forking is recommended if you plan to use version control or share your custom analyzer publicly.
Note - This repository contains a submodule. Be sure to include submodules when cloning, for example
git clone --recursive https://github.com/saleae/SampleAnalyzer.git.
If you download the repository from Github, the submodules are not included. In that case you will need to...
Download the AnalyzerSDK repository
Download the SampleAnalyzer repository
Place the AnalyzerSDK folder inside of the SampleAnalyzer folder
Once downloaded, run the script rename_analyzer.py. This script is used to rename the sample analyzer automatically. Specifically, it changes the class names in the source code, it changes the text name that will be displayed once the custom analyzer has been loaded into the Saleae Logic software, and it updates the visual studio project.
There are two names you need to provide to rename_analyzer. The first is the class name. For instance, if you are developing a SPI analyzer, the class names would be SPIAnalyzer, SPIAnalyzerResults, SPIAnalyzerSettings, etc. The file names would be similar, like SPIAnalyzer.cpp, etc.
All analyzer classes should end with "Analyzer," so the rename script will add that for you. In the first prompt after starting the script, enter "SPI". The analyzer suffix will be added for you. This needs to be a valid C++ class name - no spaces, it can't start with a number, etc.
Second, the script will prompt you for the display name. This will appear in the software in the list of analyzers after the plugin has loaded. This string can have spaces, since it will always be treated as a string, and not as the name of a class.
After that, the script will complete the renaming process and exit.
python rename_analyzer.pySPIMark's SPI Analyzer
The rename_analyzer.py script mentioned in the section above only works for the SampleAnalyzer used in this example. For any other analyzer, the rename_analyzer.py script will not work. To rename other analyzers, please follow the instructions shown in the article below.