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

Function extractInt16BE

app/rcc/scripts/parser/js/sirf_binary.js:121–124  ·  view source on GitHub ↗

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

(bytes, offset)

Source from the content-addressed store, hash-verified

119 * Extracts a 16-bit signed integer from byte array (big-endian).
120 */
121function extractInt16BE(bytes, offset) {
122 var value = (bytes[offset] << 8) | bytes[offset + 1];
123 return value > 32767 ? value - 65536 : value;
124}
125
126/**
127 * Extracts a 32-bit unsigned integer from byte array (big-endian).

Callers 1

sirf_binary.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected