@essense/iso-claim
v1.2.1
Published
Library & background program that implements the ISO address claim procedure for CANbus (i.e. for NMEA2000 devices)
Downloads
32
Maintainers
Readme
essense-iso-claim
Library & background program that implements the ISO address claim procedure for CANbus (e.g. for NMEA2000 devices)
Install
npm install @essense/iso-claim
Basic usage
const { createNode } = require('@essense/iso-claim');
const node = createNode('can0', {
// Required config:
preferAddress: 89,
supportedPGNs: [],
// Optional:
port: 8001,
deviceClass: 25,
deviceFunction: 130,
systemInstance: 0,
industryGroup: 4,
instanceLower: 0,
instanceUpper: 0,
manufacturerCode: 999,
uniqueNumber: Math.floor(Math.random() * Math.floor(2097151)),
certificationLevel: 0,
loadEquivalency: 1,
modelId: 'EsSense.AI Device',
modelSerialCode: 'Serial Number',
modelVersion: 'CANbus ISO address arbitration library',
productCode: 1337,
});
node.on('error', (err) => console.error('[error]', err.message));
node.on('connected', () => console.log('Connected to bus!'));
node.on('disconnected', () => console.log('Disconnected from bus!'));