34#include <NDEVR/Device.h>
35#include <NDEVR/String.h>
36#include <NDEVR/TimeSpan.h>
43class QBluetoothSocket;
44class QBluetoothServiceInfo;
45class QBluetoothDeviceInfo;
46class QBluetoothAddress;
184 virtual void tx(
const String& data);
187 virtual void close();
189 virtual void clearConnectionInfo();
190 [[nodiscard]]
virtual bool isOpen()
const;
191 [[nodiscard]]
virtual const String&
address()
const {
return m_connection_info.address; }
192 [[nodiscard]]
virtual const String&
type()
const {
return m_connection_info.type; }
195 [[nodiscard]]
virtual String threadID()
const;
196 [[nodiscard]]
virtual bool canReadLine(
char deliminator =
'\n')
const;
205 virtual bool waitForReadyRead(
const TimeSpan& span);
206 virtual void setDefaultRxBufferSize(
uint04 default_rx_buffer_size);
208 [[nodiscard]]
virtual bool ping()
const;
216 void initConnection();
242 bool m_log_tx =
true;
243 bool m_log_rx =
true;
244 bool m_show_errors =
false;
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
void connectionStateChangedSignal(ConnectionState state)
virtual bool waitForReadyRead(const TimeSpan &span)=0
virtual String threadID() const
Definition Connection.h:147
void dataAvailableSignal()
virtual bool open(const ConnectionInfo &request)=0
virtual uint04 bytesAvailable() const =0
virtual void tx(const String &command)=0
ProgressInfo * m_log
Definition Connection.h:152
virtual uint04 rx(char *s, uint04 max_size=Constant< uint04 >::Max)=0
virtual uint04 peek(char *s, uint04 size=Constant< uint04 >::Max) const =0
virtual bool isOpen() const =0
virtual TranslatedString lastError() const =0
Definition Connection.h:155
static Buffer< ConnectionFactory * > s_registered_factories
Definition Connection.h:168
virtual bool handlesType(const String &request) const =0
virtual ConnectionBackend * createConnection(const ConnectionInfo &request)=0
virtual Buffer< ConnectionInfo > availableConnections(const ConnectionSearchParamaters ¶ms)=0
virtual Buffer< ConnectionCategory > availableConnectionCatagories()=0
Definition Connection.h:171
void connectionStateChangedSignal(ConnectionState state)
virtual const String & address() const
Definition Connection.h:191
String m_connection_rx_buffer
Definition Connection.h:231
void dataAvailableSignal()
ProgressInfo * rawNetworkLog()
Definition Connection.h:198
const ProgressInfo * rawNetworkLog() const
Definition Connection.h:201
Buffer< std::function< void(const String &)> > m_rx_callback
Definition Connection.h:230
virtual void setTXDelay(const TimeSpan &tx_delay)
Definition Connection.h:197
void setRawLoggingMode(RawConnectionLoggingMode mode)
Definition Connection.h:207
const ConnectionInfo & connectionInfo() const
Definition Connection.h:202
ConnectionInfo m_connection_info
Definition Connection.h:228
Buffer< std::function< void(const String &)> > m_tx_callback
Definition Connection.h:229
virtual const String & type() const
Definition Connection.h:192
Time lastRxTime() const
Definition Connection.h:199
Time lastTxTime() const
Definition Connection.h:200
Definition ProgressInfo.hpp:43
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
Definition TranslatedString.h:9
RawConnectionLoggingMode
Definition Connection.h:82
ConnectionState
Definition Connection.h:53
@ e_attempting_connection
@ e_access_to_port_denied
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
uint04 wait_time
Definition IPWidget.cpp:141
@ e_initializing
Definition OrientationSensor.h:43
ConnectionOpenType
Definition Connection.h:69
Definition Connection.h:114
String icon
Definition Connection.h:117
TranslatedString name
Definition Connection.h:115
String id
Definition Connection.h:116
Definition Connection.h:87
HARDWARE_API void setID(const String &id)
Definition Connection.cpp:17
String type
Definition Connection.h:89
bool operator!=(const ConnectionInfo &other) const
Definition Connection.h:105
String thread_id
Definition Connection.h:94
ProgressInfo * log
Definition Connection.h:93
void autoSetName()
Definition Connection.h:100
TranslatedString name
Definition Connection.h:88
ConnectionOpenType connect_mode
Definition Connection.h:91
String address
Definition Connection.h:90
String id() const
Definition Connection.h:96
TimeSpan max_timeout
Definition Connection.h:92
Definition Connection.h:120
std::function< SearchReturn(const ConnectionInfo &)> on_service_found
Definition Connection.h:128
std::function< SearchReturn(const ConnectionInfo &)> on_device_found
Definition Connection.h:127
ProgressInfo * log
Definition Connection.h:129
SearchReturn
Definition Connection.h:122
@ e_continue_searching
Definition Connection.h:123
@ e_stop_searching
Definition Connection.h:124
Buffer< ConnectionCategory > allowed_categories
Definition Connection.h:126
TimeSpan timeout
Definition Connection.h:130
Definition BaseValues.hpp:272