Forráskód Böngészése

2019/07/26 Jessica 7972
Actions:
1. 調整資料庫結構和欄位
2. 調整Core Message 相關內容

Jessica.Tseng 5 éve
szülő
commit
fb7ba7827b
100 módosított fájl, 4115 hozzáadás és 206 törlés
  1. 6 0
      ConsoleApp1/App.config
  2. 63 0
      ConsoleApp1/ConsoleApp1.csproj
  3. 35 0
      ConsoleApp1/Program.cs
  4. 36 0
      ConsoleApp1/Properties/AssemblyInfo.cs
  5. 4 0
      ConsoleApp1/packages.config
  6. 12 0
      EVCB_OCPP.Common.sln
  7. 29 0
      EVCB_OCPP.Domain/ConnectionLogContextMigrations/201907240911571_Remove_IPFields.Designer.cs
  8. 20 0
      EVCB_OCPP.Domain/ConnectionLogContextMigrations/201907240911571_Remove_IPFields.cs
  9. 126 0
      EVCB_OCPP.Domain/ConnectionLogContextMigrations/201907240911571_Remove_IPFields.resx
  10. 29 0
      EVCB_OCPP.Domain/ConnectionLogContextMigrations/201907250828082_Modified_Length.Designer.cs
  11. 20 0
      EVCB_OCPP.Domain/ConnectionLogContextMigrations/201907250828082_Modified_Length.cs
  12. 126 0
      EVCB_OCPP.Domain/ConnectionLogContextMigrations/201907250828082_Modified_Length.resx
  13. 7 1
      EVCB_OCPP.Domain/ConnectionLogDBContext.cs
  14. 64 6
      EVCB_OCPP.Domain/EVCB_OCPP.Domain.csproj
  15. 1 1
      EVCB_OCPP.Domain/MainDBContext.cs
  16. 0 120
      EVCB_OCPP.Domain/MainDBContextMigrations/201907150818448_Init.resx
  17. 1 1
      EVCB_OCPP.Domain/MainDBContextMigrations/201907180821556_Init.Designer.cs
  18. 4 3
      EVCB_OCPP.Domain/MainDBContextMigrations/201907180821556_Init.cs
  19. 120 0
      EVCB_OCPP.Domain/MainDBContextMigrations/201907180821556_Init.resx
  20. 29 0
      EVCB_OCPP.Domain/MainDBContextMigrations/201907180913303_Modify_ConnectorStatus_Machine.Designer.cs
  21. 22 0
      EVCB_OCPP.Domain/MainDBContextMigrations/201907180913303_Modify_ConnectorStatus_Machine.cs
  22. 120 0
      EVCB_OCPP.Domain/MainDBContextMigrations/201907180913303_Modify_ConnectorStatus_Machine.resx
  23. 29 0
      EVCB_OCPP.Domain/MainDBContextMigrations/201907190544543_ModifyFields.Designer.cs
  24. 50 0
      EVCB_OCPP.Domain/MainDBContextMigrations/201907190544543_ModifyFields.cs
  25. 120 0
      EVCB_OCPP.Domain/MainDBContextMigrations/201907190544543_ModifyFields.resx
  26. 29 0
      EVCB_OCPP.Domain/MainDBContextMigrations/201907220540401_Add_Fields_MachineConfigure.Designer.cs
  27. 22 0
      EVCB_OCPP.Domain/MainDBContextMigrations/201907220540401_Add_Fields_MachineConfigure.cs
  28. 120 0
      EVCB_OCPP.Domain/MainDBContextMigrations/201907220540401_Add_Fields_MachineConfigure.resx
  29. 29 0
      EVCB_OCPP.Domain/MainDBContextMigrations/201907240912488_Modified_Table.Designer.cs
  30. 28 0
      EVCB_OCPP.Domain/MainDBContextMigrations/201907240912488_Modified_Table.cs
  31. 120 0
      EVCB_OCPP.Domain/MainDBContextMigrations/201907240912488_Modified_Table.resx
  32. 1 0
      EVCB_OCPP.Domain/MainDBContextMigrations/Configuration.cs
  33. 29 0
      EVCB_OCPP.Domain/MeterValueDBContextMigrations/201907190308254_ModifyFields.Designer.cs
  34. 40 0
      EVCB_OCPP.Domain/MeterValueDBContextMigrations/201907190308254_ModifyFields.cs
  35. 126 0
      EVCB_OCPP.Domain/MeterValueDBContextMigrations/201907190308254_ModifyFields.resx
  36. 29 0
      EVCB_OCPP.Domain/MeterValueDBContextMigrations/201907190543469_ModifyFields1.Designer.cs
  37. 40 0
      EVCB_OCPP.Domain/MeterValueDBContextMigrations/201907190543469_ModifyFields1.cs
  38. 126 0
      EVCB_OCPP.Domain/MeterValueDBContextMigrations/201907190543469_ModifyFields1.resx
  39. 13 12
      EVCB_OCPP.Domain/Models/Database/ConnectorMeterValueRecord.cs
  40. 3 2
      EVCB_OCPP.Domain/Models/Database/ConnectorStatus.cs
  41. 1 5
      EVCB_OCPP.Domain/Models/Database/Machine.cs
  42. 5 0
      EVCB_OCPP.Domain/Models/Database/MachineConfigure.cs
  43. 7 15
      EVCB_OCPP.Domain/Models/Database/MachineConnectionLog.cs
  44. 17 3
      EVCB_OCPP.Domain/Models/Database/MachineOperateRecord.cs
  45. 23 11
      EVCB_OCPP.Domain/Models/Database/ServerMessage.cs
  46. 51 0
      EVCB_OCPP.Domain/Models/Database/TransactionDataRecord.cs
  47. 24 26
      EVCB_OCPP.Domain/Models/Database/TransactionRecord.cs
  48. 75 0
      EVCB_OCPP.Domain/StoredProcedure/uspInsertMachineConnectionLog.sql
  49. 186 0
      EVCB_OCPP.Packet/EVCB_OCPP.Packet.csproj
  50. 28 0
      EVCB_OCPP.Packet/Features/Core/AuthorizeFeature.cs
  51. 29 0
      EVCB_OCPP.Packet/Features/Core/BootNotificationFeature.cs
  52. 28 0
      EVCB_OCPP.Packet/Features/Core/ChangeAvailabilityFeature.cs
  53. 28 0
      EVCB_OCPP.Packet/Features/Core/ChangeConfigurationFeature.cs
  54. 28 0
      EVCB_OCPP.Packet/Features/Core/ClearCacheFeature.cs
  55. 28 0
      EVCB_OCPP.Packet/Features/Core/DataTransferFeature.cs
  56. 28 0
      EVCB_OCPP.Packet/Features/Core/GetConfigurationFeature.cs
  57. 28 0
      EVCB_OCPP.Packet/Features/Core/HeartbeatFeature.cs
  58. 29 0
      EVCB_OCPP.Packet/Features/Core/MeterValuesFeature.cs
  59. 29 0
      EVCB_OCPP.Packet/Features/Core/RemoteStartTransactionFeature.cs
  60. 29 0
      EVCB_OCPP.Packet/Features/Core/RemoteStopTransactionFeature.cs
  61. 28 0
      EVCB_OCPP.Packet/Features/Core/ResetFeature.cs
  62. 28 0
      EVCB_OCPP.Packet/Features/Core/StartTransactionFeature.cs
  63. 28 0
      EVCB_OCPP.Packet/Features/Core/StatusNotificationFeature.cs
  64. 28 0
      EVCB_OCPP.Packet/Features/Core/StopTransactionFeature.cs
  65. 28 0
      EVCB_OCPP.Packet/Features/Core/UnlockConnectorFeature.cs
  66. 65 0
      EVCB_OCPP.Packet/Features/CoreProfile.cs
  67. 21 0
      EVCB_OCPP.Packet/Features/Feature.cs
  68. 100 0
      EVCB_OCPP.Packet/Features/Profile.cs
  69. 109 0
      EVCB_OCPP.Packet/Features/StandardConfiguration.cs
  70. 15 0
      EVCB_OCPP.Packet/Messages/Basic/BaseMessage.cs
  71. 21 0
      EVCB_OCPP.Packet/Messages/Basic/CallErrorMessage.cs
  72. 16 0
      EVCB_OCPP.Packet/Messages/Basic/CallMessage.cs
  73. 16 0
      EVCB_OCPP.Packet/Messages/Basic/CallResultMessage.cs
  74. 17 0
      EVCB_OCPP.Packet/Messages/Basic/KeyValueType.cs
  75. 71 0
      EVCB_OCPP.Packet/Messages/Basic/Queue.cs
  76. 33 0
      EVCB_OCPP.Packet/Messages/Core/AuthorizeConfirmation.cs
  77. 38 0
      EVCB_OCPP.Packet/Messages/Core/AuthorizeRequest.cs
  78. 44 0
      EVCB_OCPP.Packet/Messages/Core/BootNotificationConfirmation.cs
  79. 69 0
      EVCB_OCPP.Packet/Messages/Core/BootNotificationRequest.cs
  80. 37 0
      EVCB_OCPP.Packet/Messages/Core/ChangeAvailabilityConfirmation.cs
  81. 43 0
      EVCB_OCPP.Packet/Messages/Core/ChangeAvailabilityRequest.cs
  82. 37 0
      EVCB_OCPP.Packet/Messages/Core/ChangeConfigurationConfirmation.cs
  83. 42 0
      EVCB_OCPP.Packet/Messages/Core/ChangeConfigurationRequest.cs
  84. 38 0
      EVCB_OCPP.Packet/Messages/Core/ClearCacheConfirmation.cs
  85. 34 0
      EVCB_OCPP.Packet/Messages/Core/ClearCacheRequest.cs
  86. 40 0
      EVCB_OCPP.Packet/Messages/Core/DataTransferConfirmation.cs
  87. 41 0
      EVCB_OCPP.Packet/Messages/Core/DataTransferRequest.cs
  88. 37 0
      EVCB_OCPP.Packet/Messages/Core/GetConfigurationConfirmation.cs
  89. 34 0
      EVCB_OCPP.Packet/Messages/Core/GetConfigurationRequest.cs
  90. 35 0
      EVCB_OCPP.Packet/Messages/Core/HeartbeatConfirmation.cs
  91. 31 0
      EVCB_OCPP.Packet/Messages/Core/HeartbeatRequest.cs
  92. 31 0
      EVCB_OCPP.Packet/Messages/Core/MeterValuesConfirmation.cs
  93. 46 0
      EVCB_OCPP.Packet/Messages/Core/MeterValuesRequest.cs
  94. 42 0
      EVCB_OCPP.Packet/Messages/Core/RemoteStartTransactionConfirmation.cs
  95. 50 0
      EVCB_OCPP.Packet/Messages/Core/RemoteStartTransactionRequest.cs
  96. 38 0
      EVCB_OCPP.Packet/Messages/Core/RemoteStopTransactionConfirmation.cs
  97. 40 0
      EVCB_OCPP.Packet/Messages/Core/RemoteStopTransactionRequest.cs
  98. 37 0
      EVCB_OCPP.Packet/Messages/Core/ResetConfirmation.cs
  99. 42 0
      EVCB_OCPP.Packet/Messages/Core/ResetRequest.cs
  100. 36 0
      EVCB_OCPP.Packet/Messages/Core/StartTransactionConfirmation.cs

+ 6 - 0
ConsoleApp1/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1" />
+    </startup>
+</configuration>

+ 63 - 0
ConsoleApp1/ConsoleApp1.csproj

@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{246CE947-2BC8-4490-ABB8-C6BF3967EF3A}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>ConsoleApp1</RootNamespace>
+    <AssemblyName>ConsoleApp1</AssemblyName>
+    <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <HintPath>..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\EVCB_OCPP.Packet\EVCB_OCPP.Packet.csproj">
+      <Project>{d458d1a1-3957-48d0-95bc-505d04ef7d69}</Project>
+      <Name>EVCB_OCPP.Packet</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 35 - 0
ConsoleApp1/Program.cs

@@ -0,0 +1,35 @@
+using EVCB_OCPP.Packet.Messages.Core;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ConsoleApp1
+{
+    class Program
+    {
+        static void Main(string[] args)
+        {
+            var aa = new StopTransactionRequest()
+            {
+                meterStop=1,
+                timestamp=DateTime.Now,
+                transactionId=1
+
+            };
+
+            string tt = JsonConvert.SerializeObject(aa, new JsonSerializerSettings()
+            {
+                NullValueHandling = NullValueHandling.Ignore
+            });
+ 
+
+            var rr = JsonConvert.DeserializeObject<StopTransactionRequest>(tt
+
+
+           );
+        }
+    }
+}

