MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / extractInt32LE

Function extractInt32LE

app/rcc/scripts/parser/js/nmea_2000.js:149–153  ·  view source on GitHub ↗

* Extracts a 32-bit signed integer from byte array (little-endian).

(bytes, offset)

Source from the content-addressed store, hash-verified

147 * Extracts a 32-bit signed integer from byte array (little-endian).
148 */
149function extractInt32LE(bytes, offset) {
150 var value = bytes[offset] | (bytes[offset + 1] << 8) |
151 (bytes[offset + 2] << 16) | (bytes[offset + 3] << 24);
152 return value > 2147483647 ? value - 4294967296 : value;
153}
154
155/**
156 * Extracts the PGN from a 29-bit CAN identifier.

Callers 1

nmea_2000.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected