Snippets

OICP 2.1 Push EVSE Data | C#

Updated by Julius Poessnecker

File (2) Example.cs Modified

  • Ignore whitespace
  • Hide word diff
-var EVSEDataRecords  = Enumeration.Create(
-
-    new EVSEDataRecord(
-        EVSEId:               EVSE_Id.           Parse("DE*GEF*E123456789*1"),
-        ChargingStationId:    ChargingStation_Id.Parse("DE*GEF*S123456789"),
-        ChargingStationName:  I18NString.        Create(Languages.de, "Testbox 1").
-                                                    Add(Languages.en, "Testbox One").,
-
-        Address:              Address.Create(
-                                  Country.Germany,
-                                  "07749", "Jena",
-                                  "Biberweg", "18"
-                              ),
-
-        GeoCoordinate:        GeoCoordinate.Create(
-                                  Latitude. Parse(49.731102),
-                                  Longitude.Parse(10.142530)
-                              ),
-
-        Plugs:                Enumeration.Create(
-                                  PlugTypes.TypeFSchuko,
-                                  PlugTypes.Type2Outlet
-                              ),
-
-        AuthenticationModes:  Enumeration.Create(
-                                  AuthenticationModes.NFC_RFID_Classic,
-                                  AuthenticationModes.NFC_RFID_DESFire,
-                                  AuthenticationModes.REMOTE
-                              ),
-
-        PaymentOptions:       Enumeration.Create(
-                                  PaymentOptions.Contract,
-                                  PaymentOptions.Direct
-                              ),
-
-        Accessibility:        AccessibilityTypes.Paying_publicly_accessible,
-
-        HotlinePhoneNumber:   "+49 555 12345678",
-
-        IsHubjectCompatible:  true,
-        DynamicInfoAvailable: true,
-        IsOpen24Hours:        true
-    ),
-
-    new EVSEDataRecord(...)
-
-);
-
-
-var req = new CPOClient("api.playground.hubject.com").
-
-              PushEVSEData(EVSEDataRecords,
-                           ActionType.insert,
-                           IncludeEVSEs: evse => evse.EVSEId.ToString().
-                                                 StartsWith("DE")).
-
-              ContinueWith(task => {
-
-                  var Acknowledgement = task.Result.Content;
-
-                  if (Acknowledgement.Result)
-                      Console.WriteLine("success!");
-
-                  else
-                  {
-                      Console.WriteLine(Acknowledgement.StatusCode.Code);
-                      Console.WriteLine(Acknowledgement.StatusCode.Description);
-                      Console.WriteLine(Acknowledgement.StatusCode.AdditionalInfo);
-                  }
-
-              });
-
-// Wait for the task to complete...
-req.Wait();
+new EVSEDataRecord(
+    EVSEId:               EVSE_Id.           Parse("DE*GEF*E123456789*1"),
+    ChargingStationId:    ChargingStation_Id.Parse("DE*GEF*S123456789"),
+    ChargingStationName:  I18NString.        Create(Languages.de, "Testbox 1").
+                                                Add(Languages.en, "Testbox One").,
+
+    Address:              Address.Create(
+                              Country.Germany,
+                              "07749", "Jena",
+                              "Biberweg", "18"
+                          ),
+
+    GeoCoordinate:        GeoCoordinate.Create(
+                              Latitude. Parse(49.731102),
+                              Longitude.Parse(10.142530)
+                          ),
+
+    Plugs:                Enumeration.Create(
+                              PlugTypes.TypeFSchuko,
+                              PlugTypes.Type2Outlet
+                          ),
+
+    AuthenticationModes:  Enumeration.Create(
+                              AuthenticationModes.NFC_RFID_Classic,
+                              AuthenticationModes.NFC_RFID_DESFire,
+                              AuthenticationModes.REMOTE
+                          ),
+
+    PaymentOptions:       Enumeration.Create(
+                              PaymentOptions.Contract,
+                              PaymentOptions.Direct
+                          ),
+
+    ValueAddedServices    Enumeration.Create(
+                              ValueAddedServices.Reservation,
+                              ValueAddedServices.DynamicPricing,
+                              ValueAddedServices.ParkingSensors,
+                              ValueAddedServices.MaximumPowerCharging,
+                              ValueAddedServices.PredictiveChargePointUsage,
+                              ValueAddedServices.ChargingPlans,
+                              ValueAddedServices.None
+                          ),
+
+    Accessibility:        AccessibilityTypes.Paying_publicly_accessible,
+
+    HotlinePhoneNumber:   "+49 555 12345678",
+
+    IsHubjectCompatible:  true,
+    DynamicInfoAvailable: true,
+    IsOpen24Hours:        true
+),
+
+new EVSEDataRecord(...)
Updated by Julius Poessnecker

