|
MIP SDK
0.0.1
MicroStrain Communications Library for embedded systems
|
A collection of C++ classes and functions covering the full mip api. More...
Namespaces | |
| C | |
| commands_3dm | |
| commands_base | |
| commands_filter | |
| commands_gnss | |
| commands_rtk | |
| commands_system | |
| data_filter | |
| data_gnss | |
| data_sensor | |
| data_shared | |
| data_system | |
| platform | |
Classes | |
| struct | CompositeDescriptor |
| Convenience struct holding both descriptor set and field descriptor. More... | |
| struct | Bitfield |
| A dummy struct which is used to mark bitfield objects. More... | |
| struct | MipFieldInfo |
| class | Field |
| C++ class representing a MIP field. More... | |
| class | Packet |
| C++ class representing a MIP Packet. More... | |
| class | Parser |
| C++ class representing a MIP parser. More... | |
| struct | Dispatcher |
| struct | CmdQueue |
| C++ wrapper around a command queue. More... | |
| struct | PendingCmd |
| C++ class representing the state of a MIP command. More... | |
| class | Connection |
| Represents a type of connection to a MIP device. More... | |
| class | DeviceInterface |
| Represents a connected MIP device. More... | |
| struct | CmdResult |
| Represents the status of a MIP command. More... | |
| class | Serializer |
| Serialization class. More... | |
Typedefs | |
| using | DescriptorRate = C::mip_descriptor_rate |
| using | PacketLength = C::packet_length |
| using | DispatchHandler = C::mip_dispatch_handler |
| using | RemainingCount = C::remaining_count |
| using | Timestamp = C::timestamp_type |
| using | Timeout = C::timeout_type |
Enumerations | |
| enum class | FunctionSelector : uint8_t { WRITE = C::MIP_FUNCTION_WRITE , READ = C::MIP_FUNCTION_READ , SAVE = C::MIP_FUNCTION_SAVE , LOAD = C::MIP_FUNCTION_LOAD , RESET = C::MIP_FUNCTION_RESET } |
Functions | |
| bool | mip_is_valid_descriptor_set (uint8_t descriptor_set) |
| Determines if the descriptor set is valid. More... | |
| bool | mip_is_data_descriptor_set (uint8_t descriptor_set) |
| Determines if the descriptor set represents some kind of data. More... | |
| bool | mip_is_cmd_descriptor_set (uint8_t descriptor_set) |
| Determines if the descriptor set contains commands. More... | |
| bool | mip_is_reserved_descriptor_set (uint8_t descriptor_set) |
| Determines if the descriptor is reserved for special purposes. More... | |
| bool | mip_is_valid_field_descriptor (uint8_t field_descriptor) |
| Determines if the field descriptor is valid. More... | |
| bool | mip_is_cmd_field_descriptor (uint8_t field_descriptor) |
| Determines if the field descriptor is a command. More... | |
| bool | mip_is_reply_field_descriptor (uint8_t field_descriptor) |
| Determines if the field descriptor is for an ack/nack reply. More... | |
| bool | mip_is_response_field_descriptor (uint8_t field_descriptor) |
| Determines if the field descriptor contains response data from a command. More... | |
| bool | mip_is_reserved_cmd_field_descriptor (uint8_t field_descriptor) |
| Determines if the field descriptor is reserved. More... | |
| bool | mip_is_shared_data_field_descriptor (uint8_t field_descriptor) |
| Determines if the field descriptor is from the shared data set. More... | |
| void | insert_mip_function_selector (mip_serializer *serializer, enum mip_function_selector self) |
| void | extract_mip_function_selector (mip_serializer *serializer, enum mip_function_selector *self) |
| void | insert_mip_descriptor_rate (mip_serializer *serializer, const mip_descriptor_rate *self) |
| void | extract_mip_descriptor_rate (mip_serializer *serializer, mip_descriptor_rate *self) |
| template<class Derived > | |
| void | insert (Serializer &serializer, const Bitfield< Derived > &bitfield) |
| template<class Derived > | |
| void | extract (Serializer &serializer, Bitfield< Derived > &bitfield) |
| bool | isValidDescriptorSet (uint8_t descriptorSet) |
| bool | isDataDescriptorSet (uint8_t descriptorSet) |
| bool | isCommandDescriptorSet (uint8_t descriptorSet) |
| bool | isReservedDescriptorSet (uint8_t descriptorSet) |
| bool | isValidFieldDescriptor (uint8_t fieldDescriptor) |
| bool | isCommandFieldDescriptor (uint8_t fieldDescriptor) |
| bool | isReplyFieldDescriptor (uint8_t fieldDescriptor) |
| bool | isResponseFieldDescriptor (uint8_t fieldDescriptor) |
| bool | isReservedFieldDescriptor (uint8_t fieldDescriptor) |
| bool | isSharedDataFieldDescriptor (uint8_t fieldDescriptor) |
| void | insert (Serializer &serializer, const DescriptorRate &self) |
| void | extract (Serializer &serializer, DescriptorRate &self) |
| template<class Function > | |
| bool | parseMipDataFromSource (C::mip_parser &parser, Function reader, size_t maxPackets) |
| Read data from a source into the internal parsing buffer. More... | |
| template<class Cmd > | |
| CmdResult | runCommand (C::mip_interface &device, const Cmd &cmd, Timeout additionalTime=0) |
| template<class Cmd > | |
| CmdResult | runCommand (C::mip_interface &device, const Cmd &cmd, typename Cmd::Response &response, Timeout additionalTime=0) |
| template<class Cmd , class... Args> | |
| CmdResult | runCommand (C::mip_interface &device, const Args &&... args, Timeout additionalTime) |
| template<class Cmd > | |
| bool | startCommand (C::mip_interface &device, C::mip_pending_cmd &pending, const Cmd &cmd, Timeout additionalTime) |
| const char * | mip_cmd_result_to_string (enum mip_cmd_result result) |
| Converts the command result to a string for debugging. More... | |
| bool | mip_cmd_result_is_finished (enum mip_cmd_result status) |
| Determines if the command has completed, timed out, been cancelled, or otherwise is no longer waiting for a response. More... | |
| bool | mip_cmd_result_is_reply (enum mip_cmd_result result) |
| Determines if the result is a reply from the device (i.e. mip_ack). More... | |
| bool | mip_cmd_result_is_status (enum mip_cmd_result result) |
| Determines if the result code was generated by this lib (i.e. mip_cmd_status). More... | |
| bool | mip_cmd_result_is_ack (enum mip_cmd_result result) |
| Determines if the result is an ack (successful response from the device) More... | |
| void | mip_serializer_init_insertion (mip_serializer *serializer, uint8_t *buffer, size_t buffer_size) |
| Initialize a serialization struct for insertion into a buffer. More... | |
| void | mip_serializer_init_extraction (mip_serializer *serializer, const uint8_t *buffer, size_t buffer_size) |
| Initialize a serialization struct for extract from a buffer. More... | |
| void | mip_serializer_init_from_field (mip_serializer *serializer, const mip_field *field) |
| Initialize a serialization struct from a MIP field payload. More... | |
| size_t | mip_serializer_capacity (const mip_serializer *serializer) |
| Determines the total length the buffer. More... | |
| size_t | mip_serializer_length (const mip_serializer *serializer) |
| Determines the length of the data in the buffer. More... | |
| remaining_count | mip_serializer_remaining (const mip_serializer *serializer) |
| Determines the difference between the length and buffer size. More... | |
| bool | mip_serializer_is_ok (const mip_serializer *serializer) |
| Determines if the data read/written is less than the buffer size. More... | |
| bool | mip_serializer_is_complete (const mip_serializer *serializer) |
| Determines if the number of remaining bytes is 0. More... | |
| void | extract_count (mip_serializer *serializer, uint8_t *count_out, uint8_t max_count) |
| Similar to extract_u8 but allows a maximum value to be specified. More... | |
| void | insert (Serializer &serializer, bool value) |
| void | insert (Serializer &serializer, char value) |
| void | insert (Serializer &serializer, uint8_t value) |
| void | insert (Serializer &serializer, uint16_t value) |
| void | insert (Serializer &serializer, uint32_t value) |
| void | insert (Serializer &serializer, uint64_t value) |
| void | insert (Serializer &serializer, int8_t value) |
| void | insert (Serializer &serializer, int16_t value) |
| void | insert (Serializer &serializer, int32_t value) |
| void | insert (Serializer &serializer, int64_t value) |
| void | insert (Serializer &serializer, float value) |
| void | insert (Serializer &serializer, double value) |
| template<typename Enum > | |
| std::enable_if< std::is_enum< Enum >::value, void >::type | insert (Serializer &serializer, Enum value) |
| Inserts an enum into the buffer. More... | |
| template<typename T > | |
| bool | insert (const T &value, uint8_t *buffer, size_t bufferSize) |
| Insert the given value into the buffer. More... | |
| void | extract (Serializer &serializer, bool &value) |
| void | extract (Serializer &serializer, char &value) |
| void | extract (Serializer &serializer, uint8_t &value) |
| void | extract (Serializer &serializer, uint16_t &value) |
| void | extract (Serializer &serializer, uint32_t &value) |
| void | extract (Serializer &serializer, uint64_t &value) |
| void | extract (Serializer &serializer, int8_t &value) |
| void | extract (Serializer &serializer, int16_t &value) |
| void | extract (Serializer &serializer, int32_t &value) |
| void | extract (Serializer &serializer, int64_t &value) |
| void | extract (Serializer &serializer, float &value) |
| void | extract (Serializer &serializer, double &value) |
| template<typename Enum > | |
| std::enable_if< std::is_enum< Enum >::value, void >::type | extract (Serializer &serializer, Enum &value) |
| Extract an enum from the buffer. More... | |
| template<typename T > | |
| bool | extract (T &value_out, const uint8_t *buffer, size_t bufferSize, size_t offset=0, bool exact_size=false) |
| Extract the value given a buffer, size, and starting offset. More... | |
A collection of C++ classes and functions covering the full mip api.
| using mip::DescriptorRate = typedef C::mip_descriptor_rate |
| using mip::PacketLength = typedef C::packet_length |
| using mip::RemainingCount = typedef C::remaining_count |
| using mip::Timeout = typedef C::timeout_type |
| using mip::Timestamp = typedef C::timestamp_type |
|
strong |
| void mip::extract | ( | Serializer & | serializer, |
| Bitfield< Derived > & | bitfield | ||
| ) |
|
inline |
| void mip::extract_count | ( | mip_serializer * | serializer, |
| uint8_t * | count_out, | ||
| uint8_t | max_count | ||
| ) |
Similar to extract_u8 but allows a maximum value to be specified.
If the maximum count would be exceeded, an error is generated which causes further extraction to fail.
| serializer | |
| count_out | The counter value read from the buffer. |
| max_count | The maximum value of the counter. If the count exceeds this, it is set to 0 and the serializer is put into an error state. |
| void mip::extract_mip_descriptor_rate | ( | mip_serializer * | serializer, |
| mip_descriptor_rate * | self | ||
| ) |
| void mip::extract_mip_function_selector | ( | mip_serializer * | serializer, |
| enum mip_function_selector * | self | ||
| ) |
| void mip::insert | ( | Serializer & | serializer, |
| const Bitfield< Derived > & | bitfield | ||
| ) |
|
inline |
| void mip::insert_mip_descriptor_rate | ( | mip_serializer * | serializer, |
| const mip_descriptor_rate * | self | ||
| ) |
| void mip::insert_mip_function_selector | ( | mip_serializer * | serializer, |
| enum mip_function_selector | self | ||
| ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| bool mip::mip_cmd_result_is_ack | ( | enum mip_cmd_result | result | ) |
Determines if the result is an ack (successful response from the device)
| bool mip::mip_cmd_result_is_finished | ( | enum mip_cmd_result | status | ) |
Determines if the command has completed, timed out, been cancelled, or otherwise is no longer waiting for a response.
| bool mip::mip_cmd_result_is_reply | ( | enum mip_cmd_result | result | ) |
Determines if the result is a reply from the device (i.e. mip_ack).
| bool mip::mip_cmd_result_is_status | ( | enum mip_cmd_result | result | ) |
Determines if the result code was generated by this lib (i.e. mip_cmd_status).
| const char* mip::mip_cmd_result_to_string | ( | enum mip_cmd_result | result | ) |
Converts the command result to a string for debugging.
| result | Any value. |
| bool mip::mip_is_cmd_descriptor_set | ( | uint8_t | descriptor_set | ) |
Determines if the descriptor set contains commands.
| descriptor_set |
| bool mip::mip_is_cmd_field_descriptor | ( | uint8_t | field_descriptor | ) |
Determines if the field descriptor is a command.
| field_descriptor |
| bool mip::mip_is_data_descriptor_set | ( | uint8_t | descriptor_set | ) |
Determines if the descriptor set represents some kind of data.
| descriptor_set |
| bool mip::mip_is_reply_field_descriptor | ( | uint8_t | field_descriptor | ) |
Determines if the field descriptor is for an ack/nack reply.
| field_descriptor |
| bool mip::mip_is_reserved_cmd_field_descriptor | ( | uint8_t | field_descriptor | ) |
Determines if the field descriptor is reserved.
The descriptor set is assumed to be a command set.
| field_descriptor |
| bool mip::mip_is_reserved_descriptor_set | ( | uint8_t | descriptor_set | ) |
Determines if the descriptor is reserved for special purposes.
| descriptor_set |
| bool mip::mip_is_response_field_descriptor | ( | uint8_t | field_descriptor | ) |
Determines if the field descriptor contains response data from a command.
The descriptor set is assumed to be a command set.
| field_descriptor |
| bool mip::mip_is_shared_data_field_descriptor | ( | uint8_t | field_descriptor | ) |
Determines if the field descriptor is from the shared data set.
The descriptor set is assumed to be a data set.
| field_descriptor |
| bool mip::mip_is_valid_descriptor_set | ( | uint8_t | descriptor_set | ) |
Determines if the descriptor set is valid.
| descriptor_set |
| bool mip::mip_is_valid_field_descriptor | ( | uint8_t | field_descriptor | ) |
Determines if the field descriptor is valid.
| field_descriptor |
| size_t mip::mip_serializer_capacity | ( | const mip_serializer * | serializer | ) |
Determines the total length the buffer.
| serializer |
| void mip::mip_serializer_init_extraction | ( | mip_serializer * | serializer, |
| const uint8_t * | buffer, | ||
| size_t | buffer_size | ||
| ) |
Initialize a serialization struct for extract from a buffer.
| serializer | |
| buffer | A pointer from which data will be read. |
| buffer_size | Maximum number of bytes to be read from the buffer. |
| void mip::mip_serializer_init_from_field | ( | mip_serializer * | serializer, |
| const mip_field * | field | ||
| ) |
Initialize a serialization struct from a MIP field payload.
| serializer | |
| field |
| void mip::mip_serializer_init_insertion | ( | mip_serializer * | serializer, |
| uint8_t * | buffer, | ||
| size_t | buffer_size | ||
| ) |
Initialize a serialization struct for insertion into a buffer.
| serializer | |
| buffer | Buffer into which data will be written. Can be NULL if buffer_size==0. |
| buffer_size | Size of the buffer. Data will not be written beyond this size. |
| bool mip::mip_serializer_is_complete | ( | const mip_serializer * | serializer | ) |
Determines if the number of remaining bytes is 0.
Use this to determine if the entire buffer has been extracted. It is not particularly useful for insertion.
| serializer |
| bool mip::mip_serializer_is_ok | ( | const mip_serializer * | serializer | ) |
Determines if the data read/written is less than the buffer size.
If the application attempts to read or write beyond the end of the buffer (as defined by the buffer_size passed to the init function), the read or write will be a no-op but the offset will still be advanced. This allows the condition to be detected.
| serializer |
| size_t mip::mip_serializer_length | ( | const mip_serializer * | serializer | ) |
Determines the length of the data in the buffer.
| serializer | For insertion, returns how many bytes have been written. For extraction, returns how many bytes have been read. |
| remaining_count mip::mip_serializer_remaining | ( | const mip_serializer * | serializer | ) |
Determines the difference between the length and buffer size.
| serializer | For insertion, returns how many unwritten bytes remain in the buffer. For extraction, returns how many bytes have not been read. |