MIP_SDK
v3.0.0
MicroStrain Communications Library for embedded systems
|
Go to the documentation of this file.
3 #include "../connection.hpp"
25 static constexpr
auto TYPE =
"Serial";
31 bool sendToDevice(
const uint8_t* data,
size_t length)
final;
45 std::string mPortName;
49 const char*
interfaceName()
const override {
return mPortName.c_str(); }
50 uint32_t
parameter()
const override {
return mBaudrate; }
59 static constexpr
auto TYPE =
"USB";
const char * mType
Definition: connection.hpp:59
SerialConnection(std::string portName, uint32_t baudrate)
Creates a Serial Connection that will communicate with a device over serial.
Definition: serial_connection.cpp:16
static constexpr auto TYPE
Definition: serial_connection.hpp:25
const char * interfaceName() const override
Definition: serial_connection.hpp:49
bool connect() override
Connect to the port.
Definition: serial_connection.cpp:38
Definition: serial_port.h:42
A serial connection but indicates that it's actually a USB connection.
Definition: serial_connection.hpp:56
bool recvFromDevice(uint8_t *buffer, size_t max_length, unsigned int wait_time_ms, size_t *length_out, EmbeddedTimestamp *timestamp_out) final
Receives bytes from the device.
Definition: serial_connection.cpp:58
Can be used on Windows, OSX, or linux to communicate with a MIP device over serial.
Definition: serial_connection.hpp:21
static constexpr auto TYPE
Definition: serial_connection.hpp:59
C::microstrain_embedded_timestamp EmbeddedTimestamp
Definition: embedded_time.hpp:9
bool sendToDevice(const uint8_t *data, size_t length) final
Sends bytes to the device.
Definition: serial_connection.cpp:66
Represents a type of connection.
Definition: connection.hpp:25
void connectionInfo(std::string &name, uint32_t &baudrate) const
Definition: serial_connection.hpp:37
bool isConnected() const override
Check if the port is connected.
Definition: serial_connection.cpp:32
UsbSerialConnection(const std::string &portName, uint32_t baudrate)
Definition: serial_connection.hpp:61
~SerialConnection()
Closes the underlying serial port.
Definition: serial_connection.cpp:26
bool disconnect() override
Disconnect from the port.
Definition: serial_connection.cpp:47
uint32_t parameter() const override
Definition: serial_connection.hpp:50
Definition: embedded_time.h:8