File (0) OICP Added

  • Ignore whitespace
  • Hide word diff
+The service description can be found in the OICP 2.1 (CPO).
+
+Section:
+3.3.1 eRoamingPushEVSEData
+
+To download the latest OICP Version, please visit our website:
+https://www.hubject.com/downloads/
Updated by Gregor Schermuly

File (1) Push EVSE Data | C#.cs Added

  • Ignore whitespace
  • Hide word diff
+/// <summary>
+/// Create a new task pushing a single EVSE data record onto the OICP server.
+/// </summary>
+/// <param name="EVSEDataRecord">A EVSE data record.</param>
+/// <param name="OICPAction">An optional OICP action.</param>
+/// <param name="OperatorId">An optional EVSE operator Id to use. Otherwise it will be taken from the EVSE data record.</param>
+/// <param name="OperatorName">An optional EVSE operator name.</param>
+/// <param name="IncludeEVSEs">An optional delegate for filtering EVSE data records before pushing them to the server.</param>
+/// <param name="QueryTimeout">An optional timeout for this query.</param>
+public async Task<HTTPResponse<HubjectAcknowledgement>>
+
+    PushEVSEData(EVSEDataRecord                 EVSEDataRecord,
+                 ActionType                     OICPAction    = ActionType.insert,
+                 EVSEOperator_Id                OperatorId    = null,
+                 String                         OperatorName  = null,
+                 Func<EVSEDataRecord, Boolean>  IncludeEVSEs  = null,
+                 TimeSpan?                      QueryTimeout  = null)
+
+{ ... }
+
+/// <summary>
+/// Create a new task pushing EVSE data records onto the OICP server.
+/// </summary>
+/// <param name="OICPAction">The OICP action.</param>
+/// <param name="EVSEDataRecords">An array of EVSE data records.</param>
+public async Task<HTTPResponse<HubjectAcknowledgement>>
+
+    PushEVSEData(ActionType               OICPAction,
+                 params EVSEDataRecord[]  EVSEDataRecords)
+
+{ ... }
+
+/// <summary>
+/// Create a new task pushing EVSE data records onto the OICP server.
+/// </summary>
+/// <param name="OICPAction">The OICP action.</param>
+/// <param name="OperatorId">The EVSE operator Id to use.</param>
+/// <param name="EVSEDataRecords">An array of EVSE data records.</param>
+public async Task<HTTPResponse<HubjectAcknowledgement>>
+
+    PushEVSEData(ActionType               OICPAction,
+                 EVSEOperator_Id          OperatorId,
+                 params EVSEDataRecord[]  EVSEDataRecords)
+
+{ ... }
+
+/// <summary>
+/// Create a new task pushing EVSE data records onto the OICP server.
+/// </summary>
+/// <param name="OICPAction">The OICP action.</param>
+/// <param name="OperatorId">The EVSE operator Id to use.</param>
+/// <param name="OperatorName">The EVSE operator name.</param>
+/// <param name="EVSEDataRecords">An array of EVSE data records.</param>
+public async Task<HTTPResponse<HubjectAcknowledgement>>
+
+    PushEVSEData(ActionType               OICPAction,
+                 EVSEOperator_Id          OperatorId,
+                 String                   OperatorName,
+                 params EVSEDataRecord[]  EVSEDataRecords)
+
+{ ... }
+
+/// <summary>
+/// Create a new task pushing EVSE data records onto the OICP server.
+/// </summary>
+/// <param name="EVSEDataRecords">An enumeration of EVSE data records.</param>
+/// <param name="OICPAction">An optional OICP action.</param>
+/// <param name="OperatorId">An optional EVSE operator Id to use. Otherwise it will be taken from the EVSE data records.</param>
+/// <param name="OperatorName">An optional EVSE operator name.</param>
+/// <param name="IncludeEVSEs">An optional delegate for filtering EVSE data records before pushing them to the server.</param>
+/// <param name="QueryTimeout">An optional timeout for this query.</param>
+public async Task<HTTPResponse<HubjectAcknowledgement>>
+
+    PushEVSEData(IEnumerable<EVSEDataRecord>    EVSEDataRecords,
+                 ActionType                     OICPAction    = ActionType.fullLoad,
+                 EVSEOperator_Id                OperatorId    = null,
+                 String                         OperatorName  = null,
+                 Func<EVSEDataRecord, Boolean>  IncludeEVSEs  = null,
+                 TimeSpan?                      QueryTimeout  = null)
+
+{ ... }