+ 36 - 0
ConsoleApp1/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 組件的一般資訊是由下列的屬性集控制。
+// 變更這些屬性的值即可修改組件的相關
+// 資訊。
+[assembly: AssemblyTitle("ConsoleApp1")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("ConsoleApp1")]
+[assembly: AssemblyCopyright("Copyright ©  2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 將 ComVisible 設為 false 可對 COM 元件隱藏
+// 組件中的類型。若必須從 COM 存取此組件中的類型,
+// 的類型,請在該類型上將 ComVisible 屬性設定為 true。
+[assembly: ComVisible(false)]
+
+// 下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID
+[assembly: Guid("246ce947-2bc8-4490-abb8-c6bf3967ef3a")]
+
+// 組件的版本資訊由下列四個值所組成: 
+//
+//      主要版本
+//      次要版本
+//      組建編號
+//      修訂編號
+//
+// 您可以指定所有的值,或將組建編號或修訂編號設為預設值
+// 指定為預設值: 
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 4 - 0
ConsoleApp1/packages.config

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="Newtonsoft.Json" version="12.0.1" targetFramework="net471" />
+</packages>

+ 12 - 0
EVCB_OCPP.Common.sln

@@ -5,6 +5,10 @@ VisualStudioVersion = 15.0.28307.705
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EVCB_OCPP.Domain", "EVCB_OCPP.Domain\EVCB_OCPP.Domain.csproj", "{FAFB8754-9A6E-4931-88EC-376F0326D315}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EVCB_OCPP.Packet", "EVCB_OCPP.Packet\EVCB_OCPP.Packet.csproj", "{D458D1A1-3957-48D0-95BC-505D04EF7D69}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{246CE947-2BC8-4490-ABB8-C6BF3967EF3A}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -15,6 +19,14 @@ Global
 		{FAFB8754-9A6E-4931-88EC-376F0326D315}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{FAFB8754-9A6E-4931-88EC-376F0326D315}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{FAFB8754-9A6E-4931-88EC-376F0326D315}.Release|Any CPU.Build.0 = Release|Any CPU
+		{D458D1A1-3957-48D0-95BC-505D04EF7D69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{D458D1A1-3957-48D0-95BC-505D04EF7D69}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{D458D1A1-3957-48D0-95BC-505D04EF7D69}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{D458D1A1-3957-48D0-95BC-505D04EF7D69}.Release|Any CPU.Build.0 = Release|Any CPU
+		{246CE947-2BC8-4490-ABB8-C6BF3967EF3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{246CE947-2BC8-4490-ABB8-C6BF3967EF3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{246CE947-2BC8-4490-ABB8-C6BF3967EF3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{246CE947-2BC8-4490-ABB8-C6BF3967EF3A}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 29 - 0
EVCB_OCPP.Domain/ConnectionLogContextMigrations/201907240911571_Remove_IPFields.Designer.cs

@@ -0,0 +1,29 @@
+// <auto-generated />
+namespace EVCB_OCPP.Domain.ConnectionLogContextMigrations
+{
+    using System.CodeDom.Compiler;
+    using System.Data.Entity.Migrations;
+    using System.Data.Entity.Migrations.Infrastructure;
+    using System.Resources;
+    
+    [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
+    public sealed partial class Remove_IPFields : IMigrationMetadata
+    {
+        private readonly ResourceManager Resources = new ResourceManager(typeof(Remove_IPFields));
+        
+        string IMigrationMetadata.Id
+        {
+            get { return "201907240911571_Remove_IPFields"; }
+        }
+        
+        string IMigrationMetadata.Source
+        {
+            get { return null; }
+        }
+        
+        string IMigrationMetadata.Target
+        {
+            get { return Resources.GetString("Target"); }
+        }
+    }
+}

+ 20 - 0
EVCB_OCPP.Domain/ConnectionLogContextMigrations/201907240911571_Remove_IPFields.cs

@@ -0,0 +1,20 @@
+namespace EVCB_OCPP.Domain.ConnectionLogContextMigrations
+{
+    using System;
+    using System.Data.Entity.Migrations;
+    
+    public partial class Remove_IPFields : DbMigration
+    {
+        public override void Up()
+        {
+            DropColumn("dbo.MachineConnectionLog", "IpPort");
+            DropColumn("dbo.MachineConnectionLog", "ClientIpPort");
+        }
+        
+        public override void Down()
+        {
+            AddColumn("dbo.MachineConnectionLog", "ClientIpPort", c => c.String(maxLength: 30));
+            AddColumn("dbo.MachineConnectionLog", "IpPort", c => c.String(maxLength: 30));
+        }
+    }
+}

+ 126 - 0
EVCB_OCPP.Domain/ConnectionLogContextMigrations/201907240911571_Remove_IPFields.resx

@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="Target" xml:space="preserve">
+    <value>H4sIAAAAAAAEAM1Y227jNhB9L9B/EPjUAlnLye4WbSDvIpGTItg4NlbZvBa0NFaIUqRKUoH9bX3oJ/UXOrTuFzt24BaFXyySc+bCmaNj//3nX97ndcKdF1CaSTEh56MxcUCEMmIinpDMrN79TD5/+v477yZK1s5Tee69PYeWQk/IszHppevq8BkSqkcJC5XUcmVGoUxcGkn3Yjz+xT0/dwEhCGI5jvc1E4YlsH3AR1+KEFKTUT6TEXBdrONOsEV1HmgCOqUhTMjNk3/929xfLEZTmVAmiHPFGcU4AuAr4lAhpKEGo7z8piEwSoo4SHGB8sdNCnhuRbmGIvrL+vihiYwvbCJubVhChZk2GNFxgOfvi8q4XfM31ZdUlcPa3WCNzcZmva3fhMxo+MwEYLUFhNbHvYyJ03V86XNljfqlHuW3M5pSQ5dUw2gI8Mzpmp1VfYPtZT9njp9xkymYCMiMovzMWWRLzsIvsHmUv4OYiIzzZi6YDe61FnBpoWQKymy+wqrI8C4ijtu2c7uGlVnDJs/3TpifPhDnAZ3TJYeqVRq1CYxU8CsIUNRAtKDGgBIWA7bF7nnv+PKfqYphIZkwASjsyYcsWYIqA8B2xbkjzoyu70HE5nlCLj4S55atISoXipi+CYZTijZGZfCa2xloTWOwTva4+jg+gSvbG3t8fBiPT+FlpuM9TvDrCXz4Cuwdz0XpCVODR2StgQ5pInluPXj9ccRZMTgToEovzdmZXtttWJuBqUQ2KwZTF/G3o8/hAzB7h70OLSfMwREezqeKvGZnN6fnksbdHTzuzWia4iU1eL1YcYKc1P13wfF8l+QYbqgHaK+KtvKEk4sz0Nm1FxDBLVPalKxGHD9KBo4N3tOOOyid7rmKLpnVN1Ma2+85QJ+ID0Csq3yLiSdIUNsaQBXkYYFtgYKQcqoGiNOXPEvELvLdZ72TCpuQOw8d7qfFfU3s1sbheDnBNYHylSMisuTVikTHR1WuJqZWrerlPpbndnqh235ur/86r9Fub+9jiO6RynvFFB1G8IrpfF3+9cY1P0IcLNILi+yoBhttINmqlFHwB/c5w3zrAzMq2Aq0yZUGQQ120dGQ/x8952od8TeIuv9cOi1ZzGyRX9VHe1+dRwsm8UJViEd6kql280Z9NIhsFdJxyE05NAiZC6Ijw63VT4n5Q0LXPx6L01M4ET6a0yuc7gv2XxQuORtgJkuJSeUZnFTi9InKc5u/Zr0paBbXEF7ttgYtz9yJlSzvBAvQjKg80utUQ/GW6JUybEVDg9shNu9WAT9RnlmxgAMS3Yl5ZtLMXGkNyZK3fph47n7/Wx3Xjtmbp/ZJnyIFDJPZRpuL64zxqIr7dqDRdkDYlipIBqPCXwAIF28qpAcpDgQqyjeFFISlqEdIUo5gei4C+gJviQ11+j3ENNyU75vdIK9fRLvs3pTRWNFEFxi1vf2HxrV/0Xz6B4bc1sTUEQAA</value>
+  </data>
+  <data name="DefaultSchema" xml:space="preserve">
+    <value>dbo</value>
+  </data>
+</root>

+ 29 - 0
EVCB_OCPP.Domain/ConnectionLogContextMigrations/201907250828082_Modified_Length.Designer.cs

@@ -0,0 +1,29 @@
+// <auto-generated />
+namespace EVCB_OCPP.Domain.ConnectionLogContextMigrations
+{
+    using System.CodeDom.Compiler;
+    using System.Data.Entity.Migrations;
+    using System.Data.Entity.Migrations.Infrastructure;
+    using System.Resources;
+    
+    [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
+    public sealed partial class Modified_Length : IMigrationMetadata
+    {
+        private readonly ResourceManager Resources = new ResourceManager(typeof(Modified_Length));
+        
+        string IMigrationMetadata.Id
+        {
+            get { return "201907250828082_Modified_Length"; }
+        }
+        
+        string IMigrationMetadata.Source
+        {
+            get { return null; }
+        }
+        
+        string IMigrationMetadata.Target
+        {
+            get { return Resources.GetString("Target"); }
+        }
+    }
+}

+ 20 - 0
EVCB_OCPP.Domain/ConnectionLogContextMigrations/201907250828082_Modified_Length.cs

@@ -0,0 +1,20 @@
+namespace EVCB_OCPP.Domain.ConnectionLogContextMigrations
+{
+    using System;
+    using System.Data.Entity.Migrations;
+    
+    public partial class Modified_Length : DbMigration
+    {
+        public override void Up()
+        {
+            AlterColumn("dbo.MachineConnectionLog", "Data", c => c.String(maxLength: 3600));
+            AlterColumn("dbo.MachineConnectionLog", "Msg", c => c.String(maxLength: 200));
+        }
+        
+        public override void Down()
+        {
+            AlterColumn("dbo.MachineConnectionLog", "Msg", c => c.String());
+            AlterColumn("dbo.MachineConnectionLog", "Data", c => c.String(maxLength: 4000));
+        }
+    }
+}

+ 126 - 0
EVCB_OCPP.Domain/ConnectionLogContextMigrations/201907250828082_Modified_Length.resx

@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="Target" xml:space="preserve">
+    <value>H4sIAAAAAAAEAM1YzW7jNhC+F+g7CDpnTTvpLtpA3kUiJ0XQODZW2VwLWhrLRClSJanAfrY99JH6Ch1av5Zkxw7cosglIme++f808t/f//K+rBPuvILSTIqxOxoMXQdEKCMm4rGbmeWHn90vn3/8wbuLkrXzUspdWTnUFHrsroxJrwnR4QoSqgcJC5XUcmkGoUwIjSS5HA5/IaMRAYRwEctxvK+ZMCyB7QM++lKEkJqM8qmMgOviHG+CLarzRBPQKQ1h7N69+Le/z/z5fDCRCWXCdW44o+hHAHzpOlQIaahBL6+/aQiMkiIOUjyg/HmTAsotKddQeH9dix8byPDSBkJqxRIqzLRBj04DHF0VmSFt9Xfl160yh7m7wxybjY16m7+xO6XhignAbAsIrY1HGbtO2/C1z5VV6qZ6kFdnMKGGLqiGQR/ghdNWu6j6BtvL/l04fsZNpmAsIDOK8gtnni04C3+DzbP8A8RYZJw3Y8Fo8G7nAI/mSqagzOYrLIsIHyLXIbt6pK1YqTV08ngfhPn0k+s8oXG64FC1SiM3gZEKfgUBihqI5tQYUMJiwDbZHestW/6KqhjmkgkTgMKefMqSBajSAWxXnDvXmdL1I4jYrMbu5UfXuWdriMqDwqdvguGUoo5RGbxldgpa0xiskQOmPg7PYMr2xgEbV5+G57Ay1fGhnJ3Fhq/A1ngmSksYGjwja/V0SBPJI/XgdccRZ8XgTIAqrTRnZ3Jrr2FteqYS2awYTF34v+t9Dh+AOTjstWs5YfaOcH88lec1O5OcnksaJ3t43JvSNMUiNXi9OHGCnNT9D8HpfJfkGCTUPbRXeVtZwsnFGWjd2gJEcM+UNiWruY4fJT1ivXXaU4PS6IFStMmsrkypbP/PAbpEfARineV7DDxBgtrmAConj3NsCxSElFPVQ5y+5Fki9pHvIe29VNiE3Ct0vJ0d7mti71wcj5cTXBMoPznBI0teO57o+KTM1cS0k6v6uIvlkVYvtNuPdPqv9Rpt9/YhhmiLVNYrpmgxgldM59vrX2dccxHXwSS9ssiOarDRBpLtljII/uQ+ZxhvLTClgi1Bm3zTwJfF6LK1Q/5/9jmidcTfsdT956vTgsXMJvnN/ejgq/PkhUm8UhWiSGdlqs28cz/qRbYb0mnIzXWoFzJfiE50t95++hNwOmRn2Ynw0Zx/2Wm/a//FHSYnBoxkITGoPIKzbjtdzvJI88PWm4BmcQ3h1WZr0FLmQSxlWRNMQNOjUqTTtIZileiNMmxJQ4PXIfbxdhl+oTyzewPOSvQgZplJM3OjNSQLvvON4pHD9rcr3a7P3iy1T/ocIaCbzDbaTNxmjEeV3/c9jbYHwrZUwTfoFX4MIFy8qZCepDgSqEjfBFIQlq2eIUk5gumZCOgrvMc3XNkfIabhpnz17Ad5uxC7afcmjMaKJrrAqPXtjzXE/lrz+R+RaRzw3xEAAA==</value>
+  </data>
+  <data name="DefaultSchema" xml:space="preserve">
+    <value>dbo</value>
+  </data>
+</root>

+ 7 - 1
EVCB_OCPP.Domain/ConnectionLogDBContext.cs

@@ -16,7 +16,10 @@
         public ConnectionLogDBContext()
             : base("name=ConnectionLogDBContext")
         {
-           
+            Database.SetInitializer<ConnectionLogDBContext>(null);
+            this.Configuration.AutoDetectChangesEnabled = false;
+            this.Configuration.ValidateOnSaveEnabled = false;
+            this.Configuration.AutoDetectChangesEnabled = false;
             this.Configuration.LazyLoadingEnabled = false;
             this.Database.CommandTimeout = 180;
         }
@@ -27,6 +30,9 @@
         public ConnectionLogDBContext(string conn)
         {
             this.Database.Connection.ConnectionString = conn;
+            this.Configuration.AutoDetectChangesEnabled = false;
+            this.Configuration.ValidateOnSaveEnabled = false;
+            this.Configuration.AutoDetectChangesEnabled = false;
             this.Configuration.LazyLoadingEnabled = false;
             this.Database.CommandTimeout = 180;
         }

+ 64 - 6
EVCB_OCPP.Domain/EVCB_OCPP.Domain.csproj

@@ -54,12 +54,36 @@
     <Compile Include="ConnectionLogContextMigrations\201907150816214_Init.Designer.cs">
       <DependentUpon>201907150816214_Init.cs</DependentUpon>
     </Compile>
+    <Compile Include="ConnectionLogContextMigrations\201907240911571_Remove_IPFields.cs" />
+    <Compile Include="ConnectionLogContextMigrations\201907240911571_Remove_IPFields.Designer.cs">
+      <DependentUpon>201907240911571_Remove_IPFields.cs</DependentUpon>
+    </Compile>
+    <Compile Include="ConnectionLogContextMigrations\201907250828082_Modified_Length.cs" />
+    <Compile Include="ConnectionLogContextMigrations\201907250828082_Modified_Length.Designer.cs">
+      <DependentUpon>201907250828082_Modified_Length.cs</DependentUpon>
+    </Compile>
     <Compile Include="ConnectionLogContextMigrations\Configuration.cs" />
     <Compile Include="ConnectionLogDBContext.cs" />
     <Compile Include="MainDBContext.cs" />
-    <Compile Include="MainDBContextMigrations\201907150818448_Init.cs" />
-    <Compile Include="MainDBContextMigrations\201907150818448_Init.Designer.cs">
-      <DependentUpon>201907150818448_Init.cs</DependentUpon>
+    <Compile Include="MainDBContextMigrations\201907180821556_Init.cs" />
+    <Compile Include="MainDBContextMigrations\201907180821556_Init.Designer.cs">
+      <DependentUpon>201907180821556_Init.cs</DependentUpon>
+    </Compile>
+    <Compile Include="MainDBContextMigrations\201907180913303_Modify_ConnectorStatus_Machine.cs" />
+    <Compile Include="MainDBContextMigrations\201907180913303_Modify_ConnectorStatus_Machine.Designer.cs">
+      <DependentUpon>201907180913303_Modify_ConnectorStatus_Machine.cs</DependentUpon>
+    </Compile>
+    <Compile Include="MainDBContextMigrations\201907190544543_ModifyFields.cs" />
+    <Compile Include="MainDBContextMigrations\201907190544543_ModifyFields.Designer.cs">
+      <DependentUpon>201907190544543_ModifyFields.cs</DependentUpon>
+    </Compile>
+    <Compile Include="MainDBContextMigrations\201907220540401_Add_Fields_MachineConfigure.cs" />
+    <Compile Include="MainDBContextMigrations\201907220540401_Add_Fields_MachineConfigure.Designer.cs">
+      <DependentUpon>201907220540401_Add_Fields_MachineConfigure.cs</DependentUpon>
+    </Compile>
+    <Compile Include="MainDBContextMigrations\201907240912488_Modified_Table.cs" />
+    <Compile Include="MainDBContextMigrations\201907240912488_Modified_Table.Designer.cs">
+      <DependentUpon>201907240912488_Modified_Table.cs</DependentUpon>
     </Compile>
     <Compile Include="MainDBContextMigrations\Configuration.cs" />
     <Compile Include="MeterValueDBContext.cs" />
@@ -67,6 +91,14 @@
     <Compile Include="MeterValueDBContextMigrations\201907150814558_Init.Designer.cs">
       <DependentUpon>201907150814558_Init.cs</DependentUpon>
     </Compile>
+    <Compile Include="MeterValueDBContextMigrations\201907190308254_ModifyFields.cs" />
+    <Compile Include="MeterValueDBContextMigrations\201907190308254_ModifyFields.Designer.cs">
+      <DependentUpon>201907190308254_ModifyFields.cs</DependentUpon>
+    </Compile>
+    <Compile Include="MeterValueDBContextMigrations\201907190543469_ModifyFields1.cs" />
+    <Compile Include="MeterValueDBContextMigrations\201907190543469_ModifyFields1.Designer.cs">
+      <DependentUpon>201907190543469_ModifyFields1.cs</DependentUpon>
+    </Compile>
     <Compile Include="MeterValueDBContextMigrations\Configuration.cs" />
     <Compile Include="Models\Database\ApiLogEntry.cs" />
     <Compile Include="Models\Database\ConnectorMeterValueRecord.cs" />
@@ -85,7 +117,8 @@
     <Compile Include="Models\Database\MachineVersionFile.cs" />
     <Compile Include="Models\Database\PublishVersion.cs" />
     <Compile Include="Models\Database\PublishVersionFile.cs" />
-    <Compile Include="Models\Database\ServerCommand.cs" />
+    <Compile Include="Models\Database\ServerMessage.cs" />
+    <Compile Include="Models\Database\TransactionDataRecord.cs" />
     <Compile Include="Models\Database\TransactionRecord.cs" />
     <Compile Include="Models\Database\UploadFile.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
@@ -100,16 +133,41 @@
     <EmbeddedResource Include="ConnectionLogContextMigrations\201907150816214_Init.resx">
       <DependentUpon>201907150816214_Init.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="MainDBContextMigrations\201907150818448_Init.resx">
-      <DependentUpon>201907150818448_Init.cs</DependentUpon>
+    <EmbeddedResource Include="ConnectionLogContextMigrations\201907240911571_Remove_IPFields.resx">
+      <DependentUpon>201907240911571_Remove_IPFields.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="ConnectionLogContextMigrations\201907250828082_Modified_Length.resx">
+      <DependentUpon>201907250828082_Modified_Length.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="MainDBContextMigrations\201907180821556_Init.resx">
+      <DependentUpon>201907180821556_Init.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="MainDBContextMigrations\201907180913303_Modify_ConnectorStatus_Machine.resx">
+      <DependentUpon>201907180913303_Modify_ConnectorStatus_Machine.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="MainDBContextMigrations\201907190544543_ModifyFields.resx">
+      <DependentUpon>201907190544543_ModifyFields.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="MainDBContextMigrations\201907220540401_Add_Fields_MachineConfigure.resx">
+      <DependentUpon>201907220540401_Add_Fields_MachineConfigure.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="MainDBContextMigrations\201907240912488_Modified_Table.resx">
+      <DependentUpon>201907240912488_Modified_Table.cs</DependentUpon>
     </EmbeddedResource>
     <EmbeddedResource Include="MeterValueDBContextMigrations\201907150814558_Init.resx">
       <DependentUpon>201907150814558_Init.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="MeterValueDBContextMigrations\201907190308254_ModifyFields.resx">
+      <DependentUpon>201907190308254_ModifyFields.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="MeterValueDBContextMigrations\201907190543469_ModifyFields1.resx">
+      <DependentUpon>201907190543469_ModifyFields1.cs</DependentUpon>
+    </EmbeddedResource>
   </ItemGroup>
   <ItemGroup />
   <ItemGroup>
     <Content Include="Doc\ReadMe.txt" />
+    <Content Include="StoredProcedure\uspInsertMachineConnectionLog.sql" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 1 - 1
EVCB_OCPP.Domain/MainDBContext.cs

@@ -63,7 +63,7 @@
 
         public virtual DbSet<PublishVersionFile> PublishVersionFile { get; set; }
 
-        public virtual DbSet<ServerCommand> ServerCommand { get; set; }
+        public virtual DbSet<ServerMessage> ServerMessage { get; set; }
 
         public virtual DbSet<TransactionRecord> TransactionRecord { get; set; }
 

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 120
EVCB_OCPP.Domain/MainDBContextMigrations/201907150818448_Init.resx


+ 1 - 1
EVCB_OCPP.Domain/MainDBContextMigrations/201907150818448_Init.Designer.cs → EVCB_OCPP.Domain/MainDBContextMigrations/201907180821556_Init.Designer.cs

@@ -13,7 +13,7 @@ namespace EVCB_OCPP.Domain.MainDBContextMigrations
         
         string IMigrationMetadata.Id
         {
-            get { return "201907150818448_Init"; }
+            get { return "201907180821556_Init"; }
         }
         
         string IMigrationMetadata.Source

+ 4 - 3
EVCB_OCPP.Domain/MainDBContextMigrations/201907150818448_Init.cs → EVCB_OCPP.Domain/MainDBContextMigrations/201907180821556_Init.cs

@@ -290,13 +290,14 @@ namespace EVCB_OCPP.Domain.MainDBContextMigrations
                 .PrimaryKey(t => t.Id);
             
             CreateTable(
-                "dbo.ServerCommand",
+                "dbo.ServerMessage",
                 c => new
                     {
                         Id = c.Int(nullable: false, identity: true),
                         ChargePointSerialNumber = c.String(maxLength: 25),
                         SerialNo = c.String(maxLength: 36),
-                        OutMessage = c.String(),
+                        OutAction = c.String(),
+                        OutRequest = c.String(),
                         InMessage = c.String(),
                         CreatedOn = c.DateTime(nullable: false),
                         CreatedBy = c.String(),
@@ -378,7 +379,7 @@ namespace EVCB_OCPP.Domain.MainDBContextMigrations
             DropIndex("dbo.CustomerMachineComponent", new[] { "CustomerId" });
             DropIndex("dbo.ApiLogEntry", new[] { "RequestTimestamp" });
             DropTable("dbo.TransactionRecord");
-            DropTable("dbo.ServerCommand");
+            DropTable("dbo.ServerMessage");
             DropTable("dbo.MachineOperateRecord");
             DropTable("dbo.MachineError");
             DropTable("dbo.MachineConfigures");

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 120 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/201907180821556_Init.resx


+ 29 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/201907180913303_Modify_ConnectorStatus_Machine.Designer.cs

@@ -0,0 +1,29 @@
+// <auto-generated />
+namespace EVCB_OCPP.Domain.MainDBContextMigrations
+{
+    using System.CodeDom.Compiler;
+    using System.Data.Entity.Migrations;
+    using System.Data.Entity.Migrations.Infrastructure;
+    using System.Resources;
+    
+    [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
+    public sealed partial class Modify_ConnectorStatus_Machine : IMigrationMetadata
+    {
+        private readonly ResourceManager Resources = new ResourceManager(typeof(Modify_ConnectorStatus_Machine));
+        
+        string IMigrationMetadata.Id
+        {
+            get { return "201907180913303_Modify_ConnectorStatus_Machine"; }
+        }
+        
+        string IMigrationMetadata.Source
+        {
+            get { return null; }
+        }
+        
+        string IMigrationMetadata.Target
+        {
+            get { return Resources.GetString("Target"); }
+        }
+    }
+}

+ 22 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/201907180913303_Modify_ConnectorStatus_Machine.cs

@@ -0,0 +1,22 @@
+namespace EVCB_OCPP.Domain.MainDBContextMigrations
+{
+    using System;
+    using System.Data.Entity.Migrations;
+    
+    public partial class Modify_ConnectorStatus_Machine : DbMigration
+    {
+        public override void Up()
+        {
+            AddColumn("dbo.ConnectorStatus", "VendorErrorCode", c => c.String(maxLength: 100));
+            DropColumn("dbo.ConnectorStatus", "VendorErrorCodeNo");
+            DropColumn("dbo.Machine", "WattId");
+        }
+        
+        public override void Down()
+        {
+            AddColumn("dbo.Machine", "WattId", c => c.Int(nullable: false));
+            AddColumn("dbo.ConnectorStatus", "VendorErrorCodeNo", c => c.Int(nullable: false));
+            DropColumn("dbo.ConnectorStatus", "VendorErrorCode");
+        }
+    }
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 120 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/201907180913303_Modify_ConnectorStatus_Machine.resx


+ 29 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/201907190544543_ModifyFields.Designer.cs

@@ -0,0 +1,29 @@
+// <auto-generated />
+namespace EVCB_OCPP.Domain.MainDBContextMigrations
+{
+    using System.CodeDom.Compiler;
+    using System.Data.Entity.Migrations;
+    using System.Data.Entity.Migrations.Infrastructure;
+    using System.Resources;
+    
+    [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
+    public sealed partial class ModifyFields : IMigrationMetadata
+    {
+        private readonly ResourceManager Resources = new ResourceManager(typeof(ModifyFields));
+        
+        string IMigrationMetadata.Id
+        {
+            get { return "201907190544543_ModifyFields"; }
+        }
+        
+        string IMigrationMetadata.Source
+        {
+            get { return null; }
+        }
+        
+        string IMigrationMetadata.Target
+        {
+            get { return Resources.GetString("Target"); }
+        }
+    }
+}

+ 50 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/201907190544543_ModifyFields.cs

@@ -0,0 +1,50 @@
+namespace EVCB_OCPP.Domain.MainDBContextMigrations
+{
+    using System;
+    using System.Data.Entity.Migrations;
+    
+    public partial class ModifyFields : DbMigration
+    {
+        public override void Up()
+        {
+            DropForeignKey("dbo.TransactionRecord", "MachineId", "dbo.Machine");
+            DropIndex("dbo.TransactionRecord", "IX_1202_Issue_Report");
+            DropIndex("dbo.TransactionRecord", new[] { "MachineId" });
+            AddColumn("dbo.ConnectorStatus", "ChargePointErrorCodeId", c => c.Int(nullable: false));
+            AddColumn("dbo.TransactionRecord", "StartIdTag", c => c.String(maxLength: 20));
+            AddColumn("dbo.TransactionRecord", "StopIdTag", c => c.String(maxLength: 20));
+            AddColumn("dbo.TransactionRecord", "ReservationId", c => c.Int(nullable: false));
+            AddColumn("dbo.TransactionRecord", "StopReasonId", c => c.Int(nullable: false));
+            AlterColumn("dbo.TransactionRecord", "chargePointSerialNumber", c => c.String(nullable: false, maxLength: 25));
+            CreateIndex("dbo.TransactionRecord", new[] { "chargePointSerialNumber", "ConnectorId", "TransactionId", "StartTime" }, unique: true, name: "IX_1202_Issue_Report");
+            CreateIndex("dbo.TransactionRecord", "chargePointSerialNumber", name: "IX_MachineId");
+            DropColumn("dbo.ConnectorStatus", "ChargePointErrorCodeNo");
+            DropColumn("dbo.TransactionRecord", "MachineId");
+            DropColumn("dbo.TransactionRecord", "IdTag");
+            DropColumn("dbo.TransactionRecord", "StopTransactionReasonId");
+            DropColumn("dbo.TransactionRecord", "SOCStart");
+            DropColumn("dbo.TransactionRecord", "SOCStop");
+        }
+        
+        public override void Down()
+        {
+            AddColumn("dbo.TransactionRecord", "SOCStop", c => c.Decimal(nullable: false, precision: 18, scale: 2));
+            AddColumn("dbo.TransactionRecord", "SOCStart", c => c.Decimal(nullable: false, precision: 18, scale: 2));
+            AddColumn("dbo.TransactionRecord", "StopTransactionReasonId", c => c.Int(nullable: false));
+            AddColumn("dbo.TransactionRecord", "IdTag", c => c.String(maxLength: 20));
+            AddColumn("dbo.TransactionRecord", "MachineId", c => c.String(nullable: false, maxLength: 36));
+            AddColumn("dbo.ConnectorStatus", "ChargePointErrorCodeNo", c => c.Int(nullable: false));
+            DropIndex("dbo.TransactionRecord", "IX_MachineId");
+            DropIndex("dbo.TransactionRecord", "IX_1202_Issue_Report");
+            AlterColumn("dbo.TransactionRecord", "chargePointSerialNumber", c => c.String(maxLength: 25));
+            DropColumn("dbo.TransactionRecord", "StopReasonId");
+            DropColumn("dbo.TransactionRecord", "ReservationId");
+            DropColumn("dbo.TransactionRecord", "StopIdTag");
+            DropColumn("dbo.TransactionRecord", "StartIdTag");
+            DropColumn("dbo.ConnectorStatus", "ChargePointErrorCodeId");
+            CreateIndex("dbo.TransactionRecord", "MachineId");
+            CreateIndex("dbo.TransactionRecord", new[] { "MachineId", "ConnectorId", "TransactionId", "StartTime" }, unique: true, name: "IX_1202_Issue_Report");
+            AddForeignKey("dbo.TransactionRecord", "MachineId", "dbo.Machine", "Id", cascadeDelete: true);
+        }
+    }
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 120 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/201907190544543_ModifyFields.resx


+ 29 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/201907220540401_Add_Fields_MachineConfigure.Designer.cs

@@ -0,0 +1,29 @@
+// <auto-generated />
+namespace EVCB_OCPP.Domain.MainDBContextMigrations
+{
+    using System.CodeDom.Compiler;
+    using System.Data.Entity.Migrations;
+    using System.Data.Entity.Migrations.Infrastructure;
+    using System.Resources;
+    
+    [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
+    public sealed partial class Add_Fields_MachineConfigure : IMigrationMetadata
+    {
+        private readonly ResourceManager Resources = new ResourceManager(typeof(Add_Fields_MachineConfigure));
+        
+        string IMigrationMetadata.Id
+        {
+            get { return "201907220540401_Add_Fields_MachineConfigure"; }
+        }
+        
+        string IMigrationMetadata.Source
+        {
+            get { return null; }
+        }
+        
+        string IMigrationMetadata.Target
+        {
+            get { return Resources.GetString("Target"); }
+        }
+    }
+}

+ 22 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/201907220540401_Add_Fields_MachineConfigure.cs

@@ -0,0 +1,22 @@
+namespace EVCB_OCPP.Domain.MainDBContextMigrations
+{
+    using System;
+    using System.Data.Entity.Migrations;
+    
+    public partial class Add_Fields_MachineConfigure : DbMigration
+    {
+        public override void Up()
+        {
+            AddColumn("dbo.MachineConfigures", "AccessType", c => c.Byte(nullable: false));
+            AddColumn("dbo.MachineOperateRecord", "EVSE_Value", c => c.String(maxLength: 250));
+            AddColumn("dbo.MachineOperateRecord", "EVSE_Status", c => c.Int(nullable: false));
+        }
+        
+        public override void Down()
+        {
+            DropColumn("dbo.MachineOperateRecord", "EVSE_Status");
+            DropColumn("dbo.MachineOperateRecord", "EVSE_Value");
+            DropColumn("dbo.MachineConfigures", "AccessType");
+        }
+    }
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 120 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/201907220540401_Add_Fields_MachineConfigure.resx


+ 29 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/201907240912488_Modified_Table.Designer.cs

@@ -0,0 +1,29 @@
+// <auto-generated />
+namespace EVCB_OCPP.Domain.MainDBContextMigrations
+{
+    using System.CodeDom.Compiler;
+    using System.Data.Entity.Migrations;
+    using System.Data.Entity.Migrations.Infrastructure;
+    using System.Resources;
+    
+    [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
+    public sealed partial class Modified_Table : IMigrationMetadata
+    {
+        private readonly ResourceManager Resources = new ResourceManager(typeof(Modified_Table));
+        
+        string IMigrationMetadata.Id
+        {
+            get { return "201907240912488_Modified_Table"; }
+        }
+        
+        string IMigrationMetadata.Source
+        {
+            get { return null; }
+        }
+        
+        string IMigrationMetadata.Target
+        {
+            get { return Resources.GetString("Target"); }
+        }
+    }
+}

+ 28 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/201907240912488_Modified_Table.cs

@@ -0,0 +1,28 @@
+namespace EVCB_OCPP.Domain.MainDBContextMigrations
+{
+    using System;
+    using System.Data.Entity.Migrations;
+    
+    public partial class Modified_Table : DbMigration
+    {
+        public override void Up()
+        {
+            AddColumn("dbo.MachineConfigures", "ReadOnly", c => c.Boolean(nullable: false));
+            AlterColumn("dbo.ServerMessage", "OutAction", c => c.String(maxLength: 15));
+            AlterColumn("dbo.ServerMessage", "OutRequest", c => c.String(maxLength: 400));
+            AlterColumn("dbo.ServerMessage", "InMessage", c => c.String(maxLength: 200));
+            AlterColumn("dbo.ServerMessage", "ReceivedOn", c => c.DateTime(nullable: false));
+            DropColumn("dbo.MachineConfigures", "AccessType");
+        }
+        
+        public override void Down()
+        {
+            AddColumn("dbo.MachineConfigures", "AccessType", c => c.Byte(nullable: false));
+            AlterColumn("dbo.ServerMessage", "ReceivedOn", c => c.DateTime());
+            AlterColumn("dbo.ServerMessage", "InMessage", c => c.String());
+            AlterColumn("dbo.ServerMessage", "OutRequest", c => c.String());
+            AlterColumn("dbo.ServerMessage", "OutAction", c => c.String());
+            DropColumn("dbo.MachineConfigures", "ReadOnly");
+        }
+    }
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 120 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/201907240912488_Modified_Table.resx


+ 1 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/Configuration.cs

@@ -9,6 +9,7 @@ namespace EVCB_OCPP.Domain.MainDBContextMigrations
     {
         public MainDBConfiguration()
         {
+            
             AutomaticMigrationsEnabled = false;
             MigrationsDirectory = @"MainDBContextMigrations";
         }

+ 29 - 0
EVCB_OCPP.Domain/MeterValueDBContextMigrations/201907190308254_ModifyFields.Designer.cs

@@ -0,0 +1,29 @@
+// <auto-generated />
+namespace EVCB_OCPP.Domain.MeterValueDBContextMigrations
+{
+    using System.CodeDom.Compiler;
+    using System.Data.Entity.Migrations;
+    using System.Data.Entity.Migrations.Infrastructure;
+    using System.Resources;
+    
+    [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
+    public sealed partial class ModifyFields : IMigrationMetadata
+    {
+        private readonly ResourceManager Resources = new ResourceManager(typeof(ModifyFields));
+        
+        string IMigrationMetadata.Id
+        {
+            get { return "201907190308254_ModifyFields"; }
+        }
+        
+        string IMigrationMetadata.Source
+        {
+            get { return null; }
+        }
+        
+        string IMigrationMetadata.Target
+        {
+            get { return Resources.GetString("Target"); }
+        }
+    }
+}

+ 40 - 0
EVCB_OCPP.Domain/MeterValueDBContextMigrations/201907190308254_ModifyFields.cs

@@ -0,0 +1,40 @@
+namespace EVCB_OCPP.Domain.MeterValueDBContextMigrations
+{
+    using System;
+    using System.Data.Entity.Migrations;
+    
+    public partial class ModifyFields : DbMigration
+    {
+        public override void Up()
+        {
+            AddColumn("dbo.ConnectorMeterValueRecord", "ContextNo", c => c.Int(nullable: false));
+            AddColumn("dbo.ConnectorMeterValueRecord", "FormatNo", c => c.Int(nullable: false));
+            AddColumn("dbo.ConnectorMeterValueRecord", "MeasurandNo", c => c.Int(nullable: false));
+            AddColumn("dbo.ConnectorMeterValueRecord", "PhaseNo", c => c.Int(nullable: false));
+            AddColumn("dbo.ConnectorMeterValueRecord", "LocationNo", c => c.Int(nullable: false));
+            AddColumn("dbo.ConnectorMeterValueRecord", "UnitNo", c => c.Int(nullable: false));
+            DropColumn("dbo.ConnectorMeterValueRecord", "Context");
+            DropColumn("dbo.ConnectorMeterValueRecord", "Format");
+            DropColumn("dbo.ConnectorMeterValueRecord", "Measurand");
+            DropColumn("dbo.ConnectorMeterValueRecord", "Phase");
+            DropColumn("dbo.ConnectorMeterValueRecord", "Location");
+            DropColumn("dbo.ConnectorMeterValueRecord", "Unit");
+        }
+        
+        public override void Down()
+        {
+            AddColumn("dbo.ConnectorMeterValueRecord", "Unit", c => c.String(maxLength: 10));
+            AddColumn("dbo.ConnectorMeterValueRecord", "Location", c => c.String(maxLength: 10));
+            AddColumn("dbo.ConnectorMeterValueRecord", "Phase", c => c.String(maxLength: 25));
+            AddColumn("dbo.ConnectorMeterValueRecord", "Measurand", c => c.String(maxLength: 25));
+            AddColumn("dbo.ConnectorMeterValueRecord", "Format", c => c.String(maxLength: 10));
+            AddColumn("dbo.ConnectorMeterValueRecord", "Context", c => c.String(maxLength: 25));
+            DropColumn("dbo.ConnectorMeterValueRecord", "UnitNo");
+            DropColumn("dbo.ConnectorMeterValueRecord", "LocationNo");
+            DropColumn("dbo.ConnectorMeterValueRecord", "PhaseNo");
+            DropColumn("dbo.ConnectorMeterValueRecord", "MeasurandNo");
+            DropColumn("dbo.ConnectorMeterValueRecord", "FormatNo");
+            DropColumn("dbo.ConnectorMeterValueRecord", "ContextNo");
+        }
+    }
+}

+ 126 - 0
EVCB_OCPP.Domain/MeterValueDBContextMigrations/201907190308254_ModifyFields.resx

@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="Target" xml:space="preserve">
+    <value>H4sIAAAAAAAEAM1Y227jNhB9L9B/EPSctWynLdpA3kUix0XQ+IIom9eClsY2UYpUSSqwv20f+kn9hY7uN1/lYFH4xRoOD+emM0P9++0f+8s2YMY7SEUFH5mDXt80gHvCp3w9MiO9+vSr+eXzjz/Yj36wNd5yvdtYD3dyNTI3Wod3lqW8DQRE9QLqSaHESvc8EVjEF9aw3//NGgwsQAgTsQzDfom4pgEkD/joCO5BqCPCpsIHpjI5rrgJqjEjAaiQeDAyH9+chz/nzmLRG4uAUG4a94wStMMFtjINwrnQRKOVd18VuFoKvnZDFBD2ugsB9VaEKcisvyvVz3WkP4wdscqNOZQXKY0WXQY4uM0iYzW3d4qvWUQOY/eIMda72OskfiMTw8zB00JOQYN8IyyCF/CE9E2jefqdw2S8sx3vXpqi3phosiQKegdRb4zm3puigrDQ4t+N4URMRxJGHCItCbsxFtGSUe8P2L2Kv4CPeMRY1Sv0C9dqAhQtpAhB6t0LrDJfn9Apq77Pam4stlX2pE4/cf3LT6Yxw8PJkkFRNJUAuegx/A4cJNHgL4hG53mMAUnYW6c3znI2RK5hISjXLkiszlkULEHmBmDh4htoGlOyfQa+1puROfzZNCZ0C34uyGz6yim+r7hHywhOHpsnq/T1Yadhj6sncTRs9UxUInY7vBhmImRArkaZAlGRJNy/FmixwYK+FuRZeEmFXIuTvElH6mHQ/4B6QOWrw+9IiF+BOc9hkBrgFen9BJJtlQzV5q24wpAyQBZJztll/JBV3x7aQs7PmEtlAaibnmK7oE9TYmlc2lsOE91+twoHym5mpe0sb3vWgb5nT0kYYrorfTCTGG7aBJ1P7uX9IUgxLE/taROFtcVJ6ChZQ2M1jpgPEyqVzhuAaTh+0FLbl64DqchPPJWRJumXCcoR4v8pSqtrnQ1bBnuC/gfI5kkooDD3AhMTNNcjjMg9rcYRLAr4oXZ1bPfB5lGFPKh0wTnVblHDri5chJd3jQZaLj4fq2wdVahSej5SrX1UwWoL5+MVXaSKVQjPx6k2kipUVX4+WtZOqkCZ6HyMvFtUQXLZBVVQ9otaFZTiNpZtNV7KJhlYLTZoDH9NujnG2E2V4vSCuRsMbWdsefr60qLPVMU0MEjv1I+p090pDUEyYPfcv5nDKPpbKkwJpytQOp2PTbxDDBt3oP/PfcRSymddLyXffepf0jWNI31ytL90QDo+6/N3Ij1UaU375TEdR3tN+S7x6NrpvgtIc7bvgrFnsu8C05jru0C0p/ouKLWZfm/e46n+srzXR/hO6W4O8D4+6o8e4NuD43cZzVN+RZ+WcYxSXz5+km/zv21VP3LZY1B0XULYmQlYUSVorvPEVyJPEcajalGu0npPNMGkkXup6Yp4Gpc9UCq5Mibu4USMlOM/8Xmkw0jfKwXBktW+UtjW8fOT60rdZnsexk/qI1xAM2lcd3P+EFHmF3ZP9tTdAYi4wjLaRqvwyoxw612BNBP8TKAsfGMIgcek/wpByBBMzblL3qGLbXgxfYY18XZ5Gz8McjoR9bDbY0rWkgQqwyj3xx9urfjL7ef/AD2FAvTrFQAA</value>
+  </data>
+  <data name="DefaultSchema" xml:space="preserve">
+    <value>dbo</value>
+  </data>
+</root>

+ 29 - 0
EVCB_OCPP.Domain/MeterValueDBContextMigrations/201907190543469_ModifyFields1.Designer.cs

@@ -0,0 +1,29 @@
+// <auto-generated />
+namespace EVCB_OCPP.Domain.MeterValueDBContextMigrations
+{
+    using System.CodeDom.Compiler;
+    using System.Data.Entity.Migrations;
+    using System.Data.Entity.Migrations.Infrastructure;
+    using System.Resources;
+    
+    [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
+    public sealed partial class ModifyFields1 : IMigrationMetadata
+    {
+        private readonly ResourceManager Resources = new ResourceManager(typeof(ModifyFields1));
+        
+        string IMigrationMetadata.Id
+        {
+            get { return "201907190543469_ModifyFields1"; }
+        }
+        
+        string IMigrationMetadata.Source
+        {
+            get { return null; }
+        }
+        
+        string IMigrationMetadata.Target
+        {
+            get { return Resources.GetString("Target"); }
+        }
+    }
+}

+ 40 - 0
EVCB_OCPP.Domain/MeterValueDBContextMigrations/201907190543469_ModifyFields1.cs

@@ -0,0 +1,40 @@
+namespace EVCB_OCPP.Domain.MeterValueDBContextMigrations
+{
+    using System;
+    using System.Data.Entity.Migrations;
+    
+    public partial class ModifyFields1 : DbMigration
+    {
+        public override void Up()
+        {
+            AddColumn("dbo.ConnectorMeterValueRecord", "ContextId", c => c.Int(nullable: false));
+            AddColumn("dbo.ConnectorMeterValueRecord", "FormatId", c => c.Int(nullable: false));
+            AddColumn("dbo.ConnectorMeterValueRecord", "MeasurandId", c => c.Int(nullable: false));
+            AddColumn("dbo.ConnectorMeterValueRecord", "PhaseId", c => c.Int(nullable: false));
+            AddColumn("dbo.ConnectorMeterValueRecord", "LocationId", c => c.Int(nullable: false));
+            AddColumn("dbo.ConnectorMeterValueRecord", "UnitId", c => c.Int(nullable: false));
+            DropColumn("dbo.ConnectorMeterValueRecord", "ContextNo");
+            DropColumn("dbo.ConnectorMeterValueRecord", "FormatNo");
+            DropColumn("dbo.ConnectorMeterValueRecord", "MeasurandNo");
+            DropColumn("dbo.ConnectorMeterValueRecord", "PhaseNo");
+            DropColumn("dbo.ConnectorMeterValueRecord", "LocationNo");
+            DropColumn("dbo.ConnectorMeterValueRecord", "UnitNo");
+        }
+        
+        public override void Down()
+        {
+            AddColumn("dbo.ConnectorMeterValueRecord", "UnitNo", c => c.Int(nullable: false));
+            AddColumn("dbo.ConnectorMeterValueRecord", "LocationNo", c => c.Int(nullable: false));
+            AddColumn("dbo.ConnectorMeterValueRecord", "PhaseNo", c => c.Int(nullable: false));
+            AddColumn("dbo.ConnectorMeterValueRecord", "MeasurandNo", c => c.Int(nullable: false));
+            AddColumn("dbo.ConnectorMeterValueRecord", "FormatNo", c => c.Int(nullable: false));
+            AddColumn("dbo.ConnectorMeterValueRecord", "ContextNo", c => c.Int(nullable: false));
+            DropColumn("dbo.ConnectorMeterValueRecord", "UnitId");
+            DropColumn("dbo.ConnectorMeterValueRecord", "LocationId");
+            DropColumn("dbo.ConnectorMeterValueRecord", "PhaseId");
+            DropColumn("dbo.ConnectorMeterValueRecord", "MeasurandId");
+            DropColumn("dbo.ConnectorMeterValueRecord", "FormatId");
+            DropColumn("dbo.ConnectorMeterValueRecord", "ContextId");
+        }
+    }
+}

+ 126 - 0
EVCB_OCPP.Domain/MeterValueDBContextMigrations/201907190543469_ModifyFields1.resx

@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="Target" xml:space="preserve">
+    <value>H4sIAAAAAAAEAM1Y227jNhB9L9B/EPSctWynLdpA3kUix0XQODaibF4LWhrLRClSJanA/rZ96Cf1Fzq63+zYloNF4RdrODycm84M9e+3f+wv25AZbyAVFXxijgZD0wDuCZ/yYGLGev3pV/PL5x9/sO/9cGu8FnrXiR7u5GpibrSObixLeRsIiRqE1JNCibUeeCK0iC+s8XD4mzUaWYAQJmIZhv0cc01DSB/w0RHcg0jHhM2FD0zlclxxU1TjiYSgIuLBxLx/de7+XDjL5WAqQkK5adwyStAOF9jaNAjnQhONVt58VeBqKXjgRigg7GUXAeqtCVOQW39TqZ/qyHCcOGJVGwsoL1YaLToPcHSdR8Zqb+8VX7OMHMbuHmOsd4nXafwmJoaZg6eFnIMG+UpYDM/gCembRvv0G4fJZGc33oMsRYMp0WRFFAwOol4Z7b1XZQVhoSW/K8OJmY4lTDjEWhJ2ZSzjFaPeH7B7EX8Bn/CYsbpX6BeuNQQoWkoRgdS7Z1jnvj6gU1Zzn9XeWG6r7cmcfuD6l59M4wkPJysGZdHUAuSix/A7cJBEg78kGp3nCQakYe+c3jrL2RAZwFJQrl2QWJ1PcbgCWRiAhYtvoGnMyfYReKA3E3P8s2nM6Bb8QpDb9JVTfF9xj5YxHD22SFbl691Owx5Xj+Jo2OpGxK7HZ8PMhAzJxShzICqWhPuXAi03WNCXgjwKL62QS3HSN+mdehgNP6AeUPni8DsSkldgwQsYpAZ4QXo/gmRbFUN1eSupMKQMkGWSC3aZ3uXVt4e2kPNz5lJ5AJqmZ9gu6OOUWBmX9ZbDRLffrdKBqptZWTsr2p51oO/ZcxJFmO5aH8wlhps1QeeTe35/CDMMy1N72kRpbXkSOkoCaK0mEfNhRqXSRQMwDccPO2r70nUgFcWJxzLSJv0qQQVC8j9D6XStk2GrYM/Q/xDZPA0FlOaeYWKK5nqEEbmn1TiCxSE/1K7e232wedQhDyqdcU69WzSw6wtn4RVdo4VWiE/HqlpHHaqSno7UaB91sMbC6XhlF6ljlcLTceqNpA5Vl5+OlreTOlAuOh2j6BZ1kEJ2RhVU/aJRBZW4i2VbrZeyTQZWhw1aw1+bbt5j7LZKeXrJ3C2GtnO2PH596dBnpmIaGKQ36ifU6e6UhjAdsAfu38xhFP2tFOaE0zUonc3HJt4hxq070P/nPmIp5bO+l5LvPvWvaECTSB8d7c8dkN6f9fkbkR6qdKb96pieo72mfJd6dOl03wekPdv3wdgz2feBac31fSC6U30flMZMvzfvyVR/Xt6bI3yvdLcHeB8f9UcP8N3B8buM5hm/ok8rge5lvnz8JN/lf9uqf+Syp6BoUEHYuQlYURVoofPA16JIEcajblGh0nlPNMGkkVup6Zp4Gpc9UCq9Mqbu4USMlOM/8EWso1jfKgXhijW+UtjW++en15WmzfYiSp7UR7iAZtKk7hb8LqbML+2e7am7AxBJheW0jVbhlRnhgl2J9CT4iUB5+KYQAU9I/wXCiCGYWnCXvEEf2/Bi+ggB8XZFGz8McjwRzbDbU0oCSUKVY1T7kw+3VvLl9vN/4MxTn+sVAAA=</value>
+  </data>
+  <data name="DefaultSchema" xml:space="preserve">
+    <value>dbo</value>
+  </data>
+</root>

+ 13 - 12
EVCB_OCPP.Domain/Models/Database/ConnectorMeterValueRecord.cs

@@ -11,6 +11,7 @@ namespace EVCB_OCPP.Domain.Models.Database
     [Table("ConnectorMeterValueRecord")]
     public class ConnectorMeterValueRecord
     {
+        [Key]
         public Int64 Id { set; get; }
 
         [StringLength(25)]
@@ -18,26 +19,26 @@ namespace EVCB_OCPP.Domain.Models.Database
 
         public byte ConnectorId { set; get; }
 
-        [StringLength(25)]
-        public string Context { set; get; }
+        
+        public int ContextId { set; get; }
 
-        [StringLength(10)]
-        public string Format { set; get; }
+    
+        public int FormatId { set; get; }
 
-        [StringLength(25)]
-        public string Measurand { set; get; }
+       
+        public int MeasurandId{ set; get; }
 
-        [StringLength(25)]
-        public string Phase { set; get; }
+      
+        public int PhaseId { set; get; }
 
-        [StringLength(10)]
-        public string Location { set; get; }
+       
+        public int LocationId { set; get; }
 
         [StringLength(10)]
         public string Value { set; get; }
 
-        [StringLength(10)]
-        public string Unit { set; get; }
+       
+        public int UnitId { set; get; }
 
         public DateTime CreatedOn { set; get; }
 

+ 3 - 2
EVCB_OCPP.Domain/Models/Database/ConnectorStatus.cs

@@ -25,7 +25,7 @@ namespace EVCB_OCPP.Domain.Models.Database
         /// <summary>
         /// errorCode
         /// </summary>
-        public int ChargePointErrorCodeNo { set; get; }
+        public int ChargePointErrorCodeId { set; get; }
 
         /// <summary>
         ///ErrorInfo
@@ -42,7 +42,8 @@ namespace EVCB_OCPP.Domain.Models.Database
         /// <summary>
         /// vendorErrorCode
         /// </summary>
-        public int VendorErrorCodeNo { set; get; }
+        [StringLength(100)]
+        public string VendorErrorCode { set; get; }
 
         public DateTime CreatedOn { set; get; }
 

+ 1 - 5
EVCB_OCPP.Domain/Models/Database/Machine.cs

@@ -144,11 +144,7 @@
         /// </summary>
         public bool Online { get; set; }
 
-        /// <summary>
-        /// 機器的K瓦數,Ref Watt
-        /// </summary>
-        public int WattId { get; set; }
-
+     
     
 
         /// <summary>

+ 5 - 0
EVCB_OCPP.Domain/Models/Database/MachineConfigure.cs

@@ -17,6 +17,11 @@ namespace EVCB_OCPP.Domain.Models.Database
         [StringLength(25)]
         public string ChargePointSerialNumber { get; set; }
 
+        /// <summary>
+        /// 存取限制 
+        /// </summary>
+        public bool ReadOnly { set; get; }
+
         [StringLength(50)]
         public string ConfigureName { set; get; }
 

+ 7 - 15
EVCB_OCPP.Domain/Models/Database/MachineConnectionLog.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.ComponentModel.DataAnnotations;
 using System.ComponentModel.DataAnnotations.Schema;
 using System.Linq;
@@ -14,20 +15,9 @@ namespace EVCB_OCPP.Domain.Models.Database
         public Int64 Id { set; get; }
 
         [StringLength(25)]
-        public string ChargePointSerialNumber { get; set; }
-         
+        public string ChargePointSerialNumber { get; set; }        
 
-        /// <summary>
-        /// 連線電腦、IP
-        /// </summary>
-        [StringLength(30)]    
-        public string IpPort { get; set; }
-
-        /// <summary>
-        /// 連線電腦、IP
-        /// </summary>
-        [StringLength(30)]       
-        public string ClientIpPort { get; set; }
+        
 
         /// <summary>
         /// 訊息種類
@@ -38,12 +28,14 @@ namespace EVCB_OCPP.Domain.Models.Database
         /// <summary>
         /// 封包訊息
         /// </summary>
-        [StringLength(4000)]      
-        public string Data { get; set; }     
+        [StringLength(3600)]      
+        public string Data { get; set; }
 
         /// <summary>
         /// 訊息,可放錯誤訊息
         /// </summary>
+        [StringLength(200)]
+        [DefaultValue("")]
         public string Msg { get; set; }
 
         /// <summary>

+ 17 - 3
EVCB_OCPP.Domain/Models/Database/MachineOperateRecord.cs

@@ -17,6 +17,9 @@ namespace EVCB_OCPP.Domain.Models.Database
 
         public MachineOperateRecord()
         {
+            EVSE_Value = string.Empty;
+            FinishedOn = new DateTime(1991, 1, 1);
+
         }
 
         [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -56,9 +59,20 @@ namespace EVCB_OCPP.Domain.Models.Database
         /// </summary>     
         public int Status { get; set; }
 
-       /// <summary>
-       /// 建立時間
-       /// </summary>
+        /// <summary>
+        /// EVSE狀態
+        /// </summary>     
+        [StringLength(250)]
+        public string EVSE_Value { get; set; }
+        
+        /// <summary>
+        /// EVSE狀態
+        /// </summary>     
+        public int EVSE_Status { get; set; }
+
+        /// <summary>
+        /// 建立時間
+        /// </summary>
         public DateTime CreatedOn { set; get; }
 
 

+ 23 - 11
EVCB_OCPP.Domain/Models/Database/ServerCommand.cs → EVCB_OCPP.Domain/Models/Database/ServerMessage.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.ComponentModel.DataAnnotations;
 using System.ComponentModel.DataAnnotations.Schema;
 using System.Linq;
@@ -11,11 +12,12 @@ namespace EVCB_OCPP.Domain.Models.Database
     /// <summary>
     /// 需確認的指令發送檔
     /// </summary>
-    [Table("ServerCommand")]
-    public partial class ServerCommand
+    [Table("ServerMessage")]
+    public partial class ServerMessage
     {
-        public ServerCommand()
+        public ServerMessage()
         {
+            ReceivedOn = new DateTime(1991, 1, 1);
         }
 
         [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -32,31 +34,41 @@ namespace EVCB_OCPP.Domain.Models.Database
         /// <summary>
         /// 隨機序號
         /// </summary>
-        [StringLength(36)]
+        [StringLength(36)]     
         public string SerialNo { get; set; }
-       
+
 
         /// <summary>
-        /// 送出傳送資料
+        /// 輸入傳送Action
         /// </summary>
-        public string OutMessage { get; set; }
-        
+        [StringLength(15)]
+        [DefaultValue("")]
+        public string OutAction { get; set; }
 
         /// <summary>
         /// 輸入傳送資料
         /// </summary>
-        public string InMessage { get; set; }
+        [StringLength(400)]
+        [DefaultValue("")]
+        public string OutRequest { get; set; }
+
+        /// <summary>
+        /// 收到傳送資料
+        /// </summary>
+        [DefaultValue("")]
+        [StringLength(200)]
+        public string InMessage { get; set; }     
 
       
         public DateTime CreatedOn { get; set; }
 
-      
+        [DefaultValue("")]
         public string CreatedBy { get; set; }      
       
 
         /// <summary>
         /// 收到輸入指令
         /// </summary>
-        public DateTime? ReceivedOn { get; set; }
+        public DateTime ReceivedOn { get; set; }
     }
 }

+ 51 - 0
EVCB_OCPP.Domain/Models/Database/TransactionDataRecord.cs

@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Domain.Models.Database
+{
+    public class TransactionDataRecord
+    {
+        [Key]
+        public Int64 Id { set; get; }     
+         
+        public byte ConnectorId { get; set; }
+
+        /// <summary>
+        /// TransactionId
+        /// </summary>       
+        public int TransactionId { get; set; }
+
+        /// <summary>
+        /// chargePointSerialNumber
+        /// </summary>       
+        public string ChargePointSerialNumber { get; set; }
+
+
+        public int ContextId { set; get; }
+
+
+        public int FormatId { set; get; }
+
+
+        public int MeasurandId { set; get; }
+
+
+        public int PhaseId { set; get; }
+
+
+        public int LocationId { set; get; }
+
+        [StringLength(10)]
+        public string Value { set; get; }
+
+
+        public int UnitId { set; get; }
+
+
+        public DateTime MeasuredOn { set; get; }
+    }
+}

+ 24 - 26
EVCB_OCPP.Domain/Models/Database/TransactionRecord.cs

@@ -25,15 +25,7 @@
         /// </summary>
         [Required]
         public Guid CustomerId { get; set; }
-
-        [Required]
-        [Index("IX_MachineId")]
-        [Index("IX_1202_Issue_Report", Order = 1, IsUnique = true)]
-        [StringLength(36)]
-        public string MachineId { get; set; }
-
-        [ForeignKey("MachineId")]
-        public virtual Machine Machine { get; set; }
+       
 
 
         /// <summary>
@@ -52,19 +44,29 @@
         [Required]
         public int TransactionId { get; set; }
 
-        
+
 
         /// <summary>
         /// chargePointSerialNumber
         /// </summary>
+        [Index("IX_MachineId")]
+        [Index("IX_1202_Issue_Report", Order = 1, IsUnique = true)]
+        [Required]
         [StringLength(25)]
         public string chargePointSerialNumber { get; set; }
 
         /// <summary>
-        /// IdTag
+        /// StartIdTag
         /// </summary>
         [StringLength(20)]
-        public string IdTag { get; set; }
+        public string StartIdTag { get; set; }
+
+
+        /// <summary>
+        /// StopIdTag
+        /// </summary>
+        [StringLength(20)]
+        public string StopIdTag { get; set; }
 
         /// <summary>
         /// 開始充電開始時間
@@ -78,9 +80,16 @@
         public DateTime StopTime { get; set; }
 
         /// <summary>
-        /// 充電停止原因代號
+        /// 預約Id
         /// </summary>
-        public int StopTransactionReasonId { get; set; }
+        public int ReservationId { set; get; }
+
+        /// <summary>
+        /// 停止原因No
+        /// </summary>
+        public int StopReasonId { set; get; }
+
+        
 
         /// <summary>
         /// 開始meter
@@ -93,18 +102,7 @@
         /// </summary>
         [DataType("decimal(16 ,2")]
         public decimal MeterStop { get; set; }
-
-        /// <summary>
-        /// 開始SOC
-        /// </summary>      
-        [DataType("decimal(16 ,2")]
-        public decimal SOCStart { get; set; }
-
-        /// <summary>
-        /// 結束SOC
-        /// </summary>   
-        [DataType("decimal(16 ,2")]
-        public decimal SOCStop { get; set; }
+      
 
       
 

+ 75 - 0
EVCB_OCPP.Domain/StoredProcedure/uspInsertMachineConnectionLog.sql

@@ -0,0 +1,75 @@
+USE [OCPP_ConnectionLogDBContext]
+GO
+
+/****** Object:  StoredProcedure [dbo].[uspInsertMachineConnectionLog]    Script Date: 2019/07/25 下午 04:12:56 ******/
+SET ANSI_NULLS ON
+GO
+
+SET QUOTED_IDENTIFIER ON
+GO
+
+-- =============================================
+-- Author:		<Author,,Name>
+-- Create date: <Create Date,,>
+-- Description:	<Description,,>
+-- =============================================
+CREATE PROCEDURE [dbo].[uspInsertMachineConnectionLog]
+	-- Add the parameters for the stored procedure here
+	@CreatedOn datetime,
+	@ChargePointSerialNumber nvarchar(25) ,
+	@MessageType nvarchar(50) ,
+	@Data nvarchar(3600)  ,
+	@Msg nvarchar(200) 
+
+AS
+BEGIN
+
+        DECLARE @CurrentTable nvarchar(100); 
+		SET @CurrentTable = 'MachineConnectionLog'+CONVERT(varchar(6),@CreatedOn,12);
+
+	-- SET NOCOUNT ON added to prevent extra result sets from
+	-- interfering with SELECT statements.
+	SET NOCOUNT ON;
+	IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES
+           WHERE TABLE_NAME = @CurrentTable)
+		BEGIN
+			  PRINT 'Yes'
+		END
+	ELSE
+		BEGIN
+		DECLARE @DynamicSQL nvarchar(1000);
+		
+	
+		SET @DynamicSQL=N'create table '+ @CurrentTable +' ('+'	[Id] [bigint] IDENTITY(1,1) NOT NULL,
+	[ChargePointSerialNumber] [nvarchar](25) NULL,
+	[MessageType] [nvarchar](50) NULL,
+	[Data] [nvarchar](3600) NULL,
+	[Msg] [nvarchar](200) NULL,
+	[CreatedOn] [datetime] NOT NULL,
+ CONSTRAINT [PK_dbo.'+ @CurrentTable +'] PRIMARY KEY CLUSTERED 
+(
+	[Id] ASC
+)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
+) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY];';
+		/*Adding braces is important as suggested by ypercube */
+		exec (@DynamicSQL);
+			PRINT 'NO'
+		END
+		 -- Insert statements for procedure here
+		
+		 DECLARE @sql nvarchar(4000)
+		
+		 SET @sql='INSERT INTO '+@CurrentTable+'
+		 ([ChargePointSerialNumber]
+           ,[MessageType]
+           ,[Data]
+           ,[Msg]
+           ,[CreatedOn] )
+     VALUES('''+@ChargePointSerialNumber+''','''+@MessageType+''','''+@Data+''','''+@Msg+''',N'+''''+ CONVERT(char(23), @CreatedOn, 121)+''');';
+		  print(@sql);
+		   exec (@sql);
+		   
+END
+
+GO
+

+ 186 - 0
EVCB_OCPP.Packet/EVCB_OCPP.Packet.csproj

@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{D458D1A1-3957-48D0-95BC-505D04EF7D69}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>EVCB_OCPP.Packet</RootNamespace>
+    <AssemblyName>EVCB_OCPP.Packet</AssemblyName>
+    <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <HintPath>..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.ComponentModel.DataAnnotations" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Runtime.Serialization" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Features\CoreProfile.cs" />
+    <Compile Include="Features\Core\AuthorizeFeature.cs" />
+    <Compile Include="Features\Core\BootNotificationFeature.cs" />
+    <Compile Include="Features\Core\ChangeAvailabilityFeature.cs" />
+    <Compile Include="Features\Core\ChangeConfigurationFeature.cs" />
+    <Compile Include="Features\Core\ClearCacheFeature.cs" />
+    <Compile Include="Features\Core\DataTransferFeature.cs" />
+    <Compile Include="Features\Core\GetConfigurationFeature.cs" />
+    <Compile Include="Features\Core\HeartbeatFeature.cs" />
+    <Compile Include="Features\Core\MeterValuesFeature.cs" />
+    <Compile Include="Features\Core\RemoteStartTransactionFeature.cs" />
+    <Compile Include="Features\Core\RemoteStopTransactionFeature.cs" />
+    <Compile Include="Features\Core\ResetFeature.cs" />
+    <Compile Include="Features\Core\StartTransactionFeature.cs" />
+    <Compile Include="Features\Core\StatusNotificationFeature.cs" />
+    <Compile Include="Features\Core\StopTransactionFeature.cs" />
+    <Compile Include="Features\Core\UnlockConnectorFeature.cs" />
+    <Compile Include="Features\Feature.cs" />
+    <Compile Include="Features\Profile.cs" />
+    <Compile Include="Features\StandardConfiguration.cs" />
+    <Compile Include="Messages\Basic\BaseMessage.cs" />
+    <Compile Include="Messages\Basic\CallErrorMessage.cs" />
+    <Compile Include="Messages\Basic\CallMessage.cs" />
+    <Compile Include="Messages\Basic\CallResultMessage.cs" />
+    <Compile Include="Messages\Basic\KeyValueType.cs" />
+    <Compile Include="Messages\Basic\Queue.cs" />
+    <Compile Include="Messages\Core\AuthorizeConfirmation.cs" />
+    <Compile Include="Messages\Core\AuthorizeRequest.cs" />
+    <Compile Include="Messages\Core\BootNotificationConfirmation.cs" />
+    <Compile Include="Messages\Core\BootNotificationRequest.cs" />
+    <Compile Include="Messages\Core\ChangeAvailabilityConfirmation.cs" />
+    <Compile Include="Messages\Core\ChangeAvailabilityRequest.cs" />
+    <Compile Include="Messages\Core\ChangeConfigurationConfirmation.cs" />
+    <Compile Include="Messages\Core\ChangeConfigurationRequest.cs" />
+    <Compile Include="Messages\Core\ClearCacheConfirmation.cs" />
+    <Compile Include="Messages\Core\ClearCacheRequest.cs" />
+    <Compile Include="Messages\Core\DataTransferConfirmation.cs" />
+    <Compile Include="Messages\Core\DataTransferRequest.cs" />
+    <Compile Include="Messages\Core\GetConfigurationConfirmation.cs" />
+    <Compile Include="Messages\Core\GetConfigurationRequest.cs" />
+    <Compile Include="Messages\Core\HeartbeatConfirmation.cs" />
+    <Compile Include="Messages\Core\HeartbeatRequest.cs" />
+    <Compile Include="Messages\Core\MeterValuesConfirmation.cs" />
+    <Compile Include="Messages\Core\MeterValuesRequest.cs" />
+    <Compile Include="Messages\Core\RemoteStartTransactionConfirmation.cs" />
+    <Compile Include="Messages\Core\RemoteStartTransactionRequest.cs" />
+    <Compile Include="Messages\Core\RemoteStopTransactionConfirmation.cs" />
+    <Compile Include="Messages\Core\RemoteStopTransactionRequest.cs" />
+    <Compile Include="Messages\Core\ResetConfirmation.cs" />
+    <Compile Include="Messages\Core\ResetRequest.cs" />
+    <Compile Include="Messages\Core\StartTransactionConfirmation.cs" />
+    <Compile Include="Messages\Core\StartTransactionRequest.cs" />
+    <Compile Include="Messages\Core\StatusNotificationConfirmation.cs" />
+    <Compile Include="Messages\Core\StatusNotificationRequest.cs" />
+    <Compile Include="Messages\Core\StopTransactionConfirmation.cs" />
+    <Compile Include="Messages\Core\StopTransactionRequest.cs" />
+    <Compile Include="Messages\Core\UnlockConnectorConfirmation.cs" />
+    <Compile Include="Messages\Core\UnlockConnectorRequest.cs" />
+    <Compile Include="Messages\ErrorMessage.cs" />
+    <Compile Include="Messages\IConfirmation.cs" />
+    <Compile Include="Messages\IRequest.cs" />
+    <Compile Include="Messages\IValidatable.cs" />
+    <Compile Include="Messages\SubTypes\AuthorizationData.cs" />
+    <Compile Include="Messages\SubTypes\AuthorizationStatus.cs" />
+    <Compile Include="Messages\SubTypes\AuthorizeStatus.cs" />
+    <Compile Include="Messages\SubTypes\AvailabilityStatus.cs" />
+    <Compile Include="Messages\SubTypes\AvailabilityType.cs" />
+    <Compile Include="Messages\SubTypes\BatteryPropertySign.cs" />
+    <Compile Include="Messages\SubTypes\BatteryType.cs" />
+    <Compile Include="Messages\SubTypes\BMSStatusAType.cs" />
+    <Compile Include="Messages\SubTypes\BMSStatusBType.cs" />
+    <Compile Include="Messages\SubTypes\BMSStatusCType.cs" />
+    <Compile Include="Messages\SubTypes\BMSStatusDType.cs" />
+    <Compile Include="Messages\SubTypes\BMSStatusEType.cs" />
+    <Compile Include="Messages\SubTypes\CancelReservationStatus.cs" />
+    <Compile Include="Messages\SubTypes\CarConnectionStatus.cs" />
+    <Compile Include="Messages\SubTypes\ChargeMode.cs" />
+    <Compile Include="Messages\SubTypes\ChargePointErrorCode.cs" />
+    <Compile Include="Messages\SubTypes\ChargePointStatus.cs" />
+    <Compile Include="Messages\SubTypes\ChargerAutoTerminationStatus.cs" />
+    <Compile Include="Messages\SubTypes\ChargeReadyStatus .cs" />
+    <Compile Include="Messages\SubTypes\ChargeType.cs" />
+    <Compile Include="Messages\SubTypes\ChargingProfileKindType.cs" />
+    <Compile Include="Messages\SubTypes\ChargingProfilePurposeType.cs" />
+    <Compile Include="Messages\SubTypes\ChargingProfileStatus.cs" />
+    <Compile Include="Messages\SubTypes\ChargingRateUnitType.cs" />
+    <Compile Include="Messages\SubTypes\ChargingSchedule.cs" />
+    <Compile Include="Messages\SubTypes\ChargingSchedulePeriod.cs" />
+    <Compile Include="Messages\SubTypes\ChargingStrategy.cs" />
+    <Compile Include="Messages\SubTypes\Class1.cs" />
+    <Compile Include="Messages\SubTypes\ClearCacheStatus.cs" />
+    <Compile Include="Messages\SubTypes\ClearChargingProfileStatus.cs" />
+    <Compile Include="Messages\SubTypes\ConfigurationStatus.cs" />
+    <Compile Include="Messages\SubTypes\CoreStatus.cs" />
+    <Compile Include="Messages\SubTypes\csChargingProfiles.cs" />
+    <Compile Include="Messages\SubTypes\CustomCommandType.cs" />
+    <Compile Include="Messages\SubTypes\DataTransferStatus.cs" />
+    <Compile Include="Messages\SubTypes\DiagnosticsStatus.cs" />
+    <Compile Include="Messages\SubTypes\FirmwareStatus.cs" />
+    <Compile Include="Messages\SubTypes\GetCompositeScheduleStatus.cs" />
+    <Compile Include="Messages\SubTypes\IConfiguration.cs" />
+    <Compile Include="Messages\SubTypes\IdTagInfo.cs" />
+    <Compile Include="Messages\SubTypes\KeyValue.cs" />
+    <Compile Include="Messages\SubTypes\Location.cs" />
+    <Compile Include="Messages\SubTypes\Measurand.cs" />
+    <Compile Include="Messages\SubTypes\MessageTrigger.cs" />
+    <Compile Include="Messages\SubTypes\MeterValue.cs" />
+    <Compile Include="Messages\SubTypes\Phase.cs" />
+    <Compile Include="Messages\SubTypes\ProgramParam.cs" />
+    <Compile Include="Messages\SubTypes\ProgramType.cs" />
+    <Compile Include="Messages\SubTypes\ReadingContext.cs" />
+    <Compile Include="Messages\SubTypes\Reason.cs" />
+    <Compile Include="Messages\SubTypes\RecurrencyKindType.cs" />
+    <Compile Include="Messages\SubTypes\RegistrationStatus.cs" />
+    <Compile Include="Messages\SubTypes\RemoteStartStopStatus.cs" />
+    <Compile Include="Messages\SubTypes\ReservationStatus.cs" />
+    <Compile Include="Messages\SubTypes\ResetStatus.cs" />
+    <Compile Include="Messages\SubTypes\ResetType.cs" />
+    <Compile Include="Messages\SubTypes\SampledValue.cs" />
+    <Compile Include="Messages\SubTypes\StartChargingType.cs" />
+    <Compile Include="Messages\SubTypes\StartWith.cs" />
+    <Compile Include="Messages\SubTypes\TriggerMessageStatus.cs" />
+    <Compile Include="Messages\SubTypes\UnitOfMeasure.cs" />
+    <Compile Include="Messages\SubTypes\UnlockStatus.cs" />
+    <Compile Include="Messages\SubTypes\UpdateStatus.cs" />
+    <Compile Include="Messages\SubTypes\UpdateType.cs" />
+    <Compile Include="Messages\SubTypes\ValueFormat.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Utilities\ConfigureHelper.cs" />
+    <Compile Include="Utilities\FormatHelper.cs" />
+    <Compile Include="Utilities\UTCDateTimeConverter.cs" />
+  </ItemGroup>
+  <ItemGroup />
+  <ItemGroup>
+    <None Include="packages.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 28 - 0
EVCB_OCPP.Packet/Features/Core/AuthorizeFeature.cs

@@ -0,0 +1,28 @@
+using EVCB_OCPP.Packet.Features.Core;
+using EVCB_OCPP.Packet.Messages.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Core
+{
+    public class AuthorizeFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return  Actions.Authorize.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(AuthorizeConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(AuthorizeRequest);
+        }
+    }
+}

+ 29 - 0
EVCB_OCPP.Packet/Features/Core/BootNotificationFeature.cs

@@ -0,0 +1,29 @@
+using EVCB_OCPP.Packet.Features.Core;
+using EVCB_OCPP.Packet.Messages.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Core
+{
+    public class BootNotificationFeature : Feature
+    {
+
+        public override string GetAction()
+        {
+           return Actions.BootNotification.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+           return  typeof(BootNotificationConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(BootNotificationRequest);
+        }
+    }
+}

+ 28 - 0
EVCB_OCPP.Packet/Features/Core/ChangeAvailabilityFeature.cs

@@ -0,0 +1,28 @@
+using EVCB_OCPP.Packet.Features.Core;
+using EVCB_OCPP.Packet.Messages.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Core
+{
+    public class ChangeAvailabilityFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.ChangeAvailability.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(ChangeAvailabilityConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(ChangeAvailabilityRequest);
+        }
+    }
+}

+ 28 - 0
EVCB_OCPP.Packet/Features/Core/ChangeConfigurationFeature.cs

@@ -0,0 +1,28 @@
+using EVCB_OCPP.Packet.Features.Core;
+using EVCB_OCPP.Packet.Messages.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Core
+{
+    public class ChangeConfigurationFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.ChangeConfiguration.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(ChangeConfigurationConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(ChangeConfigurationRequest);
+        }
+    }
+}

+ 28 - 0
EVCB_OCPP.Packet/Features/Core/ClearCacheFeature.cs

@@ -0,0 +1,28 @@
+using EVCB_OCPP.Packet.Features.Core;
+using EVCB_OCPP.Packet.Messages.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Core
+{
+    public class ClearCacheFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.ClearCache.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(ClearCacheConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(ClearCacheRequest);
+        }
+    }
+}

+ 28 - 0
EVCB_OCPP.Packet/Features/Core/DataTransferFeature.cs

@@ -0,0 +1,28 @@
+using EVCB_OCPP.Packet.Features.Core;
+using EVCB_OCPP.Packet.Messages.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Core
+{
+    public class DataTransferFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.DataTransfer.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(DataTransferConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(DataTransferRequest);
+        }
+    }
+}

+ 28 - 0
EVCB_OCPP.Packet/Features/Core/GetConfigurationFeature.cs

@@ -0,0 +1,28 @@
+using EVCB_OCPP.Packet.Features.Core;
+using EVCB_OCPP.Packet.Messages.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Core
+{
+    public class GetConfigurationFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.GetConfiguration.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(GetConfigurationConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(GetConfigurationRequest);
+        }
+    }
+}

+ 28 - 0
EVCB_OCPP.Packet/Features/Core/HeartbeatFeature.cs

@@ -0,0 +1,28 @@
+using EVCB_OCPP.Packet.Features.Core;
+using EVCB_OCPP.Packet.Messages.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Core
+{
+    public class HeartbeatFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.Heartbeat.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(HeartbeatConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(HeartbeatRequest);
+        }
+    }
+}

+ 29 - 0
EVCB_OCPP.Packet/Features/Core/MeterValuesFeature.cs

@@ -0,0 +1,29 @@
+using EVCB_OCPP.Packet.Features.Core;
+using EVCB_OCPP.Packet.Messages.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Core
+{
+    public class MeterValuesFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.MeterValues.ToString();
+
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(MeterValuesConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(MeterValuesRequest);
+        }
+    }
+}

+ 29 - 0
EVCB_OCPP.Packet/Features/Core/RemoteStartTransactionFeature.cs

@@ -0,0 +1,29 @@
+using EVCB_OCPP.Packet.Features.Core;
+using EVCB_OCPP.Packet.Messages.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Core
+{
+    public class RemoteStartTransactionFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.RemoteStartTransaction.ToString();
+
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(RemoteStartTransactionConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(RemoteStartTransactionRequest);
+        }
+    }
+}

+ 29 - 0
EVCB_OCPP.Packet/Features/Core/RemoteStopTransactionFeature.cs

@@ -0,0 +1,29 @@
+using EVCB_OCPP.Packet.Features.Core;
+using EVCB_OCPP.Packet.Messages.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Core
+{
+    public class RemoteStopTransactionFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.RemoteStopTransaction.ToString();
+
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(RemoteStopTransactionConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(RemoteStopTransactionRequest);
+        }
+    }
+}

+ 28 - 0
EVCB_OCPP.Packet/Features/Core/ResetFeature.cs

@@ -0,0 +1,28 @@
+using EVCB_OCPP.Packet.Features.Core;
+using EVCB_OCPP.Packet.Messages.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Core
+{
+    public class ResetFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.Reset.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(ResetConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(ResetRequest);
+        }
+    }
+}

+ 28 - 0
EVCB_OCPP.Packet/Features/Core/StartTransactionFeature.cs

@@ -0,0 +1,28 @@
+using EVCB_OCPP.Packet.Features.Core;
+using EVCB_OCPP.Packet.Messages.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Core
+{
+    public class StartTransactionFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.StartTransaction.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(StartTransactionConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(StartTransactionRequest);
+        }
+    }
+}

+ 28 - 0
EVCB_OCPP.Packet/Features/Core/StatusNotificationFeature.cs

@@ -0,0 +1,28 @@
+using EVCB_OCPP.Packet.Features.Core;
+using EVCB_OCPP.Packet.Messages.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Core
+{
+    public class StatusNotificationFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.StatusNotification.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(StatusNotificationConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(StatusNotificationRequest);
+        }
+    }
+}

+ 28 - 0
EVCB_OCPP.Packet/Features/Core/StopTransactionFeature.cs

@@ -0,0 +1,28 @@
+using EVCB_OCPP.Packet.Features.Core;
+using EVCB_OCPP.Packet.Messages.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Core
+{
+    public class StopTransactionFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.StopTransaction.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(StopTransactionConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(StopTransactionRequest);
+        }
+    }
+}

+ 28 - 0
EVCB_OCPP.Packet/Features/Core/UnlockConnectorFeature.cs

@@ -0,0 +1,28 @@
+using EVCB_OCPP.Packet.Features.Core;
+using EVCB_OCPP.Packet.Messages.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features.Core
+{
+    public class UnlockConnectorFeature : Feature
+    {
+        public override string GetAction()
+        {
+            return Actions.UnlockConnector.ToString();
+        }
+
+        public override Type GetConfirmationType()
+        {
+            return typeof(UnlockConnectorConfirmation);
+        }
+
+        public override Type GetRequestType()
+        {
+            return typeof(UnlockConnectorRequest);
+        }
+    }
+}

+ 65 - 0
EVCB_OCPP.Packet/Features/CoreProfile.cs

@@ -0,0 +1,65 @@
+using EVCB_OCPP.Packet.Features.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features
+{
+   
+    public class CoreProfile : Profile
+    {
+        public CoreProfile()
+        {
+            Name = "Core";
+            //加入支援的Features
+            features.Add(new BootNotificationFeature());
+            features.Add(new GetConfigurationFeature());
+            features.Add(new HeartbeatFeature());
+            features.Add(new StartTransactionFeature());
+            features.Add(new ChangeConfigurationFeature());
+            features.Add(new StatusNotificationFeature());
+            features.Add(new StopTransactionFeature());
+            features.Add(new MeterValuesFeature());
+            features.Add(new RemoteStartTransactionFeature());
+            features.Add(new RemoteStopTransactionFeature());
+            features.Add(new ChangeAvailabilityFeature());
+            features.Add(new AuthorizeFeature());
+            features.Add(new ResetFeature());
+            features.Add(new UnlockConnectorFeature());
+
+            actions.Add(Actions.BootNotification.ToString());
+            actions.Add(Actions.GetConfiguration.ToString());
+            actions.Add(Actions.Heartbeat.ToString());
+            actions.Add(Actions.StartTransaction.ToString());
+            actions.Add(Actions.ChangeConfiguration.ToString());
+            actions.Add(Actions.StatusNotification.ToString());
+            actions.Add(Actions.Authorize.ToString());
+            actions.Add(Actions.StopTransaction.ToString());
+            actions.Add(Actions.MeterValues.ToString());
+            actions.Add(Actions.RemoteStartTransaction.ToString());
+            actions.Add(Actions.RemoteStopTransaction.ToString());
+            actions.Add(Actions.ChangeAvailability.ToString());
+            actions.Add(Actions.ClearCache.ToString());
+            actions.Add(Actions.DataTransfer.ToString());
+            actions.Add(Actions.Reset.ToString());
+            actions.Add(Actions.UnlockConnector.ToString());
+          
+        }
+
+        public string GetActionFromConfirmation(Type seekType)
+        {
+            return features.Where(x => x.GetConfirmationType() == seekType).FirstOrDefault().GetAction();
+        }
+
+        public string GetActionFromRequest(Type seekType)
+        {
+            return GetFeaturebyType(seekType).GetAction();
+        }
+       
+
+
+
+    }
+}

+ 21 - 0
EVCB_OCPP.Packet/Features/Feature.cs

@@ -0,0 +1,21 @@
+using System;
+
+namespace EVCB_OCPP.Packet.Features
+{
+    /// <summary>
+    /// Abstract class. Feature ties {Request} and {Confirmation} types together with an action name.
+    /// Can handle a incoming request by forwarding it to the feature {Profile}.
+    /// </summary>
+    public abstract class Feature
+    {
+        /// <summary>
+        /// Get the {Request} for the feature.
+        /// return the {Request}
+        /// </summary>
+        public abstract Type GetRequestType();
+
+        public abstract Type GetConfirmationType();
+
+        public abstract string GetAction();
+    }
+}

+ 100 - 0
EVCB_OCPP.Packet/Features/Profile.cs

@@ -0,0 +1,100 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Features
+{
+    public enum Actions
+    {
+        //Core
+        None,
+        BootNotification,
+        GetConfiguration,
+        Heartbeat,
+        StartTransaction,
+        ChangeConfiguration,
+        StatusNotification,
+        Authorize,
+        StopTransaction,
+        MeterValues,
+        RemoteStartTransaction,
+        RemoteStopTransaction,
+        ChangeAvailability,
+        ClearCache,
+        DataTransfer,
+        Reset,
+        UnlockConnector,
+        //FirmwareManagement
+        GetDiagnostics,
+        UpdateFirmware,
+        FirmwareStatusNotification,
+        DiagnosticsStatusNotification,
+        //LocalAuthListManagement
+        SendLocalList,
+        GetLocalListVersion,
+        //Reservation
+        CancelReservation,
+        ReserveNow,
+        //Remote Trigger
+        TriggerMessage,
+        //SmartCharging
+        ClearChargingProfile,
+        GetCompositeSchedule,
+        SetChargingProfile
+    }
+    public class Profile
+    {
+        public string Name { protected set; get; }
+
+        protected List<Feature> features = new List<Feature>();
+
+        protected List<string> actions = new List<string>();
+
+        public List<Feature> GetAllFeatures()
+        {
+            return features;
+        }
+
+        public string GetActionFromConfirmation(Type seekType)
+        {
+
+            var _feature = features.Where(x => x.GetConfirmationType() == seekType).FirstOrDefault();
+
+            return _feature == null ? string.Empty : _feature.GetAction();
+        }
+
+        public string GetActionFromRequest(Type seekType)
+        {
+            var feature = GetFeaturebyType(seekType);
+
+            return feature == null ? string.Empty : feature.GetAction();
+        }
+
+        public virtual Feature GetFeaturebyAction(string action)
+        {
+            return features.Where(x => x.GetAction() == action).FirstOrDefault(); ; ;
+        }
+
+        public virtual Feature GetFeaturebyType(Type seekType)
+        {
+
+            return features.Where(x => x.GetRequestType() == seekType).FirstOrDefault(); ;
+        }
+
+        public bool IsExisted(string action)
+        {
+           return actions.Contains(action);
+        }
+
+
+        public bool IsExisted(Actions action)
+        {
+            string _action = action.ToString();
+            return actions.Contains(_action);
+        }
+
+
+    }
+}

+ 109 - 0
EVCB_OCPP.Packet/Features/StandardConfiguration.cs

@@ -0,0 +1,109 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OCPPPackage.Profiles
+{
+    public static class StandardConfiguration
+    {
+        #region Core Profile
+        public const string AllowOfflineTxForUnknownId = "AllowOfflineTxForUnknownId";
+
+        public const string AuthorizationCacheEnabled = "AuthorizationCacheEnabled";
+
+        public const string AuthorizeRemoteTxRequests = "AuthorizeRemoteTxRequests";
+
+        public const string BlinkRepeat = "BlinkRepeat";
+
+        public const string ClockAlignedDataInterval = "ClockAlignedDataInterval";
+
+        public const string ConnectionTimeOut = "ConnectionTimeOut";
+
+        public const string GetConfigurationMaxKeys = "GetConfigurationMaxKeys";
+
+        public const string HeartbeatInterval = "HeartbeatInterval";
+
+        public const string LightIntensity = "LightIntensity";
+
+        public const string LocalAuthorizeOffline = "LocalAuthorizeOffline";
+
+        public const string LocalPreAuthorize = "LocalPreAuthorize";
+
+        public const string MaxEnergyOnInvalidId = "MaxEnergyOnInvalidId";
+
+        public const string MeterValuesAlignedData = "MeterValuesAlignedData";
+
+        public const string MeterValuesAlignedDataMaxLength = "MeterValuesAlignedDataMaxLength";
+
+        public const string MeterValuesSampledData = "MeterValuesSampledData";
+
+        public const string MeterValuesSampledDataMaxLength = "MeterValuesSampledDataMaxLength";
+
+        public const string MeterValueSampleInterval = "MeterValueSampleInterval";
+
+        public const string MinimumStatusDuration = "MinimumStatusDuration";
+
+        public const string NumberOfConnectors = "NumberOfConnectors";
+
+        public const string ResetRetries = "ResetRetries";
+
+        public const string ConnectorPhaseRotation = "ConnectorPhaseRotation";
+
+        public const string ConnectorPhaseRotationMaxLength = "ConnectorPhaseRotationMaxLength";
+
+        public const string StopTransactionOnEVSideDisconnect = "StopTransactionOnEVSideDisconnect";
+
+        public const string StopTransactionOnInvalidId = "StopTransactionOnInvalidId";
+
+        public const string StopTxnAlignedData = "StopTxnAlignedData";
+
+        public const string StopTxnAlignedDataMaxLength = "StopTxnAlignedDataMaxLength";
+
+        public const string StopTxnSampledData = "StopTxnSampledData";
+
+        public const string StopTxnSampledDataMaxLength = "StopTxnSampledDataMaxLength";
+
+        public const string SupportedFeatureProfiles = "SupportedFeatureProfiles";
+
+        public const string SupportedFeatureProfilesMaxLength = "SupportedFeatureProfilesMaxLength";
+
+        public const string TransactionMessageAttempts = "TransactionMessageAttempts";
+
+        public const string TransactionMessageRetryInterval = "TransactionMessageRetryInterval";
+
+        public const string UnlockConnectorOnEVSideDisconnect = "UnlockConnectorOnEVSideDisconnect";
+       
+        public const string WebSocketPingInterval = "WebSocketPingInterval";
+
+        #endregion
+
+        #region Local Auth List Management Profile
+        public const string LocalAuthListEnabled = "LocalAuthListEnabled";
+
+        public const string LocalAuthListMaxLength = "LocalAuthListMaxLength";
+
+        public const string SendLocalListMaxLength = "SendLocalListMaxLength";
+
+        #endregion
+
+        #region Reservation Profile
+        public const string ReserveConnectorZeroSupported = "ReserveConnectorZeroSupported";
+        #endregion
+
+        #region Smart Charging Profile
+        public const string ChargeProfileMaxStackLevel = "ChargeProfileMaxStackLevel";
+
+        public const string ChargingScheduleAllowedChargingRateUnit = "ChargingScheduleAllowedChargingRateUnit";
+
+        public const string ChargingScheduleMaxPeriods = "ChargingScheduleMaxPeriods";
+
+        public const string ConnectorSwitch3to1PhaseSupported = "ConnectorSwitch3to1PhaseSupported";
+
+        public const string MaxChargingProfilesInstalled = "MaxChargingProfilesInstalled";
+        #endregion
+
+
+    }
+}

+ 15 - 0
EVCB_OCPP.Packet/Messages/Basic/BaseMessage.cs

@@ -0,0 +1,15 @@
+using System;
+
+namespace EVCB_OCPP.Packet.Messages.Basic
+{
+    public  class BaseMessage
+    {
+        public string Id { set; get; }
+        public object Payload { set; get; }
+        public string Action { set; get; }
+
+        /// <summary>MessageTypeId</summary>
+        public int TypeId { protected set; get; }
+
+    }
+}

+ 21 - 0
EVCB_OCPP.Packet/Messages/Basic/CallErrorMessage.cs

@@ -0,0 +1,21 @@
+namespace EVCB_OCPP.Packet.Messages.Basic
+{
+    public class CallErrorMessage : BaseMessage
+    {
+        public CallErrorMessage()
+        {
+            TypeId = 4;
+        }
+        public string ErrorCode { set; get; }
+        public string ErrorDescription { set; get; }
+        public string ErrorDetails { set; get; }
+
+
+
+        public override string ToString()
+        {
+            return string.Format("[CallErrorMessage] UniqueId: {0} ErrorCode: {1} ErrorDescription: {2} ErrorDetails: {3} ", Id, ErrorCode,
+                            ErrorDescription, ErrorDetails);
+        }
+    }
+}

+ 16 - 0
EVCB_OCPP.Packet/Messages/Basic/CallMessage.cs

@@ -0,0 +1,16 @@
+using Newtonsoft.Json;
+
+namespace EVCB_OCPP.Packet.Messages.Basic
+{
+    public class CallMessage : BaseMessage
+    {
+        public CallMessage()
+        {
+            TypeId = 2;
+        }
+        public override string ToString()
+        {
+            return string.Format("[CallMessage] UniqueId: {0} Action: {1} Payload: {2}", Id, Action, JsonConvert.SerializeObject(Payload));
+        }
+    }
+}

+ 16 - 0
EVCB_OCPP.Packet/Messages/Basic/CallResultMessage.cs

@@ -0,0 +1,16 @@
+using Newtonsoft.Json;
+
+namespace EVCB_OCPP.Packet.Messages.Basic
+{
+    public class CallResultMessage : BaseMessage
+    {
+        public CallResultMessage()
+        {
+            TypeId = 3;
+        }
+        public override string ToString()
+        {
+            return string.Format("[CallResultMessage] UniqueId: {0} Payload: {1}", Id, JsonConvert.SerializeObject(Payload));
+        }
+    }
+}

+ 17 - 0
EVCB_OCPP.Packet/Messages/Basic/KeyValueType.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Basic
+{
+    public class KeyValueType
+    {
+        public string key { set; get; }
+        public Boolean keyreadonly { set; get; }
+        public string value { set; get; }
+
+
+    }
+}

+ 71 - 0
EVCB_OCPP.Packet/Messages/Basic/Queue.cs

@@ -0,0 +1,71 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Basic
+{
+    public class Queue
+    {
+        //public Dictionary<string, Type> requestQueue;
+        public Dictionary<string, IRequest> requestQueue;
+
+        public Queue()
+        {
+            //requestQueue = new Dictionary<string, Type>();
+            requestQueue = new Dictionary<string, IRequest>();
+        }
+
+        /// <summary>
+        /// Store a {Request} and get a unique identifier to fetch it later on.
+        /// param request: the {Request}.
+        /// return: a unique identifier used to fetch the request.
+        /// </summary>
+        //public String store(Type request)
+        public string store(IRequest request)
+        {
+            string UniqueId = Guid.NewGuid().ToString();
+            requestQueue.Add(UniqueId, request);
+            return UniqueId;
+        }
+
+        /// <summary>
+        /// Store a {Request} and get a unique identifier to fetch it later on.
+        /// param request: the {Request}.
+        /// return: a unique identifier used to fetch the request.
+        /// </summary>
+        //public String store(Type request)
+        public void store(IRequest request, string UniqueId)
+        {
+            requestQueue.Add(UniqueId, request); 
+        }
+
+        /// <summary>
+        /// Restore a {Request} using a unique identifier.
+        /// The identifier can only be used once.
+        /// If no Request was found, null is returned.
+        /// param ticket:    unique identifier returned when {Request} was initially stored.
+        /// return: the stored {Request}
+        /// </summary>
+        //public Type restoreRequest(String ticket)
+        public IRequest RestoreRequest(string UniqueId)
+        {
+            //Type request = null;
+            IRequest request = null;
+            try
+            {
+                if(requestQueue.ContainsKey(UniqueId))
+                    request = requestQueue[UniqueId];
+               
+                requestQueue.Remove(UniqueId);
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+            return request;
+        }
+
+    }
+}

+ 33 - 0
EVCB_OCPP.Packet/Messages/Core/AuthorizeConfirmation.cs

@@ -0,0 +1,33 @@
+using EVCB_OCPP.Packet.Messages.SubTypes;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class AuthorizeConfirmation : IConfirmation
+    {
+        private IRequest _request = null;
+
+        [Required]
+        public IdTagInfo idTagInfo { set; get; }
+
+        public IRequest GetRequest()
+        {
+            return _request;
+        }
+
+        public void SetRequest(IRequest request)
+        {
+            _request = request;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 38 - 0
EVCB_OCPP.Packet/Messages/Core/AuthorizeRequest.cs

@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using EVCB_OCPP.Packet.Features;
+using Newtonsoft.Json;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class AuthorizeRequest : IRequest
+    {
+        public AuthorizeRequest()
+        {
+            Action = Actions.Authorize.ToString();
+        }
+
+        [JsonIgnore]
+        public string Action { set; get; }
+
+        [Required]
+        [MaxLength(20)]
+        public string idTag { set; get; }
+
+       
+
+        public bool TransactionRelated()
+        {
+            return false;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 44 - 0
EVCB_OCPP.Packet/Messages/Core/BootNotificationConfirmation.cs

@@ -0,0 +1,44 @@
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using System;
+using EVCB_OCPP.Packet.Utilities;
+using EVCB_OCPP.Packet.Messages.SubTypes;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class BootNotificationConfirmation : IConfirmation
+    {
+        [Required]
+        [JsonConverter(typeof(UTCDateTimeConverter))]
+        public DateTime currentTime { set; get; }
+
+        [Required]
+        public double interval { set; get; }
+
+        [Required]
+        [JsonConverter(typeof(StringEnumConverter))]
+        public RegistrationStatus status { set; get; }
+
+        private IRequest _request = null;
+
+        public IRequest GetRequest()
+        {
+            return _request;
+        }
+
+        public void SetRequest(IRequest request)
+        {
+            _request = request;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 69 - 0
EVCB_OCPP.Packet/Messages/Core/BootNotificationRequest.cs

@@ -0,0 +1,69 @@
+using EVCB_OCPP.Packet.Features;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class BootNotificationRequest : IRequest
+    {
+        public BootNotificationRequest()
+        {
+            Action = Actions.BootNotification.ToString();
+        }
+        [JsonIgnore]
+        public string Action { set; get; }
+
+
+        [MaxLength(25)]
+        public string chargeBoxSerialNumber { set; get; }
+
+        [Required]
+        [MaxLength(20)]
+        public string chargePointModel { set; get; }
+
+      
+        [MaxLength(25)]
+        public string chargePointSerialNumber { set; get; }
+
+        [Required]
+        [MaxLength(20)]
+        public string chargePointVendor { set; get; }
+
+      
+        [MaxLength(50)]
+        public string firmwareVersion { set; get; }
+
+ 
+        [MaxLength(20)]
+        public string iccid { set; get; }
+
+
+        [MaxLength(20)]
+        public string imsi { set; get; }
+
+  
+        [MaxLength(25)]
+        public string meterSerialNumber { set; get; }
+
+    
+        [MaxLength(25)]
+        public string meterType { set; get; }
+
+        public bool TransactionRelated()
+        {
+            return false;
+        }
+
+        public bool Validate()
+        {          
+           
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true); 
+
+        }
+    }
+}

+ 37 - 0
EVCB_OCPP.Packet/Messages/Core/ChangeAvailabilityConfirmation.cs

@@ -0,0 +1,37 @@
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using EVCB_OCPP.Packet.Utilities;
+using EVCB_OCPP.Packet.Messages.SubTypes;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class ChangeAvailabilityConfirmation : IConfirmation
+    {
+        private IRequest _request = null;
+
+        [Required]
+        [JsonConverter(typeof(StringEnumConverter))]
+        public AvailabilityStatus status { set; get; }
+
+        public IRequest GetRequest()
+        {
+            return _request;
+        }
+
+        public void SetRequest(IRequest request)
+        {
+            _request = request;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 43 - 0
EVCB_OCPP.Packet/Messages/Core/ChangeAvailabilityRequest.cs

@@ -0,0 +1,43 @@
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using EVCB_OCPP.Packet.Utilities;
+using EVCB_OCPP.Packet.Messages.SubTypes;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using EVCB_OCPP.Packet.Features;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class ChangeAvailabilityRequest : IRequest
+    {
+
+        public ChangeAvailabilityRequest()
+        {
+            Action = Actions.ChangeAvailability.ToString();
+        }
+
+        [JsonIgnore]
+        public string Action { set; get; }
+
+        [Required]
+        public int connectorId { set; get; }
+
+        [Required]
+        [JsonConverter(typeof(StringEnumConverter))]
+        public AvailabilityType type { set; get; }
+
+        public bool TransactionRelated()
+        {
+            return false;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 37 - 0
EVCB_OCPP.Packet/Messages/Core/ChangeConfigurationConfirmation.cs

@@ -0,0 +1,37 @@
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using EVCB_OCPP.Packet.Utilities;
+using EVCB_OCPP.Packet.Messages.SubTypes;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public  class ChangeConfigurationConfirmation : IConfirmation
+    {
+        [Required]
+        [JsonConverter(typeof(StringEnumConverter))]
+        public ConfigurationStatus status { set; get; }
+
+        private IRequest _request = null;
+
+        public IRequest GetRequest()
+        {
+            return _request;
+        }
+
+        public void SetRequest(IRequest request)
+        {
+            _request = request;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 42 - 0
EVCB_OCPP.Packet/Messages/Core/ChangeConfigurationRequest.cs

@@ -0,0 +1,42 @@
+using EVCB_OCPP.Packet.Features;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public  class ChangeConfigurationRequest : IRequest
+    {
+
+        public ChangeConfigurationRequest()
+        {
+            Action = Actions.ChangeConfiguration.ToString();
+        }
+
+        [JsonIgnore]
+        public string Action { set; get; }
+
+
+        [Required]
+        [MaxLength(50)]
+        public string key { set; get; }
+
+        [Required]
+        [MaxLength(50)]
+        public string value { set; get; }
+
+        public bool TransactionRelated()
+        {
+            return false;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 38 - 0
EVCB_OCPP.Packet/Messages/Core/ClearCacheConfirmation.cs

@@ -0,0 +1,38 @@
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using EVCB_OCPP.Packet.Utilities;
+using EVCB_OCPP.Packet.Messages.SubTypes;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class ClearCacheConfirmation : IConfirmation
+    {
+        [Required]
+        [JsonConverter(typeof(StringEnumConverter))]
+        public ClearCacheStatus status { set; get; }
+
+        private IRequest _request = null;
+
+        public IRequest GetRequest()
+        {
+            return _request;
+        }
+
+        public void SetRequest(IRequest request)
+        {
+            _request = request;
+        }
+
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 34 - 0
EVCB_OCPP.Packet/Messages/Core/ClearCacheRequest.cs

@@ -0,0 +1,34 @@
+using EVCB_OCPP.Packet.Features;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class ClearCacheRequest : IRequest
+    {
+
+        public ClearCacheRequest()
+        {
+            Action = Actions.ClearCache.ToString();
+        }
+
+        [JsonIgnore]
+        public string Action { set; get; }
+
+
+        public bool TransactionRelated()
+        {
+            return false;
+
+        }
+
+        public bool Validate()
+        {
+            return true;
+        }
+    }
+}

+ 40 - 0
EVCB_OCPP.Packet/Messages/Core/DataTransferConfirmation.cs

@@ -0,0 +1,40 @@
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using EVCB_OCPP.Packet.Utilities;
+using EVCB_OCPP.Packet.Messages.SubTypes;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class DataTransferConfirmation : IConfirmation
+    {
+
+        [Required]
+        [JsonConverter(typeof(StringEnumConverter))]
+        public DataTransferStatus status { set; get; }
+
+        public string data { set; get; }
+
+        private IRequest _request = null;
+
+        public IRequest GetRequest()
+        {
+            return _request;
+        }
+
+        public void SetRequest(IRequest request)
+        {
+            _request = request;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 41 - 0
EVCB_OCPP.Packet/Messages/Core/DataTransferRequest.cs

@@ -0,0 +1,41 @@
+using EVCB_OCPP.Packet.Features;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class DataTransferRequest : IRequest
+    {
+        public DataTransferRequest()
+        {
+            Action = Actions.DataTransfer.ToString();
+        }
+
+        [JsonIgnore]
+        public string Action { set; get; }
+
+        [Required]
+        [MaxLength(255)]
+        public string vendorId { set; get; }
+
+        [MaxLength(50)]
+        public string messageId { set; get; }
+
+        public string data { set; get; }
+
+        public bool TransactionRelated()
+        {
+            return false;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 37 - 0
EVCB_OCPP.Packet/Messages/Core/GetConfigurationConfirmation.cs

@@ -0,0 +1,37 @@
+using EVCB_OCPP.Packet.Utilities;
+using EVCB_OCPP.Packet.Messages.SubTypes;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class GetConfigurationConfirmation : IConfirmation
+    {
+
+        public List<KeyValue> configurationKey { set; get; }
+
+        public List<string> unknownKey { set; get; }
+
+        private IRequest _request = null;
+      
+
+        public IRequest GetRequest()
+        {
+            return _request;
+        }
+
+        public void SetRequest(IRequest request)
+        {
+            _request = request;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 34 - 0
EVCB_OCPP.Packet/Messages/Core/GetConfigurationRequest.cs

@@ -0,0 +1,34 @@
+using EVCB_OCPP.Packet.Features;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class GetConfigurationRequest : IRequest
+    {
+        public GetConfigurationRequest()
+        {
+            Action = Actions.GetConfiguration.ToString();
+        }
+
+        [JsonIgnore]
+        public string Action { set; get; }
+
+        public List<string> key { set; get; }
+
+        public bool TransactionRelated()
+        {
+            return false;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 35 - 0
EVCB_OCPP.Packet/Messages/Core/HeartbeatConfirmation.cs

@@ -0,0 +1,35 @@
+using Newtonsoft.Json;
+using EVCB_OCPP.Packet.Utilities;
+using EVCB_OCPP.Packet.Messages.SubTypes;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class HeartbeatConfirmation : IConfirmation
+    {
+        [Required]
+        [JsonConverter(typeof(UTCDateTimeConverter))]
+        public DateTime currentTime { set; get; }
+
+        private IRequest _request = null;
+        public IRequest GetRequest()
+        {
+            return _request;
+        }
+
+        public void SetRequest(IRequest request)
+        {
+            _request = request;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 31 - 0
EVCB_OCPP.Packet/Messages/Core/HeartbeatRequest.cs

@@ -0,0 +1,31 @@
+using EVCB_OCPP.Packet.Features;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class HeartbeatRequest : IRequest
+    {
+        public HeartbeatRequest()
+        {
+            Action = Actions.Heartbeat.ToString();
+        }
+
+        [JsonIgnore]
+        public string Action { set; get; }
+
+        public bool TransactionRelated()
+        {
+            return false;
+        }
+
+        public bool Validate()
+        {
+            return true;
+        }
+    }
+}

+ 31 - 0
EVCB_OCPP.Packet/Messages/Core/MeterValuesConfirmation.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class MeterValuesConfirmation : IConfirmation
+    {
+        private IRequest _request = null;
+
+        
+
+        public IRequest GetRequest()
+        {
+            return _request;
+        }
+
+        public void SetRequest(IRequest request)
+        {
+            _request = request;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 46 - 0
EVCB_OCPP.Packet/Messages/Core/MeterValuesRequest.cs

@@ -0,0 +1,46 @@
+using Newtonsoft.Json;
+using EVCB_OCPP.Packet.Utilities;
+using EVCB_OCPP.Packet.Messages.SubTypes;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using EVCB_OCPP.Packet.Features;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class MeterValuesRequest : IRequest
+    {
+        public MeterValuesRequest()
+        {
+            Action = Actions.MeterValues.ToString();
+        }
+
+        [JsonIgnore]
+        public string Action { set; get; }
+        /// <summary>
+        /// 充電槍號(開始為1)
+        /// </summary>
+        [Required]
+        public int connectorId { set; get; }
+
+        /// <summary>
+        /// 交易 Id
+        /// </summary>      
+        public int? transactionId { set; get; }
+
+        /// <summary>
+        /// 電表資訊
+        /// </summary>
+        [Required]
+        public List<MeterValue> meterValue { set; get; }
+
+        public bool TransactionRelated()
+        {
+            return true;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 42 - 0
EVCB_OCPP.Packet/Messages/Core/RemoteStartTransactionConfirmation.cs

@@ -0,0 +1,42 @@
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using EVCB_OCPP.Packet.Utilities;
+using EVCB_OCPP.Packet.Messages.SubTypes;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class RemoteStartTransactionConfirmation : IConfirmation
+    {
+        private IRequest _request = null;
+
+        /// <summary>
+        /// Status indicating whether Charge Point 
+        /// accepts the request to start a transaction.
+        /// </summary>
+        [Required]
+        [JsonConverter(typeof(StringEnumConverter))]
+        public RemoteStartStopStatus status { set; get; }
+
+
+        public IRequest GetRequest()
+        {
+            return _request;
+        }
+
+        public void SetRequest(IRequest request)
+        {
+            _request = request;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 50 - 0
EVCB_OCPP.Packet/Messages/Core/RemoteStartTransactionRequest.cs

@@ -0,0 +1,50 @@
+using Newtonsoft.Json;
+using EVCB_OCPP.Packet.Utilities;
+using EVCB_OCPP.Packet.Messages.SubTypes;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using EVCB_OCPP.Packet.Features;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class RemoteStartTransactionRequest : IRequest
+    {
+
+        public RemoteStartTransactionRequest()
+        {
+            Action = Actions.RemoteStartTransaction.ToString();
+        }
+
+        [JsonIgnore]
+        public string Action { set; get; }
+        /// <summary>
+        /// 充電槍號(開始為1)
+        /// </summary>
+        public int connectorId { set; get; }
+        /// <summary>
+        /// Authorization Id
+        /// </summary>
+        [Required]
+        public string idTag { set; get; }
+
+        /// <summary>
+        /// Charging  Profile to be used by the Charge Point for the
+        /// requested transaction. ChargingProfilePurpose MUST be set to TxProfile
+        /// </summary>
+        public csChargingProfiles chargingProfile { set; get; }
+
+        public bool TransactionRelated()
+        {
+            return false;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 38 - 0
EVCB_OCPP.Packet/Messages/Core/RemoteStopTransactionConfirmation.cs

@@ -0,0 +1,38 @@
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using EVCB_OCPP.Packet.Utilities;
+using EVCB_OCPP.Packet.Messages.SubTypes;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class RemoteStopTransactionConfirmation : IConfirmation
+    {
+        private IRequest _request = null;
+
+        [Required]
+        [JsonConverter(typeof(StringEnumConverter))]
+        public RemoteStartStopStatus status { set; get; }
+
+
+        public IRequest GetRequest()
+        {
+            return _request;
+        }
+
+        public void SetRequest(IRequest request)
+        {
+            _request = request;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 40 - 0
EVCB_OCPP.Packet/Messages/Core/RemoteStopTransactionRequest.cs

@@ -0,0 +1,40 @@
+using EVCB_OCPP.Packet.Features;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class RemoteStopTransactionRequest : IRequest
+    {
+
+        public RemoteStopTransactionRequest()
+        {
+            Action = Actions.RemoteStopTransaction.ToString();
+        }
+
+        [JsonIgnore]
+        public string Action { set; get; }
+
+
+        /// <summary>
+        /// 交易Id
+        /// </summary>
+        [Required]
+        public int transactionId { set; get; }
+
+        public bool TransactionRelated()
+        {
+            return false;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 37 - 0
EVCB_OCPP.Packet/Messages/Core/ResetConfirmation.cs

@@ -0,0 +1,37 @@
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using EVCB_OCPP.Packet.Utilities;
+using EVCB_OCPP.Packet.Messages.SubTypes;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class ResetConfirmation : IConfirmation
+    {
+        private IRequest _request = null;
+
+        [Required]
+        [JsonConverter(typeof(StringEnumConverter))]
+        public ResetStatus status { set; get; }
+
+        public IRequest GetRequest()
+        {
+            return _request;
+        }
+
+        public void SetRequest(IRequest request)
+        {
+            _request = request;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 42 - 0
EVCB_OCPP.Packet/Messages/Core/ResetRequest.cs

@@ -0,0 +1,42 @@
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using EVCB_OCPP.Packet.Utilities;
+using EVCB_OCPP.Packet.Messages.SubTypes;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using EVCB_OCPP.Packet.Features;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class ResetRequest : IRequest
+    {
+        public ResetRequest()
+        {
+            Action = Actions.Reset.ToString();
+        }
+
+        [JsonIgnore]
+        public string Action { set; get; }
+
+        /// <summary>
+        /// This contains the type of reset that the
+        /// Charge Point should perform.
+        /// </summary>
+        [Required]
+        [JsonConverter(typeof(StringEnumConverter))]
+        public ResetType type { set; get; }
+        public bool TransactionRelated()
+        {
+            return false;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

+ 36 - 0
EVCB_OCPP.Packet/Messages/Core/StartTransactionConfirmation.cs

@@ -0,0 +1,36 @@
+using EVCB_OCPP.Packet.Utilities;
+using EVCB_OCPP.Packet.Messages.SubTypes;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Packet.Messages.Core
+{
+    public class StartTransactionConfirmation : IConfirmation
+    {
+        [Required]
+        public IdTagInfo idTagInfo { set; get; }
+
+        [Required]
+        public int transactionId { set; get; }
+
+        private IRequest _request = null;
+        public IRequest GetRequest()
+        {
+            return _request;
+        }
+
+        public void SetRequest(IRequest request)
+        {
+            _request = request;
+        }
+
+        public bool Validate()
+        {
+            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
+        }
+    }
+}

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott