mikuso / ocpp-rpc

A Node.js client & server implementation of the WAMP-like RPC-over-websocket system defined in the OCPP-J protocols.
MIT License
94 stars 28 forks source link

WebSockerPingInterval #75

Open chaweewatp opened 5 months ago

chaweewatp commented 5 months ago

How can I check weather client send ping to server?

JPFarber55 commented 4 months ago

I do now know Ping OCPP-RPC Message from Client(ChargePoint) to Server, I Only know Heartbeat OCPP Message, And this is how can I handle it:

// create a specific handler for Heartbeat requests
      client.handle('Heartbeat', (ocppMessage: OCPPMessage) => {
        this.logger.log(`Web Socket Server got Heartbeat from ${client.identity}`);

        // respond with the Web Socket Server's current time.
        return {
          currentTime: new Date().toISOString(),
        };
      });