File (2) Example.cs Added

  • Ignore whitespace
  • Hide word diff
+var EVSEDataRecords  = Enumeration.Create(
+
+    new EVSEDataRecord(
+        EVSEId:               EVSE_Id.           Parse("DE*GEF*E123456789*1"),
+        ChargingStationId:    ChargingStation_Id.Parse("DE*GEF*S123456789"),
+        ChargingStationName:  I18NString.        Create(Languages.de, "Testbox 1").
+                                                    Add(Languages.en, "Testbox One").,
+
+        Address:              Address.Create(
+                                  Country.Germany,
+                                  "07749", "Jena",
+                                  "Biberweg", "18"
+                              ),
+
+        GeoCoordinate:        GeoCoordinate.Create(
+                                  Latitude. Parse(49.731102),
+                                  Longitude.Parse(10.142530)
+                              ),
+
+        Plugs:                Enumeration.Create(
+                                  PlugTypes.TypeFSchuko,
+                                  PlugTypes.Type2Outlet
+                              ),
+
+        AuthenticationModes:  Enumeration.Create(
+                                  AuthenticationModes.NFC_RFID_Classic,
+                                  AuthenticationModes.NFC_RFID_DESFire,
+                                  AuthenticationModes.REMOTE
+                              ),
+
+        PaymentOptions:       Enumeration.Create(
+                                  PaymentOptions.Contract,
+                                  PaymentOptions.Direct
+                              ),
+
+        Accessibility:        AccessibilityTypes.Paying_publicly_accessible,
+
+        HotlinePhoneNumber:   "+49 555 12345678",
+
+        IsHubjectCompatible:  true,
+        DynamicInfoAvailable: true,
+        IsOpen24Hours:        true
+    ),
+
+    new EVSEDataRecord(...)
+
+);
+
+
+var req = new CPOClient("api.playground.hubject.com").
+
+              PushEVSEData(EVSEDataRecords,
+                           ActionType.insert,
+                           IncludeEVSEs: evse => evse.EVSEId.ToString().
+                                                 StartsWith("DE")).
+
+              ContinueWith(task => {
+
+                  var Acknowledgement = task.Result.Content;
+
+                  if (Acknowledgement.Result)
+                      Console.WriteLine("success!");
+
+                  else
+                  {
+                      Console.WriteLine(Acknowledgement.StatusCode.Code);
+                      Console.WriteLine(Acknowledgement.StatusCode.Description);
+                      Console.WriteLine(Acknowledgement.StatusCode.AdditionalInfo);
+                  }
+
+              });
+
+// Wait for the task to complete...
+req.Wait();

File Example.cs Deleted

  • Ignore whitespace
  • Hide word diff
