code formating
This commit is contained in:
parent
e04760f38e
commit
d060bab8e8
|
@ -15,15 +15,17 @@
|
|||
#pragma once
|
||||
|
||||
//#include <Arduino.h>
|
||||
//This device needs a lin interface to read and write on
|
||||
//This class needs a lin interface to read and write on
|
||||
#include <Lin_Interface.hpp>
|
||||
|
||||
#define LIN_BAUDRATE_IBS_SENSOR 19200
|
||||
|
||||
class IBS_Sensor {
|
||||
public:
|
||||
class IBS_Sensor
|
||||
{
|
||||
public:
|
||||
// Batery types
|
||||
enum IBS_BatteryTypes {
|
||||
enum IBS_BatteryTypes
|
||||
{
|
||||
BAT_TYPE_STARTER,
|
||||
BAT_TYPE_GEL,
|
||||
BAT_TYPE_AGM
|
||||
|
@ -49,25 +51,25 @@ class IBS_Sensor {
|
|||
uint8_t ErrorByte = 0x00; // Error code/flags?
|
||||
|
||||
// Frame "tb3", data unknown
|
||||
uint16_t unknown2;
|
||||
uint16_t unknown3;
|
||||
uint16_t unknown2 = 0;
|
||||
uint16_t unknown3 = 0;
|
||||
|
||||
// Frame "SOx", mayby includes State of Functon?
|
||||
float SOH = -1.0; // procides State of Healt in percent
|
||||
float SOC = -1.0; // procides State of Charge in percent
|
||||
uint8_t unknown4;
|
||||
uint8_t unknown5;
|
||||
uint16_t unknown6;
|
||||
float SOH = -1.0; // State of Health in percent (need replace?)
|
||||
float SOC = -1.0; // State of Charge in percent (need charge?)
|
||||
uint8_t unknown4 = 0;
|
||||
uint8_t unknown5 = 0;
|
||||
uint16_t unknown6 = 0;
|
||||
|
||||
// Frame "Capacity"
|
||||
float Cap_Max = 0.0; // max seen capacity
|
||||
float Cap_Available = 0.0; // max available capacity, means charge level
|
||||
float Cap_Max = 0.0; // max seen capacity (eq. SOH)
|
||||
float Cap_Available = 0.0; // max available capacity (eq. SOC)
|
||||
uint8_t Cap_Configured = 0; // configured battery capacity
|
||||
bool CalibrationDone = false; // data may plausible, but sensor has still some doubts
|
||||
uint8_t CalibByte = 0x00; // Capacity flag byte, may only contains CalibrationDone flag
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Request current valus form sensor
|
||||
//-----------------------------------------------------------------------------
|
||||
// Request current valus form sensor
|
||||
|
||||
// regular read
|
||||
bool readFrames();
|
||||
|
@ -80,8 +82,8 @@ class IBS_Sensor {
|
|||
bool readFrameCapacity();
|
||||
bool readFrameTB3();
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// configuration of Sensor - only needed once: data will be stored in sensor
|
||||
//-----------------------------------------------------------------------------
|
||||
// configuration of Sensor - only needed once: data will be stored in sensor
|
||||
|
||||
//configuration of sensor
|
||||
void writeConfiguration(IBS_BatteryTypes BatType, uint8_t BatCapacity);
|
||||
|
@ -91,7 +93,7 @@ class IBS_Sensor {
|
|||
void writeBatCapacity(uint8_t BatCapacity);
|
||||
void writeBatType(IBS_BatteryTypes BatType);
|
||||
|
||||
private:
|
||||
private:
|
||||
// SensorNo = 0 --> Hella IBS 200 labeled "Sensor 1"
|
||||
// SensorNo = 1 --> Hella IBS 200 labeled "Sensor 2"
|
||||
int _SensorNo;
|
||||
|
|
Loading…
Reference in New Issue