API Documentation
Loading...
Searching...
No Matches
BluetoothConnection.h
Go to the documentation of this file.
1#pragma once
2#include <NDEVR/Connection.h>
3class QBluetoothSocket;
4namespace NDEVR
5{
6 /**--------------------------------------------------------------------------------------------------
7 \brief A ConnectionBackend that provides logic for interfacing with a QBluetooth connection.
8 **/
10 {
11 public:
14 virtual uint04 peek(char*, uint04 size = Constant<uint04>::Max) const override;
15 virtual uint04 rx(char* s, uint04 size = Constant<uint04>::Max) override;
16 virtual void tx(const String& command) override;
17 virtual bool open(const ConnectionInfo& request) override;
18 virtual bool openInMainThread(const ConnectionInfo& request);
19 virtual void close() override;
20 virtual bool isOpen() const override;
21 virtual uint04 bytesAvailable() const override;
22 virtual TranslatedString lastError() const override;
23 virtual bool setBluetoothPort(QBluetoothSocket* bluetooth_port, const ConnectionInfo& info);
24 virtual bool waitForReadyRead(const TimeSpan& span) override;
25 void handleBluetoothError(int error);
26 protected:
27 QBluetoothSocket* m_socket = nullptr;
29 };
30 /**--------------------------------------------------------------------------------------------------
31 \brief A ConnectionFactory that enables the creation of a BluetoothConnection for interfacing with
32 a QBluetoothSocket
33 **/
35 {
36 public:
37 virtual bool handlesType(const String& request) const override;
38 virtual ConnectionBackend* createConnection(const ConnectionInfo& request) override;
41 };
42}
A ConnectionFactory that enables the creation of a BluetoothConnection for interfacing with a QBlueto...
Definition BluetoothConnection.h:35
virtual Buffer< ConnectionInfo > availableConnections(const ConnectionSearchParamaters &params) override
virtual Buffer< ConnectionCategory > availableConnectionCatagories() override
virtual bool handlesType(const String &request) const override
virtual ConnectionBackend * createConnection(const ConnectionInfo &request) override
A ConnectionBackend that provides logic for interfacing with a QBluetooth connection.
Definition BluetoothConnection.h:10
virtual void tx(const String &command) override
TranslatedString m_last_error
Definition BluetoothConnection.h:28
virtual bool openInMainThread(const ConnectionInfo &request)
virtual void close() override
virtual bool setBluetoothPort(QBluetoothSocket *bluetooth_port, const ConnectionInfo &info)
void handleBluetoothError(int error)
virtual bool isOpen() const override
virtual uint04 rx(char *s, uint04 size=Constant< uint04 >::Max) override
BluetoothConnection(ProgressInfo *log)
QBluetoothSocket * m_socket
Definition BluetoothConnection.h:27
virtual uint04 peek(char *, uint04 size=Constant< uint04 >::Max) const override
virtual TranslatedString lastError() const override
virtual bool waitForReadyRead(const TimeSpan &span) override
virtual uint04 bytesAvailable() const override
virtual bool open(const ConnectionInfo &request) override
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Provides the unseen backend logic for setting up, tearing down, and sending data over a specific type...
Definition Connection.h:153
Stores factories that can be registered for creating Connections of various types.
Definition Connection.h:177
A light-weight base class for Log that allows processes to update, without the need for additional in...
Definition ProgressInfo.hpp:48
The core String class for the NDEVR API.
Definition String.h:69
Stores a time span, or difference between two times, with an optional start time.
Definition TimeSpan.h:46
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
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:96
A structure designed to store information about a specific Connection.
Definition Connection.h:97
Describes settings for performing a Connection search.
Definition Connection.h:136
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233