typescript 无法实现OCPP方法“RemoteTransaction”

yhxst69z  于 2023-03-24  发布在  TypeScript
关注(0)|答案(1)|浏览(140)

我试图在我的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)
sbtkgmzw

sbtkgmzw1#

你应该正确阅读文档。充电站接收RemoteTransaction事件,而不是发送它。

相关问题