-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
29 lines (22 loc) · 1.06 KB
/
Copy pathProgram.cs
File metadata and controls
29 lines (22 loc) · 1.06 KB
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
using WebSocketSharp;
namespace SimpleOcppClient;
internal class Program
{
static void Main(string[] args)
{
using (var ws = new WebSocket("ws://localhost:8080/ocpp/WS-1337"))
{
ws.OnMessage += (sender, e) =>
{
Console.WriteLine("Received from server: " + e.Data);
};
ws.Connect();
//ws.Send("[2, \"19223201\", \"Authorize\",{\"idTag\":\"ABC12345678901234567\"} ]");
//ws.Send("[2, \"19223201\", \"Authorize\",{\"idTag\":\"A234567\"} ]");
ws.Send("[2,\"15936\",\"StatusNotification\",{\"connectorId\":1,\"errorCode\":\"NoError\",\"status\":\"Charging\"}]");
// ws.Send("[2,\"102\",\"StopTransaction\",{\"transactionId\": 172494625, \"connectorId\":1,\"idTag\":\"F6C0D248\",\"meterStop\":0,\"timestamp\":\"2022-06-13T09:13:09.819Z\"}]");
//ws.Send("[2, \"19223201\", \"BootNotification\", {\"chargePointVendor\": \"VendorX\", \"chargePointModel\": \"SingleSocketCharger\"} ]");
Console.ReadLine();
}
}
}