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

Function extractInt32LE

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

129 * Extracts a 32-bit signed integer from byte array (little-endian).
130 */
131function extractInt32LE(bytes, offset) {
132 var value = bytes[offset] | (bytes[offset + 1] << 8) |
133 (bytes[offset + 2] << 16) | (bytes[offset + 3] << 24);
134 return value > 2147483647 ? value - 4294967296 : value;
135}
136
137//------------------------------------------------------------------------------
138// Frame Parser Function

Callers 1

mavlink.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected