Getting started
Install
Section titled “Install”Each release has an
archive per platform holding pulzr-codec and engine.wasm, the JavaScript
engine, which it finds beside itself.
| Platform | Archive |
|---|---|
| Linux, x86_64 | pulzr-codec-v0.1.0-x86_64-unknown-linux-gnu.tar.gz |
| Linux, aarch64 (a Raspberry Pi 4 or 5, Graviton) | pulzr-codec-v0.1.0-aarch64-unknown-linux-gnu.tar.gz |
| macOS, Apple silicon | pulzr-codec-v0.1.0-aarch64-apple-darwin.tar.gz |
| Windows, x86_64 | pulzr-codec-v0.1.0-x86_64-pc-windows-msvc.zip |
curl -sSLO https://github.com/pulzar-net/pulzr-codec/releases/download/v0.1.0/SHA256SUMScurl -sSLO https://github.com/pulzar-net/pulzr-codec/releases/download/v0.1.0/pulzr-codec-v0.1.0-x86_64-unknown-linux-gnu.tar.gzsha256sum --check --ignore-missing SHA256SUMStar xzf pulzr-codec-v0.1.0-x86_64-unknown-linux-gnu.tar.gzOr the container image, ghcr.io/pulzar-net/pulzr-codec, which runs the
service.
Run a package’s examples
Section titled “Run a package’s examples”A codec package is a directory:
| File | |
|---|---|
device.json |
What the device is, and the libraries its codec uses |
decoder.js |
The codec |
examples/*.json |
Calls and what they must answer |
The repository’s examples/http-plug is one, a made-up plug with an HTTP API:
git clone https://github.com/pulzar-net/pulzr-codec./pulzr-codec-v0.1.0-x86_64-unknown-linux-gnu/pulzr-codec test pulzr-codec/examples/http-plugok status-answered.jsonok status-asks.jsonok switch-off.jsonok unreachable.jsonEach example ran through the codec exactly as the service runs it: the same engine, the same host API, the same limits. Testing a codec explains the example format; Codecs explains how to write one.
One call
Section titled “One call”run makes a single call and prints the codec’s whole answer:
echo '{"bytes": [8, 162, 90], "fPort": 1}' > input.jsonpulzr-codec run customer decodeUplink decoder.js input.jsonThe first call’s answer goes to stdout, and each call’s time to stderr
(PULZR_LOOP=1 makes it one call).