我试图在我的ocpp客户端实现方法“RemoteTransaction”,但出现错误。我使用的包是@extrawest/node-ts-ocpp。
我的代码
const chargingPointSimple = new OcppClient("1");
chargingPointSimple.on('connect', async () => {
let sTReq: RequestStartTransactionRequest;
sTReq = {idToken: {idToken:"someToken", type:"Central"}, remoteStartId: 0}
const sTResp = chargingPointSimple.callRequest("RequestStartTransaction", sTReq)
});
chargingPointSimple.connect('ws://localhost:3000/');
我得到的错误
No overload matches this call.
The last overload gave the following error.
Argument of type '"RequestStartTransaction"' is not assignable to parameter of type '"StatusNotification"'.
24 const sTResp = chargingPointSimple.callRequest("RequestStartTransaction", sTReq)
1条答案
按热度按时间sbtkgmzw1#
你应该正确阅读文档。充电站接收RemoteTransaction事件,而不是发送它。