mip_device.cpp
Go to the documentation of this file.
1 
2 #include "mip_device.hpp"
3 
4 namespace mip {
5 
14 
25 
26 
34 void Connection::connect_interface(C::mip_interface* device)
35 {
36  auto send = [](C::mip_interface* device, const uint8_t* data, size_t length)->bool
37  {
38  return static_cast<Connection*>(C::mip_interface_user_pointer(device))->sendToDevice(data, length);
39  };
40  auto recv = [](C::mip_interface* device, uint8_t* buffer, size_t max_length, C::mip_timeout wait_time, size_t* length_out, C::mip_timestamp* timestamp_out)->bool
41  {
42  return static_cast<Connection*>(C::mip_interface_user_pointer(device))->recvFromDevice(buffer, max_length, wait_time, length_out, timestamp_out);
43  };
44 
46 
49 }
50 
51 } // namespace mip
mip_interface
struct mip_interface mip_interface
State of the interface for communicating with a MIP device.
mip_interface_set_user_pointer
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:264
mip
Definition: ping.cpp:12
mip_interface_user_pointer
void * mip_interface_user_pointer(const mip_interface *device)
Retrieves the pointer set by mip_interface_set_user_pointer().
Definition: mip_interface.c:276
data
data
mip_interface_set_send_function
void mip_interface_set_send_function(mip_interface *device, mip_send_callback callback)
Sets the send callback function.
Definition: mip_interface.c:180
device
mip_interface device
Definition: CV7_example.c:47
mip_timestamp
uint64_t mip_timestamp
Type used for packet timestamps and timeouts.
Definition: mip_types.h:32
mip_interface_set_recv_function
void mip_interface_set_recv_function(mip_interface *device, mip_recv_callback callback)
Sets the receive callback function.
Definition: mip_interface.c:207
mip_timeout
mip_timestamp mip_timeout
Definition: mip_types.h:35
length
TF2SIMD_FORCE_INLINE tf2Scalar length(const Quaternion &q)


microstrain_inertial_driver
Author(s): Brian Bingham, Parker Hannifin Corp
autogenerated on Mon Jun 24 2024 02:51:40