View source: R/SeaSondeRCSSY.R
seasonder_read_reduced_encoded_data | R Documentation |
This function reads an array of numbers from a binary connection using a custom command-based protocol.
A block of data is processed according to its size specified in key$size
. Within the block, the first byte read
is a command byte that determines how the subsequent bytes are interpreted. The function updates a running "tracking
value" based on the commands encountered and returns a vector of decoded numbers. The supported commands are:
seasonder_read_reduced_encoded_data(connection, key, endian = "big")
connection |
A binary connection from which the encoded data is read. |
key |
A list containing a field |
endian |
A character string specifying the byte order; either |
Read 4 bytes as an unsigned 32-bit integer.
Read one count byte, then (count+1) unsigned 32-bit integers.
Read 3 bytes as a 24-bit signed integer; add its value to the current tracking value.
Read one count byte, then (count+1) 24-bit signed integers; sequentially add each to the tracking value.
Read 1 byte as a signed 8-bit integer; add it to the tracking value.
Read 2 bytes as a signed 16-bit integer; add it to the tracking value.
Read one count byte, then (count+1) signed 16-bit integers; sequentially add each to the tracking value.
Read one count byte, then (count+1) signed 8-bit integers; sequentially add each to the tracking value.
A 24-bit signed integer is computed by reading 3 bytes and then adjusting the value by subtracting 16777216 if the computed value is greater than or equal to 8388608 to account for the two's complement representation.
An integer vector containing the decoded numbers.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.