-var EVSEDataRecords  = Enumeration.Create(
-
-    new EVSEDataRecord(
-        EVSEId:               EVSE_Id.           Parse("DE*GEF*E123456789*1"),
-        ChargingStationId:    ChargingStation_Id.Parse("DE*GEF*S123456789"),
-        ChargingStationName:  I18NString.        Create(Languages.de, "Testbox 1").
-                                                    Add(Languages.en, "Testbox One").,
-
-        Address:              Address.Create(
-                                  Country.Germany,
-                                  "07749", "Jena",
-                                  "Biberweg", "18"
-                              ),
-
-        GeoCoordinate:        GeoCoordinate.Create(
-                                  Latitude. Parse(49.731102),
-                                  Longitude.Parse(10.142530)
-                              ),
-
-        Plugs:                Enumeration.Create(
-                                  PlugTypes.TypeFSchuko,
-                                  PlugTypes.Type2Outlet
-                              ),
-
-        AuthenticationModes:  Enumeration.Create(
-                                  AuthenticationModes.NFC_RFID_Classic,
-                                  AuthenticationModes.NFC_RFID_DESFire,
-                                  AuthenticationModes.REMOTE
-                              ),
-
-        PaymentOptions:       Enumeration.Create(
-                                  PaymentOptions.Contract,
-                                  PaymentOptions.Direct
-                              ),
-
-        Accessibility:        AccessibilityTypes.Paying_publicly_accessible,
-
-        HotlinePhoneNumber:   "+49 555 12345678",
-
-        IsHubjectCompatible:  true,
-        DynamicInfoAvailable: true,
-        IsOpen24Hours:        true
-    ),
-
-    new EVSEDataRecord(...)
-
-);
-
-
-var req = new CPOClient("api.playground.hubject.com").
-
-              PushEVSEData(EVSEDataRecords,
-                           ActionType.insert,
-                           IncludeEVSEs: evse => evse.EVSEId.ToString().
-                                                 StartsWith("DE")).
-
-              ContinueWith(task => {
-
-                  var Acknowledgement = task.Result.Content;
-
-                  if (Acknowledgement.Result)
-                      Console.WriteLine("success!");
-
-                  else
-                  {
-                      Console.WriteLine(Acknowledgement.StatusCode.Code);
-                      Console.WriteLine(Acknowledgement.StatusCode.Description);
-                      Console.WriteLine(Acknowledgement.StatusCode.AdditionalInfo);
-                  }
-
-              });
-
-// Wait for the task to complete...
-req.Wait();

File Push EVSE Data | C#.cs Deleted

  • Ignore whitespace
  • Hide word diff
