MIP_SDK  v4.0.0
MicroStrain Communications Library for embedded systems
Modules | Classes | Typedefs | Enumerations | Functions
Mip Fields

Functions for processing received MIP fields. More...

Modules

 Mip Field Accessors
 Functions for inspecting a MIP field.
 
 Mip Field Iteration
 Functions for iterating over fields in a MIP packet.
 

Classes

struct  mip::C::mip_field_view
 A structure representing a MIP field. More...
 

Typedefs

typedef struct mip::C::mip_field_view mip::C::mip_field_view
 A structure representing a MIP field. More...
 
typedef enum mip::C::mip_field_index mip::C::mip_field_index
 
typedef enum mip::C::mip_field_index_length mip::C::mip_field_index_length
 

Enumerations

enum  mip::C::mip_field_index { mip::C::MIP_FIELD_INDEX_LENGTH = 0, mip::C::MIP_FIELD_INDEX_DESC = 1, mip::C::MIP_FIELD_INDEX_PAYLOAD = 2 }
 
enum  mip::C::mip_field_index_length {
  mip::C::MIP_FIELD_HEADER_LENGTH = MIP_FIELD_INDEX_PAYLOAD, mip::C::MIP_FIELD_LENGTH_MIN = MIP_FIELD_HEADER_LENGTH, mip::C::MIP_FIELD_LENGTH_MAX = 255, mip::C::MIP_FIELD_PAYLOAD_LENGTH_MIN = 0,
  mip::C::MIP_FIELD_PAYLOAD_LENGTH_MAX = MIP_FIELD_LENGTH_MAX - MIP_FIELD_HEADER_LENGTH
}
 

Functions

void mip::C::mip_field_init (mip_field_view *field, uint8_t descriptor_set, uint8_t field_descriptor, const uint8_t *payload, uint8_t payload_length)
 Constructs a field view given the parameters. More...
 

Detailed Description

The MIP Packet
---------------+------------+------------+-----/ /-----+------------+
... Header | Field | Field | ... | Checksum |
---------------+------------+------------+-----/ /-----+------------+
_/ \_
_/ \_
/ \.
+------+------+---/ /----+
| Len | desc | payload | The MIP Field
+------+------+---/ /----+

Typedef Documentation

◆ mip_field_view

Use to access fields from a received MIP packet.

This structure references the original packet data and does not contain a copy of the field payload. Therefore, the data buffer must exist as long as there are instances which reference it (even if the field payload itself is not used directly).

Note
This should be considered an "opaque" structure; its members should be considered an internal implementation detail. Avoid accessing them directly as they are subject to change in future versions of this software.

◆ mip_field_index

◆ mip_field_index_length

Enumeration Type Documentation

◆ mip_field_index

Enumerator
MIP_FIELD_INDEX_LENGTH 
MIP_FIELD_INDEX_DESC 
MIP_FIELD_INDEX_PAYLOAD 

◆ mip_field_index_length

Enumerator
MIP_FIELD_HEADER_LENGTH 
MIP_FIELD_LENGTH_MIN 
MIP_FIELD_LENGTH_MAX 
MIP_FIELD_PAYLOAD_LENGTH_MIN 
MIP_FIELD_PAYLOAD_LENGTH_MAX 

Function Documentation

◆ mip_field_init()

void mip::C::mip_field_init ( mip_field_view field,
uint8_t  descriptor_set,
uint8_t  field_descriptor,
const uint8_t *  payload,
uint8_t  payload_length 
)
Parameters
field
descriptor_setThe MIP descriptor set of the packet.
field_descriptorThe MIP field descriptor.
payloadA pointer to a buffer containing the field payload, not including the field header. The data must exist while the field is in use. Can be NULL if payload_length is 0.
payload_lengthThe length of the payload. Cannot exceed MIP_FIELD_PAYLOAD_LENGTH_MAX.