2 Commits

Author SHA1 Message Date
Ondrej Trochta 88b878b4ff Merge pull request #1 from TrochtaOndrej/chata--test
Chata  test
2024-10-01 20:31:44 +02:00
Ondrej Trochta 0caeec996e test chata 2024-09-26 20:58:31 +02:00
9 changed files with 42 additions and 37 deletions
+14
View File
@@ -0,0 +1,14 @@
{
"folders": [
{
"name": "Arduino-GSM-Chata",
"path": "."
}
],
"settings": {
"files.associations": {
"pinsdefinitions": "c",
"new": "cpp"
}
}
}
+1 -11
View File
@@ -3,7 +3,7 @@
#include "GSMMobileData.h"
#include "EEPROMUtils.h"
#include "DeviceBase.h"
#include "DebugLog.h"
GSMMobileData::GSMMobileData(String id) : DeviceBase(id)
{
@@ -15,10 +15,6 @@ void GSMMobileData::readAllData(String id)
EEPROMUtils eepromUtils = EEPROMUtils();
MobileNumber = eepromUtils.readString(1, 20);
Sms = eepromUtils.readString(21, 100);
#ifdef DEBUG
DebugLog::log("Load from EEPROM. Mobile Number: " + MobileNumber + " SMS: " + Sms);
#endif
}
void GSMMobileData::updateMobileNumber(const String &newMobileNumber)
@@ -33,9 +29,6 @@ void GSMMobileData::updateMobileNumber(const String &newMobileNumber)
EEPROMUtils eepromUtils = EEPROMUtils();
MobileNumber = newMobileNumber;
eepromUtils.writeString(1, newMobileNumber, 20);
#ifdef DEBUG
DebugLog::log("Update Mobile Number: " + newMobileNumber);
#endif
}
}
@@ -50,8 +43,5 @@ void GSMMobileData::updateSMS(const String &newSMS)
EEPROMUtils eepromUtils = EEPROMUtils();
Sms = newSMS;
eepromUtils.writeString(21, newSMS, 100);
#ifdef DEBUG
DebugLog::log("Update sms: " + newSMS);
#endif
}
}
-1
View File
@@ -1,6 +1,5 @@
#include "PinTypeOut.h"
#include <Arduino.h>
#include "DebugLog.h"
void PinTypeOut::setOutputSignalToHigh()
+2 -1
View File
@@ -1,4 +1,4 @@
#include <WebServerData.h>
/*#include <WebServerData.h>
#include <Ethernet.h>
#include <Arduino.h>
@@ -46,3 +46,4 @@ String WebServerData::removeAllCharactersAfterEmptySpace(String &data)
data.replace("_", " ");
return data;
}
*/
+3 -2
View File
@@ -1,4 +1,4 @@
#ifndef WebServerData_H
/*ifndef WebServerData_H
#define WebServerData_H
#include <Ethernet.h>
@@ -19,4 +19,5 @@ public:
};
#endif // WebServerData_H
#endif // WebServerData_H
*/
+2 -1
View File
@@ -1,4 +1,4 @@
#include <Arduino.h>
/*#include <Arduino.h>
#include <Ethernet.h>
#include "WebServer.h"
#include "WebServerData.h"
@@ -134,3 +134,4 @@ void WebServer::SendToBrowser(const String &dataString)
}
client.println("");
}
*/
+3 -2
View File
@@ -1,4 +1,4 @@
#ifndef WebServer_H
/*#ifndef WebServer_H
#define WebServer_H
#include <WebServerData.h>
@@ -23,4 +23,5 @@ private:
void SendToBrowser(const String &dataString);
};
#endif // WebServer_H
#endif // WebServer_H
*/
+5 -4
View File
@@ -12,8 +12,9 @@
platform = atmelavr
board = uno
framework = arduino
lib_deps =
arduino-libraries/Ethernet@^2.0.2
featherfly/SoftwareSerial@^1.0
debug_tool = avr-stub
debug_port = COM8
monitor_port = COM8
monitor_speed = 115200
lib_deps =
jdolinay/avr-debugger@^1.5
+12 -15
View File
@@ -1,14 +1,15 @@
#include "GSMMobileDevice.h"
#include "WebServer.h"
//#include "WebServer.h"
#include "PinTypeIn.h"
#include "PinTypeOut.h"
#include <Arduino.h>
#include <IPAddress.h>
#include <Ethernet.h>
#include "WebServer.h"
#include "WebServerData.h"
#include "DebugLog.h"
#include "HTMLGenerator.h"
//#include <IPAddress.h>
// #include <Ethernet.h>
// #include "WebServer.h"
// #include "WebServerData.h"
//#include "HTMLGenerator.h"
#include "avr8-stub.h"
//#define DEBUG
@@ -20,7 +21,7 @@ static const PinTypeOut OUPUTS_PINS_ARRAY[COUNT_OUTPUTS_PIN_OUT] = {PinOutAlarm8
// PIN INPUT Initialization as INPUT
static const int COUNT_INPUTS_PIN_IN = 2;
static PinTypeIn PinInEZSAlarm2 = PinTypeIn("PIN2", 2, 100, "Input EZS ALARM"); // 100ms debounce;
static PinTypeIn PinInEZSAlarm2 = PinTypeIn("PIN4", 4, 100, "Input EZS ALARM"); // 100ms debounce;
static PinTypeIn PinInCaseOpen3 = PinTypeIn("PIN3", 3, 100, "Input Contact Box");
static const PinTypeIn INPUTS_PINS_ARRAY[COUNT_INPUTS_PIN_IN] = {PinInEZSAlarm2, PinInCaseOpen3};
@@ -35,19 +36,15 @@ GSMMobileData gsmData = GSMMobileData("GSM");
void setup()
{
#ifdef DEBUG
DebugLog::init(115200);
DebugLog::log("Called: Setup and init GSM");
DebugLog::log("Init GSM is OK");
#endif
// gsmDevice.init();
debug_init();
gsmData.MobileNumber = "+420608126674";
gsmData.Sms = "Alarm EZS CHATA";
}
void loop()
{
DebugLog::log("PIN IN 2: " + String(PinInEZSAlarm2.IsPinHigh()));
;
if (PinInEZSAlarm2.IsPinHigh())
{
PinOutAlarm8.setOutputSignalToHigh();