diff --git a/library.json b/library.json index 91352d7..90b1723 100644 --- a/library.json +++ b/library.json @@ -6,7 +6,7 @@ "type": "git", "url": "https://github.com/eloquentarduino/EloquentSurveillance" }, - "version": "1.0.14", + "version": "1.0.15", "authors": { "name": "Simone Salerno", "url": "https://github.com/eloquentarduino" diff --git a/library.properties b/library.properties index 40fd2e3..73ff14d 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=EloquentSurveillance -version=1.0.14 +version=1.0.15 author=Simone Salerno maintainer=Simone Salerno sentence=Esp32-cam surveillance system, batteries included diff --git a/src/Motion.h b/src/Motion.h index 1f42533..3b59e14 100644 --- a/src/Motion.h +++ b/src/Motion.h @@ -409,13 +409,13 @@ namespace EloquentSurveillance { uint8_t blockSize = _location.size; - for (uint16_t y = _location.y > blockSize / 2 ? ; y < _location.y + blockSize; y += blockSize / 2) { + for (uint16_t y = _location.y > blockSize / 2 ; y < _location.y + blockSize; y += blockSize / 2) { for (uint16_t x = _location.x; x < _location.x + blockSize; x += blockSize / 2) { uint16_t confidence = 0; uint16_t support = 0; for (uint16_t j = y; j < y + blockSize; j++) { - uint32_t offset = j * W; + uint32_t offset = j * (getWidth()/8); for (uint16_t i = x; i < x + blockSize; i++) { if (_changed[offset + i]) @@ -440,7 +440,7 @@ namespace EloquentSurveillance { * */ template - void forEachBlock(Callback callback, Reducer& reducer, uint16_t x, uint16_t y, uint16_t width, uitn16_t height, uint8_t size) { + void forEachBlock(Callback callback, Reducer& reducer, uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t size) { for (uint16_t j = y; j < height - size; j += size / 2) { for (uint16_t i = x; i < width - size; i += size / 2) { reducer.newBlock(); diff --git a/src/WiFiHelper.h b/src/WiFiHelper.h index 97994f5..e96ee93 100644 --- a/src/WiFiHelper.h +++ b/src/WiFiHelper.h @@ -55,7 +55,7 @@ namespace EloquentSurveillance { String getIP() { IPAddress ip = _isClient ? WiFi.localIP() : WiFi.softAPIP(); - return String(ip[0]) + '.' + ip[1] + '.' + ip[2] + '.' + ip[3]; + return String(ip[0] + '.' + ip[1] + '.' + ip[2] + '.' + ip[3]); }