Skip to content

Commit b0d1f0d

Browse files
author
Cédric Jimenez
committed
[version] Add simulated firmware version
1 parent 068e6a7 commit b0d1f0d

File tree

4 files changed

+38
-4
lines changed

4 files changed

+38
-4
lines changed

src/chargepoint/SimulatedChargePoint.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ SOFTWARE.
2727
#include "MeterSimulator.h"
2828
#include "MqttManager.h"
2929
#include "SimulatedChargePointConfig.h"
30+
#include "Version.h"
3031

3132
#include <cmath>
3233
#include <iostream>
@@ -53,7 +54,8 @@ SimulatedChargePoint::~SimulatedChargePoint() { }
5354
/** @brief Start the Charge Point (blocking) */
5455
void SimulatedChargePoint::start()
5556
{
56-
std::cout << "Starting simulated charge point : " << m_config.stackConfig().chargePointIdentifier() << std::endl;
57+
std::cout << "Starting simulated charge point v" << CHARGEPOINT_FW_VERSION << " : " << m_config.stackConfig().chargePointIdentifier()
58+
<< std::endl;
5759

5860
// MQTT connectivity
5961
std::cout << "Starting MQTT connectivity..." << std::endl;
@@ -664,7 +666,7 @@ void SimulatedChargePoint::computeCurrentConsumption(ConnectorData& connector)
664666
case 1:
665667
consumption_l1 = std::min(connector.car_consumption_l1, connector.setpoint);
666668
break;
667-
669+
668670
case 2:
669671
consumption_l1 = std::min(connector.car_consumption_l1, connector.setpoint);
670672
consumption_l2 = std::min(connector.car_consumption_l2, connector.setpoint);

src/chargepoint/Version.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
MIT License
3+
4+
Copyright (c) 2022 Cedric Jimenez
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.
23+
*/
24+
25+
#ifndef VERSION_H
26+
#define VERSION_H
27+
28+
/** @brief Firmware version of the simulated charge point */
29+
#define CHARGEPOINT_FW_VERSION "1.0.0"
30+
31+
#endif // VERSION_H

src/chargepoint/config/config.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ ChargeBoxSerialNumber=S/N9876543210
2020
ChargePointModel=Open OCPP Simulated CP
2121
ChargePointSerialNumber=S/N0123456789
2222
ChargePointVendor=OpenOCPP
23-
FirmwareVersion=0.1
2423
Iccid=
2524
Imsi=
2625
MeterSerialNumber=

src/chargepoint/ocpp/ChargePointConfig.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ SOFTWARE.
2525
#ifndef CHARGEPOINTCONFIG_H
2626
#define CHARGEPOINTCONFIG_H
2727

28+
#include "Version.h"
29+
2830
#include <openocpp/IChargePointConfig.h>
2931
#include <openocpp/IniFile.h>
3032

@@ -96,7 +98,7 @@ class ChargePointConfig : public ocpp::config::IChargePointConfig
9698
/** @brief Charge point vendor */
9799
std::string chargePointVendor() const override { return getString("ChargePointVendor"); }
98100
/** @brief Firmware version */
99-
std::string firmwareVersion() const override { return getString("FirmwareVersion"); }
101+
std::string firmwareVersion() const override { return CHARGEPOINT_FW_VERSION; }
100102
/** @brief ICCID of the moden's SIM card */
101103
std::string iccid() const override { return getString("Iccid"); }
102104
/** @brief IMSI of the moden's SIM card */

0 commit comments

Comments
 (0)