29 #define THINGSPEAK_UPDATE_URL QStringLiteral("https://api.thingspeak.com/update") 30 #define THINGSPEAK_MAX_ERRORS 5 31 #define THINGSPEAK_MAX_FIELDS 8 49 QByteArray result = Request->
ReadAll(1000).trimmed();
51 quint64
id = result.toLongLong(&ok);
59 LOG(VB_GENERAL, LOG_ERR, QStringLiteral(
"Failed to parse update id from %1 response (%2)").arg(
m_description,
uniqueId));
67 query.addQueryItem(QStringLiteral(
"api_key"),
m_apiKey);
71 query.addQueryItem(QStringLiteral(
"field%1").arg(i+1),
m_fieldValues[i]);
76 QNetworkRequest qrequest(url);
83 TorcNotifier* Create(
const QString &Type,
const QVariantMap &Details)
override 85 if (Type == QStringLiteral(
"thingspeak") && Details.contains(QStringLiteral(
"apikey")) && Details.contains(QStringLiteral(
"fields")))
#define THINGSPEAK_MAX_ERRORS
virtual bool Initialise(const QVariantMap &Details)
virtual void SetValid(bool Valid)
A wrapper around QNetworkRequest.
void ProcessRequest(TorcNetworkRequest *Request) override
TorcThingSpeakNotifierFactory TorcThingSpeakNotifierFactory
#define THINGSPEAK_MAX_FIELDS
TorcNetworkRequest * CreateRequest(void) override
QString m_fieldValues[32]
#define LOG(_MASK_, _LEVEL_, _STRING_)
QByteArray ReadAll(int Timeout)
TorcThingSpeakNotifier(const QVariantMap &Details)
#define THINGSPEAK_UPDATE_URL