 |
libRBR
v1.2.3
RBR instrument communication API
|
Go to the documentation of this file.
11 #ifndef LIBRBR_RBRPARSER_H
12 #define LIBRBR_RBRPARSER_H
24 #define RBRINSTRUMENT_EVENT_AUXILIARY_DATA_MAX 4
50 RBRINSTRUMENT_EVENT_UNKNOWN_OR_UNRECOGNIZED_EVENT = 0x00,
51 RBRINSTRUMENT_EVENT_TIME_SYNCHRONIZATION_MARKER = 0x01,
52 RBRINSTRUMENT_EVENT_DISABLE_COMMAND_RECEIVED = 0x02,
53 RBRINSTRUMENT_EVENT_RUN_TIME_ERROR_ENCOUNTERED = 0x03,
54 RBRINSTRUMENT_EVENT_CPU_RESET_DETECTED = 0x04,
55 RBRINSTRUMENT_EVENT_ONE_OR_MORE_PARAMETERS_RECOVERED_AFTER_RESET = 0x05,
56 RBRINSTRUMENT_EVENT_RESTART_FAILED_RTC_CALENDAR_CONTENTS_NOT_VALID = 0x06,
57 RBRINSTRUMENT_EVENT_RESTART_FAILED_LOGGER_STATUS_NOT_VALID = 0x07,
58 RBRINSTRUMENT_EVENT_RESTART_FAILED_PRIMARY_SCHEDULE_PARAMETERS_COULD_NOT_BE_RECOVERED = 0x08,
59 RBRINSTRUMENT_EVENT_UNABLE_TO_LOAD_ALARM_TIME_FOR_NEXT_SAMPLE = 0x09,
60 RBRINSTRUMENT_EVENT_SAMPLING_RESTARTED_AFTER_RESETTING_RTC = 0x0A,
61 RBRINSTRUMENT_EVENT_PARAMETERS_RECOVERED_SAMPLING_RESTARTED_AFTER_RESETTING_RTC = 0x0B,
62 RBRINSTRUMENT_EVENT_SAMPLING_STOPPED_END_TIME_REACHED = 0x0C,
63 RBRINSTRUMENT_EVENT_START_OF_A_RECORDED_BURST = 0x0D,
64 RBRINSTRUMENT_EVENT_START_OF_A_WAVE_BURST = 0x0E,
65 RBRINSTRUMENT_EVENT_RESERVED1 = 0x0F,
66 RBRINSTRUMENT_EVENT_STREAMING_NOW_OFF_FOR_BOTH_PORTS = 0x10,
67 RBRINSTRUMENT_EVENT_STREAMING_ON_FOR_USB_OFF_FOR_SERIAL = 0x11,
68 RBRINSTRUMENT_EVENT_STREAMING_OFF_FOR_USB_ON_FOR_SERIAL = 0x12,
69 RBRINSTRUMENT_EVENT_STREAMING_NOW_ON_FOR_BOTH_PORTS = 0x13,
70 RBRINSTRUMENT_EVENT_SAMPLING_STARTED_THRESHOLD_CONDITION_SATISFIED = 0x14,
71 RBRINSTRUMENT_EVENT_SAMPLING_PAUSED_THRESHOLD_CONDITION_NOT_MET = 0x15,
72 RBRINSTRUMENT_EVENT_POWER_SOURCE_SWITCHED_TO_INTERNAL_BATTERY = 0x16,
73 RBRINSTRUMENT_EVENT_POWER_SOURCE_SWITCHED_TO_EXTERNAL_BATTERY = 0x17,
74 RBRINSTRUMENT_EVENT_TWIST_ACTIVATION_STARTED_SAMPLING = 0x18,
75 RBRINSTRUMENT_EVENT_TWIST_ACTIVATION_PAUSED_SAMPLING = 0x19,
76 RBRINSTRUMENT_EVENT_WIFI_MODULE_DETECTED_AND_ACTIVATED = 0x1A,
77 RBRINSTRUMENT_EVENT_WIFI_MODULE_DEACTIVATED_REMOVED_OR_ACTIVITY_TIMEOUT = 0x1B,
78 RBRINSTRUMENT_EVENT_REGIMES_ENABLED_BUT_NOT_YET_IN_A_REGIME = 0x1C,
79 RBRINSTRUMENT_EVENT_ENTERED_REGIME_1 = 0x1D,
80 RBRINSTRUMENT_EVENT_ENTERED_REGIME_2 = 0x1E,
81 RBRINSTRUMENT_EVENT_ENTERED_REGIME_3 = 0x1F,
82 RBRINSTRUMENT_EVENT_START_OF_REGIME_BIN = 0x20,
83 RBRINSTRUMENT_EVENT_BEGIN_PROFILING_UP_CAST = 0x21,
84 RBRINSTRUMENT_EVENT_BEGIN_PROFILING_DOWN_CAST = 0x22,
85 RBRINSTRUMENT_EVENT_END_OF_PROFILING_CAST = 0x23,
86 RBRINSTRUMENT_EVENT_BATTERY_FAILED_SCHEDULE_FINISHED = 0x24,
87 RBRINSTRUMENT_EVENT_DIRECTIONAL_DEPENDENT_SAMPLING_BEGINNING_OF_FAST_SAMPLING_MODE = 0x25,
88 RBRINSTRUMENT_EVENT_DIRECTIONAL_DEPENDENT_SAMPLING_BEGINNING_OF_SLOW_SAMPLING_MODE = 0x26,
89 RBRINSTRUMENT_EVENT_ENERGY_USED_MARKER_INTERNAL_BATTERY = 0x27,
90 RBRINSTRUMENT_EVENT_ENERGY_USED_MARKER_EXTERNAL_POWER_SOURCE = 0x28
367 const void *
const data,
bool managedAllocation
Whether the instance memory was dynamically allocated by the constructor.
Definition: RBRParser.h:243
RBRParserSampleCallback sample
Called when a sample has been parsed.
Definition: RBRParser.h:160
RBRInstrumentDataset
Possible instrument datasets.
Definition: RBRInstrumentMemory.h:35
RBRInstrumentEventType
Instrument event types.
Definition: RBRParser.h:48
RBRInstrumentError RBRParser_parse(RBRParser *parser, RBRInstrumentDataset dataset, const void *const data, int32_t *size)
Parse a chunk of data.
void * userData
Arbitrary user data; useful in callbacks.
Definition: RBRParser.h:237
int64_t RBRInstrumentDateTime
Definition: RBRInstrument.h:181
union RBRParserConfig::@2 formatConfig
Format-specific configuration.
RBRInstrumentError(* RBRParserEventCallback)(const struct RBRParser *parser, const struct RBRInstrumentEvent *const event)
Callback to provide a parsed event to user code.
Definition: RBRParser.h:142
uint32_t auxiliaryData[RBRINSTRUMENT_EVENT_AUXILIARY_DATA_MAX]
Auxiliary data for the event.
Definition: RBRParser.h:124
RBRInstrumentError RBRParser_destroy(RBRParser *parser)
Release any resources held by the parser.
RBRParserCallbacks callbacks
The set of callbacks to be used by the parser.
Definition: RBRParser.h:234
struct RBRInstrumentEvent RBRInstrumentEvent
An instrument event.
RBRInstrumentMemoryFormat format
The format of memory being parsed.
Definition: RBRParser.h:207
RBRParserEventCallback event
Called when an event has been parsed.
Definition: RBRParser.h:174
struct RBRParserEasyParseConfig RBRParserEasyParseConfig
EasyParse-specific parser configuration.
void RBRParser_setUserData(RBRParser *parser, void *userData)
Change the arbitrary user data pointer.
RBRInstrumentError
Errors which can be returned from library functions.
Definition: RBRInstrument.h:200
RBRInstrumentEvent * eventBuffer
Where to put event data for consumption by the event callback.
Definition: RBRParser.h:181
A set of callbacks from parser to user code.
Definition: RBRParser.h:153
An instrument sample.
Definition: RBRInstrumentStreaming.h:492
struct RBRParserCallbacks RBRParserCallbacks
A set of callbacks from parser to user code.
An instrument event.
Definition: RBRParser.h:108
RBRInstrumentEventType type
The type of the event.
Definition: RBRParser.h:111
Configuration for a RBRParser.
Definition: RBRParser.h:204
struct RBRParserConfig RBRParserConfig
Configuration for a RBRParser.
int32_t auxiliaryDataLength
The number of populated entries in RBRInstrumentEvent.auxiliaryData.
Definition: RBRParser.h:122
RBRInstrumentError(* RBRParserSampleCallback)(const struct RBRParser *parser, const struct RBRInstrumentSample *const sample)
Callback to provide a parsed sample to user code.
Definition: RBRParser.h:41
int32_t channels
The number of instrument channels in each sample.
Definition: RBRParser.h:198
RBRInstrumentError RBRParser_init(RBRParser **parser, const RBRParserCallbacks *callbacks, const RBRParserConfig *config, void *userData)
Initialize a dataset parser.
RBRParserConfig config
The parser configuration.
Definition: RBRParser.h:231
#define RBRINSTRUMENT_EVENT_AUXILIARY_DATA_MAX
The maximum number of pieces of auxiliary data in an event.
Definition: RBRParser.h:24
RBRInstrumentDateTime timestamp
The timestamp of the event.
Definition: RBRParser.h:113
Parser context object.
Definition: RBRParser.h:228
void * RBRParser_getUserData(const RBRParser *parser)
Get the pointer to arbitrary user data.
Interface for simplified communication with RBR instruments.
struct RBRParser RBRParser
Parser context object.
RBRInstrumentSample * sampleBuffer
Where to put sample data for consumption by the sample callback.
Definition: RBRParser.h:167
EasyParse-specific parser configuration.
Definition: RBRParser.h:189
const char * RBRInstrumentEventType_name(RBRInstrumentEventType type)
Get a human-readable string name for an event type type.
void RBRParser_getConfig(const RBRParser *parser, RBRParserConfig *config)
Get the parser configuration.
RBRInstrumentMemoryFormat
Instrument memory formats.
Definition: RBRInstrumentMemory.h:206
struct RBRParserEasyParseConfig easyParse
EasyParse-specific parser configuration.
Definition: RBRParser.h:213