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
Or with Bun:
bun add @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
the client uses the ws package. ws is an optional dependency of
@ikalogic/scanastudio, so npm installs it by default. If your install skips
optional dependencies (--omit=optional), add it yourself:
npm install ws
Without it, connect() throws because it can find no WebSocket implementation.
To use another implementation, pass its constructor to
ScanaStudio.connect_with(Impl, url, options).
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
b3689fc384709dc4932260f1ad0daab67e6fc9f0fba720f9403f823e27c9c40a The C library carries its own version number and is released independently of the ScanaStudio application.
The archive is published as scanastudio-c-<version>.zip. The same file is
also available under the fixed name ScanaStudio-C-API.zip, which always points
to the latest release, and c-latest.json next to it gives that release's
version, date, file name and SHA-256.
Inside it:
README.md linking instructions
LICENSE MIT
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 (x86_64 + arm64)
Each platform ships a shared library and a static one. On Windows,
scanastudio.dll.lib is the import library for scanastudio.dll, and
scanastudio.lib is the static library.
From the root of the unpacked archive:
cc -Iinclude prog.c -Llinux-x86_64 -lscanastudio -o prog # Linux
cc -Iinclude prog.c -Lmacos-universal -lscanastudio -o prog # macOS
cl /Iinclude prog.c windows-x86_64\scanastudio.dll.lib
At run time the shared library must be found: LD_LIBRARY_PATH on Linux,
DYLD_LIBRARY_PATH on macOS, and next to the executable on Windows.
LD_LIBRARY_PATH=linux-x86_64 ./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.