add writeMemory to facade, remove debug output from platform

This commit is contained in:
Thomas Kunze 2018-09-15 00:22:30 +02:00
parent 6334bfe3cb
commit dc362a79c3
5 changed files with 14 additions and 7 deletions

View File

@ -34,18 +34,18 @@ void measureTemp()
currentValue *= 100 * 100; currentValue *= 100 * 100;
// write new value to groupobject // write new value to groupobject
goCurrent.objectWriteFloat(currentValue); goCurrent.objectWriteFloatDpt9(currentValue);
if (currentValue > maxValue) if (currentValue > maxValue)
{ {
maxValue = currentValue; maxValue = currentValue;
goMax.objectWriteFloat(maxValue); goMax.objectWriteFloatDpt9(maxValue);
} }
if (currentValue < minValue) if (currentValue < minValue)
{ {
minValue = currentValue; minValue = currentValue;
goMin.objectWriteFloat(minValue); goMin.objectWriteFloatDpt9(minValue);
} }
} }

View File

@ -76,7 +76,7 @@ void EspPlatform::closeMultiCast()
bool EspPlatform::sendBytes(uint8_t * buffer, uint16_t len) bool EspPlatform::sendBytes(uint8_t * buffer, uint16_t len)
{ {
printHex("<- ",buffer, len); //printHex("<- ",buffer, len);
int result = 0; int result = 0;
result = _udp.beginPacketMulticast(_mulitcastAddr, _mulitcastPort, WiFi.localIP()); result = _udp.beginPacketMulticast(_mulitcastAddr, _mulitcastPort, WiFi.localIP());
result = _udp.write(buffer, len); result = _udp.write(buffer, len);
@ -97,7 +97,7 @@ int EspPlatform::readBytes(uint8_t * buffer, uint16_t maxLen)
} }
_udp.read(buffer, len); _udp.read(buffer, len);
printHex("-> ", buffer, len); //printHex("-> ", buffer, len);
return len; return len;
} }

@ -1 +1 @@
Subproject commit f50f03ad6edaa73c6bc41496de696e1d7306b30b Subproject commit fd2334a4af59e9cea5325d399afc639517a5d41a

View File

@ -9,6 +9,7 @@ KnxFacade knx;
KnxFacade::KnxFacade() : _bau(_platform) KnxFacade::KnxFacade() : _bau(_platform)
{ {
manufacturerId(0xfa); manufacturerId(0xfa);
_bau.addSaveRestore(this);
} }
bool KnxFacade::enabled() bool KnxFacade::enabled()
@ -61,6 +62,11 @@ void KnxFacade::readMemory()
_bau.readMemory(); _bau.readMemory();
} }
void KnxFacade::writeMemory()
{
_bau.writeMemory();
}
void KnxFacade::loop() void KnxFacade::loop()
{ {
if (currentState) if (currentState)
@ -108,7 +114,7 @@ void KnxFacade::start()
pinMode(_buttonPin, INPUT); pinMode(_buttonPin, INPUT);
attachInterrupt(_buttonPin, buttonDown, FALLING); attachInterrupt(_buttonPin, buttonDown, FALLING);
switchToSate(noWifiState); switchToSate(noWifiState);
checkStates(); checkStates();
_ticker.attach_ms(100, doLed); _ticker.attach_ms(100, doLed);

View File

@ -21,6 +21,7 @@ public:
uint32_t buttonPin(); uint32_t buttonPin();
void buttonPin(uint32_t value); void buttonPin(uint32_t value);
void readMemory(); void readMemory();
void writeMemory();
void loop(); void loop();
void knxLoop(); void knxLoop();
void registerGroupObjects(GroupObject* groupObjects, uint16_t count); void registerGroupObjects(GroupObject* groupObjects, uint16_t count);