|
@@ -6,6 +6,7 @@ using SuperWebSocket;
|
|
|
using SuperWebSocket.SubProtocol;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.Configuration;
|
|
|
using System.Linq;
|
|
|
using System.Net;
|
|
|
using System.Net.Security;
|
|
@@ -77,6 +78,12 @@ namespace OCPPServer.Protocol
|
|
|
|
|
|
string[] words = session.Path.Split('/');
|
|
|
session.ChargeBoxId = words.Last();
|
|
|
+
|
|
|
+ if (ConfigurationManager.AppSettings["MaintainMode"] == "1")
|
|
|
+ {
|
|
|
+ session.ChargeBoxId = session.ChargeBoxId + "_2";
|
|
|
+ }
|
|
|
+
|
|
|
logger.Info(string.Format("ValidateHandshake: {0}", session.Path));
|
|
|
bool isExistedSN = false;
|
|
|
bool authorizated = false;
|
|
@@ -123,13 +130,13 @@ namespace OCPPServer.Protocol
|
|
|
|
|
|
if (session.Items.ContainsKey("Authorization") || session.Items.ContainsKey("authorization"))
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
using (var db = new MainDBContext())
|
|
|
{
|
|
|
|
|
|
authorizationKey = db.MachineConfiguration.Where(x => x.ChargeBoxId == session.ChargeBoxId && x.ConfigureName == StandardConfiguration.AuthorizationKey)
|
|
|
.Select(x => x.ConfigureSetting).FirstOrDefault();
|
|
|
-
|
|
|
+
|
|
|
|
|
|
if (session.ISOCPP20)
|
|
|
{
|
|
@@ -152,8 +159,8 @@ namespace OCPPServer.Protocol
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
else
|