-/// <summary>
-/// Create a new task pushing a single EVSE data record onto the OICP server.
-/// </summary>
-/// <param name="EVSEDataRecord">A EVSE data record.</param>
-/// <param name="OICPAction">An optional OICP action.</param>
-/// <param name="OperatorId">An optional EVSE operator Id to use. Otherwise it will be taken from the EVSE data record.</param>
-/// <param name="OperatorName">An optional EVSE operator name.</param>
-/// <param name="IncludeEVSEs">An optional delegate for filtering EVSE data records before pushing them to the server.</param>
-/// <param name="QueryTimeout">An optional timeout for this query.</param>
-public async Task<HTTPResponse<HubjectAcknowledgement>>
-
-    PushEVSEData(EVSEDataRecord                 EVSEDataRecord,
-                 ActionType                     OICPAction    = ActionType.insert,
-                 EVSEOperator_Id                OperatorId    = null,
-                 String                         OperatorName  = null,
-                 Func<EVSEDataRecord, Boolean>  IncludeEVSEs  = null,
-                 TimeSpan?                      QueryTimeout  = null)
-
-{ ... }
-
-/// <summary>
-/// Create a new task pushing EVSE data records onto the OICP server.
-/// </summary>
-/// <param name="OICPAction">The OICP action.</param>
-/// <param name="EVSEDataRecords">An array of EVSE data records.</param>
-public async Task<HTTPResponse<HubjectAcknowledgement>>
-
-    PushEVSEData(ActionType               OICPAction,
-                 params EVSEDataRecord[]  EVSEDataRecords)
-
-{ ... }
-
-/// <summary>
-/// Create a new task pushing EVSE data records onto the OICP server.
-/// </summary>
-/// <param name="OICPAction">The OICP action.</param>
-/// <param name="OperatorId">The EVSE operator Id to use.</param>
-/// <param name="EVSEDataRecords">An array of EVSE data records.</param>
-public async Task<HTTPResponse<HubjectAcknowledgement>>
-
-    PushEVSEData(ActionType               OICPAction,
-                 EVSEOperator_Id          OperatorId,
-                 params EVSEDataRecord[]  EVSEDataRecords)
-
-{ ... }
-
-/// <summary>
-/// Create a new task pushing EVSE data records onto the OICP server.
-/// </summary>
-/// <param name="OICPAction">The OICP action.</param>
-/// <param name="OperatorId">The EVSE operator Id to use.</param>
-/// <param name="OperatorName">The EVSE operator name.</param>
-/// <param name="EVSEDataRecords">An array of EVSE data records.</param>
-public async Task<HTTPResponse<HubjectAcknowledgement>>
-
-    PushEVSEData(ActionType               OICPAction,
-                 EVSEOperator_Id          OperatorId,
-                 String                   OperatorName,
-                 params EVSEDataRecord[]  EVSEDataRecords)
-
-{ ... }
-
-/// <summary>
-/// Create a new task pushing EVSE data records onto the OICP server.
-/// </summary>
-/// <param name="EVSEDataRecords">An enumeration of EVSE data records.</param>
-/// <param name="OICPAction">An optional OICP action.</param>
-/// <param name="OperatorId">An optional EVSE operator Id to use. Otherwise it will be taken from the EVSE data records.</param>
-/// <param name="OperatorName">An optional EVSE operator name.</param>
-/// <param name="IncludeEVSEs">An optional delegate for filtering EVSE data records before pushing them to the server.</param>
-/// <param name="QueryTimeout">An optional timeout for this query.</param>
-public async Task<HTTPResponse<HubjectAcknowledgement>>
-
-    PushEVSEData(IEnumerable<EVSEDataRecord>    EVSEDataRecords,
-                 ActionType                     OICPAction    = ActionType.fullLoad,
-                 EVSEOperator_Id                OperatorId    = null,
-                 String                         OperatorName  = null,
-                 Func<EVSEDataRecord, Boolean>  IncludeEVSEs  = null,
-                 TimeSpan?                      QueryTimeout  = null)
-
-{ ... }
Updated by Gregor Schermuly

File Example.cs Added

  • Ignore whitespace
  • Hide word diff
+var EVSEDataRecords  = Enumeration.Create(
+
+    new EVSEDataRecord(
+        EVSEId:               EVSE_Id.           Parse("DE*GEF*E123456789*1"),
+        ChargingStationId:    ChargingStation_Id.Parse("DE*GEF*S123456789"),
+        ChargingStationName:  I18NString.        Create(Languages.de, "Testbox 1").
+                                                    Add(Languages.en, "Testbox One").,
+
+        Address:              Address.Create(
+                                  Country.Germany,
+                                  "07749", "Jena",
+                                  "Biberweg", "18"
+                              ),
+
+        GeoCoordinate:        GeoCoordinate.Create(
+                                  Latitude. Parse(49.731102),
+                                  Longitude.Parse(10.142530)
+                              ),
+
+        Plugs:                Enumeration.Create(
+                                  PlugTypes.TypeFSchuko,
+                                  PlugTypes.Type2Outlet
+                              ),
+
+        AuthenticationModes:  Enumeration.Create(
+                                  AuthenticationModes.NFC_RFID_Classic,
+                                  AuthenticationModes.NFC_RFID_DESFire,
+                                  AuthenticationModes.REMOTE
+                              ),
+
+        PaymentOptions:       Enumeration.Create(
+                                  PaymentOptions.Contract,
+                                  PaymentOptions.Direct
+                              ),
+
+        Accessibility:        AccessibilityTypes.Paying_publicly_accessible,
+
+        HotlinePhoneNumber:   "+49 555 12345678",
+
+        IsHubjectCompatible:  true,
+        DynamicInfoAvailable: true,
+        IsOpen24Hours:        true
+    ),
+
+    new EVSEDataRecord(...)
+
+);
+
+
+var req = new CPOClient("api.playground.hubject.com").
+
+              PushEVSEData(EVSEDataRecords,
+                           ActionType.insert,
+                           IncludeEVSEs: evse => evse.EVSEId.ToString().
+                                                 StartsWith("DE")).
+
+              ContinueWith(task => {
+
+                  var Acknowledgement = task.Result.Content;
+
+                  if (Acknowledgement.Result)
+                      Console.WriteLine("success!");
+
+                  else
+                  {
+                      Console.WriteLine(Acknowledgement.StatusCode.Code);
+                      Console.WriteLine(Acknowledgement.StatusCode.Description);
+                      Console.WriteLine(Acknowledgement.StatusCode.AdditionalInfo);
+                  }
+
+              });
+
+// Wait for the task to complete...
+req.Wait();

