consider count in sendError
This commit is contained in:
@ -244,7 +244,7 @@ void MqttClient::sendResponse(uint8_t *responseBuffer, uint16_t responseBufferLe
|
||||
|
||||
void MqttClient::sendError(uint8_t code, uint16_t count, uint8_t token, char *name) {
|
||||
String msg = String("{ \"metadata\": { \"device\": \"MeterbusHub\", \"error\": ")
|
||||
+ code + String(", \"token\": ") + token + String(", \"name\": ") + String(name) + String(" }, \"data\": { \"uptime\": ") + m_uptime + String("}}");
|
||||
+ code + String(", \"count\": ") + count + String(", \"token\": ") + token + String(", \"name\": ") + String(name) + String(" }, \"data\": { \"uptime\": ") + m_uptime + String("}}");
|
||||
if (m_disconnectState == 0) {
|
||||
//Serial << "publishing " << msg << endl;
|
||||
//Serial << "length: " << msg.length() << endl;
|
||||
|
@ -123,9 +123,14 @@ void SendOctets::sendResponse(uint8_t *responseBuffer, uint16_t responseBufferLe
|
||||
}
|
||||
|
||||
void SendOctets::sendError(uint8_t code, uint16_t count, uint8_t token, char *name) {
|
||||
Print *out = m_server;
|
||||
switch (code) {
|
||||
case 1:
|
||||
m_server->println("SO RESP: no resp.");
|
||||
out->println("SO RESP: no resp.");
|
||||
out->print("Code: ");
|
||||
out->println(code);
|
||||
out->print("Count: ");
|
||||
out->println(count);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user