error count in all sendError calls
This commit is contained in:
parent
8b34b562f8
commit
20edb0bf68
@ -242,7 +242,7 @@ void MqttClient::sendResponse(uint8_t *responseBuffer, uint16_t responseBufferLe
|
||||
}
|
||||
}
|
||||
|
||||
void MqttClient::sendError(uint8_t code, uint8_t token, char *name) {
|
||||
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("}}");
|
||||
if (m_disconnectState == 0) {
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
void begin(CmdServer *cmdServer);
|
||||
void exec();
|
||||
virtual void sendResponse(uint8_t *responseBuffer, uint16_t responseBufferLength, uint8_t token, char *name);
|
||||
virtual void sendError(uint8_t code, uint8_t token, char *name);
|
||||
virtual void sendError(uint8_t code, uint16_t count, uint8_t token, char *name);
|
||||
friend class MqttConfig;
|
||||
private:
|
||||
MqttConfig m_mqttConfig;
|
||||
|
@ -7,7 +7,7 @@
|
||||
class ResponseCallback {
|
||||
public:
|
||||
virtual void sendResponse(uint8_t *responseBuffer, uint16_t responseBufferLength, uint8_t token, char *name) =0;
|
||||
virtual void sendError(uint8_t code, uint8_t token, char *name) = 0;
|
||||
virtual void sendError(uint8_t code, uint16_t count, uint8_t token, char *name) = 0;
|
||||
};
|
||||
|
||||
class RequestSender {
|
||||
|
@ -122,7 +122,7 @@ void SendOctets::sendResponse(uint8_t *responseBuffer, uint16_t responseBufferLe
|
||||
out->println("");
|
||||
}
|
||||
|
||||
void SendOctets::sendError(uint8_t code, uint8_t token, char *name) {
|
||||
void SendOctets::sendError(uint8_t code, uint16_t count, uint8_t token, char *name) {
|
||||
switch (code) {
|
||||
case 1:
|
||||
m_server->println("SO RESP: no resp.");
|
||||
@ -180,7 +180,7 @@ void MeterBusMaster::prepareResponse(bool err, uint8_t in) {
|
||||
|
||||
//Serial << "r1" << endl;
|
||||
if (m_responseCallback != 0) {
|
||||
m_responseCallback->sendError(1, m_token, m_name);
|
||||
m_responseCallback->sendError(1, m_errorCount, m_token, m_name);
|
||||
}
|
||||
expectedChars = 0;
|
||||
state = 0;
|
||||
|
@ -25,7 +25,7 @@ public:
|
||||
virtual String getHelp() { return "Send octets"; }
|
||||
virtual String exec(String params);
|
||||
virtual void sendResponse(uint8_t *responseBuffer, uint16_t responseBufferLength, uint8_t token, char *name);
|
||||
virtual void sendError(uint8_t code, uint8_t token, char *name);
|
||||
virtual void sendError(uint8_t code, uint16_t count, uint8_t token, char *name);
|
||||
private:
|
||||
RequestSender *m_meterBusMaster;
|
||||
};
|
||||
|
@ -11,7 +11,7 @@ void MeterBusServer::sendResponse(uint8_t *responseBuffer, uint16_t responseBuff
|
||||
m_server.write(responseBuffer, responseBufferLength);
|
||||
}
|
||||
|
||||
void MeterBusServer::sendError(uint8_t code, uint8_t token, char *name) {
|
||||
void MeterBusServer::sendError(uint8_t code, uint16_t count, uint8_t token, char *name) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ public:
|
||||
void begin();
|
||||
void exec();
|
||||
virtual void sendResponse(uint8_t *responseBuffer, uint16_t responseBufferLength, uint8_t token, char *name);
|
||||
virtual void sendError(uint8_t code, uint8_t token, char *name);
|
||||
virtual void sendError(uint8_t code, uint16_t count, uint8_t token, char *name);
|
||||
private:
|
||||
EthernetServer m_server;
|
||||
EthernetClient m_client;
|
||||
|
Loading…
x
Reference in New Issue
Block a user