Skip to content

A utility for generating parsers suitable for Chirpstack v3 and Chirpstack v4 using binary-parser

Notifications You must be signed in to change notification settings

Lezvix/binary-parser-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binary Parser Tool

A utility for generating parsers suitable for Chirpstack v3, Chirpstack v4, and more, using binary-parser

How to use

Define a parser for each LoRa device fPort

// ./src/my-parser.ts
import { Parser } from "binary-parser"
export const parser = new Parser()
    .endianness("big")
    ...

Generate Chirpstack v3 and v4 decoders in your parser distribution pipeline

// ./tools/chirpstack-pipeline.ts
import fs from "fs/promises";
import {
    generateChirpstackV4,
    generateChirpstackV3,
    LoraParsers
} from "binary-parser-tool";
import { parser } from "../src/my-parser";

const parsers: LoraParsers = {
    2: parser,
};

const [v4, v3] = await Promise.all([
    generateChirpstackV4(parsers),
    generateChirpstackV3(parsers),
]);

await Promise.all([
    fs.writeFile("./dist/chirpstack-v4-decoder.js", v4),
    fs.writeFile("./dist/chirpstack-v3-decoder.js", v3)
]);

How to install

npm install https://github.com/Lezvix/binary-parser-tool.git

About

A utility for generating parsers suitable for Chirpstack v3 and Chirpstack v4 using binary-parser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published