From 8bffe47dacf23344bdc03203783c51fcb4fc7b44 Mon Sep 17 00:00:00 2001
From: Markus Rampp <markus.rampp@uibk.ac.at>
Date: Fri, 30 Dec 2022 11:37:06 +0100
Subject: [PATCH] battery monitor config

---
 client/libs/LC7090203F/LC709203F.cpp | 8 +++++---
 client/libs/LC7090203F/LC709203F.h   | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/client/libs/LC7090203F/LC709203F.cpp b/client/libs/LC7090203F/LC709203F.cpp
index b7db139..7d93d52 100644
--- a/client/libs/LC7090203F/LC709203F.cpp
+++ b/client/libs/LC7090203F/LC709203F.cpp
@@ -41,9 +41,10 @@ uint8_t i2c_address = LC709203F_I2C_ADDR ;
 bool LC709203F::begin( void ) 
 {
   Wire.begin();
-  setPowerMode(LC709203F_POWER_OPERATE) ;
-  setCellCapacity(LC709203F_APA_500MAH) ;
-  setTemperatureMode(LC709203F_TEMPERATURE_THERMISTOR) ;
+  setPowerMode(LC709203F_POWER_OPERATE);
+  setCellCapacity(LC709203F_APA_1000MAH);
+  setTemperatureMode(LC709203F_TEMPERATURE_I2C);
+  setCellProfile(LC709203_NOM3p7_Charge4p2);
   
   return true;
 }
@@ -207,6 +208,7 @@ std::list<Message> LC709203F::buildMessages()
 {
 	std::list<Message> messages;
 	float data =cellVoltage_mV()/1000.0;
+  //FIXME: use enum instead of string
 	MeasurementData IncrementData{data, 0, {},"Voltage-Batterie"};
 	messages.emplace_back(IncrementData, sensorInformation, Time::getInstance().getEpochSeconds());
 	return messages;
diff --git a/client/libs/LC7090203F/LC709203F.h b/client/libs/LC7090203F/LC709203F.h
index 2b13919..c776d9b 100644
--- a/client/libs/LC7090203F/LC709203F.h
+++ b/client/libs/LC7090203F/LC709203F.h
@@ -106,7 +106,7 @@ protected:
   void write16( uint8_t regAddress, uint16_t data);
   int16_t read16(uint8_t regAddress);
 private:
-  const SensorInformation sensorInformation{"DR26", Protocol::Analog};
+  const SensorInformation sensorInformation{"LC709203", Protocol::I2C};
 };
 
 #endif
-- 
GitLab