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

Function extractInt16LE

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

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

(bytes, offset)

Source from the content-addressed store, hash-verified

131 * Extracts a 16-bit signed integer from byte array (little-endian).
132 */
133function extractInt16LE(bytes, offset) {
134 var value = bytes[offset] | (bytes[offset + 1] << 8);
135 return value > 32767 ? value - 65536 : value;
136}
137
138/**
139 * Extracts a 32-bit unsigned integer from byte array (little-endian).

Callers 1

nmea_2000.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected