Snippets

OICP 2.1 Remote Reservation Stop | C#

Created by Julius Poessnecker

File (0) OICP Added

  • Ignore whitespace
  • Hide word diff
+The service description can be found in the OICP 2.1.
+
+Section:
+3.2.2 eRoamingAuthorizeRemoteReservationStop
+
+To download the latest OICP Version, please visit our website:
+https://www.hubject.com/downloads/

File (1) Remote Reservation Stop | C#.cs Added

  • Ignore whitespace
  • Hide word diff
+/// <summary>
+/// Initialize the OICP HTTP/SOAP/XML server using IPAddress.Any.
+/// </summary>
+/// <param name="TCPPort">The TCP listing port.</param>
+/// <param name="URIPrefix">An optional prefix for the HTTP URIs.</param>
+public CPOServer(IPPort  TCPPort,
+                 String  URIPrefix = "")
+
+
+/// <summary>
+/// A delegate fired whenever a remote reservation stop command was received.
+/// </summary>
+/// <param name="Timestamp">The timestamp of the request.</param>
+/// <param name="RoamingNetworkId">The unique identification for the roaming network.</param>
+/// <param name="SessionId">The unique identification for this charging session.</param>
+/// <param name="PartnerSessionId">The unique identification for this charging session on the partner side.</param>
+/// <param name="ProviderId">The unique identification of the e-mobility service provider.</param>
+/// <param name="EVSEId">The unique identification of an EVSE.</param>
+/// <param name="CancellationToken">A token to cancel this task.</param>
+/// <returns>A RemoteReservationStopResult task.</returns>
+public delegate Task<RemoteReservationStopResult> OnRemoteReservationStopDelegate(DateTime            Timestamp,
+                                                            RoamingNetwork_Id   RoamingNetworkId,
+                                                            ChargingSession_Id  SessionId,
+                                                            ChargingSession_Id  PartnerSessionId,
+                                                            EVSP_Id             ProviderId,
+                                                            EVSE_Id             EVSEId,
+                                                            CancellationToken   CancellationToken);
+
+/// <summary>
+/// An event fired whenever a remote reservation stop command was received.
+/// </summary>
+public event OnRemoteReservationStopDelegate OnRemoteReservationStop;

File (2) Example.cs Added

  • Ignore whitespace
  • Hide word diff
+var CPOServer = new CPOServer(new IPPort(3103));
+
+CPOServer.OnRemoteReservationStop(async (Timestamp,
+                              RoamingNetworkId,
+                              SessionId,
+                              PartnerSessionId,
+                              ProviderId,
+                              eMAId,
+                              EVSEId,
+                              CancellationToken) => {
+
+    Console.WriteLine("[" +                 Timestamp.       ToString() +
+                      "] RemoteStop in '" + RoamingNetworkId.ToString() +
+                      "' from '"          + ProviderId.      ToString() +
+                      "' at '"            + EVSEId.          ToString() +
+                      "'");
+
+    return await Task.FromResult(RemoteReservationStopResult.Success);
+
+});
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.