libRBR
v1.2.3
RBR instrument communication API
|
Instrument commands and structures pertaining to memory and data retrieval. More...
Go to the source code of this file.
Data Structures | |
struct | RBRInstrumentMemoryInfo |
Instrument meminfo command parameters. More... | |
struct | RBRInstrumentData |
Instrument readdata command parameters. More... | |
struct | RBRInstrumentPostprocessingChannelsList |
struct | RBRInstrumentPostprocessing |
The instrument post-processing configuration. More... | |
Macros | |
#define | RBRINSTRUMENT_POSTPROCESSING_CHANNEL_MAX 24 |
The maximum number of channels which can be generated by a post-processing job. | |
Functions | |
const char * | RBRInstrumentDataset_name (RBRInstrumentDataset dataset) |
Get a human-readable string name for a dataset. More... | |
RBRInstrumentError | RBRInstrument_getMemoryInfo (RBRInstrument *instrument, RBRInstrumentMemoryInfo *memoryInfo) |
Get information about the usage and characteristics of data memory. More... | |
RBRInstrumentError | RBRInstrument_readData (RBRInstrument *instrument, RBRInstrumentData *data) |
Request a chunk of binary data from instrument data memory. More... | |
RBRInstrumentError | RBRInstrument_memoryClear (RBRInstrument *instrument) |
Clear the data storage area of the flash memory. More... | |
const char * | RBRInstrumentMemoryFormat_name (RBRInstrumentMemoryFormat format) |
Get a human-readable string name for a memory format. More... | |
RBRInstrumentError | RBRInstrument_getAvailableMemoryFormats (RBRInstrument *instrument, RBRInstrumentMemoryFormat *memoryFormats) |
Report a list of available memory formats. More... | |
RBRInstrumentError | RBRInstrument_getCurrentMemoryFormat (RBRInstrument *instrument, RBRInstrumentMemoryFormat *memoryFormat) |
Get the current memory format. More... | |
RBRInstrumentError | RBRInstrument_getNewMemoryFormat (RBRInstrument *instrument, RBRInstrumentMemoryFormat *memoryFormat) |
Get the memory format to be used for the next deployment. More... | |
RBRInstrumentError | RBRInstrument_setNewMemoryFormat (RBRInstrument *instrument, RBRInstrumentMemoryFormat memoryFormat) |
Set the memory format to be used for the next deployment. More... | |
const char * | RBRInstrumentPostprocessingAggregate_name (RBRInstrumentPostprocessingAggregate function) |
Get a human-readable string name for an aggregate function. More... | |
const char * | RBRInstrumentPostprocessingStatus_name (RBRInstrumentPostprocessingStatus status) |
Get a human-readable string name for a post-processing status. More... | |
const char * | RBRInstrumentPostprocessingCommand_name (RBRInstrumentPostprocessingCommand command) |
Get a human-readable string name for a post-processing command. More... | |
const char * | RBRInstrumentPostprocessingBinFilter_name (RBRInstrumentPostprocessingBinFilter filter) |
Get a human-readable string name for a post-processing bin filter. More... | |
RBRInstrumentError | RBRInstrument_getPostprocessing (RBRInstrument *instrument, RBRInstrumentPostprocessing *postprocessing) |
Get the instrument post-processing settings. More... | |
RBRInstrumentError | RBRInstrument_setPostprocessing (RBRInstrument *instrument, const RBRInstrumentPostprocessing *postprocessing) |
Set the instrument post-processing settings. More... | |
RBRInstrumentError | RBRInstrument_setPostprocessingCommand (RBRInstrument *instrument, RBRInstrumentPostprocessingCommand command, RBRInstrumentPostprocessingStatus *status) |
Exercises control over the post-processing state. More... | |
uint16_t | calculateCrc (const void *data, int32_t size) |
Calculate the 16-bit CRC using the CCITT polynomial f(x)=x^16+x^12+x^5+1 feeding bytes into the generator LSB first and using 0xFFFF as a seed value, is then transmitted. More... | |
Instrument commands and structures pertaining to memory and data retrieval.
typedef struct RBRInstrumentData RBRInstrumentData |
Instrument readdata
command parameters.
typedef enum RBRInstrumentDataset RBRInstrumentDataset |
Possible instrument datasets.
As an internal implementation detail, the instrument reuses file identifiers (for standard and EasyParse data), and the identifiers are non-continuous (there is no dataset 3). To keep confusion to a minimum, we use those same identifiers here.
typedef enum RBRInstrumentMemoryFormat RBRInstrumentMemoryFormat |
typedef struct RBRInstrumentMemoryInfo RBRInstrumentMemoryInfo |
Instrument meminfo
command parameters.
typedef struct RBRInstrumentPostprocessing RBRInstrumentPostprocessing |
The instrument post-processing configuration.
Functions available to aggregate channel values within bins.
Post-processing bin filters.
Post-processing channel configurations.
Post-processing control commands.
Post-processing job statuses.
enum RBRInstrumentDataset |
Possible instrument datasets.
As an internal implementation detail, the instrument reuses file identifiers (for standard and EasyParse data), and the identifiers are non-continuous (there is no dataset 3). To keep confusion to a minimum, we use those same identifiers here.
Instrument memory formats.
Functions available to aggregate channel values within bins.
Post-processing bin filters.
Post-processing control commands.
Post-processing job statuses.
uint16_t calculateCrc | ( | const void * | data, |
int32_t | size | ||
) |
Calculate the 16-bit CRC using the CCITT polynomial f(x)=x^16+x^12+x^5+1 feeding bytes into the generator LSB first and using 0xFFFF as a seed value, is then transmitted.
[in] | data | the data string used to calculate the CRC |
[in] | size | the number of characters in the string used to calculate the CRC |
RBRInstrumentError RBRInstrument_getAvailableMemoryFormats | ( | RBRInstrument * | instrument, |
RBRInstrumentMemoryFormat * | memoryFormats | ||
) |
Report a list of available memory formats.
memoryFormats will be treated as a bit field representation of available memory formats as defined by RBRInstrumentMemoryFormat. For details, consult Working with Bit Fields.
[in] | instrument | the instrument connection |
[out] | memoryFormats | available memory formats |
RBRInstrumentError RBRInstrument_getCurrentMemoryFormat | ( | RBRInstrument * | instrument, |
RBRInstrumentMemoryFormat * | memoryFormat | ||
) |
Get the current memory format.
Retrieves the format of the data presently stored in memory, either for a deployment in progress or for one which has finished. If the memory is completely empty because it has been cleared, the response will be RBRINSTRUMENT_MEMFORMAT_NONE.
[in] | instrument | the instrument connection |
[out] | memoryFormat | the current memory format |
RBRInstrumentError RBRInstrument_getMemoryInfo | ( | RBRInstrument * | instrument, |
RBRInstrumentMemoryInfo * | memoryInfo | ||
) |
Get information about the usage and characteristics of data memory.
RBRInstrumentMemoryInfo.dataset must be set to the index of the dataset for which information is to be retrieved.
[in] | instrument | the instrument connection |
[in,out] | memoryInfo | data memory information |
RBRInstrumentError RBRInstrument_getNewMemoryFormat | ( | RBRInstrument * | instrument, |
RBRInstrumentMemoryFormat * | memoryFormat | ||
) |
Get the memory format to be used for the next deployment.
[in] | instrument | the instrument connection |
[out] | memoryFormat | the new memory format |
RBRInstrumentError RBRInstrument_getPostprocessing | ( | RBRInstrument * | instrument, |
RBRInstrumentPostprocessing * | postprocessing | ||
) |
Get the instrument post-processing settings.
[in] | instrument | the instrument connection |
[out] | postprocessing | the post-processing parameters |
RBRInstrumentError RBRInstrument_memoryClear | ( | RBRInstrument * | instrument | ) |
Clear the data storage area of the flash memory.
Currently, all datasets are erased, regardless of the data storage format in use.
[in] | instrument | the instrument connection |
RBRInstrumentError RBRInstrument_readData | ( | RBRInstrument * | instrument, |
RBRInstrumentData * | data | ||
) |
Request a chunk of binary data from instrument data memory.
When calling RBRInstrument_readData(), data must be populated:
Upon return, data will have been modified so that the dataset, size, and offset reflect the the instrument response. Be sure to check the reported size as it may differ from the requested size, especially when the instrument is busy or if you're reading the last chunk of the dataset.
For example:
A communication error will be reported if the offset in response doesn't match request. A checksum error will be reported if the CRC check of the read data fails. However, data will still faithfully reflect the response parameters and data. Be sure to check the return value lest you accidentally consume invalid/corrupt data!
[in] | instrument | the instrument connection |
[in,out] | data | the instrument data |
RBRInstrumentError RBRInstrument_setNewMemoryFormat | ( | RBRInstrument * | instrument, |
RBRInstrumentMemoryFormat | memoryFormat | ||
) |
Set the memory format to be used for the next deployment.
Hardware errors may occur if:
[in] | instrument | the instrument connection |
[in] | memoryFormat | the new memory format |
RBRInstrumentError RBRInstrument_setPostprocessing | ( | RBRInstrument * | instrument, |
const RBRInstrumentPostprocessing * | postprocessing | ||
) |
Set the instrument post-processing settings.
Hardware errors may occur if:
[in] | instrument | the instrument connection |
[in] | postprocessing | the post-processing parameters |
RBRInstrumentError RBRInstrument_setPostprocessingCommand | ( | RBRInstrument * | instrument, |
RBRInstrumentPostprocessingCommand | command, | ||
RBRInstrumentPostprocessingStatus * | status | ||
) |
Exercises control over the post-processing state.
Hardware errors may occur if:
[in] | instrument | the instrument connection |
[in] | command | the post-processing command |
[out] | status | the post-processing status after executing the command |
const char* RBRInstrumentDataset_name | ( | RBRInstrumentDataset | dataset | ) |
Get a human-readable string name for a dataset.
Contrary to convention for values returned by other enum _name
functions, instances of “EasyParse” found in the names returned by this function are capitalized: “EasyParse sample data” instead of “easyparse sample data”. And, because the standard and EasyParse sample data datasets share an identifier, “standard or EasyParse data” is returned for that value.
[in] | dataset | the dataset |
const char* RBRInstrumentMemoryFormat_name | ( | RBRInstrumentMemoryFormat | format | ) |
Get a human-readable string name for a memory format.
[in] | format | the memory format |
const char* RBRInstrumentPostprocessingAggregate_name | ( | RBRInstrumentPostprocessingAggregate | function | ) |
Get a human-readable string name for an aggregate function.
For consistency with the instrument command language, returns “count”, not “sample count”, for RBRINSTRUMENT_POSTPROCESSING_AGGREGATE_SAMPLE_COUNT. The value name only includes _SAMPLE
to disambiguate between the aggregate function and the value which is the count of valid values, RBRINSTRUMENT_POSTPROCESSING_AGGREGATE_COUNT.
[in] | function | the aggregate function |
const char* RBRInstrumentPostprocessingBinFilter_name | ( | RBRInstrumentPostprocessingBinFilter | filter | ) |
Get a human-readable string name for a post-processing bin filter.
[in] | filter | the post-processing bin filter |
const char* RBRInstrumentPostprocessingCommand_name | ( | RBRInstrumentPostprocessingCommand | command | ) |
Get a human-readable string name for a post-processing command.
[in] | command | the post-processing command |
const char* RBRInstrumentPostprocessingStatus_name | ( | RBRInstrumentPostprocessingStatus | status | ) |
Get a human-readable string name for a post-processing status.
[in] | status | the post-processing status |