From 14dca73134f6111ec84afc938118b389a4cab7a3 Mon Sep 17 00:00:00 2001
From: Moritz Perschke <moritz.perschke@uibk.ac.at>
Date: Thu, 28 Jul 2022 16:06:18 +0200
Subject: [PATCH] Revert "airsensor readout added"

This reverts commit 7cca5486ef474f817cbe792d9d4b9f26c3c5571f.
---
 .gitignore                                 |  2 +-
 client/client/lib/I2C/I2C.cpp              | 26 ------------
 client/client/lib/I2C/I2C.hpp              |  8 ----
 client/client/lib/I2C/pinout.hpp           |  2 -
 client/client/lib/espnow/src/espnow.hpp    | 13 ------
 client/client/platformio.ini               |  3 +-
 client/client/src/main.cpp                 | 18 +--------
 code-snippets/espnow/espNowTest/lib/README | 46 ----------------------
 8 files changed, 3 insertions(+), 115 deletions(-)
 delete mode 100644 client/client/lib/I2C/I2C.cpp
 delete mode 100644 client/client/lib/I2C/I2C.hpp
 delete mode 100644 client/client/lib/I2C/pinout.hpp
 delete mode 100644 client/client/lib/espnow/src/espnow.hpp
 delete mode 100644 code-snippets/espnow/espNowTest/lib/README

diff --git a/.gitignore b/.gitignore
index 23b4089..88fc45a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,7 +14,7 @@ dist/
 downloads/
 eggs/
 .eggs/
-#lib/  // commented this out as to not always force add /lib in platformio project
+lib/
 lib64/
 parts/
 sdist/
diff --git a/client/client/lib/I2C/I2C.cpp b/client/client/lib/I2C/I2C.cpp
deleted file mode 100644
index e293d48..0000000
--- a/client/client/lib/I2C/I2C.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <Wire.h>
-#include <SparkFun_SCD30_Arduino_Library.h>
-#include "pinout.hpp"
-#include "I2C.hpp"
-
-SCD30 airSensor;
-
-int i2c_setup(){
-    Wire.begin(I2C_SDA, I2C_SCL);
-    if(!airSensor.begin()){
-        return 1;
-    }
-    return 0;
-}
-
-i2c_readout get_i2c_data(){
-    if(airSensor.dataAvailable()){
-        i2c_readout result;
-        result.co2 = airSensor.getCO2();
-        result.temp = airSensor.getTemperature();
-        result.humidity = airSensor.getHumidity();
-        return result;
-    }
-    i2c_readout empty; // bad, remove this
-    return empty;
-}
\ No newline at end of file
diff --git a/client/client/lib/I2C/I2C.hpp b/client/client/lib/I2C/I2C.hpp
deleted file mode 100644
index 1c767d1..0000000
--- a/client/client/lib/I2C/I2C.hpp
+++ /dev/null
@@ -1,8 +0,0 @@
-typedef struct i2c_readout{
-    float co2;
-    float temp;
-    float humidity;
-} i2c_readout;
-
-int i2c_setup();
-i2c_readout get_i2c_data();
diff --git a/client/client/lib/I2C/pinout.hpp b/client/client/lib/I2C/pinout.hpp
deleted file mode 100644
index 7385cac..0000000
--- a/client/client/lib/I2C/pinout.hpp
+++ /dev/null
@@ -1,2 +0,0 @@
-#define I2C_SDA 18
-#define I2C_SCL 19
diff --git a/client/client/lib/espnow/src/espnow.hpp b/client/client/lib/espnow/src/espnow.hpp
deleted file mode 100644
index a32e7c9..0000000
--- a/client/client/lib/espnow/src/espnow.hpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <string>
-#define NUM_SENSORS 10
-
-// I originally wanted to define the mac addresses here, but i got a "multiple definition" error?
-typedef struct dataMessage{
-    std::string identifiers[NUM_SENSORS];
-    float values[NUM_SENSORS];
-}dataMessage;
-
-int send_data(dataMessage data);
-
-int espnow_setup();
-
diff --git a/client/client/platformio.ini b/client/client/platformio.ini
index aeb9e53..ee50833 100644
--- a/client/client/platformio.ini
+++ b/client/client/platformio.ini
@@ -12,5 +12,4 @@
 platform = espressif32
 board = esp32-c3-devkitm-1
 framework = arduino
-monitor_speed = 115200
-lib_deps = sparkfun/SparkFun SCD30 Arduino Library@^1.0.18
+monitor_speed = 115200
\ No newline at end of file
diff --git a/client/client/src/main.cpp b/client/client/src/main.cpp
index e0d73da..91da067 100644
--- a/client/client/src/main.cpp
+++ b/client/client/src/main.cpp
@@ -1,6 +1,5 @@
 #include <Arduino.h>
 #include "espnow.hpp"
-#include "I2C.hpp"
 
 void setup() {
  
@@ -8,24 +7,9 @@ void setup() {
   Serial.begin(115200);
   while(!Serial);
 
-  espnow_setup();
-  i2c_setup();
+  int result = espnow_setup();
 }
 
 void loop() {
   // put your main code here, to run repeatedly:
-  i2c_readout data = get_i2c_data();
-  dataMessage message;
-  message.identifiers[0] = "co2";
-  message.identifiers[1] = "temp";
-  message.identifiers[2] = "humid";
-
-  message.values[0] = data.co2;
-  message.values[1] = data.co2;
-  message.values[2] = data.humidity;
-
-  send_data(message);
-  Serial.println("Message sent");
-
-  delay(3000);
 }
\ No newline at end of file
diff --git a/code-snippets/espnow/espNowTest/lib/README b/code-snippets/espnow/espNowTest/lib/README
deleted file mode 100644
index 6debab1..0000000
--- a/code-snippets/espnow/espNowTest/lib/README
+++ /dev/null
@@ -1,46 +0,0 @@
-
-This directory is intended for project specific (private) libraries.
-PlatformIO will compile them to static libraries and link into executable file.
-
-The source code of each library should be placed in a an own separate directory
-("lib/your_library_name/[here are source files]").
-
-For example, see a structure of the following two libraries `Foo` and `Bar`:
-
-|--lib
-|  |
-|  |--Bar
-|  |  |--docs
-|  |  |--examples
-|  |  |--src
-|  |     |- Bar.c
-|  |     |- Bar.h
-|  |  |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
-|  |
-|  |--Foo
-|  |  |- Foo.c
-|  |  |- Foo.h
-|  |
-|  |- README --> THIS FILE
-|
-|- platformio.ini
-|--src
-   |- main.c
-
-and a contents of `src/main.c`:
-```
-#include <Foo.h>
-#include <Bar.h>
-
-int main (void)
-{
-  ...
-}
-
-```
-
-PlatformIO Library Dependency Finder will find automatically dependent
-libraries scanning project source files.
-
-More information about PlatformIO Library Dependency Finder
-- https://docs.platformio.org/page/librarymanager/ldf.html
-- 
GitLab