Skip to content

Commit e9db5d1

Browse files
committed
[localcontroller] Add connection status information to ICentralSystemProxy interface
1 parent d9b7f90 commit e9db5d1

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/localcontroller/centralsystem/CentralSystemProxy.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ void CentralSystemProxy::disconnect()
100100
m_rpc.stop();
101101
}
102102

103+
/** @brief Indicate if the connection with the central system is active */
104+
bool CentralSystemProxy::isConnected() const
105+
{
106+
return m_rpc.isConnected();
107+
}
108+
103109
/** @copydoc bool ICentralSystemProxy::call(const ocpp::messages::BootNotificationReq&,
104110
* ocpp::messages::BootNotificationConf&,
105111
* std::string&,

src/localcontroller/centralsystem/CentralSystemProxy.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ class CentralSystemProxy : public ICentralSystemProxy,
9595
/** @copydoc void ICentralSystemProxy::disconnect() */
9696
void disconnect() override;
9797

98+
/** @brief Indicate if the connection with the central system is active */
99+
bool isConnected() const override;
100+
98101
/** @copydoc void ICentralSystemProxy::registerListener(ILocalControllerProxyEventsHandler&) */
99102
void registerListener(ILocalControllerProxyEventsHandler& listener) override { m_listener = &listener; }
100103

src/localcontroller/interface/ICentralSystemProxy.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ class ICentralSystemProxy
105105
/** @brief Disconnect from the central system */
106106
virtual void disconnect() = 0;
107107

108+
/**
109+
* @brief Indicate if the connection with the central system is active
110+
* @return true if the connection is active, false otherwise
111+
*/
112+
virtual bool isConnected() const = 0;
113+
108114
/**
109115
* @brief Register a listener to the proxy events
110116
* @param listener Listener to the proxy events

0 commit comments

Comments
 (0)