mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Added/Updated/Fixed doxygen comments
This commit is contained in:
@@ -18,91 +18,142 @@
|
||||
|
||||
class ImageProcessor;
|
||||
|
||||
/// @brief The Connection object created by \a JsonServer when a new connection is establshed
|
||||
///
|
||||
/// The Connection object created by \a JsonServer when a new connection is establshed
|
||||
///
|
||||
class JsonClientConnection : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/// @brief Constructor
|
||||
///
|
||||
/// Constructor
|
||||
/// @param socket The Socket object for this connection
|
||||
/// @param hyperion The Hyperion server
|
||||
///
|
||||
JsonClientConnection(QTcpSocket * socket, Hyperion * hyperion);
|
||||
|
||||
/// @brief Destructor
|
||||
///
|
||||
/// Destructor
|
||||
///
|
||||
~JsonClientConnection();
|
||||
|
||||
signals:
|
||||
/// @brief Signal which is emitted when the connection is being closed
|
||||
///
|
||||
/// Signal which is emitted when the connection is being closed
|
||||
/// @param connection This connection object
|
||||
///
|
||||
void connectionClosed(JsonClientConnection * connection);
|
||||
|
||||
private slots:
|
||||
/// @brief Slot called when new data has arrived
|
||||
///
|
||||
/// Slot called when new data has arrived
|
||||
///
|
||||
void readData();
|
||||
|
||||
/// @brief Slot called when this connection is being closed
|
||||
///
|
||||
/// Slot called when this connection is being closed
|
||||
///
|
||||
void socketClosed();
|
||||
|
||||
private:
|
||||
/// @brief Handle an incoming JSON message
|
||||
///
|
||||
/// Handle an incoming JSON message
|
||||
///
|
||||
/// @param message the incoming message as string
|
||||
///
|
||||
void handleMessage(const std::string & message);
|
||||
|
||||
/// @brief Handle an incoming JSON Color message
|
||||
///
|
||||
/// Handle an incoming JSON Color message
|
||||
///
|
||||
/// @param message the incoming message
|
||||
///
|
||||
void handleColorCommand(const Json::Value & message);
|
||||
|
||||
/// @brief Handle an incoming JSON Image message
|
||||
///
|
||||
/// Handle an incoming JSON Image message
|
||||
///
|
||||
/// @param message the incoming message
|
||||
///
|
||||
void handleImageCommand(const Json::Value & message);
|
||||
|
||||
/// @brief Handle an incoming JSON Server info message
|
||||
///
|
||||
/// Handle an incoming JSON Server info message
|
||||
///
|
||||
/// @param message the incoming message
|
||||
///
|
||||
void handleServerInfoCommand(const Json::Value & message);
|
||||
|
||||
/// @brief Handle an incoming JSON Clear message
|
||||
///
|
||||
/// Handle an incoming JSON Clear message
|
||||
///
|
||||
/// @param message the incoming message
|
||||
///
|
||||
void handleClearCommand(const Json::Value & message);
|
||||
|
||||
/// @brief Handle an incoming JSON Clearall message
|
||||
///
|
||||
/// Handle an incoming JSON Clearall message
|
||||
///
|
||||
/// @param message the incoming message
|
||||
///
|
||||
void handleClearallCommand(const Json::Value & message);
|
||||
|
||||
/// @brief Handle an incoming JSON Transform message
|
||||
///
|
||||
/// Handle an incoming JSON Transform message
|
||||
///
|
||||
/// @param message the incoming message
|
||||
///
|
||||
void handleTransformCommand(const Json::Value & message);
|
||||
|
||||
/// @brief Handle an incoming JSON message of unknown type
|
||||
///
|
||||
/// Handle an incoming JSON message of unknown type
|
||||
///
|
||||
/// @param message the incoming message
|
||||
///
|
||||
void handleNotImplemented();
|
||||
|
||||
/// @brief Send a message to the connected client
|
||||
///
|
||||
/// Send a message to the connected client
|
||||
///
|
||||
/// @param message The JSON message to send
|
||||
///
|
||||
void sendMessage(const Json::Value & message);
|
||||
|
||||
/// @brief Send a standard reply indicating success
|
||||
///
|
||||
/// Send a standard reply indicating success
|
||||
///
|
||||
void sendSuccessReply();
|
||||
|
||||
/// @brief Send an error message back to the client
|
||||
///
|
||||
/// Send an error message back to the client
|
||||
///
|
||||
/// @param error String describing the error
|
||||
///
|
||||
void sendErrorReply(const std::string & error);
|
||||
|
||||
private:
|
||||
/// @brief Check if a JSON messag is valid according to a given JSON schema
|
||||
///
|
||||
/// Check if a JSON messag is valid according to a given JSON schema
|
||||
///
|
||||
/// @param message JSON message which need to be checked
|
||||
/// @param schemaResource Qt esource identifier with the JSON schema
|
||||
/// @param errors Output error message
|
||||
///
|
||||
/// @return true if message conforms the given JSON schema
|
||||
///
|
||||
bool checkJson(const Json::Value & message, const QString &schemaResource, std::string & errors);
|
||||
|
||||
private:
|
||||
/// The TCP-Socket that is connected tot the Json-client
|
||||
QTcpSocket * _socket;
|
||||
|
||||
/// The processor for translating images to led-values
|
||||
ImageProcessor * _imageProcessor;
|
||||
|
||||
/// Link to Hyperion for writing led-values to a priority channel
|
||||
Hyperion * _hyperion;
|
||||
|
||||
/// The buffer used for reading data from the socket
|
||||
QByteArray _receiveBuffer;
|
||||
};
|
||||
|
Reference in New Issue
Block a user