MIP_SDK
v3.0.0-736-g212583cf
MicroStrain Communications Library for embedded systems
|
Go to the documentation of this file.
103 template<
bool (*Send)(Interface&, const u
int8_t*,
size_t)>
105 template<
bool (*Send)(Interface&, microstrain::ConstU8ArrayView)>
108 template<
bool (*Recv)(Interface&, u
int8_t*,
size_t, Timeout,
bool,
size_t*, Timestamp*)>
110 template<
bool (*Recv)(Interface&, microstrain::U8ArrayView, Timeout,
bool,
size_t*, Timestamp*)>
113 template<
bool (*Update)(Interface&, Timeout,
bool)>
118 template<
class UserClass,
bool (UserClass::*Send)(const u
int8_t*,
size_t)>
120 template<
class UserClass,
bool (UserClass::*Send)(microstrain::ConstU8ArrayView)>
122 template<
class UserClass,
bool (*Send)(UserClass*, microstrain::ConstU8ArrayView)>
125 template<
class UserClass,
bool (UserClass::*Recv)(u
int8_t*,
size_t, Timeout,
bool,
size_t*, Timestamp*)>
127 template<
class UserClass,
bool (UserClass::*Recv)(microstrain::U8ArrayView, Timeout,
bool,
size_t*, Timestamp*)>
129 template<
class UserClass,
bool (*Recv)(UserClass*, microstrain::U8ArrayView, Timeout,
bool,
size_t*, Timestamp*)>
132 template<
class UserClass,
bool (UserClass::*Update)(Timeout,
bool)>
134 template<
class UserClass,
bool (*Update)(UserClass*, Timeout,
bool)>
142 bool (T::*Update)(
Timeout, bool) =
nullptr
148 template<
class Derived,
bool (Derived::*Send)(microstrain::ConstU8ArrayView)>
151 template<
class Derived,
bool (Derived::*Recv)(microstrain::U8ArrayView, Timeout,
bool,
size_t*, Timestamp*)>
154 template<
class Derived,
bool (Derived::*Update)(Timeout,
bool)>
162 bool (Derived::*Update)(
Timeout, bool) =
nullptr
195 bool recvFromDevice(
microstrain::U8ArrayView buffer,
Timeout wait_time,
bool from_cmd,
size_t* length_out,
Timestamp* timestamp_out) {
return C::mip_interface_recv_from_device(
this, buffer.
data(), buffer.
size(), wait_time, from_cmd, length_out, timestamp_out); }
220 template<
void (*Callback)(
void*, const PacketView&, Timestamp)>
223 template<
class Object,
void (Object::*Callback)(const PacketView&, Timestamp)>
226 template<
void (*Callback)(
void*, const FieldView&, Timestamp)>
229 template<
class Object,
void (Object::*Callback)(const FieldView& field, Timestamp)>
232 template<
class DataField,
void (*Callback)(
void*, const DataField&, Timestamp)>
235 template<
class DataField,
void (*Callback)(
void*, const DataField&, u
int8_t, Timestamp)>
238 template<
class DataField,
class Object,
void (Object::*Callback)(const DataField&, Timestamp)>
241 template<
class DataField,
class Object,
void (Object::*Callback)(const DataField&, u
int8_t, Timestamp)>
244 template<
class DataField>
254 template<
class Cmd,
class... Args>
287 template<
bool (*Send)(Interface&, const u
int8_t*,
size_t)>
292 return (*Send)(*
static_cast<Interface*
>(device), data, length);
301 template<
bool (*Send)(Interface&, microstrain::ConstU8ArrayView)>
306 return (*Send)(*
static_cast<Interface*
>(device), {data, length});
315 template<
bool (*Recv)(Interface&, u
int8_t*,
size_t, Timeout,
bool,
size_t*, Timestamp*)>
320 return (*Recv)(*
static_cast<Interface*
>(device), buffer, max_length, wait_time, from_cmd, length_out, timestamp_out);
329 template<
bool (*Recv)(Interface&, microstrain::U8ArrayView, Timeout,
bool,
size_t*, Timestamp*)>
334 return (*Recv)(*
static_cast<Interface*
>(device), {buffer, max_length}, wait_time, from_cmd, length_out, timestamp_out);
343 template<
bool (*Update)(Interface&, Timeout,
bool)>
348 return (*Update)(*
static_cast<Interface*
>(device), wait_time, from_cmd);
381 template<
class UserClass,
bool (UserClass::*Send)(const u
int8_t*,
size_t)>
387 return (object->*Send)(data, length);
413 template<
class UserClass,
bool (UserClass::*Send)(microstrain::ConstU8ArrayView)>
419 return (object->*Send)({data, length});
445 template<
class UserClass,
bool (*Send)(UserClass*, microstrain::ConstU8ArrayView)>
451 return (*Send)(object, {data, length});
465 template<
class UserClass,
bool (UserClass::*Recv)(u
int8_t*,
size_t, Timeout,
bool,
size_t*, Timestamp*)>
471 return (object->*Recv)(buffer, max_length, wait_time, from_cmd, length_out, timestamp_out);
484 template<
class UserClass,
bool (UserClass::*Recv)(microstrain::U8ArrayView, Timeout,
bool,
size_t*, Timestamp*)>
490 return (object->*Recv)({buffer, max_length}, wait_time, from_cmd, length_out, timestamp_out);
503 template<
class UserClass,
bool (*Recv)(UserClass*, microstrain::U8ArrayView, Timeout,
bool,
size_t*, Timestamp*)>
509 return (*Recv)(object, {buffer, max_length}, wait_time, from_cmd, length_out, timestamp_out);
522 template<
class UserClass,
bool (UserClass::*Update)(Timeout,
bool)>
528 return (object->*Update)(wait_time, from_cmd);
541 template<
class UserClass,
bool (*Update)(UserClass*, Timeout,
bool)>
547 return (*Update)(object, wait_time, from_cmd);
592 bool (UserClass::*Update)(
Timeout, bool)
596 setUserPointer(
object);
598 setSendFunctionUserPointer<UserClass, Send>();
599 setRecvFunctionUserPointer<UserClass, Recv>();
602 if(Update ==
nullptr && Recv !=
nullptr)
605 setUpdateFunctionUserPointer<UserClass, Update>();
635 template<
class Derived,
bool (Derived::*Send)(microstrain::ConstU8ArrayView)>
638 static_assert(std::is_base_of<C::mip_interface, Derived>::value,
"Derived must inherit C::mip_interface.");
642 return (
static_cast<Derived*
>(device)->*Send)({data, length});
655 template<
class Derived,
bool (Derived::*Recv)(microstrain::U8ArrayView, Timeout,
bool,
size_t*, Timestamp*)>
658 static_assert(std::is_base_of<C::mip_interface, Derived>::value,
"Derived must inherit C::mip_interface.");
662 return (
static_cast<Derived*
>(device)->*Recv)({buffer, max_length}, wait_time, from_cmd, length_out, timestamp_out);
675 template<
class Derived,
bool (Derived::*Update)(Timeout,
bool)>
678 static_assert(std::is_base_of<C::mip_interface, Derived>::value,
"Derived must inherit C::mip_interface.");
682 return (
static_cast<Derived*
>(device)->*Update)(wait_time, from_cmd);
723 bool (Derived::*Update)(
Timeout, bool)
727 static_assert(std::is_base_of<C::mip_interface, Derived>::value,
"Derived must inherit C::mip_interface.");
729 setSendFunctionDerived<Derived, Send>();
730 setRecvFunctionDerived<Derived, Recv>();
733 if(Update ==
nullptr && Recv !=
nullptr)
736 setRecvFunctionDerived<Derived, Update>();
782 template<
void (*Callback)(
void*, const PacketView&, Timestamp)>
788 Callback(context, packetView, timestamp);
827 template<
class Object,
void (Object::*Callback)(const PacketView&, Timestamp)>
833 Object* obj =
static_cast<Object*
>(pointer);
834 (obj->*Callback)(packetView, timestamp);
873 template<
void (*Callback)(
void*, const FieldView&, Timestamp)>
879 Callback(context, fieldView, timestamp);
918 template<
class Object,
void (Object::*Callback)(const FieldView&, Timestamp)>
924 Object* obj =
static_cast<Object*
>(pointer);
925 (obj->*Callback)(fieldView, timestamp);
966 template<
class DataField,
void (*Callback)(
void*, const DataField&, Timestamp)>
969 assert(descriptorSet != 0x00);
970 if (descriptorSet == 0x00)
973 assert(descriptorSet != 0xFF);
974 if (descriptorSet == 0xFF)
982 assert(ok); (void)ok;
984 Callback(context, data, timestamp);
1025 template<
class DataField,
void (*Callback)(
void*, const DataField&, u
int8_t, Timestamp)>
1028 assert(descriptorSet != 0x00);
1029 if (descriptorSet == 0x00)
1032 assert(descriptorSet != 0xFF);
1033 if (descriptorSet == 0xFF)
1041 assert(ok); (void)ok;
1085 template<
class DataField,
class Object,
void (Object::*Callback)(const DataField&, Timestamp)>
1088 assert(descriptorSet != 0x00);
1089 if (descriptorSet == 0x00)
1092 assert(descriptorSet != 0xFF);
1093 if (descriptorSet == 0xFF)
1101 assert(ok); (void)ok;
1103 Object* obj =
static_cast<Object*
>(pointer);
1104 (obj->*Callback)(data, timestamp);
1146 template<
class DataField,
class Object,
void (Object::*Callback)(const DataField&, u
int8_t, Timestamp)>
1149 assert(descriptorSet != 0x00);
1150 if (descriptorSet == 0x00)
1153 assert(descriptorSet != 0xFF);
1154 if (descriptorSet == 0xFF)
1162 assert(ok); (void)ok;
1164 Object* obj =
static_cast<Object*
>(pointer);
1171 template<
class DataField>
1203 template<
class Cmd,
class... Args>
1206 Cmd cmd{std::forward<Args>(args)...};
1207 return runCommand(device, cmd, additionalTime);
void setRecvFunctionUserPointer()
Sets the receive callback function (class member function version w/ ptr & length).
Definition: mip_interface.hpp:466
void registerDataCallback(C::mip_dispatch_handler &handler, void *userData=nullptr, uint8_t descriptorSet=DataField::DESCRIPTOR_SET)
Registers a data callback (free function version).
Definition: mip_interface.hpp:967
@ MIP_DISPATCH_ANY_DATA_SET
Definition: mip_dispatch.h:70
void(* mip_dispatch_field_callback)(void *context, const mip_field_view *field, mip_timestamp timestamp)
Signature for field-level callbacks.
Definition: mip_dispatch.h:54
A collection of C++ classes and functions covering the full mip api.
Definition: commands_3dm.c:11
void setRecvFunction(C::mip_recv_callback callback)
Definition: mip_interface.hpp:98
void * mip_interface_user_pointer(const mip_interface *device)
Retrieves the pointer set by mip_interface_set_user_pointer().
Definition: mip_interface.c:281
bool startCommand(PendingCmd &pending, const Cmd &cmd, Timeout additionalTime=0)
Definition: mip_interface.hpp:261
void mip_dispatcher_remove_handler(mip_dispatcher *self, mip_dispatch_handler *handler)
Removes a handler from the dispatch system.
Definition: mip_dispatch.c:210
@ MIP_DISPATCH_ANY_DESCRIPTOR
Definition: mip_dispatch.h:74
bool mip_interface_default_update(mip_interface *device, mip_timeout wait_time, bool from_cmd)
Polls the port for new data or command replies.
Definition: mip_interface.c:404
void setSendFunctionDerived()
Sets the send callback function (derived member function version).
Definition: mip_interface.hpp:636
void mip_interface_set_update_function(mip_interface *device, mip_update_callback callback)
Sets the update function.
Definition: mip_interface.c:245
Interface(microstrain::Connection *connection, Timeout parseTimeout, Timeout baseReplyTimeout)
Initialize the mip_interface components.
Definition: mip_interface.hpp:75
bool defaultUpdateExtBuffer(Timeout wait_time, bool from_cmd, microstrain::U8ArrayView buffer)
Definition: mip_interface.hpp:200
void inputBytes(const uint8_t *data, size_t length, Timestamp timestamp)
Definition: mip_interface.hpp:202
bool mip_interface_update(mip_interface *device, mip_timeout wait_time, bool from_cmd)
Call to process data from the device.
Definition: mip_interface.c:372
uint8_t mip_field_descriptor_set(const mip_field_view *field)
Returns the descriptor set of the packet containing this field._.
Definition: mip_field.c:49
void setSendFunction(C::mip_send_callback callback)
Definition: mip_interface.hpp:97
mip_send_callback mip_interface_send_function(const mip_interface *device)
Gets the send function pointer.
Definition: mip_interface.c:197
void setUpdateFunction(C::mip_update_callback function)
Definition: mip_interface.hpp:99
bool mip_interface_recv_from_device(mip_interface *device, uint8_t *buffer, size_t max_length, mip_timeout wait_time, bool from_cmd, size_t *length_out, mip_timestamp *timestamp_out)
Checks for data at the port and reads it into buffer.
Definition: mip_interface.c:342
void mip_interface_input_bytes_from_device(mip_interface *device, const uint8_t *data, size_t length, mip_timestamp timestamp)
Passes data from the device into the parser.
Definition: mip_interface.c:495
bool mip_interface_start_command_packet(mip_interface *device, const mip_packet_view *packet, mip_pending_cmd *cmd)
Queues the command and sends the packet. Does not wait for completion.
Definition: mip_interface.c:693
CmdResult waitForReply(C::mip_pending_cmd &cmd)
Definition: mip_interface.hpp:211
bool extract(FieldType &field, bool exact_size=true) const
Deserializes the field data to specific field struct.
Definition: mip_field.hpp:124
CmdResult runCommand(const Cmd &cmd, typename Cmd::Response &response, Timeout additionalTime=0)
Definition: mip_interface.hpp:258
CmdResult runCommand(const Cmd &cmd, Timeout additionalTime=0)
Definition: mip_interface.hpp:252
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
void registerExtractor(C::mip_dispatch_handler &handler, DataField *field, uint8_t descriptorSet=DataField::DESCRIPTOR_SET)
Definition: mip_interface.hpp:1172
void updateTime(Timestamp timestamp)
Definition: mip_interface.hpp:207
void mip_interface_update_time(mip_interface *device, mip_timestamp timestamp)
Call this to ensure that pending commands time out properly.
Definition: mip_interface.c:528
mip_timeout mip_cmd_queue_base_reply_timeout(const mip_cmd_queue *queue)
Gets the base reply timeout for all commands.
Definition: mip_cmdqueue.c:493
struct mip::C::mip_interface mip_interface
State of the interface for communicating with a MIP device.
Interface & operator=(const Interface &)=delete
static constexpr C::mip_cmd_result STATUS_ERROR
Command could not be executed (error sending/receiving)
Definition: mip_result.hpp:27
const CmdQueue & cmdQueue() const
Definition: mip_interface.hpp:185
void removeAllHandlers()
Definition: mip_interface.hpp:40
mip_update_callback mip_interface_update_function(const mip_interface *device)
Gets the update function pointer.
Definition: mip_interface.c:257
void addHandler(DispatchHandler &handler)
Definition: mip_interface.hpp:37
C::mip_recv_callback recvFunction() const
Definition: mip_interface.hpp:94
Structure representing a MIP Packet.
Definition: mip_packet.h:63
Holds the state of the MIP dispatch system.
Definition: mip_dispatch.h:130
void setRecvFunctionFree()
Sets the receive callback function (free function version).
Definition: mip_interface.hpp:316
void mip_interface_input_bytes_andor_time(mip_interface *device, const uint8_t *received_data, size_t data_length, mip_timestamp now)
This function takes care of processing received data and updating the current time.
Definition: mip_interface.c:473
static constexpr size_t PAYLOAD_LENGTH_MAX
Definition: mip_field.hpp:38
ConstArrayView< uint8_t > ConstU8ArrayView
Definition: array_view.hpp:151
microstrain::C::microstrain_embedded_timestamp mip_timeout
Definition: mip_types.h:16
bool update(Timeout wait_time, bool from_cmd=false)
Definition: mip_interface.hpp:197
struct mip::C::mip_dispatch_handler mip_dispatch_handler
Handler information for MIP Packet or Field callbacks.
C::mip_send_callback sendFunction() const
Definition: mip_interface.hpp:93
void(* mip_dispatch_packet_callback)(void *context, const mip_packet_view *packet, mip_timestamp timestamp)
Signature for packet-level callbacks.
Definition: mip_dispatch.h:45
void mip_dispatcher_add_handler(mip_dispatcher *self, mip_dispatch_handler *handler)
Registers a handler in the dispatch system.
Definition: mip_dispatch.c:189
struct mip::C::mip_pending_cmd mip_pending_cmd
Represents a command awaiting a reply from the device.
A mip packet with a self-contained buffer (useful with std::vector).
Definition: mip_packet.hpp:330
C++ class representing the state of a MIP command.
Definition: mip_cmdqueue.hpp:46
void setUpdateFunctionFree()
Sets the update callback function (free function version).
Definition: mip_interface.hpp:344
bool defaultUpdate(Timeout wait_time, bool from_cmd=false)
Definition: mip_interface.hpp:199
bool mip_interface_default_update_ext_buffer(mip_interface *device, mip_timeout wait_time, bool from_cmd, uint8_t *buffer, size_t buffer_size)
Polls the port for new data or command replies using a supplied buffer.
Definition: mip_interface.c:446
void setUserPointer(void *ptr)
Sets an optional user data pointer which can be retrieved later.
Definition: mip_interface.hpp:175
A structure representing a MIP field.
Definition: mip_field.h:53
Represents the status of a MIP command.
Definition: mip_result.hpp:24
void setUpdateFunctionUserPointer()
Sets the update callback function (class member function version).
Definition: mip_interface.hpp:523
bool sendToDevice(microstrain::ConstU8ArrayView data)
Definition: mip_interface.hpp:192
void mip_interface_init(mip_interface *device, mip_timeout parse_timeout, mip_timeout base_reply_timeout, mip_send_callback send, mip_recv_callback recv, mip_update_callback update, void *user_pointer)
Initialize the mip_interface components.
Definition: mip_interface.c:150
void inputBytes(microstrain::ConstU8ArrayView data, Timestamp timestamp)
Definition: mip_interface.hpp:203
uint8_t mip_pending_cmd_response_length(const mip_pending_cmd *cmd)
Returns the length of the response data.
Definition: mip_cmdqueue.c:142
void setRecvFunctionDerived()
Sets the receive callback function (derived member function version).
Definition: mip_interface.hpp:656
void registerPacketCallback(C::mip_dispatch_handler &handler, uint8_t descriptorSet, bool afterFields, C::mip_dispatch_packet_callback callback, void *userData)
Definition: mip_interface.hpp:217
enum mip_cmd_result mip_interface_run_command_packet(mip_interface *device, const mip_packet_view *packet, mip_pending_cmd *cmd)
Similar to mip_interface_start_command_packet but waits for the command to complete.
Definition: mip_interface.c:672
void registerFieldCallback(C::mip_dispatch_handler &handler, uint8_t descriptorSet, uint8_t fieldDescriptor, C::mip_dispatch_field_callback callback, void *userData)
Definition: mip_interface.hpp:218
const Parser & parser() const
Definition: mip_interface.hpp:184
CmdResult runCommand(C::mip_interface &device, const Cmd &cmd, Timeout additionalTime=0)
Definition: mip_interface.hpp:1193
C++ class representing a MIP field.
Definition: mip_field.hpp:24
Definition: mip_interface.hpp:30
microstrain::U8ArrayView buffer_w()
Gets the entire storage buffer for the packet.
Definition: mip_packet.hpp:91
bool(* mip_recv_callback)(struct mip_interface *device, uint8_t *buffer, size_t max_length, mip_timeout wait_time, bool from_cmd, size_t *length_out, mip_timestamp *timestamp_out)
Called from mip_interface_recv_from_device() to receive data from the device port.
Definition: mip_interface.h:37
State of the interface for communicating with a MIP device.
Definition: mip_interface.h:44
void mip_pending_cmd_init_full(mip_pending_cmd *cmd, uint8_t descriptor_set, uint8_t field_descriptor, uint8_t response_descriptor, uint8_t *response_buffer, uint8_t response_buffer_size, mip_timeout additional_time)
Initialize a pending mip commmand with all parameters.
Definition: mip_cmdqueue.c:90
void setSendFunctionFree()
Sets the send callback function (free function version).
Definition: mip_interface.hpp:288
bool mip_interface_send_to_device(mip_interface *device, const uint8_t *data, size_t length)
Sends data to the port (i.e. from this library to the physical device).
Definition: mip_interface.c:323
Parser & parser()
Definition: mip_interface.hpp:181
void mip_cmd_queue_set_base_reply_timeout(mip_cmd_queue *queue, mip_timeout timeout)
Sets the base reply timeout for all commands.
Definition: mip_cmdqueue.c:483
void mip_interface_set_send_function(mip_interface *device, mip_send_callback callback)
Sets the send callback function.
Definition: mip_interface.c:185
@ DESCRIPTOR_SET
Definition: commands_3dm.hpp:31
microstrain::EmbeddedTimestamp Timestamp
Definition: mip_types.h:50
mip_parser * mip_interface_parser(mip_interface *device)
Returns the MIP parser for the device.
Definition: mip_interface.c:289
Represents a command awaiting a reply from the device.
Definition: mip_cmdqueue.h:37
C::mip_update_callback updateFunction() const
Definition: mip_interface.hpp:95
CmdResult runCommand(Args &&... args, Timeout additionalTime=0)
Definition: mip_interface.hpp:255
bool recv_from_connection(Connection *conn, U8ArrayView buffer, Timeout timeout, bool, size_t *length_out, Timestamp *timestamp_out)
Adapts microstrain::Connection::recvFromDevice to a signature compatible with mip interface receive c...
Definition: mip_interface.cpp:60
Timeout baseReplyTimeout() const
Definition: mip_interface.hpp:178
mip_cmd_queue * mip_interface_cmd_queue(mip_interface *device)
Returns the commmand queue for the device.
Definition: mip_interface.c:297
void mip_interface_input_packet_from_device(mip_interface *device, const mip_packet_view *packet, mip_timestamp timestamp)
Processes a pre-parsed packet for command replies and data.
Definition: mip_interface.c:510
CmdQueue & cmdQueue()
Definition: mip_interface.hpp:182
constexpr pointer data() const noexcept
Definition: array_view.hpp:69
bool sendToDevice(const C::mip_packet_view &packet)
Definition: mip_interface.hpp:193
void mip_interface_set_recv_function(mip_interface *device, mip_recv_callback callback)
Sets the receive callback function.
Definition: mip_interface.c:212
static constexpr C::mip_cmd_result ACK_OK
Command completed successfully.
Definition: mip_result.hpp:34
microstrain::EmbeddedTimeout Timeout
Definition: mip_types.h:51
@ MIP_ACK_OK
Command completed successfully.
Definition: mip_result.h:40
Represents a view over a contiguous array of objects, similar to std::span, and is implemented as a p...
Definition: array_view.hpp:44
void setBaseReplyTimeout(Timeout timeout)
Definition: mip_interface.hpp:179
enum mip_cmd_result mip_interface_wait_for_reply(mip_interface *device, mip_pending_cmd *cmd)
Blocks until the pending command completes or times out.
Definition: mip_interface.c:564
mip_recv_callback mip_interface_recv_function(const mip_interface *device)
Gets the receive function pointer.
Definition: mip_interface.c:224
void inputPacket(const C::mip_packet_view &packet, Timestamp timestamp)
Definition: mip_interface.hpp:205
void setSendFunctionUserPointer()
Sets the send callback function (class member function version w/ ptr & length).
Definition: mip_interface.hpp:382
void * userPointer()
Definition: mip_interface.hpp:176
Handler information for MIP Packet or Field callbacks.
Definition: mip_dispatch.h:94
Represents a type of connection.
Definition: connection.hpp:21
microstrain::C::microstrain_embedded_timestamp mip_timestamp
Definition: mip_types.h:15
bool(* mip_send_callback)(struct mip_interface *device, const uint8_t *data, size_t length)
Called from mip_interface_send_to_device() to send data to the device port. The application should fo...
Definition: mip_interface.h:36
bool(* mip_update_callback)(struct mip_interface *device, mip_timeout wait_time, bool from_cmd)
Callback function typedef for custom update behavior.
Definition: mip_interface.h:38
void mip_pending_cmd_init_with_timeout(mip_pending_cmd *cmd, uint8_t descriptor_set, uint8_t field_descriptor, mip_timeout additional_time)
Initialize a pending mip commmand with extra timeout time.
Definition: mip_cmdqueue.c:48
void inputBytesAndOrTime(microstrain::ConstU8ArrayView data, Timestamp timestamp)
Definition: mip_interface.hpp:209
bool recvFromDevice(microstrain::U8ArrayView buffer, Timeout wait_time, bool from_cmd, size_t *length_out, Timestamp *timestamp_out)
Definition: mip_interface.hpp:195
@ ANY_DESCRIPTOR
Definition: mip_interface.hpp:34
bool startCommand(C::mip_interface &device, C::mip_pending_cmd &pending, const Cmd &cmd, Timeout additionalTime)
Definition: mip_interface.hpp:1228
void setCallbacksDerived()
Sets the callback functions to a derived class object.
Definition: mip_interface.hpp:725
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
Represents a connected MIP device.
Definition: mip_interface.hpp:52
C++ class representing a view of a MIP packet.
Definition: mip_packet.hpp:34
void removeHandler(DispatchHandler &handler)
Definition: mip_interface.hpp:38
void setUpdateFunctionDerived()
Sets the update callback function (derived member function version).
Definition: mip_interface.hpp:676
void setCallbacksUserPointer(T *object)
constexpr size_t size() const noexcept
Definition: array_view.hpp:71
bool sendToDevice(const uint8_t *data, size_t length)
Definition: mip_interface.hpp:191
C++ class representing a MIP parser.
Definition: mip_parser.hpp:19
@ ANY_DATA_SET
Definition: mip_interface.hpp:33
Interface(Timeout parseTimeout, Timeout baseReplyTimeout)
Initialize the mip_interface components.
Definition: mip_interface.hpp:64
void mip_interface_register_field_callback(mip_interface *device, mip_dispatch_handler *handler, uint8_t descriptor_set, uint8_t field_descriptor, mip_dispatch_field_callback callback, void *user_data)
Registers a callback for packets of the specified descriptor set.
Definition: mip_interface.c:743
Definition: embedded_time.h:8
void mip_dispatcher_remove_all_handlers(mip_dispatcher *self)
Removes all handlers from the dispatcher.
Definition: mip_dispatch.c:239
void connect_interface(mip::Interface &device, Connection &conn)
Sets up the mip interface callbacks to point at this object.
Definition: mip_interface.cpp:47
void mip_interface_register_packet_callback(mip_interface *device, mip_dispatch_handler *handler, uint8_t descriptor_set, bool after_fields, mip_dispatch_packet_callback callback, void *user_data)
Registers a callback for packets of the specified descriptor set.
Definition: mip_interface.c:720
size_t extract(Serializer &serializer, Vector< T, N > &v)
Definition: common.hpp:133
void mip_interface_set_user_pointer(mip_interface *device, void *pointer)
Sets an optional user data pointer which can be retrieved later.
Definition: mip_interface.c:269
C++ wrapper around a command queue.
Definition: mip_cmdqueue.hpp:20
ArrayView< uint8_t > U8ArrayView
Definition: array_view.hpp:150