Installation
Two things are needed to use the SDK: a client library in your preferred language, and a server to talk to.
The client library​
- Python
- NodeJS
- Rust
- C
pip install ikalogic-scanastudio
Python 3.10 or newer. The package is fully typed and ships py.typed, so mypy
and your editor see the whole API.
from ikalogic_scanastudio import ScanaStudio, Trigger
The client is synchronous: no async in the public API, and no event loop
to set up.
npm install @ikalogic/scanastudio
Node 20 or newer.
import { ScanaStudio, Trigger } from '@ikalogic/scanastudio';
The package ships both ESM and CommonJS builds with full TypeScript types, so
import and require both work.
Node 22 and later have a global WebSocket and need nothing else. On Node 20,
also install ws:
npm install ws
Without it, connect() throws because it can find no WebSocket implementation.
The package exposes a browser entry point that uses the platform WebSocket,
so a web page can drive a ScanaStudio server directly. Mind
the missing authentication
before you expose one.
cargo add scanastudio-client
Or in Cargo.toml:
[dependencies]
scanastudio-client = "0.2"
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
use scanastudio_client::{ScanaStudio, Trigger, DEFAULT_URL};
The Rust client is async, on tokio. Request and response types are available
under scanastudio_client::proto.
The C library is distributed as one archive:
ScanaStudio C API
One cross-platform archive: include/scanastudio.h, an example, and the prebuilt libraries for Windows (x86_64), Linux (x86_64) and macOS (universal). There is no per-platform download to choose from.
sha256
394610b8566cd0c7f53080ddadcb96df13a58eb89b5e8bafc8b3e8e781053ef5 The C library carries its own version number and is released independently of the ScanaStudio application.
Inside it:
include/scanastudio.h the header, always matching the libraries below
examples/capture.c capture on a demo device, decode, read the packets
examples/inspect.c open a .scana, describe it, seek its edges, measure
windows-x86_64/ scanastudio.dll, scanastudio.dll.lib, scanastudio.lib
linux-x86_64/ libscanastudio.so, libscanastudio.a
macos-universal/ libscanastudio.dylib, libscanastudio.a
Put the header and the library for your platform wherever your build expects them; the paths below are only an example.
cc -I/opt/scanastudio-sdk/include prog.c \
-L/opt/scanastudio-sdk/lib -lscanastudio -o prog
./prog
If the shared library is not on the loader's search path, point to it at run time:
LD_LIBRARY_PATH=/opt/scanastudio-sdk/lib ./prog
The header carries extern "C" guards, so C++ can include it unchanged.
The server​
Every client needs a server to connect to. There are two ways to have one.
Run ScanaStudio. The application starts its own server and your script can connect to it. This is the easiest way to start, and you can watch what your script does in the window.
Run the server on its own. The server binary is installed alongside the application and runs headless, with no window or display, which suits a lab machine or a CI runner:
| Platform | Where the installer puts it |
|---|---|
| Windows | %LOCALAPPDATA%\Programs\ScanaStudio\scanastudio-server.exe |
| Linux | <prefix>/bin/scanastudio-server — /usr/bin from the .deb or .rpm |
| macOS | /Applications/ScanaStudio.app/Contents/MacOS/scanastudio-server |
scanastudio-server
It listens on ws://127.0.0.1:4911. Move it with --listen or the
SCANASTUDIO_LISTEN environment variable:
scanastudio-server --listen 127.0.0.1:5000 # another port, still local only
scanastudio-server --listen 192.168.1.20:4911 # one network interface only
scanastudio-server --listen 0.0.0.0:4911 # every interface
The protocol has no authentication. A server listening beyond loopback gives anyone who can reach the port full control of your instruments, and lets them write files on that machine. Read Remote and shared instruments before you open it up.
Linux: device permissions​
On Linux, a device is visible but not openable until the udev rules are
installed. The .deb, the .rpm and the tarball's install.sh all place
60-ikalogic.rules in /etc/udev/rules.d for you.
If a device appears in devices() but refuses to open, the rules are usually
missing (install.sh --no-udev, or an install without root). Re-run the
installer, or copy the rules file by hand and reload:
sudo udevadm control --reload-rules && sudo udevadm trigger
Checking it works​
You do not need hardware. Every server offers demo devices:
- Python
- NodeJS
- Rust
- C
from ikalogic_scanastudio import ScanaStudio
with ScanaStudio.connect() as server:
print(server.info)
for device in server.devices():
print(" ", device)
import { ScanaStudio } from '@ikalogic/scanastudio';
const server = await ScanaStudio.connect();
console.log(server.info);
for (const device of await server.devices()) console.log(' ', device.key);
server.close();
use scanastudio_client::{ScanaStudio, DEFAULT_URL};
#[tokio::main]
async fn main() -> scanastudio_client::Result<()> {
let server = ScanaStudio::connect(DEFAULT_URL).await?;
println!("{:?}", server.info());
for device in server.devices().await? {
println!(" {}", device.key);
}
Ok(())
}
#include <stdio.h>
#include "scanastudio.h"
int main(void) {
ss_server *server = ss_server_connect(NULL);
if (!server) { fprintf(stderr, "%s\n", ss_last_error()); return 1; }
char *info = ss_server_info(server);
printf("%s\n", info);
ss_string_free(info);
char *devices = ss_server_devices(server);
printf("%s\n", devices);
ss_string_free(devices);
ss_server_disconnect(server);
return 0;
}
You should see the server's version and at least one demo device. se254 is
the one used throughout this documentation.
If connect fails with a protocol version mismatch, the SDK and the server are
out of step. Update whichever is older.
Next: your first capture.