-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathICentralSystemEventsHandler.h
67 lines (54 loc) · 2.15 KB
/
ICentralSystemEventsHandler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
Copyright (c) 2020 Cedric Jimenez
This file is part of OpenOCPP.
OpenOCPP is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 2.1 of the License, or
(at your option) any later version.
OpenOCPP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with OpenOCPP. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPENOCPP_ICENTRALSYSTEMEVENTSHANDLER_H
#define OPENOCPP_ICENTRALSYSTEMEVENTSHANDLER_H
#include "ICentralSystem.h"
namespace ocpp
{
namespace centralsystem
{
/** @brief Interface for central system event handlers implementations */
class ICentralSystemEventsHandler
{
public:
/** @brief Destructor */
virtual ~ICentralSystemEventsHandler() { }
/**
* @brief Called to accept an incoming connection
* @param ip_address IP address of the client
* @return true if the incoming connection must be accepted, false otherwise
*/
virtual bool acceptConnection(const char* ip_address) = 0;
/**
* @brief Called when connection fails to established
* @param ip_address IP address of the client
*/
virtual void clientFailedToConnect(const char* ip_address) = 0;
/**
* @brief Called to check the charge point credentials for HTTP basic authentication
* @param chargepoint_id Charge Point identifier
* @param password Password
* @return true if the credentials are valid, false otherwise
*/
virtual bool checkCredentials(const std::string& chargepoint_id, const std::string& password) = 0;
/**
* @brief Called when a charge point is connected
* @param chargepoint Charge point connection
*/
virtual void chargePointConnected(std::shared_ptr<ICentralSystem::IChargePoint> chargepoint) = 0;
};
} // namespace centralsystem
} // namespace ocpp
#endif // OPENOCPP_ICENTRALSYSTEMEVENTSHANDLER_H