Can be used with another connection to communicate with a device, and record the data at the same time.
More...
#include <recording_connection.hpp>
|
static constexpr auto | TYPE = "Recording" |
|
static constexpr auto | TYPE = "None" |
|
Can be used with another connection to communicate with a device, and record the data at the same time.
◆ RecordingConnection()
microstrain::connections::RecordingConnection::RecordingConnection |
( |
Connection * |
connection, |
|
|
std::ostream * |
recvStream = nullptr , |
|
|
std::ostream * |
sendStream = nullptr |
|
) |
| |
Creates a RecordingConnection that will write received bytes to recvStream, and sent bytes to sendStream.
- Parameters
-
connection | Connection object that will actually communicate with the device |
recvStream | The stream to write to when bytes are received. Null if received bytes should not be written to a stream |
sendStream | The stream to write to when bytes are sent. Null if sent bytes should not be written to a stream |
◆ ~RecordingConnection()
microstrain::connections::RecordingConnection::~RecordingConnection |
( |
| ) |
|
|
default |
◆ connect()
bool microstrain::connections::RecordingConnection::connect |
( |
| ) |
|
|
inlineoverridevirtual |
◆ disconnect()
bool microstrain::connections::RecordingConnection::disconnect |
( |
| ) |
|
|
inlineoverridevirtual |
◆ interfaceName()
const char* microstrain::connections::RecordingConnection::interfaceName |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ isConnected()
bool microstrain::connections::RecordingConnection::isConnected |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ parameter()
uint32_t microstrain::connections::RecordingConnection::parameter |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ recvFileBytesWritten()
uint64_t microstrain::connections::RecordingConnection::recvFileBytesWritten |
( |
| ) |
const |
|
inline |
◆ recvFromDevice()
bool microstrain::connections::RecordingConnection::recvFromDevice |
( |
uint8_t * |
buffer, |
|
|
size_t |
max_length, |
|
|
unsigned int |
wait_time_ms, |
|
|
size_t * |
length_out, |
|
|
EmbeddedTimestamp * |
timestamp_out |
|
) |
| |
|
overridevirtual |
Receives bytes from the device.
- Parameters
-
buffer | Buffer to store the received data in |
max_length | Max number of bytes that can be read. Should be at most the length of buffer. |
wait_time_ms | Time to wait for data in milliseconds. |
length_out | Number of bytes actually read. |
timestamp_out | Timestamp of when the data was received |
Implements microstrain::Connection.
◆ sendFileBytesWritten()
uint64_t microstrain::connections::RecordingConnection::sendFileBytesWritten |
( |
| ) |
const |
|
inline |
◆ sendToDevice()
bool microstrain::connections::RecordingConnection::sendToDevice |
( |
const uint8_t * |
data, |
|
|
size_t |
length |
|
) |
| |
|
overridevirtual |
Sends bytes to the device.
- Parameters
-
data | The data to send to the device |
length | Length of data in bytes |
Implements microstrain::Connection.
◆ mConnection
Connection* microstrain::connections::RecordingConnection::mConnection |
|
protected |
◆ mRecvFile
std::ostream* microstrain::connections::RecordingConnection::mRecvFile |
|
protected |
◆ mRecvFileWritten
uint64_t microstrain::connections::RecordingConnection::mRecvFileWritten = 0 |
|
protected |
◆ mSendFile
std::ostream* microstrain::connections::RecordingConnection::mSendFile |
|
protected |
◆ mSendFileWritten
uint64_t microstrain::connections::RecordingConnection::mSendFileWritten = 0 |
|
protected |
◆ TYPE
constexpr auto microstrain::connections::RecordingConnection::TYPE = "Recording" |
|
staticconstexpr |
The documentation for this class was generated from the following files: