Local Service¶
The Local service is a unique service in the way, that it has now service client
like the TaskClient
for the Task
service. This is
because the local service holds only information for one location e.g. the
location where your home is.
-
class
Local
: public QObject¶ A implementation of the Knut local service.
Public Types
-
enum
MessageType
¶ This enum type describes the message types used to communicate with the Knut server via the KnutClient::writeRequest() as specified by the Knut local API.
Values:
-
LOCAL_REQUEST
= 1¶ Requests the local information.
-
LOCAL_RESPONSE
= 2¶ The local information send by the server.
-
Public Functions
-
void
connectToClient
(KnutClient *knutClient)¶ Connects to the KnutClient knutClient.
Connects the onKnutConnected() slot to the KnutClient::knutConnected() signal and the onReadyRead() slot to the signal KnutClient::receivedMessage() signal.
Public Slots
-
void
onReadyRead
(const QJsonObject &message, const quint8 &serviceId, const quint16 &messageType)¶ Slot called when a message is available.
If a message is received by the KnutClient, this slot is called. If the serviceId is
0x04
, the message will be handled.
Property
-
property
Local::isDaylight
This property describes whether it is currently day or night.
-
property
Local::nextSunRise
This property holds the date and time of the next sun rise.
-
property
Local::nextSunSet
This property holds the date and time of the next sun set.
-
property
Local::location
This property holds the location name.
-
enum