0.12.14 • Published 6 months ago

isobus-name-resolver-ts v0.12.14

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
6 months ago

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:

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

0.12.14

6 months ago

0.12.12

8 months ago

0.12.13

7 months ago

0.12.11

8 months ago

0.12.10

9 months ago

0.12.9

2 years ago

0.12.8

2 years ago

0.12.7

2 years ago

0.12.6

2 years ago

0.12.5

2 years ago

0.12.4

3 years ago

0.12.3

3 years ago

0.12.2

3 years ago

0.12.1

3 years ago

0.12.0

4 years ago

0.11.6

4 years ago

0.11.5

4 years ago

0.11.4

4 years ago

0.11.3

4 years ago

0.11.2

4 years ago

0.11.1

4 years ago

0.11.0

4 years ago

0.10.1

4 years ago

0.10.0

4 years ago

0.9.2

4 years ago

0.9.1

4 years ago

0.9.0

4 years ago

0.8.0

4 years ago

0.7.0

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago