Skip to content

Commit

Permalink
Merge branch 'main' into new_features_24
Browse files Browse the repository at this point in the history
  • Loading branch information
shining-man committed Feb 9, 2024
2 parents cb34567 + ff6d885 commit 82abde5
Show file tree
Hide file tree
Showing 57 changed files with 715 additions and 708 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"string": "cpp",
"*.tcc": "cpp",
"streambuf": "cpp"
}
},
"files.trimTrailingWhitespace": true
}
6 changes: 3 additions & 3 deletions include/BleHandler.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 tobias
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand Down Expand Up @@ -32,7 +32,7 @@ struct bleDevice {
class BleHandler {
public:
BleHandler();

void init();
void start();
void stop();
Expand All @@ -50,7 +50,7 @@ class BleHandler {
private:
uint8_t timer_startScan;
bool bo_mStartManualScan;

bool handleConnectionToDevices();
void handleDisconnectionToDevices();
};
Expand Down
30 changes: 15 additions & 15 deletions include/BmsData.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 Tobias Himmler
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand Down Expand Up @@ -51,20 +51,20 @@ struct bmsData_s

//bmsErrors
#define BMS_ERR_STATUS_OK 0
#define BMS_ERR_STATUS_CELL_OVP 1 //bit0 single cell overvoltage protection
#define BMS_ERR_STATUS_CELL_UVP 2 //bit1 single cell undervoltage protection
#define BMS_ERR_STATUS_BATTERY_OVP 4 //bit2 whole pack overvoltage protection
#define BMS_ERR_STATUS_BATTERY_UVP 8 //bit3 Whole pack undervoltage protection
#define BMS_ERR_STATUS_CHG_OTP 16 //bit4 charging over temperature protection
#define BMS_ERR_STATUS_CHG_UTP 32 //bit5 charging low temperature protection
#define BMS_ERR_STATUS_DSG_OTP 64 //bit6 Discharge over temperature protection
#define BMS_ERR_STATUS_DSG_UTP 128 //bit7 discharge low temperature protection
#define BMS_ERR_STATUS_CHG_OCP 256 //bit8 charging overcurrent protection
#define BMS_ERR_STATUS_DSG_OCP 512 //bit9 Discharge overcurrent protection
#define BMS_ERR_STATUS_SHORT_CIRCUIT 1024 //bit10 short circuit protection
#define BMS_ERR_STATUS_AFE_ERROR 2048 //bit11 Front-end detection IC error
#define BMS_ERR_STATUS_SOFT_LOCK 4096 //bit12 software lock MOS
#define BMS_ERR_STATUS_RESERVED1 8192 //bit13 Reserved
#define BMS_ERR_STATUS_CELL_OVP 1 //bit0 single cell overvoltage protection
#define BMS_ERR_STATUS_CELL_UVP 2 //bit1 single cell undervoltage protection
#define BMS_ERR_STATUS_BATTERY_OVP 4 //bit2 whole pack overvoltage protection
#define BMS_ERR_STATUS_BATTERY_UVP 8 //bit3 Whole pack undervoltage protection
#define BMS_ERR_STATUS_CHG_OTP 16 //bit4 charging over temperature protection
#define BMS_ERR_STATUS_CHG_UTP 32 //bit5 charging low temperature protection
#define BMS_ERR_STATUS_DSG_OTP 64 //bit6 Discharge over temperature protection
#define BMS_ERR_STATUS_DSG_UTP 128 //bit7 discharge low temperature protection
#define BMS_ERR_STATUS_CHG_OCP 256 //bit8 charging overcurrent protection
#define BMS_ERR_STATUS_DSG_OCP 512 //bit9 Discharge overcurrent protection
#define BMS_ERR_STATUS_SHORT_CIRCUIT 1024 //bit10 short circuit protection
#define BMS_ERR_STATUS_AFE_ERROR 2048 //bit11 Front-end detection IC error
#define BMS_ERR_STATUS_SOFT_LOCK 4096 //bit12 software lock MOS
#define BMS_ERR_STATUS_RESERVED1 8192 //bit13 Reserved
#define BMS_ERR_STATUS_RESERVED2 16384 //bit14 Reserved
#define BMS_ERR_STATUS_RESERVED3 32768 //bit15 Reserved

Expand Down
8 changes: 4 additions & 4 deletions include/BscSerial.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 tobias
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand All @@ -20,12 +20,12 @@ class BscSerial {
void setSoftSerial(uint8_t u8_devNr, uint32_t baudrate);
void setSerialBaudrate(uint8_t u8_devNr);
void setSerialRxBufferSize(uint8_t u8_devNr, uint16_t rxBufSize);

void cyclicRun();

void setReadBmsFunktion(uint8_t u8_devNr, uint8_t funktionsTyp);


private:
SemaphoreHandle_t mSerialMutex = NULL;

Expand Down
2 changes: 1 addition & 1 deletion include/Canbus.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 Tobias Himmler
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand Down
4 changes: 2 additions & 2 deletions include/Json.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 Tobias Himmler
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand All @@ -11,7 +11,7 @@
class Json {
public:
Json();

uint16_t getArraySize(const char *json, long startPos);
bool getValue(const char *json, int idx, String name, uint32_t searchStartPos, String& retValue, uint32_t& arrayStart);

Expand Down
2 changes: 1 addition & 1 deletion include/Ow.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 Tobias Himmler
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand Down
10 changes: 5 additions & 5 deletions include/WebSettings.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 tobias
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand Down Expand Up @@ -35,7 +35,7 @@
#define HTML_SEPARATION 13
//Max Type = 15

#define BACKGROUND_COLOR "#ffffff"
#define BACKGROUND_COLOR "#ffffff"

#define BUTTON_SAVE 0
#define BUTTON_1 1
Expand All @@ -51,7 +51,7 @@ class WebSettings {
//Parameterfile
boolean deleteConfig();
boolean writeConfig();

static String getString(uint16_t name, boolean fromFlash, uint8_t u8_dataType);
static String getString(uint16_t name, uint8_t groupNr);
static int32_t getInt(uint16_t name, uint8_t u8_dataType);
Expand Down Expand Up @@ -80,7 +80,7 @@ class WebSettings {
void registerOnButton1(void (*callback)());
void registerOnButton2(void (*callback)());
void registerOnButton3(void (*callback)());

void setTimerHandlerName(String handlerName, uint16_t timerSec=1000);
void handleHtmlFormRequest(WebServer * server);
void handleGetValues(WebServer *server);
Expand All @@ -90,7 +90,7 @@ class WebSettings {

static uint16_t getParmId(uint16_t id, uint8_t groupIdx);
static void getIdFromParamId(uint16_t paramId, uint16_t &id, uint8_t &groupIdx);

private:
const char *parameterFile;
String str_mConfName;
Expand Down
2 changes: 1 addition & 1 deletion include/bscTime.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 Tobias Himmler
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand Down
2 changes: 1 addition & 1 deletion include/crc.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2023 Tobias Himmler
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand Down
4 changes: 2 additions & 2 deletions include/devices/DalyBms.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 tobias
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand Down Expand Up @@ -31,4 +31,4 @@
bool DalyBms_readBmsData(Stream *port, uint8_t devNr, void (*callback)(uint8_t, uint8_t), serialDevData_s *devData);


#endif
#endif
36 changes: 18 additions & 18 deletions include/devices/JbdBms.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 tobias
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand Down Expand Up @@ -34,22 +34,22 @@

//Protection State
#define JBDBMS_STATUS_OK 0
#define JBDBMS_STATUS_CELL_OVP 1 //bit0 single cell overvoltage protection
#define JBDBMS_STATUS_CELL_UVP 2 //bit1 single cell undervoltage protection
#define JBDBMS_STATUS_PACK_OVP 4 //bit2 whole pack overvoltage protection
#define JBDBMS_STATUS_PACK_UVP 8 //bit3 Whole pack undervoltage protection
#define JBDBMS_STATUS_CHG_OTP 16 //bit4 charging over-temperature protection
#define JBDBMS_STATUS_CHG_UTP 32 //bit5 charging low temperature protection
#define JBDBMS_STATUS_DSG_OTP 64 //bit6 Discharge over temperature protection
#define JBDBMS_STATUS_DSG_UTP 128 //bit7 discharge low temperature protection
#define JBDBMS_STATUS_CHG_OCP 256 //bit8 charging overcurrent protection
#define JBDBMS_STATUS_DSG_OCP 512 //bit9 Discharge overcurrent protection
#define JBDBMS_STATUS_SHORT_CIRCUIT 1024 //bit10 short circuit protection
#define JBDBMS_STATUS_AFE_ERROR 2048 //bit11 Front-end detection IC error
#define JBDBMS_STATUS_SOFT_LOCK 4096 //bit12 software lock MOS
#define JBDBMS_STATUS_RESERVED1 8192 //bit13 Reserved
#define JBDBMS_STATUS_RESERVED2 16384 //bit14 Reserved
#define JBDBMS_STATUS_RESERVED3 32768 //bit15 Reserved
#define JBDBMS_STATUS_CELL_OVP 1 //bit0 single cell overvoltage protection
#define JBDBMS_STATUS_CELL_UVP 2 //bit1 single cell undervoltage protection
#define JBDBMS_STATUS_PACK_OVP 4 //bit2 whole pack overvoltage protection
#define JBDBMS_STATUS_PACK_UVP 8 //bit3 Whole pack undervoltage protection
#define JBDBMS_STATUS_CHG_OTP 16 //bit4 charging over-temperature protection
#define JBDBMS_STATUS_CHG_UTP 32 //bit5 charging low temperature protection
#define JBDBMS_STATUS_DSG_OTP 64 //bit6 Discharge over temperature protection
#define JBDBMS_STATUS_DSG_UTP 128 //bit7 discharge low temperature protection
#define JBDBMS_STATUS_CHG_OCP 256 //bit8 charging overcurrent protection
#define JBDBMS_STATUS_DSG_OCP 512 //bit9 Discharge overcurrent protection
#define JBDBMS_STATUS_SHORT_CIRCUIT 1024 //bit10 short circuit protection
#define JBDBMS_STATUS_AFE_ERROR 2048 //bit11 Front-end detection IC error
#define JBDBMS_STATUS_SOFT_LOCK 4096 //bit12 software lock MOS
#define JBDBMS_STATUS_RESERVED1 8192 //bit13 Reserved
#define JBDBMS_STATUS_RESERVED2 16384 //bit14 Reserved
#define JBDBMS_STATUS_RESERVED3 32768 //bit15 Reserved



Expand All @@ -60,4 +60,4 @@

bool JbdBms_readBmsData(Stream *port, uint8_t devNr, void (*callback)(uint8_t, uint8_t), serialDevData_s *devData);

#endif
#endif
4 changes: 2 additions & 2 deletions include/devices/JkBms.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 tobias
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand All @@ -15,4 +15,4 @@

bool JkBms_readBmsData(Stream *port, uint8_t devNr, void (*callback)(uint8_t, uint8_t), serialDevData_s *devData);

#endif
#endif
2 changes: 1 addition & 1 deletion include/devices/JkBmsBt.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 tobias
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand Down
4 changes: 2 additions & 2 deletions include/devices/JkBmsV13.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 tobias
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand All @@ -16,4 +16,4 @@
bool JkBmsV13_readBmsData(Stream *port, uint8_t devNr, void (*callback)(uint8_t, uint8_t), serialDevData_s *devData);


#endif
#endif
2 changes: 1 addition & 1 deletion include/devices/NeeyBalancer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 tobias
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand Down
4 changes: 2 additions & 2 deletions include/devices/SeplosBms.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 tobias
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand All @@ -14,4 +14,4 @@

bool SeplosBms_readBmsData(Stream *port, uint8_t devNr, void (*callback)(uint8_t, uint8_t), serialDevData_s *devData);

#endif
#endif
4 changes: 2 additions & 2 deletions include/devices/SmartShunt.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 tobias
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand All @@ -21,4 +21,4 @@

bool SmartShunt_readBmsData(Stream *port, uint8_t devNr, void (*callback)(uint8_t, uint8_t), serialDevData_s *devData);

#endif
#endif
4 changes: 2 additions & 2 deletions include/devices/SylcinBms.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2023 nsc2001
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand All @@ -14,4 +14,4 @@

bool SylcinBms_readBmsData(Stream *port, uint8_t devNr, void (*callback)(uint8_t, uint8_t), serialDevData_s *devData);

#endif
#endif
6 changes: 3 additions & 3 deletions include/devices/serialDevData.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 tobias
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand All @@ -16,10 +16,10 @@ struct serialDevData_s
uint8_t u8_BmsDataAdr;
bool bo_sendMqttMsg;

bool bo_writeData;
bool bo_writeData;
serialDataRwTyp_e rwDataTyp;
uint8_t rwDataLen;
uint8_t *rwData;
};

#endif
#endif
2 changes: 1 addition & 1 deletion include/dio.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 Tobias Himmler
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand Down
2 changes: 1 addition & 1 deletion include/i2c.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 Tobias Himmler
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand Down
4 changes: 2 additions & 2 deletions include/log.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright (c) 2022 Tobias Himmler
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

#ifndef LOG_H
#define LOG_H

#include <Arduino.h>

void debugInit();

#ifdef DEBUG_ON_FS
Expand Down
4 changes: 2 additions & 2 deletions include/mqtt_t.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2022 Tobias Himmler
//
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

Expand All @@ -10,7 +10,7 @@

void initMqtt();
bool mqttLoop();

bool mqttConnect();
void mqttDisconnect();
bool mqttConnected();
Expand Down
Loading

0 comments on commit 82abde5

Please sign in to comment.