Skip to content

Commit 61bbd45

Browse files
authored
Merge pull request #156 from c-jimenez/release/v1.4.0
Release/v1.4.0
2 parents d30c25f + 6a1a845 commit 61bbd45

37 files changed

+244
-47
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
cmake_minimum_required(VERSION 3.13)
66

77
project(OpenOCPP DESCRIPTION "Open Source C++ implementation of the OCPP 1.6 protocol"
8-
VERSION 1.3.1
8+
VERSION 1.4.0
99
)
1010

1111
# Definitions for Version.h file

examples/common/DefaultCentralSystemEventsHandler.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ bool DefaultCentralSystemEventsHandler::acceptConnection(const char* ip_address)
6666
return true;
6767
}
6868

69+
/** @copydoc void ICentralSystemEventsHandler::clientFailedToConnect(const char*) */
70+
void DefaultCentralSystemEventsHandler::clientFailedToConnect(const char* ip_address)
71+
{
72+
cout << "Client [" << ip_address << "] failed to connect" << endl;
73+
}
74+
6975
/** @copydoc bool ICentralSystemEventsHandler::checkCredentials(const std::string&, const std::string&) */
7076
bool DefaultCentralSystemEventsHandler::checkCredentials(const std::string& chargepoint_id, const std::string& password)
7177
{

examples/common/DefaultCentralSystemEventsHandler.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ class DefaultCentralSystemEventsHandler : public ocpp::centralsystem::ICentralSy
4848
/** @copydoc bool ICentralSystemEventsHandler::acceptConnection(const char*) */
4949
bool acceptConnection(const char* ip_address) override;
5050

51+
/** @copydoc void ICentralSystemEventsHandler::clientFailedToConnect(const char*) */
52+
void clientFailedToConnect(const char* ip_address) override;
53+
5154
/** @copydoc bool ICentralSystemEventsHandler::checkCredentials(const std::string&, const std::string&) */
5255
bool checkCredentials(const std::string& chargepoint_id, const std::string& password) override;
5356

examples/common/DefaultChargePointEventsHandler.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,9 +691,13 @@ ocpp::types::UpdateFirmwareStatusEnumType DefaultChargePointEventsHandler::check
691691
if (!ca_certificates.empty())
692692
{
693693
// Check signing certificate
694-
if (signing_certificate.verify(ca_certificates))
694+
for (const auto& cer : ca_certificates)
695695
{
696-
ret = UpdateFirmwareStatusEnumType::Accepted;
696+
if (signing_certificate.verify(cer.certificateChain()))
697+
{
698+
ret = UpdateFirmwareStatusEnumType::Accepted;
699+
break;
700+
}
697701
}
698702
}
699703
else

examples/common/DefaultLocalControllerEventsHandler.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ bool DefaultLocalControllerEventsHandler::acceptConnection(const char* ip_addres
4848
return true;
4949
}
5050

51+
/** @copydoc void ILocalControllerEventsHandler::clientFailedToConnect(const char*) */
52+
void DefaultLocalControllerEventsHandler::clientFailedToConnect(const char* ip_address)
53+
{
54+
cout << "Client [" << ip_address << "] failed to connect" << endl;
55+
}
56+
5157
/** @copydoc bool ILocalControllerEventsHandler::checkCredentials(const std::string&, const std::string&) */
5258
bool DefaultLocalControllerEventsHandler::checkCredentials(const std::string& chargepoint_id, const std::string& password)
5359
{

examples/common/DefaultLocalControllerEventsHandler.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ class DefaultLocalControllerEventsHandler : public ocpp::localcontroller::ILocal
4646
/** @copydoc bool ILocalControllerEventsHandler::acceptConnection(const char*) */
4747
bool acceptConnection(const char* ip_address) override;
4848

49+
/** @copydoc void ILocalControllerEventsHandler::clientFailedToConnect(const char*) */
50+
void clientFailedToConnect(const char* ip_address) override;
51+
4952
/** @copydoc bool ILocalControllerEventsHandler::checkCredentials(const std::string&, const std::string&) */
5053
bool checkCredentials(const std::string& chargepoint_id, const std::string& password) override;
5154

src/centralsystem/CentralSystem.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,14 @@ void CentralSystem::rpcClientConnected(const std::string& chargepoint_id, std::s
300300
m_events_handler.chargePointConnected(chargepoint);
301301
}
302302

303+
/** @copydoc void RpcServer::IListener::rpcClientFailedToConnect(const char*) */
304+
void CentralSystem::rpcClientFailedToConnect(const char* ip_address)
305+
{
306+
// Notify failure => no additional processing is done here
307+
// to keep this callback has fast as possible
308+
return m_events_handler.clientFailedToConnect(ip_address);
309+
}
310+
303311
/** @copydoc void RpcServer::IListener::rpcServerError() */
304312
void CentralSystem::rpcServerError()
305313
{

src/centralsystem/CentralSystem.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ class CentralSystem : public ICentralSystem, public ocpp::rpc::RpcServer::IListe
7878
/** @copydoc void RpcServer::IListener::rpcClientConnected(const std::string&, std::shared_ptr<Client>) */
7979
void rpcClientConnected(const std::string& chargepoint_id, std::shared_ptr<ocpp::rpc::RpcServer::Client> client) override;
8080

81+
/** @copydoc void RpcServer::IListener::rpcClientFailedToConnect(const char*) */
82+
void rpcClientFailedToConnect(const char* ip_address) override;
83+
8184
/** @copydoc void RpcServer::IListener::rpcServerError() */
8285
void rpcServerError() override;
8386

src/centralsystem/interface/ICentralSystemEventsHandler.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ class ICentralSystemEventsHandler
4040
*/
4141
virtual bool acceptConnection(const char* ip_address) = 0;
4242

43+
/**
44+
* @brief Called when connection fails to established
45+
* @param ip_address IP address of the client
46+
*/
47+
virtual void clientFailedToConnect(const char* ip_address) = 0;
48+
4349
/**
4450
* @brief Called to check the charge point credentials for HTTP basic authentication
4551
* @param chargepoint_id Charge Point identifier

src/chargepoint/ChargePoint.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ bool ChargePoint::start()
292292
*m_msg_dispatcher,
293293
*m_msg_sender,
294294
m_requests_fifo,
295+
*m_status_manager,
295296
*m_authent_manager,
296297
*m_reservation_manager,
297298
*m_meter_values_manager,

0 commit comments

Comments
 (0)