API Documentation
Loading...
Searching...
No Matches
SerialPortConnection.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/Connection.h>
4class QSerialPort;
5namespace NDEVR
6{
17 {
18 public:
21 virtual uint04 peek(char* s, uint04 size) const override;
22 virtual uint04 rx(char*, uint04 size = Constant<uint04>::Max) override;
23 virtual void tx(const String& command) override;
24 virtual bool open(const ConnectionInfo& request) override;
25 virtual void close() override;
26 virtual bool isOpen() const override;
27 virtual uint04 bytesAvailable() const override;
28 virtual TranslatedString lastError() const override;
29 bool setSerialPort(QSerialPort* serial_port, ConnectionOpenType connection_type = ConnectionOpenType::e_read_write, ProgressInfo* log = nullptr);
30 virtual bool waitForReadyRead(const TimeSpan& span) override;
31 void handleSerialPortError(int error, ProgressInfo* log);
32 static void ToString(const QSerialPort& value, String& string);
33 static void FromString(const String& string, QSerialPort& value);
34 static ConnectionInfo CreateInfo(const QSerialPortInfo& value);
35 static ConnectionInfo CreateInfo(const QSerialPort& value);
36 String threadID() const override;
37 protected:
38 QSerialPort* m_serial_port = nullptr;
40 };
42 {
43 public:
44 virtual bool handlesType(const String& request) const override;
45 virtual ConnectionBackend* createConnection(const ConnectionInfo& request) override;
47 virtual Buffer<ConnectionInfo> availableConnections(const ConnectionSearchParamaters& params) override;
48 virtual Buffer<ConnectionCategory> availableConnectionCatagories() override;
49 };
50}
#define NDEVR_SERIAL_PORT_API
Definition DLLInfo.h:73
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition Connection.h:134
Definition Connection.h:155
Definition ProgressInfo.hpp:43
Definition SerialPortConnection.h:42
Definition SerialPortConnection.h:17
TranslatedString m_last_error
Definition SerialPortConnection.h:39
Definition String.h:40
Definition TimeSpan.h:40
Definition TranslatedString.h:9
Definition ACIColor.h:37
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
ConnectionOpenType
Definition Connection.h:69
Definition Connection.h:87
Definition Connection.h:120
Definition BaseValues.hpp:272
Definition SerialPortConnection.h:8
uint04 parity
Definition SerialPortConnection.h:12
uint04 flow_control
Definition SerialPortConnection.h:14
uint04 stop_bits
Definition SerialPortConnection.h:13
String port_name
Definition SerialPortConnection.h:9
uint04 baud_rate
Definition SerialPortConnection.h:10
uint04 data_bits
Definition SerialPortConnection.h:11