API Documentation
Loading...
Searching...
No Matches
WebSocketConnection Class Reference

A ConnectionBackend that allows the software to interface with QWebSocket for communicating with WebSocket devices. More...

#include <WebSocketConnection.h>

Inheritance diagram for WebSocketConnection:
[legend]
Collaboration diagram for WebSocketConnection:
[legend]

Public Member Functions

virtual uint04 bytesAvailable () const override
 
virtual void close () override
 
virtual bool isOpen () const override
 
virtual TranslatedString lastError () const override
 
virtual bool open (const ConnectionInfo &request) override
 
virtual uint04 peek (char *, uint04 size) const override
 
virtual uint04 rx (char *, uint04 size=Constant< uint04 >::Max) override
 
virtual bool setPort (QWebSocket *tcp_port)
 
void setSocket (QWebSocket *socket)
 
virtual void tx (const String &command) override
 
virtual bool waitForConnection (QWebSocket *socket, const ConnectionInfo &request)
 
virtual bool waitForReadyRead (const TimeSpan &span) override
 
 WebSocketConnection (ProgressInfo *log)
 
 ~WebSocketConnection ()
 
- Public Member Functions inherited from ConnectionBackend
 ConnectionBackend (ProgressInfo *log)
 
virtual String threadID () const
 

Protected Slots

void binaryMessageRecieved (const QByteArray &array)
 
void handleSocketErrorSlot (int error)
 
void textMessageRecieved (const QString &message)
 

Protected Attributes

String m_data
 
TranslatedString m_last_error
 
QWebSocket * m_socket = nullptr
 
- Protected Attributes inherited from ConnectionBackend
ProgressInfom_log
 

Additional Inherited Members

- Signals inherited from ConnectionBackend
void connectionStateChangedSignal (ConnectionState state)
 
void dataAvailableSignal ()
 

Detailed Description

A ConnectionBackend that allows the software to interface with QWebSocket for communicating with WebSocket devices.


WebSockets is a web technology providing full-duplex communications channels over a single TCP connection. The WebSocket protocol was standardized by the IETF as RFC 6455 in 2011. QWebSocket can both be used in a client application and server application.

Constructor & Destructor Documentation

◆ WebSocketConnection()

◆ ~WebSocketConnection()

Member Function Documentation

◆ binaryMessageRecieved

void binaryMessageRecieved ( const QByteArray & array)
protectedslot

◆ bytesAvailable()

virtual uint04 bytesAvailable ( ) const
overridevirtual

Implements ConnectionBackend.

◆ close()

virtual void close ( )
overridevirtual

Implements ConnectionBackend.

◆ handleSocketErrorSlot

void handleSocketErrorSlot ( int error)
protectedslot

◆ isOpen()

virtual bool isOpen ( ) const
overridevirtual

Implements ConnectionBackend.

◆ lastError()

virtual TranslatedString lastError ( ) const
overridevirtual

Implements ConnectionBackend.

◆ open()

virtual bool open ( const ConnectionInfo & request)
overridevirtual

Implements ConnectionBackend.

◆ peek()

virtual uint04 peek ( char * ,
uint04 size ) const
overridevirtual

Implements ConnectionBackend.

◆ rx()

virtual uint04 rx ( char * ,
uint04 size = Constantuint04 >::Max )
overridevirtual

Implements ConnectionBackend.

◆ setPort()

virtual bool setPort ( QWebSocket * tcp_port)
virtual

◆ setSocket()

void setSocket ( QWebSocket * socket)

◆ textMessageRecieved

void textMessageRecieved ( const QString & message)
protectedslot

◆ tx()

virtual void tx ( const String & command)
overridevirtual

Implements ConnectionBackend.

◆ waitForConnection()

virtual bool waitForConnection ( QWebSocket * socket,
const ConnectionInfo & request )
virtual

◆ waitForReadyRead()

virtual bool waitForReadyRead ( const TimeSpan & span)
overridevirtual

Implements ConnectionBackend.

Member Data Documentation

◆ m_data

String m_data
protected

◆ m_last_error

TranslatedString m_last_error
protected

◆ m_socket

QWebSocket* m_socket = nullptr
protected

The documentation for this class was generated from the following file: