MIP SDK  0.0.1
MicroStrain Communications Library for embedded systems
tcp_connection.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <mip/mip_device.hpp>
4 
5 #include <mip/utils/tcp_socket.h>
6 
7 #include <string>
8 
9 
11 
12 namespace mip
13 {
14 namespace platform
15 {
16 
18 {
19 public:
20  TcpConnection() = default;
21  TcpConnection(const std::string& hostname, uint16_t port);
23 
24  bool recvFromDevice(uint8_t* buffer, size_t max_length, size_t* length_out, mip::Timestamp* timestamp) final;
25  bool sendToDevice(const uint8_t* data, size_t length) final;
26 
27 private:
28  tcp_socket mSocket;
29 };
30 
31 }; // namespace platform
32 }; // namespace mip
Represents a type of connection to a MIP device.
Definition: mip_device.hpp:136
Definition: tcp_connection.hpp:18
bool recvFromDevice(uint8_t *buffer, size_t max_length, size_t *length_out, mip::Timestamp *timestamp) final
Definition: tcp_connection.cpp:24
bool sendToDevice(const uint8_t *data, size_t length) final
Definition: tcp_connection.cpp:30
~TcpConnection()
Definition: tcp_connection.cpp:19
A collection of C++ classes and functions covering the full mip api.
Definition: commands_3dm.c:11
C::timestamp_type Timestamp
Definition: mip_types.h:43
Definition: tcp_socket.h:24
mip::Timestamp getCurrentTimestamp()