npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

isobus-name-resolver-ts

v0.12.14

Published

Simple tool to parse an isobus name hexstring and split it into its components.

Downloads

14

Readme

isobus-name-resolver-ts

Build Node.js package NPM package version NPM downloads License

The ISOBUS (ISO 11783) standard specifies a serial data network for control and communications on forestry and agricultural machines. Every control function in an ISOBUS network has a unique NAME (defined in ISO 11783-5) that contains information on that function, such as a manufacturer code and a device class

isobus-name-resolver-ts is a typescript library for parsing such a ISOBUS NAME and providing its seperate fields as raw values, as well as corresponding labels if available

Usage

Installation

The package can be installed via npm:

npm install isobus-name-resolver-ts

Example

In order to parse an ISOBUS NAME, simply instantiate an object of the class IsobusName with the NAME in hexadecimal notation or as a buffer as the only parameter

import {IsobusName} from 'isobus-name-resolver-ts';

const hexInput = 'A01284000DE0C3FF';
const isobusName = new IsobusName(hexInput);

console.log(isobusName.toString());
/* OUTPUT:
 * -------------
 * ISOBUS Name String: A01284000DE0C3FF
 * Device Class: Forage (9)
 * Manufacturer Code: Bernard Krone Holding SE & Co. KG (formerly Maschinenfabrik Bernard Krone GmbH) (111)
 * Identity Number: 50175
 * ECU Instance: 0
 * Function Instance: 0
 * Function: Forage Machine Control (132)
 * Device Class Instance: 0
 * Industry Group: Agricultural and Forestry Equipment (2)
 * Self Configurable Address: true
*/

Attention: this package uses the browser compatible buffer instead of the node.js buffer. In order to instantiate an IsobusName by a Buffer object, this package has to be used, e.g.:

// tell node js to use external package 'buffer' by adding trailing slash
import {Buffer} from 'buffer/';
let buf = Buffer.from("A01284000DE0C3FF", "hex");
let isoName = new IsobusName(buf);

API

Class IsobusName:

| Method | return value | description | |---------------------------------------|----------|--------------------------------------------------------------------------------------------------------| |toString() | string | returns a human readable string representation of all parts of the ISOBUS NAME | |getDeviceClass() | number | returns the raw device class value (sometimes called vehicle system) | |getDeviceClassLabel() | string | returns the device class description of the device class in the given industry group | |getDeviceClassInstance() | number | returns the device class instance | |getManufacturerCode() | number | returns the raw manufacturer code value (sometimes called manufacturer id) | |getManufacturerCodeLabel() | string | returns the manufacturer name of the manufacturer | |getIdentityNumber() | number | returns the identity number assigned by the manufacturer | |getEcuInstance() | number | returns the ecu instance | |getFunction() | number | returns the raw function value | |getFunctionLabel() | string | returns the function description of the function in the given device class in the given industry group | |getFunctionInstance() | number | returns the function instance | |getIndustryGroup() | number | returns the raw industry group value | |getIndustryGroupLabel() | string | returns the industry group description | |getSelfConfigurableAddress() | number | returns the raw self-configurable address value (either 1 or 0) | |getSelfConfigurableAddressLabel() | string | returns either 'true' or 'false' (string) wether the the CF is self-configurable or not | |getIsoNameString() | string | returns the raw ISOBUS NAME string used to instantiate the object |


Development

Local Development

At first the dependencies should be installed using:

npm install

For all functions returning a label, the isobus-name-resolver relies on the external data from isobus.net, so before being able to build the package locally, the ISOBUS Parameters have to be exported from this page (direct download link). The downloaded zip file has to be extracted into the /isoExport folder of this project. The resulting CSV files can be transformed into the needed JSON file (/src/isoData.json) by executing:

npm run translate-iso-export

Afterwards, the package can be built (transpiled) using:

npm run tsc

This will create the source files of the npm package in /dist.

The last two commands can be combined by:

npm run build

Automated build

The package is automatically built, versioned and published using github actions on the following occasions:

  • A Push on master, e.g when a pull request is merged -> minor version increase
  • Scheduled two times a week (Sundays and Thursdays) only if the exported ISOBUS parameters changed -> patch version increase

The needed isobus.net export is downloaded automatically as well