-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathindex_16.ts
33 lines (30 loc) · 985 Bytes
/
index_16.ts
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
require("dotenv").config();
import { OcppVersion } from "./src/ocppVersion";
import { bootNotificationOcppMessage } from "./src/v16/messages/bootNotification";
import { statusNotificationOcppMessage } from "./src/v16/messages/statusNotification";
import { VCP } from "./src/vcp";
const vcp = new VCP({
endpoint: process.env.WS_URL ?? "ws://localhost:3000",
chargePointId: process.env.CP_ID ?? "123456",
ocppVersion: OcppVersion.OCPP_1_6,
basicAuthPassword: process.env.PASSWORD ?? undefined,
adminPort: Number.parseInt(process.env.ADMIN_PORT ?? "9999"),
});
(async () => {
await vcp.connect();
vcp.send(
bootNotificationOcppMessage.request({
chargePointVendor: "Solidstudio",
chargePointModel: "VirtualChargePoint",
chargePointSerialNumber: "S001",
firmwareVersion: "1.0.0",
}),
);
vcp.send(
statusNotificationOcppMessage.request({
connectorId: 1,
errorCode: "NoError",
status: "Available",
}),
);
})();