1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using EVCB_OCPP.Packet.Features;
- using EVCB_OCPP.Packet.Messages.Basic;
- using EVCB_OCPP.Packet20.Messages;
- using EVCB_OCPP.WSServer.Message;
- using Newtonsoft.Json;
- using Newtonsoft.Json.Linq;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace EVCB_OCPP.WSServer
- {
- class Program
- {
- static void Main(string[] args)
- {
- string tt = "{ \"connectorId\": 1, \"evseId\": 1, \"connectorStatus\": \"Occupied\", \"timestamp\": \"2020-10-28T08:28:47Z\"}";
- var gg= JsonConvert.DeserializeObject<StatusNotificationRequest>(tt);
- ProtalServer s = new ProtalServer();
- Console.WriteLine("Starting Server...");
- s.Start();
- Console.Read();
- }
- public static object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
- {
- DateTime? timevalue = null;
- if (reader.Value != null)
- {
- DateTime date = ((DateTime)reader.Value).ToLocalTime();
- timevalue = new DateTime(date.Year, date.Month, date.Day, date.TimeOfDay.Hours, date.TimeOfDay.Minutes, date.TimeOfDay.Seconds, 000);
- }
- return timevalue;
- }
- }
- }
|