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

Function extractInt16LE

app/rcc/scripts/parser/js/mavlink.js:116–119  ·  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

114 * Extracts a 16-bit signed integer from byte array (little-endian).
115 */
116function extractInt16LE(bytes, offset) {
117 var value = bytes[offset] | (bytes[offset + 1] << 8);
118 return value > 32767 ? value - 65536 : value;
119}
120
121/**
122 * Extracts a 16-bit unsigned integer from byte array (little-endian).

Callers 1

mavlink.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected