MIP_SDK
v3.0.0-736-g212583cf
MicroStrain Communications Library for embedded systems
|
uint16_t mip_packet_checksum_value(const mip_packet_view *packet)
Returns the value of the checksum as written in the packet.
Definition: mip_packet.c:164
int mip_packet_cancel_last_field(mip_packet_view *packet, uint8_t *payload_ptr)
Removes the last field from the packet after having allocated it.
Definition: mip_packet.c:438
A collection of C++ classes and functions covering the full mip api.
Definition: commands_3dm.c:11
void mip_packet_from_buffer(mip_packet_view *packet, const uint8_t *buffer, size_t length)
Initializes a MIP packet from an existing buffer.
Definition: mip_packet.c:44
@ MIP_PACKET_HEADER_LENGTH
Definition: mip_packet.h:80
int mip_packet_create_field(mip_packet_view *packet, uint8_t field_descriptor, uint8_t payload_length, uint8_t **payload_ptr_out)
Allocate a MIP field within the packet and return the payload pointer.
Definition: mip_packet.c:355
@ MIP_PACKET_LENGTH_MIN
Definition: mip_packet.h:84
int mip_packet_remaining_space(const mip_packet_view *packet)
Returns the remaining space available for more payload data.
Definition: mip_packet.c:262
void mip_packet_reset(mip_packet_view *packet, uint8_t descriptor_set)
Reinitialize the packet with the given descriptor set.
Definition: mip_packet.c:485
@ MIP_PACKET_INDEX_SYNC_1
Definition: mip_packet.h:71
@ MIP_SYNC_2
Definition: mip_packet.h:91
uint8_t * mip_packet_payload_w(mip_packet_view *packet)
Returns a writable pointer to the packet's payload (the first field).
Definition: mip_packet.c:153
struct microstrain::C::microstrain_serializer microstrain_serializer
Structure used for serialization.
uint_least16_t mip_packet_total_length(const mip_packet_view *packet)
Returns the total length of the packet, in bytes.
Definition: mip_packet.c:113
@ MIP_PACKET_INDEX_LENGTH
Definition: mip_packet.h:74
bool mip_packet_is_sane(const mip_packet_view *packet)
Returns true if the packet buffer is not NULL and is at least the minimum size (MIP_PACKET_LENGTH_MIN...
Definition: mip_packet.c:203
Structure representing a MIP Packet.
Definition: mip_packet.h:63
const uint8_t * mip_packet_buffer(const mip_packet_view *packet)
Returns a read-only pointer to the data buffer.
Definition: mip_packet.c:121
@ MIP_PACKET_INDEX_DESC_SET
Definition: mip_packet.h:73
uint8_t * mip_packet_buffer_w(mip_packet_view *packet)
Returns a writable pointer to the data buffer.
Definition: mip_packet.c:129
uint8_t mip_packet_descriptor_set(const mip_packet_view *packet)
Returns the MIP descriptor set for this packet.
Definition: mip_packet.c:95
bool mip_packet_is_valid(const mip_packet_view *packet)
Returns true if the packet is valid.
Definition: mip_packet.c:216
@ MIP_PACKET_PAYLOAD_LENGTH_MAX
Definition: mip_packet.h:83
@ MIP_SYNC_1
Definition: mip_packet.h:90
void mip_packet_create(mip_packet_view *packet, uint8_t *buffer, size_t buffer_size, uint8_t descriptor_set)
Create a brand-new MIP packet in the given buffer.
Definition: mip_packet.c:70
@ MIP_PACKET_INDEX_SYNC_2
Definition: mip_packet.h:72
bool mip_packet_add_field(mip_packet_view *packet, uint8_t field_descriptor, const uint8_t *payload, uint8_t payload_length)
Adds a pre-constructed MIP field to the packet.
Definition: mip_packet.c:313
@ MIP_PACKET_INDEX_PAYLOAD
Definition: mip_packet.h:75
mip_packet_index
Definition: mip_packet.h:69
int mip_packet_update_last_field_length(mip_packet_view *packet, uint8_t *payload_ptr, uint8_t new_payload_length)
Changes the size of the last field in the packet.
Definition: mip_packet.c:402
const uint8_t * mip_packet_payload(const mip_packet_view *packet)
Returns a pointer to the packet's payload (the first field).
Definition: mip_packet.c:145
@ MIP_PACKET_CHECKSUM_LENGTH
Definition: mip_packet.h:81
uint16_t mip_packet_compute_checksum(const mip_packet_view *packet)
Computes the checksum of the MIP packet.
Definition: mip_packet.c:176
uint8_t mip_packet_payload_length(const mip_packet_view *packet)
Returns the length of the payload (MIP fields).
Definition: mip_packet.c:103
@ MIP_PACKET_LENGTH_MAX
Definition: mip_packet.h:85
bool mip_packet_is_empty(const mip_packet_view *packet)
Returns true if the mip packet contains no payload.
Definition: mip_packet.c:234
uint_least16_t mip_packet_buffer_length(const mip_packet_view *packet)
Returns the size of the buffer backing the MIP packet.
Definition: mip_packet.c:248
mip_packet_sync_byte
Definition: mip_packet.h:88
@ MIP_PACKET_PAYLOAD_LENGTH_MIN
Definition: mip_packet.h:82
void mip_packet_finalize(mip_packet_view *packet)
Prepares the packet for transmission by adding the checksum.
Definition: mip_packet.c:467
const uint8_t * mip_packet_data(const mip_packet_view *packet)
Returns a pointer to the data buffer containing the packet.
Definition: mip_packet.c:137
struct mip::C::mip_packet_view mip_packet_view
Structure representing a MIP Packet.
bool mip_packet_is_data(const mip_packet_view *packet)
Returns true if the packet is from a data descriptor set.
Definition: mip_packet.c:275
Definition: embedded_time.h:8
mip_packet_index_length
Definition: mip_packet.h:78