File Push EVSE Data | C#.cs Modified

  • Ignore whitespace
  • Hide word diff
                  Func<EVSEDataRecord, Boolean>  IncludeEVSEs  = null,
                  TimeSpan?                      QueryTimeout  = null)
 
-{ ... }
-
-
-
-///Example
-
-var EVSEDataRecords  = Enumeration.Create(
-
-    new EVSEDataRecord(
-        EVSEId:               EVSE_Id.           Parse("DE*GEF*E123456789*1"),
-        ChargingStationId:    ChargingStation_Id.Parse("DE*GEF*S123456789"),
-        ChargingStationName:  I18NString.        Create(Languages.de, "Testbox 1").
-                                                    Add(Languages.en, "Testbox One").,
-
-        Address:              Address.Create(
-                                  Country.Germany,
-                                  "07749", "Jena",
-                                  "Biberweg", "18"
-                              ),
-
-        GeoCoordinate:        GeoCoordinate.Create(
-                                  Latitude. Parse(49.731102),
-                                  Longitude.Parse(10.142530)
-                              ),
-
-        Plugs:                Enumeration.Create(
-                                  PlugTypes.TypeFSchuko,
-                                  PlugTypes.Type2Outlet
-                              ),
-
-        AuthenticationModes:  Enumeration.Create(
-                                  AuthenticationModes.NFC_RFID_Classic,
-                                  AuthenticationModes.NFC_RFID_DESFire,
-                                  AuthenticationModes.REMOTE
-                              ),
-
-        PaymentOptions:       Enumeration.Create(
-                                  PaymentOptions.Contract,
-                                  PaymentOptions.Direct
-                              ),
-
-        Accessibility:        AccessibilityTypes.Paying_publicly_accessible,
-
-        HotlinePhoneNumber:   "+49 555 12345678",
-
-        IsHubjectCompatible:  true,
-        DynamicInfoAvailable: true,
-        IsOpen24Hours:        true
-    ),
-
-    new EVSEDataRecord(...)
-
-);
-
-
-var req = new CPOClient("api.playground.hubject.com").
-
-              PushEVSEData(EVSEDataRecords,
-                           ActionType.insert,
-                           IncludeEVSEs: evse => evse.EVSEId.ToString().
-                                                 StartsWith("DE")).
-
-              ContinueWith(task => {
-
-                  var Acknowledgement = task.Result.Content;
-
-                  if (Acknowledgement.Result)
-                      Console.WriteLine("success!");
-
-                  else
-                  {
-                      Console.WriteLine(Acknowledgement.StatusCode.Code);
-                      Console.WriteLine(Acknowledgement.StatusCode.Description);
-                      Console.WriteLine(Acknowledgement.StatusCode.AdditionalInfo);
-                  }
-
-              });
-
-// Wait for the task to complete...
-req.Wait();
+{ ... }
Updated by Gregor Schermuly

File Push EVSE Data | C#.cs Modified

  • Ignore whitespace
  • Hide word diff
 
 
 ///Example
+
 var EVSEDataRecords  = Enumeration.Create(
 
     new EVSEDataRecord(
  1. 1
  2. 2
HTTPS SSH

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