mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-26 20:23:41 +00:00
Temporarily removed KMP
This commit is contained in:
@@ -78,7 +78,7 @@ ADC_MODE(ADC_VCC);
|
||||
|
||||
#include "MeterCommunicator.h"
|
||||
#include "PassiveMeterCommunicator.h"
|
||||
#include "KmpCommunicator.h"
|
||||
//#include "KmpCommunicator.h"
|
||||
#include "PulseMeterCommunicator.h"
|
||||
|
||||
#include "Uptime.h"
|
||||
@@ -171,7 +171,7 @@ RealtimePlot rtp;
|
||||
|
||||
MeterCommunicator* mc = NULL;
|
||||
PassiveMeterCommunicator* passiveMc = NULL;
|
||||
KmpCommunicator* kmpMc = NULL;
|
||||
//KmpCommunicator* kmpMc = NULL;
|
||||
PulseMeterCommunicator* pulseMc = NULL;
|
||||
|
||||
bool networkConnected = false;
|
||||
@@ -260,9 +260,11 @@ void rxerr(int err) {
|
||||
if(passiveMc != NULL) {
|
||||
passiveMc->rxerr(err);
|
||||
}
|
||||
/*
|
||||
if(kmpMc != NULL) {
|
||||
kmpMc->rxerr(err);
|
||||
}
|
||||
*/
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -730,10 +732,12 @@ void loop() {
|
||||
delete pulseMc;
|
||||
pulseMc = NULL;
|
||||
}
|
||||
/*
|
||||
if(kmpMc != NULL) {
|
||||
delete(kmpMc);
|
||||
kmpMc = NULL;
|
||||
}
|
||||
*/
|
||||
if(passiveMc == NULL) {
|
||||
passiveMc = new PassiveMeterCommunicator(&Debug);
|
||||
}
|
||||
@@ -741,6 +745,7 @@ void loop() {
|
||||
hwSerial = passiveMc->getHwSerial();
|
||||
mc = passiveMc;
|
||||
break;
|
||||
/*
|
||||
case METER_PARSER_KAMSTRUP:
|
||||
if(pulseMc != NULL) {
|
||||
delete pulseMc;
|
||||
@@ -757,11 +762,14 @@ void loop() {
|
||||
hwSerial = kmpMc->getHwSerial();
|
||||
mc = kmpMc;
|
||||
break;
|
||||
*/
|
||||
case METER_PARSER_PULSE:
|
||||
/*
|
||||
if(kmpMc != NULL) {
|
||||
delete(kmpMc);
|
||||
kmpMc = NULL;
|
||||
}
|
||||
*/
|
||||
if(passiveMc != NULL) {
|
||||
delete(passiveMc);
|
||||
passiveMc = NULL;
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
/**
|
||||
* @copyright Utilitech AS 2024
|
||||
* License: Fair Source
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "MeterCommunicator.h"
|
||||
#include "RemoteDebug.h"
|
||||
#include "AmsConfiguration.h"
|
||||
#include "Timezone.h"
|
||||
#include "ImpulseAmsData.h"
|
||||
|
||||
class KmpCommunicator : public MeterCommunicator {
|
||||
public:
|
||||
KmpCommunicator(RemoteDebug* debugger);
|
||||
void configure(MeterConfig& config, Timezone* tz);
|
||||
bool loop();
|
||||
AmsData* getData(AmsData& meterState);
|
||||
int getLastError();
|
||||
bool isConfigChanged();
|
||||
void getCurrentConfig(MeterConfig& meterConfig);
|
||||
|
||||
HardwareSerial* getHwSerial();
|
||||
void rxerr(int err);
|
||||
|
||||
private:
|
||||
uint64_t lastUpdate = 0;
|
||||
uint8_t reqNo = 0;
|
||||
|
||||
uint8_t *hanBuffer = NULL;
|
||||
uint16_t hanBufferSize = 0;
|
||||
Stream *hanSerial;
|
||||
#if defined(ESP8266)
|
||||
SoftwareSerial *swSerial = NULL;
|
||||
#endif
|
||||
HardwareSerial *hwSerial = NULL;
|
||||
uint8_t rxBufferErrors = 0;
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user