فهرست منبع

2020/01/16 Jessica

Actions:
1.DLL 替換成40aaad4 的檔案
2.測試工具 調整 預約到期時間 (5天)
3.新增驗證拒絕名單:"AC5CDC3D", "48C4CBD9257A"  & 驗證拒絕邏輯
4.調整GetConfigure 邏輯 ,每次連上來都確認是否已保存電樁43個KeyValue ,一次最多抓8個 最小數量依電樁設定為準
5.修正 連線邏輯 樁號不存在 直接回覆 404 、SubProtocol 不支援要等連線完成才做斷線處理
6.MachineConnectionLog 增加紀錄IP SessionId
Jessica.Tseng 5 سال پیش
والد
کامیت
6e6044be88

+ 24 - 0
EVCB_OCPP.Server.sln

@@ -7,6 +7,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EVCB_OCPP.WSServer", "EVCB_
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestTool.RemoteTriggerAPP", "TestTool.RemoteTriggerAPP\TestTool.RemoteTriggerAPP.csproj", "{F39A3B1E-2B93-40E1-9C7B-8CEE2529BF52}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SuperSocket.SocketBase.Net40", "SocketBase\SuperSocket.SocketBase.Net40.csproj", "{40B77789-EA11-4C05-8F52-86711D7BCAAF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SuperSocket.Common.Net40", "SocketCommon\SuperSocket.Common.Net40.csproj", "{A24F4D38-BA9C-4FD6-95B7-4980DE36131A}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SuperSocket.SocketEngine.Net40", "SocketEngine\SuperSocket.SocketEngine.Net40.csproj", "{153FEF72-191C-43D9-BE71-2B351C7AC760}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SuperWebSocket.NET45", "SuperWebSocket\SuperWebSocket.NET45.csproj", "{2DC79E40-BB70-4F6A-B378-905F2FBC6E97}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -21,6 +29,22 @@ Global
 		{F39A3B1E-2B93-40E1-9C7B-8CEE2529BF52}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{F39A3B1E-2B93-40E1-9C7B-8CEE2529BF52}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{F39A3B1E-2B93-40E1-9C7B-8CEE2529BF52}.Release|Any CPU.Build.0 = Release|Any CPU
+		{40B77789-EA11-4C05-8F52-86711D7BCAAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{40B77789-EA11-4C05-8F52-86711D7BCAAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{40B77789-EA11-4C05-8F52-86711D7BCAAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{40B77789-EA11-4C05-8F52-86711D7BCAAF}.Release|Any CPU.Build.0 = Release|Any CPU
+		{A24F4D38-BA9C-4FD6-95B7-4980DE36131A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{A24F4D38-BA9C-4FD6-95B7-4980DE36131A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{A24F4D38-BA9C-4FD6-95B7-4980DE36131A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{A24F4D38-BA9C-4FD6-95B7-4980DE36131A}.Release|Any CPU.Build.0 = Release|Any CPU
+		{153FEF72-191C-43D9-BE71-2B351C7AC760}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{153FEF72-191C-43D9-BE71-2B351C7AC760}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{153FEF72-191C-43D9-BE71-2B351C7AC760}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{153FEF72-191C-43D9-BE71-2B351C7AC760}.Release|Any CPU.Build.0 = Release|Any CPU
+		{2DC79E40-BB70-4F6A-B378-905F2FBC6E97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{2DC79E40-BB70-4F6A-B378-905F2FBC6E97}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{2DC79E40-BB70-4F6A-B378-905F2FBC6E97}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{2DC79E40-BB70-4F6A-B378-905F2FBC6E97}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 7 - 3
EVCB_OCPP.WSServer/App.config

@@ -7,13 +7,17 @@
     <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
   </configSections>
    <connectionStrings>
-    <add name="ConnectionLogDBContext" connectionString="data source=172.1.0.142\SQLEXPRESS;initial catalog=OCPP_ConnectionLogDBContext;persist security info=True;user id=sa;password=Ph0930118811;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
+    <!--<add name="ConnectionLogDBContext" connectionString="data source=172.1.0.142\SQLEXPRESS;initial catalog=OCPP_ConnectionLogDBContext;persist security info=True;user id=sa;password=Ph0930118811;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
     <add name="MainDBContext" connectionString="data source=172.1.0.142\SQLEXPRESS;initial catalog=OCPP_MainDBContext;;persist security info=True;user id=sa;password=Ph0930118811;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
-    <add name="MeterValueDBContext" connectionString="data source=172.1.0.142\SQLEXPRESS;initial catalog=OCPP_MeterValueDBContext;;persist security info=True;user id=sa;password=Ph0930118811;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
+    <add name="MeterValueDBContext" connectionString="data source=172.1.0.142\SQLEXPRESS;initial catalog=OCPP_MeterValueDBContext;;persist security info=True;user id=sa;password=Ph0930118811;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />-->
+   <add name="ConnectionLogDBContext" connectionString="data source=172.1.2.187\SQLEXPRESS2017;initial catalog=StandardOCPP_ConnectionLog;persist security info=True;user id=sa;password=Ph0930118811;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
+    <add name="MainDBContext" connectionString="data source=172.1.2.187\SQLEXPRESS2017;initial catalog=StandardOCPP_Main;;persist security info=True;user id=sa;password=Ph0930118811;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
+    <add name="MeterValueDBContext" connectionString="data source=172.1.2.187\SQLEXPRESS2017;initial catalog=StandardOCPP_MeterValue;;persist security info=True;user id=sa;password=Ph0930118811;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
+ 
   </connectionStrings>
   <appSettings>
     <add key="ServerIP" value=""/>
-    <add key="WSPort" value="2017"/>
+    <add key="WSPort" value="8080"/>
     <add key="WSSPort" value="2013"/>
   
   </appSettings>

BIN
EVCB_OCPP.WSServer/DLL/EVCB_OCPP.Domain.dll


BIN
EVCB_OCPP.WSServer/DLL/EVCB_OCPP.Packet.dll


+ 20 - 14
EVCB_OCPP.WSServer/EVCB_OCPP.WSServer.csproj

@@ -56,18 +56,6 @@
     <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
       <HintPath>..\packages\NLog.4.6.6\lib\net45\NLog.dll</HintPath>
     </Reference>
-    <Reference Include="SuperSocket.Common">
-      <HintPath>DLL\SuperSocket.Common.dll</HintPath>
-    </Reference>
-    <Reference Include="SuperSocket.SocketBase">
-      <HintPath>DLL\SuperSocket.SocketBase.dll</HintPath>
-    </Reference>
-    <Reference Include="SuperSocket.SocketEngine">
-      <HintPath>DLL\SuperSocket.SocketEngine.dll</HintPath>
-    </Reference>
-    <Reference Include="SuperWebSocket">
-      <HintPath>DLL\SuperWebSocket.dll</HintPath>
-    </Reference>
     <Reference Include="System" />
     <Reference Include="System.ComponentModel.DataAnnotations" />
     <Reference Include="System.Configuration" />
@@ -130,9 +118,27 @@
     <Content Include="DLL\EVCB_OCPP.Domain.dll" />
     <Content Include="DLL\EVCB_OCPP.Packet.dll" />
   </ItemGroup>
-  <ItemGroup />
+  <ItemGroup>
+    <ProjectReference Include="..\SocketBase\SuperSocket.SocketBase.Net40.csproj">
+      <Project>{40b77789-ea11-4c05-8f52-86711d7bcaaf}</Project>
+      <Name>SuperSocket.SocketBase.Net40</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\SocketCommon\SuperSocket.Common.Net40.csproj">
+      <Project>{a24f4d38-ba9c-4fd6-95b7-4980de36131a}</Project>
+      <Name>SuperSocket.Common.Net40</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\SocketEngine\SuperSocket.SocketEngine.Net40.csproj">
+      <Project>{153fef72-191c-43d9-be71-2b351c7ac760}</Project>
+      <Name>SuperSocket.SocketEngine.Net40</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\SuperWebSocket\SuperWebSocket.NET45.csproj">
+      <Project>{2dc79e40-bb70-4f6a-b378-905f2fbc6e97}</Project>
+      <Name>SuperWebSocket.NET45</Name>
+    </ProjectReference>
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <PropertyGroup>
-    <PreBuildEvent>GitVersion.exe $(SolutionDir) /updateassemblyinfo</PreBuildEvent>
+    <PreBuildEvent>
+    </PreBuildEvent>
   </PropertyGroup>
 </Project>

+ 48 - 15
EVCB_OCPP.WSServer/Message/CoreProfileHandler.cs

@@ -21,6 +21,7 @@ namespace EVCB_OCPP.WSServer.Message
 
     internal partial class ProfileHandler
     {
+        private List<string> idtag_RejecttionList = new List<string>() { "AC5CDC3D", "48C4CBD9257A" };
         int counnter = 0;
         internal MessageResult ExecuteCoreRequest(Actions action, ClientData session, IRequest request)
         {
@@ -208,6 +209,7 @@ namespace EVCB_OCPP.WSServer.Message
                         long _pastTime = DateTimeOffset.Now.AddYears(-20).ToUnixTimeSeconds();
                         int _tranId = (int)(_pastTime % 100000000) * 10 + 1;
 
+
                         //需處理StopTransactionOnInvalidId 情境,時間若和當前時間差距10秒,發動Authorize詢問後在回覆
                         using (var db = new MainDBContext())
                         {
@@ -232,17 +234,20 @@ namespace EVCB_OCPP.WSServer.Message
                         }
 
 
+
                         var confirm = new StartTransactionConfirmation()
                         {
                             idTagInfo = new Packet.Messages.SubTypes.IdTagInfo()
                             {
-                                status = AuthorizationStatus.Accepted
+                                status = idtag_RejecttionList.Contains(_request.idTag) ? AuthorizationStatus.Invalid : AuthorizationStatus.Accepted
                             },
                             transactionId = _tranId
 
 
 
                         };
+
+
                         result.Message = confirm;
                         result.Success = true;
                     }
@@ -318,14 +323,14 @@ namespace EVCB_OCPP.WSServer.Message
                     break;
                 case Actions.Authorize:
                     {
-
+                        AuthorizeRequest _request = request as AuthorizeRequest;
 
                         var confirm = new AuthorizeConfirmation()
                         {
 
                             idTagInfo = new Packet.Messages.SubTypes.IdTagInfo()
                             {
-                                status = AuthorizationStatus.Accepted
+                                status = idtag_RejecttionList.Contains(_request.idTag) ? AuthorizationStatus.Invalid : AuthorizationStatus.Accepted
                             }
                         };
                         result.Message = confirm;
@@ -507,26 +512,54 @@ namespace EVCB_OCPP.WSServer.Message
                         {
                             var configure = db.MachineConfigure.Where(x => x.ChargeBoxId == session.ChargeBoxId).ToList();
 
-                            foreach (var item in _confirm.configurationKey)
+                            if (_confirm.configurationKey != null)
                             {
-                                var foundConfig = configure.Find(x => x.ConfigureName == item.key);
-                                if (foundConfig != null)
+                                foreach (var item in _confirm.configurationKey)
                                 {
-                                    foundConfig.ReadOnly = item.IsReadOnly;
-                                    foundConfig.ConfigureSetting = item.value;
+                                    var foundConfig = configure.Find(x => x.ConfigureName == item.key);
+                                    if (foundConfig != null)
+                                    {
+                                        foundConfig.ReadOnly = item.IsReadOnly;
+                                        foundConfig.ConfigureSetting = item.value;
+                                    }
+                                    else
+                                    {
+                                        db.MachineConfigure.Add(new MachineConfigure()
+                                        {
+                                            ChargeBoxId = session.ChargeBoxId,
+                                            ConfigureName = item.key,
+                                            ReadOnly = item.IsReadOnly,
+                                            ConfigureSetting = item.value,
+                                            Exists=true
+                                        });
+                                    }
                                 }
-                                else
+                            }
+                            if (_confirm.unknownKey != null)
+                            {
+                                foreach (var item in _confirm.unknownKey)
                                 {
-                                    db.MachineConfigure.Add(new MachineConfigure()
+                                    var foundConfig = configure.Find(x => x.ConfigureName == item);
+                                    if (foundConfig != null)
                                     {
-                                        ChargeBoxId = session.ChargeBoxId,
-                                        ConfigureName = item.key,
-                                        ReadOnly = item.IsReadOnly,
-                                        ConfigureSetting = item.value
-                                    });
+                                        foundConfig.ReadOnly = true;
+                                        foundConfig.ConfigureSetting = string.Empty;
+                                        foundConfig.Exists = false;
+                                    }
+                                    else
+                                    {
+                                        db.MachineConfigure.Add(new MachineConfigure()
+                                        {
+                                            ChargeBoxId = session.ChargeBoxId,
+                                            ConfigureName = item
+                                        });
+                                    }
                                 }
                             }
 
+
+
+
                             var operation = db.MachineOperateRecord.Where(x => x.SerialNo == requestId &&
                            x.ChargeBoxId == session.ChargeBoxId && x.Status == 0).FirstOrDefault();
 

+ 1 - 1
EVCB_OCPP.WSServer/Properties/AssemblyInfo.cs

@@ -35,4 +35,4 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyVersion("0.1.0.0")]
 [assembly: AssemblyFileVersion("0.1.0.0")]
 
-[assembly: AssemblyInformationalVersion("04071bd")]
+[assembly: AssemblyInformationalVersion("9f82982")]

+ 141 - 72
EVCB_OCPP.WSServer/ProtalServer.cs

@@ -37,13 +37,14 @@ namespace EVCB_OCPP.WSServer
     {
         static private ILogger logger = NLog.LogManager.GetCurrentClassLogger();
 
-        private Dictionary<string, ClientData> ClientDic = new Dictionary<string, ClientData>();
+
+        private Dictionary<string, ClientData> clientDic = new Dictionary<string, ClientData>();
         private readonly Object _lockClientDic = new object();
         private readonly Object _lockConfirmPacketList = new object();
-        private ProfileHandler _profileHandler = new ProfileHandler();
-        private List<NeedConfirmMessage> NeedConfirmPacketList = new List<NeedConfirmMessage>();
+        private ProfileHandler profileHandler = new ProfileHandler();
+        private List<NeedConfirmMessage> needConfirmPacketList = new List<NeedConfirmMessage>();
         private DateTime checkUpdateDt = DateTime.Now;
-        private List<string> _needConfirmActions = new List<string>()
+        private List<string> needConfirmActions = new List<string>()
         {
              "GetConfiguration",
              "ChangeConfiguration",
@@ -108,6 +109,10 @@ namespace EVCB_OCPP.WSServer
             Task serverUpdateTask = new Task(ServerUpdateTrigger, _ct);
             serverUpdateTask.Start();
 
+
+            Task serverHealthTask = new Task(HealthAlarmTrigger, _ct);
+           // serverHealthTask.Start();
+
             while (true)
             {
                 var input = Console.ReadLine();
@@ -130,14 +135,14 @@ namespace EVCB_OCPP.WSServer
                             Dictionary<string, ClientData> _copyClientDic = null;
                             lock (_lockClientDic)
                             {
-                                _copyClientDic = new Dictionary<string, ClientData>(ClientDic);
+                                _copyClientDic = new Dictionary<string, ClientData>(clientDic);
 
                             }
                             var list = _copyClientDic.Select(c => c.Value).ToList();
                             int i = 1;
                             foreach (var c in list)
                             {
-                                logger.Info(i + ":" + c.ChargeBoxId);
+                                logger.Info(i + ":" + c.ChargeBoxId + " " + c.SessionID);
                                 i++;
                             }
 
@@ -149,14 +154,14 @@ namespace EVCB_OCPP.WSServer
                             Dictionary<string, ClientData> _copyClientDic = null;
                             lock (_lockClientDic)
                             {
-                                _copyClientDic = new Dictionary<string, ClientData>(ClientDic);
+                                _copyClientDic = new Dictionary<string, ClientData>(clientDic);
 
                             }
-                            var lcn = ClientDic.Select(c => c.Value.CustomerName).Distinct().ToList();
+                            var lcn = clientDic.Select(c => c.Value.CustomerName).Distinct().ToList();
                             int iLcn = 1;
                             foreach (var c in lcn)
                             {
-                                logger.Info(iLcn + ":" + c + ":" + ClientDic.Where(z => z.Value.CustomerName == c).Count().ToString());
+                                logger.Info(iLcn + ":" + c + ":" + clientDic.Where(z => z.Value.CustomerName == c).Count().ToString());
                                 iLcn++;
                             }
 
@@ -209,6 +214,8 @@ namespace EVCB_OCPP.WSServer
             }
         }
 
+
+
         internal void Stop()
         {
             if (_cts != null)
@@ -219,38 +226,65 @@ namespace EVCB_OCPP.WSServer
 
         private void CheckEVSEConfigure(string chargeBoxId)
         {
-
-
+            int skipCount = 0;
+            int takeCount = 8;
             using (var db = new MainDBContext())
             {
 
-                var _sn = db.MachineConfigure.Where(x => x.ChargeBoxId == chargeBoxId).Select(x => x.ChargeBoxId).FirstOrDefault();
-                if (string.IsNullOrEmpty(_sn))
+                string maxKeys = StandardConfiguration.AllConfigs.Skip(skipCount).Take(1).FirstOrDefault();
+                if (maxKeys == StandardConfiguration.GetConfigurationMaxKeys)
                 {
-                    db.ServerMessage.Add(new ServerMessage()
+                    var _Configure = db.MachineConfigure.Where(x => x.ChargeBoxId == chargeBoxId && x.ConfigureName == maxKeys).Select(x => new { ConfigureSetting = x.ConfigureSetting, ConfigureName = x.ConfigureName }).FirstOrDefault();
+                    if (_Configure != null)
                     {
-                        ChargeBoxId = chargeBoxId,
-                        CreatedBy = "Server",
-                        CreatedOn = DateTime.Now,
-                        OutAction = Actions.GetConfiguration.ToString(),
-                        OutRequest = JsonConvert.SerializeObject(
+                        int cp_ConfiureCount = 0;
+                        int.TryParse(_Configure.ConfigureSetting, out cp_ConfiureCount);
+                        takeCount = takeCount > cp_ConfiureCount ? cp_ConfiureCount : takeCount;
+                        skipCount = 1;
+                        if (string.IsNullOrEmpty(_Configure.ConfigureSetting)) return;
+                    }
+
+                }
+
+                while (StandardConfiguration.AllConfigs.Count > skipCount)
+                {
+                    string _key = StandardConfiguration.AllConfigs.Skip(skipCount).Take(1).FirstOrDefault();
+                    var _Configure = db.MachineConfigure.Where(x => x.ChargeBoxId == chargeBoxId && x.ConfigureName == _key).Select(x => new { ConfigureSetting = x.ConfigureSetting, ConfigureName = x.ConfigureName }).FirstOrDefault();
+                    takeCount = StandardConfiguration.AllConfigs.Count - skipCount > takeCount ? takeCount : StandardConfiguration.AllConfigs.Count - skipCount;
+
+                    var _keys = StandardConfiguration.AllConfigs.Skip(skipCount).Take(takeCount).ToList();
+                    Console.WriteLine("===============Skip:" + skipCount);
+                    if (_Configure == null)
+                    {
+                        Console.WriteLine("_Configure == null===============Skip:" + skipCount);
+                        db.ServerMessage.Add(new ServerMessage()
+                        {
+                            ChargeBoxId = chargeBoxId,
+                            CreatedBy = "Server",
+                            CreatedOn = DateTime.Now,
+                            OutAction = Actions.GetConfiguration.ToString(),
+                            OutRequest = JsonConvert.SerializeObject(
                             new GetConfigurationRequest()
                             {
-                                key = new List<string>()
+                                key = _keys
 
                             },
                             new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore, Formatting = Formatting.None }),
-                        SerialNo = Guid.NewGuid().ToString(),
-                        InMessage = string.Empty
+                            SerialNo = Guid.NewGuid().ToString(),
+                            InMessage = string.Empty
 
-                    });
+                        });
+
+                        db.SaveChanges();
+                    }
+
+                    skipCount = skipCount + takeCount;
 
-                    db.SaveChanges();
                 }
+
             }
         }
 
-
         private void OpenNetwork()
         {
 
@@ -269,6 +303,7 @@ namespace EVCB_OCPP.WSServer
             //設定server config
             var serverConfig = new ServerConfig
             {
+
                 //Port = Convert.ToInt32(2012),
                 //Ip = "172.17.40.13",
                 MaxRequestLength = 4096,
@@ -300,31 +335,54 @@ namespace EVCB_OCPP.WSServer
 
         private void AppServer_SessionClosed(ClientData session, CloseReason value)
         {
-            Console.WriteLine(session.RemoteEndPoint.Address);
-            WriteMachineLog(session.ChargeBoxId, string.Format("CloseReason: {0}", value), "Connection", "");
+            //  Console.WriteLine(session.RemoteEndPoint.Address);
+            WriteMachineLog(session, string.Format("CloseReason: {0}", value), "Connection", "");
             RemoveClient(session);
             // close Connection
         }
 
         private void AppServer_NewSessionConnected(ClientData session)
         {
-            Console.WriteLine("------------New");
-            session.m_ReceiveData += new ClientData.OCPPClientDataEventHandler<ClientData, String>(ReceivedMessage);
+
             try
             {
                 lock (_lockClientDic)
                 {
+                    bool isNotSupported = session.SecWebSocketProtocol.Contains("ocpp1.6") ? false : true;
+                    if (isNotSupported)
+                    {
+                        logger.Debug(string.Format("ChargeBoxId:{0} SecWebSocketProtocol:{1} NotSupported", session.ChargeBoxId, session.SecWebSocketProtocol));
+                        WriteMachineLog(session, string.Format("SecWebSocketProtocol:{0} NotSupported", session.SecWebSocketProtocol), "Connection", "");
+                        return;
+                    }
                     ClientData _removeClient = null;
-
-                    ClientDic.TryGetValue(session.ChargeBoxId, out _removeClient);
+                    clientDic.TryGetValue(session.ChargeBoxId, out _removeClient);
                     if (_removeClient != null)
                     {
+                        WriteMachineLog(_removeClient, "Duplicate Logins", "Connection", "");
+                        _removeClient.Close(CloseReason.ServerShutdown);
                         RemoveClient(_removeClient);
                     }
-                    ClientDic.Add(session.ChargeBoxId, session);
-                 
-                    Console.WriteLine("------------New" + (session == null ? "Oops" : session.ChargeBoxId));
-                    WriteMachineLog(session.ChargeBoxId, "", "Connection", "");
+
+                    session.IsCheckIn = true;
+
+                    clientDic.Add(session.ChargeBoxId, session);
+                    session.m_ReceiveData += new ClientData.OCPPClientDataEventHandler<ClientData, String>(ReceivedMessage);
+                    logger.Debug("------------New " + (session == null ? "Oops" : session.ChargeBoxId));
+                    WriteMachineLog(session, "NewSessionConnected", "Connection", "");
+
+                    using (var db = new MainDBContext())
+                    {
+                        var machine = db.Machine.Where(x => x.ChargeBoxId == session.ChargeBoxId).FirstOrDefault();
+                        if (machine != null)
+                        {
+                            machine.ConnectionType = session.Origin.Contains("https") ? 2 : 1;
+                            db.SaveChanges();
+                        }
+                    }
+
+
+                    CheckEVSEConfigure(session.ChargeBoxId);
                 }
             }
             catch (Exception ex)
@@ -342,7 +400,7 @@ namespace EVCB_OCPP.WSServer
             MessageResult analysisResult = msgAnalyser.AnalysisReceiveData(session, rawdata);
 
 
-            WriteMachineLog(session.ChargeBoxId, rawdata,
+            WriteMachineLog(session, rawdata,
                 string.Format("{0} {1}", string.IsNullOrEmpty(analysisResult.Action) ? "unknown" : analysisResult.Action, analysisResult.Id == 2 ? "Request" : (analysisResult.Id == 3 ? "Confirmation" : "Error")));
 
             if (analysisResult.Success == false)
@@ -422,7 +480,7 @@ namespace EVCB_OCPP.WSServer
                         {
 
                             bool oldstatus = session.IsCheckIn;
-                            var replyResult = _profileHandler.ExecuteCoreRequest(action, session, (IRequest)analysisResult.Message);
+                            var replyResult = profileHandler.ExecuteCoreRequest(action, session, (IRequest)analysisResult.Message);
                             if (replyResult.Success)
                             {
                                 string response = msgAnalyser.GenerateConfirmation(analysisResult.UUID, (IConfirmation)replyResult.Message);
@@ -445,7 +503,7 @@ namespace EVCB_OCPP.WSServer
                                             }
 
 
-                                            CheckEVSEConfigure(session.ChargeBoxId);
+                                            // CheckEVSEConfigure(session.ChargeBoxId);
                                         }
                                     }
                                 }
@@ -463,7 +521,7 @@ namespace EVCB_OCPP.WSServer
                         break;
                     case "FirmwareManagement":
                         {
-                            var replyResult = _profileHandler.ExecuteFirmwareManagementRequest(action, session, (IRequest)analysisResult.Message);
+                            var replyResult = profileHandler.ExecuteFirmwareManagementRequest(action, session, (IRequest)analysisResult.Message);
                             if (replyResult.Success)
                             {
                                 string response = msgAnalyser.GenerateConfirmation(analysisResult.UUID, (IConfirmation)replyResult.Message);
@@ -503,32 +561,32 @@ namespace EVCB_OCPP.WSServer
                 {
                     case "Core":
                         {
-                            confirmResult = _profileHandler.ExecuteCoreConfirm(action, session, (IConfirmation)analysisResult.Message, analysisResult.RequestId);
+                            confirmResult = profileHandler.ExecuteCoreConfirm(action, session, (IConfirmation)analysisResult.Message, analysisResult.RequestId);
                         }
                         break;
                     case "FirmwareManagement":
                         {
-                            confirmResult = _profileHandler.ExecuteFirmwareManagementConfirm(action, session, (IConfirmation)analysisResult.Message, analysisResult.RequestId);
+                            confirmResult = profileHandler.ExecuteFirmwareManagementConfirm(action, session, (IConfirmation)analysisResult.Message, analysisResult.RequestId);
                         }
                         break;
                     case "RemoteTrigger":
                         {
-                            confirmResult = _profileHandler.ExecuteRemoteTriggerConfirm(action, session, (IConfirmation)analysisResult.Message, analysisResult.RequestId);
+                            confirmResult = profileHandler.ExecuteRemoteTriggerConfirm(action, session, (IConfirmation)analysisResult.Message, analysisResult.RequestId);
                         }
                         break;
                     case "Reservation":
                         {
-                            confirmResult = _profileHandler.ExecuteReservationConfirm(action, session, (IConfirmation)analysisResult.Message, analysisResult.RequestId);
+                            confirmResult = profileHandler.ExecuteReservationConfirm(action, session, (IConfirmation)analysisResult.Message, analysisResult.RequestId);
                         }
                         break;
                     case "LocalAuthListManagement":
                         {
-                            confirmResult = _profileHandler.ExecuteLocalAuthListManagementConfirm(action, session, (IConfirmation)analysisResult.Message, analysisResult.RequestId);
+                            confirmResult = profileHandler.ExecuteLocalAuthListManagementConfirm(action, session, (IConfirmation)analysisResult.Message, analysisResult.RequestId);
                         }
                         break;
                     case "SmartCharging":
                         {
-                            confirmResult = _profileHandler.ExecuteSmartChargingConfirm(action, session, (IConfirmation)analysisResult.Message, analysisResult.RequestId);
+                            confirmResult = profileHandler.ExecuteSmartChargingConfirm(action, session, (IConfirmation)analysisResult.Message, analysisResult.RequestId);
                         }
                         break;
                     default:
@@ -565,32 +623,32 @@ namespace EVCB_OCPP.WSServer
                 {
                     case "Core":
                         {
-                            _profileHandler.ReceivedCoreError(action, analysisResult.ReceivedErrorCode, session, analysisResult.RequestId);
+                            profileHandler.ReceivedCoreError(action, analysisResult.ReceivedErrorCode, session, analysisResult.RequestId);
                         }
                         break;
                     case "FirmwareManagement":
                         {
-                            _profileHandler.ReceivedFirmwareManagementError(action, analysisResult.ReceivedErrorCode, session, analysisResult.RequestId);
+                            profileHandler.ReceivedFirmwareManagementError(action, analysisResult.ReceivedErrorCode, session, analysisResult.RequestId);
                         }
                         break;
                     case "RemoteTrigger":
                         {
-                            _profileHandler.ReceivedRemoteTriggerError(action, analysisResult.ReceivedErrorCode, session, analysisResult.RequestId);
+                            profileHandler.ReceivedRemoteTriggerError(action, analysisResult.ReceivedErrorCode, session, analysisResult.RequestId);
                         }
                         break;
                     case "Reservation":
                         {
-                            _profileHandler.ExecuteReservationError(action, analysisResult.ReceivedErrorCode, session, analysisResult.RequestId);
+                            profileHandler.ExecuteReservationError(action, analysisResult.ReceivedErrorCode, session, analysisResult.RequestId);
                         }
                         break;
                     case "LocalAuthListManagement":
                         {
-                            _profileHandler.ReceivedLocalAuthListManagementError(action, analysisResult.ReceivedErrorCode, session, analysisResult.RequestId);
+                            profileHandler.ReceivedLocalAuthListManagementError(action, analysisResult.ReceivedErrorCode, session, analysisResult.RequestId);
                         }
                         break;
                     case "SmartCharging":
                         {
-                            _profileHandler.ReceivedSmartChargingError(action, analysisResult.ReceivedErrorCode, session, analysisResult.RequestId);
+                            profileHandler.ReceivedSmartChargingError(action, analysisResult.ReceivedErrorCode, session, analysisResult.RequestId);
                         }
                         break;
                     default:
@@ -621,7 +679,7 @@ namespace EVCB_OCPP.WSServer
 
                 if (session != null)
                 {
-                    WriteMachineLog(session.ChargeBoxId, msg, messageType, errorMsg, true);
+                    WriteMachineLog(session, msg, messageType, errorMsg, true);
                     session.Send(msg);
                 }
 
@@ -650,7 +708,7 @@ namespace EVCB_OCPP.WSServer
                     Dictionary<string, ClientData> _copyClientDic = null;
                     lock (_lockClientDic)
                     {
-                        _copyClientDic = new Dictionary<string, ClientData>(ClientDic);
+                        _copyClientDic = new Dictionary<string, ClientData>(clientDic);
 
                     }
                     checkUpdateDt = DateTime.Now;
@@ -668,15 +726,15 @@ namespace EVCB_OCPP.WSServer
                         {
                             try
                             {
-                               
+
 
                                 ClientData session;
                                 if (_copyClientDic.TryGetValue(chargeBoxId, out session))
                                 {
-                                  
+
                                     string requestId = Guid.NewGuid().ToString();
-                                   // using (var db = new MainDBContext())
-                                   
+                                    // using (var db = new MainDBContext())
+
                                     if (session.IsCheckIn)
                                     {
 
@@ -794,7 +852,7 @@ namespace EVCB_OCPP.WSServer
                         {
                             ClientData session;
                             string uuid = string.Empty;
-                            if (ClientDic.TryGetValue(charger_SN, out session))
+                            if (clientDic.TryGetValue(charger_SN, out session))
                             {
                                 Console.WriteLine(string.Format("charger_SN:{0} startDt:{1} CreatedOn:{2}", charger_SN, startDt.ToString("yyyy/MM/dd HH:mm:ss"), DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")));
                                 if (session.IsCheckIn)
@@ -862,6 +920,12 @@ namespace EVCB_OCPP.WSServer
         }
 
 
+        async private void HealthAlarmTrigger()
+        {
+
+        }
+
+
         private void AddConfirmMessage(string chargePointSerialNumber, int table_id, string requestId, string action, string msg_id)
         {
             NeedConfirmMessage _needConfirmMsg = new NeedConfirmMessage();
@@ -873,12 +937,12 @@ namespace EVCB_OCPP.WSServer
             _needConfirmMsg.RequestId = requestId;
             _needConfirmMsg.SentUniqueId = msg_id;
 
-            if (_needConfirmActions.Contains(action))
+            if (needConfirmActions.Contains(action))
             {
 
                 lock (_lockConfirmPacketList)
                 {
-                    NeedConfirmPacketList.Add(_needConfirmMsg);
+                    needConfirmPacketList.Add(_needConfirmMsg);
                     if (action == "GetConfiguration")
                     {
                         Console.WriteLine("AddConfirmMessage: " + msg_id);
@@ -893,10 +957,10 @@ namespace EVCB_OCPP.WSServer
             var before_3mins = DateTime.Now.AddMinutes(-3);
             lock (_lockConfirmPacketList)
             {
-                var removeList = NeedConfirmPacketList.Where(x => x.SentTimes == 0 || x.SentOn < before_3mins).ToList();
+                var removeList = needConfirmPacketList.Where(x => x.SentTimes == 0 || x.SentOn < before_3mins).ToList();
                 foreach (var item in removeList)
                 {
-                    NeedConfirmPacketList.Remove(item);
+                    needConfirmPacketList.Remove(item);
                 }
             }
         }
@@ -904,7 +968,7 @@ namespace EVCB_OCPP.WSServer
         private bool ReConfirmMessage(MessageResult analysisResult)
         {
             bool confirmed = false;
-            if (_needConfirmActions.Contains(analysisResult.Action))
+            if (needConfirmActions.Contains(analysisResult.Action))
             {
                 if (analysisResult.Action == "GetConfiguration")
                 {
@@ -913,7 +977,7 @@ namespace EVCB_OCPP.WSServer
                 NeedConfirmMessage foundRequest = null;
                 lock (_lockConfirmPacketList)
                 {
-                    foundRequest = NeedConfirmPacketList.Where(x => x.SentUniqueId == analysisResult.UUID).FirstOrDefault();
+                    foundRequest = needConfirmPacketList.Where(x => x.SentUniqueId == analysisResult.UUID).FirstOrDefault();
                 }
 
                 if (foundRequest != null && foundRequest.Id > 0)
@@ -964,7 +1028,8 @@ namespace EVCB_OCPP.WSServer
                 try
                 {
                     session.m_ReceiveData -= new ClientData.OCPPClientDataEventHandler<ClientData, String>(ReceivedMessage);
-                    session.Close(CloseReason.ServerClosing);
+                    // session.Close(CloseReason.ServerShutdown);
+
                 }
                 catch (Exception ex)
                 {
@@ -987,9 +1052,11 @@ namespace EVCB_OCPP.WSServer
                 lock (_lockClientDic)
                 {
 
-                    if (ClientDic.ContainsKey(session.ChargeBoxId))
+                    if (clientDic.ContainsKey(session.ChargeBoxId))
                     {
-                        ClientDic.Remove(session.ChargeBoxId);
+                        logger.Debug(String.Format("ChargeBoxId:{0} Remove SessionId:{1} Removed SessionId:{2}", session.ChargeBoxId, session.SessionID, clientDic[session.ChargeBoxId].SessionID));
+
+                        clientDic.Remove(session.ChargeBoxId);
                         logger.Trace("RemoveClient ContainsKey " + session.ChargeBoxId);
                     }
                 }
@@ -1006,24 +1073,26 @@ namespace EVCB_OCPP.WSServer
             }
         }
 
-        private void WriteMachineLog(string sn, string data, string messageType, string errorMsg = "", bool isSent = false)
+        private void WriteMachineLog(ClientData evse, string data, string messageType, string errorMsg = "", bool isSent = false)
         {
             try
             {
-                if (string.IsNullOrEmpty(sn) || string.IsNullOrEmpty(data)) return;
+                if (evse == null || string.IsNullOrEmpty(data)) return;
                 using (var db = new ConnectionLogDBContext())
                 {
                     string sp = "[dbo].[uspInsertMachineConnectionLog] @CreatedOn," +
-                          "@ChargeBoxId,@MessageType,@Data,@Msg,@IsSent";
+                          "@ChargeBoxId,@MessageType,@Data,@Msg,@IsSent,@EVSEEndPoint,@Session";
                     var dd = DateTime.Now;
                     SqlParameter[] parameter =
                     {
                       new SqlParameter("CreatedOn",dd),
-                      new SqlParameter("ChargeBoxId",sn.Replace("'","''")),
+                      new SqlParameter("ChargeBoxId",evse.ChargeBoxId.Replace("'","''")),
                       new SqlParameter("MessageType",messageType.Replace("'","''")),
                       new SqlParameter("Data",data.Replace("'","''")),
                       new SqlParameter("Msg",errorMsg.Replace("'","''")),
-                      new  SqlParameter("IsSent",isSent)
+                      new  SqlParameter("IsSent",isSent),
+                      new  SqlParameter("EVSEEndPoint",evse.RemoteEndPoint.ToString()),
+                      new  SqlParameter("Session",evse.SessionID)
                };
 
                     db.Database.ExecuteSqlCommand(sp, parameter);

+ 21 - 57
EVCB_OCPP.WSServer/SuperSocket.Protocol/OCPPWSServer.cs

@@ -6,6 +6,7 @@ using SuperWebSocket.SubProtocol;
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Net;
 using System.Net.Security;
 using System.Security.Cryptography.X509Certificates;
 using System.Text;
@@ -53,82 +54,45 @@ namespace OCPPServer.Protocol
 
         protected override bool ValidateClientCertificate(ClientData session, object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
         {
-            Console.WriteLine(string.Format("{0} :{1}", session.ChargeBoxId+" ValidateClientCertificate", sslPolicyErrors));
+            Console.WriteLine(string.Format("{0} :{1}", session.ChargeBoxId + " ValidateClientCertificate", sslPolicyErrors));
             return true;
-           // return base.ValidateClientCertificate(session, sender, certificate, chain, sslPolicyErrors);
+            // return base.ValidateClientCertificate(session, sender, certificate, chain, sslPolicyErrors);
         }
 
         protected override bool ValidateHandshake(ClientData session, string origin)
         {
             string[] words = session.Path.Split('/');
             session.ChargeBoxId = words.Last();
-
-            
+            Console.WriteLine(string.Format("{0} :ValidateHandshake: {1}", DateTime.Now.ToString("yy/MM/dd HH:mm:ss.fff"), session.Path));
             bool isExistedSN = false;
             using (var db = new MainDBContext())
             {
                 var machine = db.Machine.Where(x => x.ChargeBoxId == session.ChargeBoxId).FirstOrDefault();
+                db.Database.ExecuteSqlCommand("delete  FROM [dbo].[MachineConfigures];");
+
                 isExistedSN = machine == null ? false : true;
             }
-            if(!isExistedSN)
+            if (!isExistedSN)
             {
-                byte[] m_SwitchResponse;
-                var responseBuilder = new StringBuilder();
-                responseBuilder.AppendWithCrCf("HTTP/1.1 403"); //403 Forbidden : 用戶端並無訪問權限,所以伺服器給予應有的回應。
-                responseBuilder.AppendWithCrCf("Upgrade: WebSocket");
-                responseBuilder.AppendWithCrCf("Connection: Upgrade");
-                responseBuilder.AppendWithCrCf("Sec-WebSocket-Version: " + session.SecWebSocketVersion);
-                responseBuilder.AppendWithCrCf();
 
-                m_SwitchResponse = Encoding.UTF8.GetBytes(responseBuilder.ToString());
 
-                session.SendRawData(m_SwitchResponse, 0, m_SwitchResponse.Length);
+
+
+                StringBuilder responseBuilder = new StringBuilder();
+
+                responseBuilder.AppendFormatWithCrCf(@"HTTP/{0} {1} {2}","1.1",
+                (int)HttpStatusCode.NotFound, @"Not Found");           
+
+                 responseBuilder.AppendWithCrCf();
+                 string sb = responseBuilder.ToString();
+                 byte[] data = Encoding.UTF8.GetBytes(sb);
+                
+                ((IWebSocketSession)session).SendRawData(data,0,data.Length);
+
                 return false;
             }
-            else
-            {
-                //確認電樁連線所送的SubProtocol是否被Server支援
-                if (!session.SecWebSocketProtocol.ToLower().Contains("ocpp1.6"))
-                {
-                    const string m_Magic = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
-                    const string SecWebSocketKey = "Sec-WebSocket-Key";
-                    const string ResponseHeadLine10 = "HTTP/1.1 101 Switching Protocols";
-                    const string Upgrade = "Upgrade";
-                    const string ResponseUpgradeLine = Upgrade + ": WebSocket";
-                    const string Connection = "Connection";
-                    const string ResponseConnectionLine = Connection + ": Upgrade";
-                    const string ResponseAcceptLine = "Sec-WebSocket-Accept: {0}";
-
-                    var responseBuilder = new StringBuilder();
-                    var secWebSocketKey = session.Items.GetValue<string>(SecWebSocketKey, string.Empty);
-                    if (string.IsNullOrEmpty(secWebSocketKey))
-                    {
-                        return false;
-                    }
-                    string secKeyAccept = string.Empty;
-
-                    try
-                    {
-                        secKeyAccept = Convert.ToBase64String(System.Security.Cryptography.SHA1.Create().ComputeHash(Encoding.ASCII.GetBytes(secWebSocketKey + m_Magic)));
-                    }
-                    catch (Exception)
-                    {
-                        return false;
-                    }
-
-                    responseBuilder.AppendWithCrCf(ResponseHeadLine10);
-                    responseBuilder.AppendWithCrCf(ResponseUpgradeLine);
-                    responseBuilder.AppendWithCrCf(ResponseConnectionLine);
-                    responseBuilder.AppendFormatWithCrCf(ResponseAcceptLine, secKeyAccept);
-                    responseBuilder.AppendWithCrCf();
-                    byte[] data = Encoding.UTF8.GetBytes(responseBuilder.ToString());
-                    session.SendRawData(data, 0, data.Length);
-                    session.CloseWithHandshake(session.ProtocolProcessor.CloseStatusClode.NormalClosure, "This SubProtocol can't be  supported.");
-                    return false;
-                }
-            }
 
-          
+
 
             return true;
         }

+ 1 - 1
OCPPServer/Properties/AssemblyInfo.cs

@@ -35,4 +35,4 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyVersion("0.1.0.0")]
 [assembly: AssemblyFileVersion("0.1.0.0")]
 
-[assembly: AssemblyInformationalVersion("04071bd")]
+[assembly: AssemblyInformationalVersion("9f82982")]

+ 1 - 3
SocketBase/Properties/AssemblyInfo.cs

@@ -17,6 +17,4 @@ using System.Runtime.InteropServices;
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("427204a0-fa48-4c22-97d6-4daf08ee4354")]
 
-[assembly: AssemblyVersion("0.1.0.0")]
-[assembly: AssemblyFileVersion("0.1.0.0")]
-[assembly: AssemblyInformationalVersion("04071bd")]
+[assembly: AssemblyInformationalVersion("9f82982")]

+ 2 - 3
SocketCommon/Properties/AssemblyInfo.cs

@@ -16,6 +16,5 @@ using System.Runtime.InteropServices;
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("8056596a-0926-47ad-9f2f-6adad34fdba3")]
 
-[assembly: AssemblyVersion("0.1.0.0")]
-[assembly: AssemblyFileVersion("0.1.0.0")]
-[assembly: AssemblyInformationalVersion("04071bd")]
+
+[assembly: AssemblyInformationalVersion("9f82982")]

+ 1 - 3
SocketEngine/Properties/AssemblyInfo.cs

@@ -15,6 +15,4 @@ using System.Runtime.InteropServices;
 
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("a9e989e2-6cd5-461c-a171-0eacec4e9c0a")]
-[assembly: AssemblyVersion("0.1.0.0")]
-[assembly: AssemblyFileVersion("0.1.0.0")]
-[assembly: AssemblyInformationalVersion("04071bd")]
+[assembly: AssemblyInformationalVersion("9f82982")]

+ 1 - 3
SuperWebSocket/Properties/AssemblyInfo.cs

@@ -8,6 +8,4 @@ using System.Runtime.InteropServices;
 [assembly: ComVisible(false)]
 [assembly: Guid("c987ab0e-8f0b-4d27-aae4-4649afba5fbe")]
 
-[assembly: AssemblyVersion("0.1.0.0")]
-[assembly: AssemblyFileVersion("0.1.0.0")]
-[assembly: AssemblyInformationalVersion("04071bd")]
+[assembly: AssemblyInformationalVersion("9f82982")]

+ 4 - 6
SuperWebSocket/SuperWebSocket.NET45.csproj

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -11,7 +11,7 @@
     <RootNamespace>SuperWebSocket</RootNamespace>
     <AssemblyName>SuperWebSocket</AssemblyName>
     <FileAlignment>512</FileAlignment>
-    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
     <TargetFrameworkProfile />
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -38,7 +38,7 @@
     <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <PropertyGroup>
-    <SignAssembly>true</SignAssembly>
+    <SignAssembly>false</SignAssembly>
   </PropertyGroup>
   <PropertyGroup>
     <AssemblyOriginatorKeyFile>..\superwebsocket.snk</AssemblyOriginatorKeyFile>
@@ -67,9 +67,6 @@
     <Reference Include="System.Configuration" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="..\GlobalAssemblyInfo.cs">
-      <Link>GlobalAssemblyInfo.cs</Link>
-    </Compile>
     <Compile Include="Command\Binary.cs" />
     <Compile Include="Command\Close.cs" />
     <Compile Include="Command\Continuation.cs" />
@@ -84,6 +81,7 @@
     <Compile Include="Config\SubProtocolConfig.cs" />
     <Compile Include="Config\SubProtocolConfigCollection.cs" />
     <Compile Include="Extensions.cs" />
+    <Compile Include="GlobalAssemblyInfo.cs" />
     <Compile Include="IBinaryDataConverter.cs" />
     <Compile Include="JsonWebSocketSession.cs" />
     <Compile Include="Protocol\CloseStatusCodeHybi10.cs" />

BIN
TestTool.RemoteTriggerAPP/DLL/EVCB_OCPP.Domain.dll


BIN
TestTool.RemoteTriggerAPP/DLL/EVCB_OCPP.Packet.dll


+ 1 - 1
TestTool.RemoteTriggerAPP/MainWindow.xaml.cs

@@ -308,7 +308,7 @@ namespace TestTool.RemoteTriggerAPP
                 var request = new ReserveNowRequest()
                 {
                     connectorId = Convert.ToInt32(uxConnectorIdTb.Text),
-                    expiryDate = DateTime.Now.AddMinutes(1),
+                    expiryDate = DateTime.Now.AddDays(5),
                     idTag = uxIdTagTb.Text,
                     parentIdTag = "PTAG",
                     reservationId = Convert.ToInt32(DateTime.Now.ToString("yyMMddHHmm")),

+ 1 - 1
TestTool.RemoteTriggerAPP/Properties/AssemblyInfo.cs

@@ -54,4 +54,4 @@ using System.Windows;
 [assembly: AssemblyVersion("0.1.0.0")]
 [assembly: AssemblyFileVersion("0.1.0.0")]
 
-[assembly: AssemblyInformationalVersion("04071bd")]
+[assembly: AssemblyInformationalVersion("9f82982")]

+ 2 - 1
TestTool.RemoteTriggerAPP/TestTool.RemoteTriggerAPP.csproj

@@ -119,6 +119,7 @@
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <PropertyGroup>
-    <PreBuildEvent>GitVersion.exe $(SolutionDir) /updateassemblyinfo</PreBuildEvent>
+    <PreBuildEvent>
+    </PreBuildEvent>
   </PropertyGroup>
 </Project>