This commit is contained in:
Luc Vandenbroucke 2026-08-18 12:15:26 +02:00
commit 1c6be47d46
1258 changed files with 936746 additions and 0 deletions

342
.gitignore vendored Normal file
View file

@ -0,0 +1,342 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# ASP.NET Core default setup: bower directory is configured as wwwroot/lib/ and bower restore is true
**/wwwroot/lib/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb

14
CheckCom/CheckCom.csproj Normal file
View file

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.IO.Ports" Version="10.0.10" />
</ItemGroup>
</Project>

37
CheckCom/Crc16IbmSdlc.cs Normal file
View file

@ -0,0 +1,37 @@
using System;
using System.Text;
public static class Crc16IbmSdlc
{
private const ushort PolyReversed = 0x8408; // Reflected 0x1021
private const ushort Init = 0xFFFF;
private const ushort XorOut = 0xFFFF;
private static readonly ushort[] Table = new ushort[256];
static Crc16IbmSdlc()
{
for (ushort i = 0; i < 256; i++)
{
ushort value = i;
for (byte j = 0; j < 8; j++)
{
if ((value & 1) != 0)
value = (ushort)((value >> 1) ^ PolyReversed);
else
value >>= 1;
}
Table[i] = value;
}
}
public static ushort ComputeChecksum(ReadOnlySpan<byte> data)
{
ushort crc = Init;
foreach (byte b in data)
{
crc = (ushort)((crc >> 8) ^ Table[(crc ^ b) & 0xFF]);
}
return (ushort)(crc ^ XorOut);
}
}

189
CheckCom/Program.cs Normal file
View file

@ -0,0 +1,189 @@
using System.Buffers;
using System.Buffers.Binary;
using System.ComponentModel.DataAnnotations;
using System.IO.Ports;
//string bx = "4F000000780000004F00000078000000000000000000";
//ReadOnlySpan<byte> rs = Convert.FromHexString(bx);
//int x = rs.Length;
//ushort checksum = Crc16IbmSdlc.ComputeChecksum(rs);
string bufp = "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff";
string buf = "ffffffffc0ffffff003f00c1";
Span<byte> discoverID = [ 0xff, 0xff, 0xff];
Span<byte> curID = [ 0xff, 0xf9, 0x07 ];
Span<byte> curIDrest = [ 0x00, 0x00, 0xc2, 0x01, 0x00 ];
byte[] bufferp = Convert.FromHexString(bufp);
byte[] buffer = Convert.FromHexString(buf);
byte[] buffer2 = new byte[256];
ReadOnlySpan<byte> bConnect = MakeConnect(4, curID, curIDrest);
ReadOnlySpan<byte> bDiscover = MakeDiscover(discoverID);
string hexString;
SerialPort sp = new SerialPort("COM3", 9600);
sp.Open();
sp.BaudRate = 9600; sp.Parity = Parity.None; sp.DataBits = 8; sp.StopBits = StopBits.One;
sp.DtrEnable = true;
sp.RtsEnable = true;
sp.ReadTimeout = 1000;
sp.Handshake = Handshake.RequestToSend;
for (int ix = 0; ix < 2; ix++)
{
hexString = Convert.ToHexString(bDiscover);
Console.WriteLine($"-> Discover {hexString}");
sp.BaseStream.Write(bDiscover);
int b = sp.Read(buffer2, 0, 255);
hexString = Convert.ToHexString(buffer2,0,b);
Console.WriteLine($"<- ok {b} bytes: {hexString}");
Thread.Sleep(500);
}
sp.ReadTimeout = 1000;
sp.DiscardInBuffer();
sp.DiscardOutBuffer();
for (int ix = 0; ix < 2; ix++)
{
hexString = Convert.ToHexString(bConnect);
Console.WriteLine($"-> Connect {hexString}");
sp.BaseStream.Write(bConnect);
int b = sp.Read(buffer2, 0, 255);
hexString = Convert.ToHexString(buffer2, 0, b);
Console.WriteLine($"<- ok {b} bytes: {hexString}");
Thread.Sleep(500);
} //-> "C0FFF907879994C1"
//for (int ix = 0; ix < 32; ix++)
//{
// //hexString = Convert.ToHexString(makeBuf, 0, makeBuf.Length);
// //Console.WriteLine($"-> {hexString}");
// //sp.Write(makeBuf, 0, makeBuf.Length);
// int b = 0;
// try
// {
// b = sp.Read(buffer2, 0, 255);
// }
// catch (TimeoutException)
// {
// Console.WriteLine("Read timeout");
// }
// if (b > 0)
// {
// hexString = Convert.ToHexString(buffer2, 0, b);
// Console.WriteLine($"ok {b} bytes: {hexString}");
// }
//} //-> "C0FFF907879994C1"
sp.Close();
Console.ReadLine();
ReadOnlySpan<byte> MakeDiscover(Span<byte> discoverID)
{
return BuildPacket(64, discoverID , new byte[] { 0x00 });
}
ReadOnlySpan<byte> MakeConnect(int syncbytes, ReadOnlySpan<byte> ID, ReadOnlySpan<byte> IDrest)
{
byte[] packet = new byte[1 + ID.Length + IDrest.Length];
packet[0] = 0x07; //connectcommnand
ID.CopyTo(packet.AsSpan(1));
IDrest.CopyTo(packet.AsSpan(1 + ID.Length));
return BuildPacket(syncbytes, ID, packet);
}
ReadOnlySpan<byte> BuildPacket(int syncbytes, ReadOnlySpan<byte> ID, byte[] payload)
{
ArrayBufferWriter<byte> writer = new ArrayBufferWriter<byte>();
if (syncbytes > 0)
{
Span<byte> span = writer.GetSpan(syncbytes);
span.Fill(0xFF);
writer.Advance(syncbytes);
}
writer.Write(new byte[] { 0xC0 }); // STX
int startCS = writer.WrittenCount;
if (ID!=ReadOnlySpan<byte>.Empty) writer.Write(ID);
// 3. Schrijf de dynamische payload
writer.Write(payload);
// 4. Pak alle geschreven data, maar sla de eerste byte (index 0) over via Slice(1)
ReadOnlySpan<byte> dataToChecksum = writer.WrittenSpan.Slice(startCS);
// Bereken de 16-bit checksum
ushort checksum = Crc16IbmSdlc.ComputeChecksum(dataToChecksum);
// 5. Reserveer ruimte voor de staart: 2 bytes checksum + 1 finale byte = 3 bytes
Span<byte> tailSpan = writer.GetSpan(3);
// Checksum wegschrijven in Little Endian (LSB eerst, dan MSB)
tailSpan[0] = (byte)(checksum & 0xFF); // Least Significant Byte
tailSpan[1] = (byte)((checksum >> 8) & 0xFF); // Most Significant Byte
// Finale byte toevoegen
tailSpan[2] = 0xc1; // ETX (End of Text)
// Geef door aan de writer dat we exact 3 bytes hebben toegevoegd
writer.Advance(3);
// 6. Return het resultaat (of stuur writer.WrittenSpan direct naar je Socket)
return writer.WrittenSpan;
}
byte[] MakeBuf(int synccount, string prefix, string id, string playloadrest, string suffix)
{
// Calculate lengths
int prefixLen = prefix.Length / 2;
int idLen = id.Length / 2;
int payloadLen = playloadrest.Length / 2;
int suffixLen = suffix.Length / 2;
int chkLen = 2; // 2 bytes for the CRC16
int blen = synccount + chkLen + prefixLen + idLen + payloadLen + suffixLen;
byte[] buf = new byte[blen];
// 1. Fill sync count bytes with 0xFF
buf.AsSpan(0, synccount).Fill(0xFF);
int currentOffset = synccount;
Convert.FromHexString(prefix, buf.AsSpan(currentOffset), out _, out int written);
currentOffset += written;
int chkstart = currentOffset;
Convert.FromHexString(id, buf.AsSpan(currentOffset), out _, out int idWritten);
currentOffset += idWritten;
Convert.FromHexString(playloadrest, buf.AsSpan(currentOffset), out _, out int payloadWritten);
currentOffset += payloadWritten;
int chkOffset = currentOffset;
int chkend = chkOffset - chkstart;
currentOffset += 2;
Convert.FromHexString(suffix, buf.AsSpan(currentOffset), out _, out int suffixWritten);
currentOffset += suffixWritten;
UInt16 chk = (UInt16)Crc16IbmSdlc.ComputeChecksum(buf.AsSpan(chkstart, chkend));
BinaryPrimitives.WriteUInt16LittleEndian(buf.AsSpan(chkOffset, 2), chk);
return buf;
}

View file

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

View file

@ -0,0 +1,53 @@
<?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>{41FCBAFF-5FC7-49A1-9A97-23B8F0742F59}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>CheckRemoteeDosLocal</RootNamespace>
<AssemblyName>CheckRemoteeDosLocal</AssemblyName>
<TargetFrameworkVersion>v4.8</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="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" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CheckRemoteeDosLocal
{
class Program
{
static System.Net.NetworkInformation.Ping nip;
static System.Data.SqlClient.SqlConnectionStringBuilder cb;
static System.Data.SqlClient.SqlConnection coeDosLocal;
static void init()
{
cb = new System.Data.SqlClient.SqlConnectionStringBuilder()
{
DataSource = "192.168.113.160",
InitialCatalog = "eDosLocal",
IntegratedSecurity = false,
NetworkLibrary = "dbmssocn",
TrustServerCertificate = true,
Authentication = System.Data.SqlClient.SqlAuthenticationMethod.SqlPassword,
UserID = "sa",
Password = "HPHEdos"
};
}
static bool openCon(int ipLastByte)
{
bool rv = false;
cb.DataSource = $"192.168.113.{ipLastByte}";
nip = new System.Net.NetworkInformation.Ping();
var pr = nip.Send(cb.DataSource);
if (pr.Status == System.Net.NetworkInformation.IPStatus.Success)
{
coeDosLocal = new System.Data.SqlClient.SqlConnection(cb.ConnectionString);
try
{
coeDosLocal.Open();
rv = true;
}
catch (System.Exception ex)
{
System.Console.WriteLine($"No sql open from ${cb.DataSource} : {ex.Message}");
}
}
else
System.Console.WriteLine($"No answer from ${cb.DataSource}");
return rv;
}
static void Main(string[] args)
{
init();
for (int ix = 160; ix <= 170; ix++)
{
if (openCon(ix))
{
System.Console.WriteLine($"sql ok from ${cb.DataSource} ");
coeDosLocal.Close();
}
}
}
}
}

View file

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CheckRemoteeDosLocal")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CheckRemoteeDosLocal")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("41fcbaff-5fc7-49a1-9a97-23b8f0742f59")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

6
CompareDef/App.config Normal file
View file

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

View file

@ -0,0 +1,53 @@
<?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>{E8982C85-2107-4B5D-A9C1-FDB91B4F54FF}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>CompareDef</RootNamespace>
<AssemblyName>CompareDef</AssemblyName>
<TargetFrameworkVersion>v4.8</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="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" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

76
CompareDef/Program.cs Normal file
View file

@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CompareDef
{
class Program
{
const string def1 = @"D:\l\src\cs\eDosStation\TestMK3Dll\reader31\reader3.def";
const string def2 = @"D:\l\src\cs\eDosStation\TestMK3Dll\reader32\reader32.def";
static System.Collections.Generic.Dictionary<string, int> def1List, def2List;
static System.Collections.Generic.Dictionary<string, int> ImportDef(string defPath)
{
char[] sep = new char[] { ' ', '\t' };
System.Collections.Generic.Dictionary<string, int> list = new Dictionary<string, int>();
using (var s = new System.IO.StreamReader(defPath))
{
s.ReadLine();
s.ReadLine();
#pragma warning disable CS0168 // The variable 'l' is declared but never used
string l;
#pragma warning restore CS0168 // The variable 'l' is declared but never used
while (!s.EndOfStream)
{
var a = s.ReadLine().Split(sep, StringSplitOptions.RemoveEmptyEntries);
if (a.Length==2)
{
int i = a[0].IndexOf('=');
if (i >= 0)
a[0] = a[0].Substring(0, i );
i = a[0].LastIndexOf('@');
if (i >= 0) a[0] = a[0].Substring(0, i);
if (a[0].StartsWith("Begin", StringComparison.CurrentCultureIgnoreCase)) a[0] = a[0].Substring(5);
else if (a[0].StartsWith("End", StringComparison.CurrentCultureIgnoreCase)) a[0] = a[0].Substring(3);
if (!list.ContainsKey(a[0])) list.Add(a[0], int.Parse(a[1].Substring(1)));
}
}
};
return list;
}
static void CompareLists()
{
foreach (var x in def2List)
{
if (def1List.ContainsKey(x.Key))
{
//if (def1List[x.Key] != x.Value)
//{
// System.Diagnostics.Debug.WriteLine($"Ordinal changed function {x.Key} ordinal1 = {def1List[x.Key]} now at {x.Value}");
//}
} else
{
System.Diagnostics.Debug.WriteLine($"New function {x.Key} at {x.Value}");
}
}
}
static void Main(string[] args)
{
def1List = ImportDef(def1);
def2List = ImportDef(def2);
CompareLists();
}
}
}

View file

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CompareDef")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CompareDef")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e8982c85-2107-4b5d-a9c1-fdb91b4f54ff")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

110
EPDReader/EPDReader.cpp Normal file
View file

@ -0,0 +1,110 @@
// EPDReader.cpp : Defines the functions for the static library.
//
#include "pch.h"
#include "framework.h"
#include "EPDReader.h"
#pragma comment (lib, "Setupapi.lib")
#include <cfgmgr32.h>
#include <setupapi.h>
#include <devguid.h>
#include <exception>
int ExecuteTest(LPCTSTR DriverName)
{
HDEVINFO hDevInfo;
int numberFound_ = 1;
LPCTSTR g_deviceDesc = _T("USB Composite Device");
LPCTSTR thrmo = _T("USB\\VID_0EBB&PID_0340&MI_00");
TCHAR tempString[512] = { 0 };
hDevInfo = SetupDiGetClassDevs(&GUID_DEVCLASS_USB, // ignored if DIGCF_ALLCLASSES set
NULL, // all devices
NULL, // optional
DIGCF_PRESENT);
if (!hDevInfo)
{
return FALSE;
}
else
{
SP_DEVINFO_DATA deviceInfoData;
int i = 0;
deviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
DWORD devIndex;
for (devIndex = 0; SetupDiEnumDeviceInfo(hDevInfo, devIndex, &deviceInfoData); ++devIndex)
{
// for each device
DWORD junk;
bool found = false;
if (SetupDiGetDeviceRegistryProperty(hDevInfo, &deviceInfoData, SPDRP_DEVICEDESC, &junk, (PBYTE)tempString, sizeof(tempString), NULL))
{
OutputDebugStringW(tempString);
OutputDebugStringW(L"\n" );
if (_tcsicmp((LPCTSTR)tempString, g_deviceDesc) == 0)
{
// This is what we are looking for
// Add this line to find the registry key for this device and print it to the command line
memset(tempString, 0, 500);
SetupDiGetDeviceRegistryProperty(hDevInfo, &deviceInfoData, SPDRP_HARDWAREID, &junk, (PBYTE)tempString, sizeof(tempString), NULL);
if (numberFound_ == 1)
{
OutputDebugStringW(L" -> ");
OutputDebugStringW(tempString);
OutputDebugStringW(L"\n");
//This is the case we want where only one device is plugged in only do stuff with this device if it is the one that is plugged in
if (_tcsicmp((LPCTSTR)tempString, DriverName) == 0)
{
// this is the device that we want
}
else
{
continue;
}
}
SP_CLASSINSTALL_HEADER classInstallParams;
SP_PROPCHANGE_PARAMS propChangeParams;
classInstallParams.cbSize = sizeof(SP_CLASSINSTALL_HEADER);
classInstallParams.InstallFunction = DIF_PROPERTYCHANGE;
propChangeParams.ClassInstallHeader = classInstallParams;
propChangeParams.StateChange = DICS_PROPCHANGE;
propChangeParams.Scope = DICS_FLAG_GLOBAL;
propChangeParams.HwProfile = 0;
// This sets the parameters that we want to change
SetupDiSetClassInstallParams(hDevInfo,
&deviceInfoData,
(PSP_CLASSINSTALL_HEADER)&propChangeParams,
sizeof(SP_PROPCHANGE_PARAMS));
// This call should change the state of the device
if (!SetupDiCallClassInstaller(DIF_PROPERTYCHANGE, hDevInfo, &deviceInfoData))
{
//we have not been able to change the setting so clean up and throw an error
SetupDiDestroyDeviceInfoList(hDevInfo);
throw(std::exception("Error enabling/disabling the device"));
}
}
}
}
// Get rid of the handle
SetupDiDestroyDeviceInfoList(hDevInfo);
}
return TRUE;
}

4
EPDReader/EPDReader.h Normal file
View file

@ -0,0 +1,4 @@
#pragma once
#include <tchar.h>
#include <Windows.h>
int ExecuteTest(LPCTSTR DriverName);

158
EPDReader/EPDReader.vcxproj Normal file
View file

@ -0,0 +1,158 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{e3fec35e-e7c3-43ae-b1e7-a017bf642020}</ProjectGuid>
<RootNamespace>EPDReader</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="EPDReader.h" />
<ClInclude Include="framework.h" />
<ClInclude Include="pch.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="EPDReader.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="framework.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="pch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="EPDReader.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="EPDReader.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

3
EPDReader/framework.h Normal file
View file

@ -0,0 +1,3 @@
#pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers

5
EPDReader/pch.cpp Normal file
View file

@ -0,0 +1,5 @@
// pch.cpp: source file corresponding to the pre-compiled header
#include "pch.h"
// When you are using pre-compiled headers, this source file is necessary for compilation to succeed.

13
EPDReader/pch.h Normal file
View file

@ -0,0 +1,13 @@
// pch.h: This is a precompiled header file.
// Files listed below are compiled only once, improving build performance for future builds.
// This also affects IntelliSense performance, including code completion and many code browsing features.
// However, files listed here are ALL re-compiled if any one of them is updated between builds.
// Do not add files here that you will be updating frequently as this negates the performance advantage.
#ifndef PCH_H
#define PCH_H
// add headers that you want to pre-compile here
#include "framework.h"
#endif //PCH_H

22
EpdBase/AssemblyInfo.cpp Normal file
View file

@ -0,0 +1,22 @@
#include "stdafx.h"
using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
using namespace System::Runtime::InteropServices;
using namespace System::Security::Permissions;
[assembly:AssemblyTitleAttribute(L"EpdBase")];
[assembly:AssemblyDescriptionAttribute(L"")];
[assembly:AssemblyConfigurationAttribute(L"")];
[assembly:AssemblyCompanyAttribute(L"")];
[assembly:AssemblyProductAttribute(L"EpdBase")];
[assembly:AssemblyCopyrightAttribute(L"Copyright (c) 2019-2025 Luc Vandenbroucke")];
[assembly:AssemblyTrademarkAttribute(L"")];
[assembly:AssemblyCultureAttribute(L"")];
[assembly:AssemblyVersionAttribute("1.0.*")];
[assembly:ComVisible(false)];
[assembly:CLSCompliantAttribute(true)];

733
EpdBase/EpdBase.cpp Normal file
View file

@ -0,0 +1,733 @@
#include "stdafx.h"
#pragma unmanaged
#include "EpdBase.h"
#include "TimeFunctions.h"
#define DiscoveryTimeslotPeriod 500
#define DiscoveryExpirationPeriod 6000
#define RxRetryCount 5
#define TxRetryCount 5
#pragma unmanaged
void EpdBase::Epd2U::CancelAll()
{
SetEvent(hCancel);
}
void EpdBase::Epd2U::test()
{
if (progressCallback) {
progressCallback(EpdSteps::StepTest, EpdStepResults::OK); // Triggers the callback
}
}
EpdBase::Epd2U::Epd2U(int comport)
{
port = comport;
CommsInitialized = 0;
isBG = isNG = VersionOK = hasAlarm = false;
maxDiscoverTime = 10000;
hWaitTimer = CreateWaitableTimer(NULL, TRUE, NULL);
hCancel = CreateWaitableTimer(NULL, TRUE, NULL);
if (port == 0) return;
SetAutoCommit(0);
Error = 123;
AlarmStatus = 0;
BC = 0;
BaseCountsClock = 0;
hasAlarm = hasFault = false;
EPDStep = EpdSteps::StepInitialized;
EPDStepResult = EpdStepResults::None;
Hp10Dose = Hp07Dose = Hp10Total = Hp07Total = Knocks = Resets = QualityData = 0;
Hp10Peak = Hp07Peak = Hp10Time = Hp07Time = 0;
eDosDose07Warning = eDosDose07Alarm = eDosDose10Warning = eDosDose10Alarm = eDosRate07Warning = eDosRate07Alarm = eDosRate10Warning = eDosRate10Alarm = eDosBatteryWarning = eDosDoseAlarm = eDosRateAlarm = 0;
ErrorSource = ErrorReason = ErrorData = 0;
K1 = K2 = K3 = K4 = K5 = K6 = 0;
SG =BC = FB = HG = 0;
}
WORD EpdBase::Epd2U::WriteConfig()
{
if (port == 0 ) return 1;
return WriteDisplayConfig(00,2,40,10, 2,displayConfig, 56);
}
DWORD EpdBase::Epd2U::StartCom()
{
DWORD rv;
ErrorReason = 0;
ErrorSource = 0;
int mx = 10;
if (port == 0) {
CommsInitialized = 1;
return 1;
}
if (CommsInitialized == 0)
do {
mx--;
InitRv = InitComms(port, 9600, 8, 0, 0); //1=success
if (InitRv == 0) {
rv = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
Sleep(400); //DeinitComms(port);
}
else {
SetRetryCounts(RxRetryCount, TxRetryCount);
SetDiscoveryTimeslotPeriod(port, DiscoveryTimeslotPeriod);
SetDiscoveryTimeslotCount(port, 1);
SetDiscoveryExpirationPeriod(port, DiscoveryExpirationPeriod);
}
} while (InitRv == 0 && mx > 0);
if (InitRv == 0) { ErrorReason = 1; CommsInitialized = 0; }
else { ErrorReason = 0; CommsInitialized = 1; }
isBG = isNG = VersionOK = hasAlarm = false;
return ErrorReason;
}
void EpdBase::Epd2U::EndCom()
{
if (port > 0 && CommsInitialized == 1) {
DeinitComms(port);
Sleep(300);
}
CommsInitialized = 0;
}
EpdBase::Epd2U::~Epd2U()
{
EndCom();
}
bool EpdBase::Epd2U::isCancelled()
{
return WaitForSingleObject(hCancel, 0) == WAIT_OBJECT_0;
}
int EpdBase::Epd2U::StartDiscover( int EpdTimeoutms)
{
ResetEvent(hCancel);
EPDStep = EpdSteps::StepDiscovering;
maxDiscoverTime = EpdTimeoutms;
if (port == 0) {
DeviceCount = 1;
DeviceIDs[0] = 768;
return 1;
}
DiscRV = 0;
ConnectTries = 0; ConnectTimerFired = 0;
if (CommsInitialized == 1 && hWaitTimer != nullptr) {
FlushDiscoveryCache(port);
FlushBuffers(port);
Error = 0;
int maxtries = 100; DeviceCount = 0; DiscRV = 1; DWORD wo = 1; // ongeveer 43 tries in 10 seconden
CancelWaitableTimer(hWaitTimer);
LARGE_INTEGER wt; //100 nanoseconds *10000 = millisec
INT64 t = maxDiscoverTime; t *= (INT64)-10000;
wt.QuadPart = t; // Int32x32To64(maxDiscoverTime, -10000); //15 seconden proberen
SetWaitableTimer(hWaitTimer, &wt, 0, NULL, NULL, 0);
while (DeviceCount == 0 && wo != 0 && !isCancelled()) //tries-- > 0 &&
{
ConnectTries++;
DiscRV = Discover(port, DeviceIDs, MaxDevices, &DeviceCount);
if (DiscRV == 0) {
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
}
else {
HANDLE handles[2];
handles[0] = hWaitTimer;
handles[1] = hCancel;
wo = WaitForMultipleObjects(2, handles, false, 100);
if (wo == 0) { ConnectTimerFired = 1; DiscRV = 1; EPDStepResult = EpdStepResults::OK; }
else if (wo == 1) { //Cancelled
DiscRV = 0; EPDStepResult = EpdStepResults::Error; }
else {
DiscRV = 0; EPDStepResult = EpdStepResults::Error;
}
}
}
CancelWaitableTimer(hWaitTimer);
}
if (progressCallback) progressCallback(EPDStep, EPDStepResult);
return DiscRV;
}
/// <summary>
///
/// </summary>
/// <param name="DeviceID"></param>
/// <returns>0 OK</returns>
int EpdBase::Epd2U::Open(DWORD DeviceID)
{
int rv = 0;
CurrentDeviceID = DeviceID;
if (port > 0 && CommsInitialized==1) {
ConRV = Connect(DeviceID);
if (ConRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
else {
OpenRV = OpenDevice(port, CurrentDeviceID);
if (OpenRV == 0) rv=Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
}
}
else { OpenRV = ConRV = 1; rv = 0; }
return rv;
}
void EpdBase::Epd2U::Close(WORD doEndCom)
{
if (port > 0 && CurrentDeviceID>0) CloseDevice();
CurrentDeviceID = 0;
FlushBuffers(port);
if (doEndCom) EndCom();
}
int EpdBase::Epd2U::CloseAndSignal(WORD EndSessionControl, WORD duration, WORD doEndCom)
{
int rv = 0;
WORD r;
Sleep(250);
r = EndSession(EndSessionControl, duration);
if (r == 1) rv = 0; else rv = 1;
Close( doEndCom);
return rv;
}
void EpdBase::Epd2U::DecodeFunctionFlags()
{
EpdType = (FunctionFlags & 0x1F00) >> 8;
//0=BG 3=Neutron 4=BG Mk3 7=Neutron Mk4
}
void EpdBase::Epd2U::DecodeStatus()
{
hasAlarm = hasFault = false;
DetectorsOn = (OperatingStatus & 1) != 0;
EPDIssued = (OperatingStatus & 4) != 0;
EPDLocked = (OperatingStatus & 0x10)!=0;
EPDTesting = (OperatingStatus & 0x20) != 0;
EPDProcSec = (OperatingStatus & 0x40) != 0;
EPDFaulty = (OperatingStatus & 0x80) != 0;
EPDNewFault = (ErrorStatus & 1) != 0;
EPDComFault = (ErrorStatus & 2) != 0;
EPDCalFault = (ErrorStatus & 4) != 0;
EPDDetFault = (ErrorStatus & 8) != 0;
EPDEprFault = (ErrorStatus & 0x10) != 0;
EPDTrhFault = (ErrorStatus & 0x20) != 0;
EPDOthFault = (ErrorStatus & 0x80) != 0;
AlarmDoseHP101G = (AlarmStatus & 1) != 0;
AlarmDoseHP102G = (AlarmStatus & 2) != 0;
AlarmDoseHP07N = (AlarmStatus & 4) != 0;
AlarmRateHP101G = (AlarmStatus & 8) != 0;;
AlarmRateHP102G = (AlarmStatus & 0x10) != 0;
AlarmRateHP07N = (AlarmStatus & 0x20) != 0;
//OtherAlarm
OtherAlarmRateHp101G = (OtherAlarms & 1) != 0;
OtherAlarmRateHp102G = (OtherAlarms & 2) != 0;
OtherAlarmRateHp07N = (OtherAlarms & 4) != 0;
OtherAlarmReturn = (OtherAlarms & 8) != 0;
OtherAlarmBatLow = (OtherAlarms & 0x10) != 0;
OtherAlarmCarrier = (OtherAlarms & 0x20) != 0;
OtherAlarmBatVolt = (OtherAlarms & 0x40) != 0;
//New fields
eDosDose07Alarm = AlarmDoseHP07N;
eDosDose07Warning = eDosDose07Alarm;
eDosDose10Warning = AlarmDoseHP101G;
eDosDose10Alarm = AlarmRateHP102G;
eDosRate07Alarm = OtherAlarmRateHp07N || AlarmRateHP07N;
eDosRate07Warning = eDosRate07Alarm;
eDosRate10Warning = OtherAlarmRateHp101G || AlarmRateHP101G;
eDosRate10Alarm = OtherAlarmRateHp102G || AlarmRateHP102G;
eDosBatteryWarning = OtherAlarmBatLow || OtherAlarmBatVolt;
if (!VersionOK) OtherAlarms &= 0x7f;
eDosDoseAlarm = eDosDose07Alarm || eDosDose10Alarm;
eDosRateAlarm = eDosRate07Alarm || eDosRate10Alarm;
hasAlarm = (eDosRateAlarm || eDosDoseAlarm);
hasFault = ((OtherAlarms & 0xf8) != 0) || ((OperatingStatus & 0x80) != 0) || (ErrorStatus != 0);
StatusDecoded = true;
}
/// <summary>
///
/// </summary>
/// <returns>0 = ok</returns>
WORD EpdBase::Epd2U::ReadStatus()
{
int rv = 0;
EPDStep = EpdSteps::StepReadStatus;
EPDStepResult = EpdStepResults::Started;
Error = 0; ReadStatusRV = 0;
if (isCancelled()) {
EPDStepResult = EpdStepResults::Error;
if (progressCallback) progressCallback(EPDStep, EPDStepResult);
return 1;
}
memset(WearerID, 0, WearerIDLength + 1);
memset(WearerName, 0, WearerNameLength + 1);
IssueCount = OperatingStatus = ErrorStatus = AlarmStatus = OtherAlarms = EEPROMBadSectors = 0;
RealTime = EpdClock = OffTime = EpdID = 0;
ErrorSource = ErrorReason = ErrorData = 0;
HardVersion = HardVersionMinor= SoftVersion = FunctionFlags = 0;
if (port == 0) {
EpdID = 4567;
EpdType = 0;
FunctionFlags = 0x000;
return 0;
}
RealTime = UnixTimeNow();
CommitRV = ReadEpdStatus(&EpdClock, &RealTime, &IssueCount, &OffTime, &OperatingStatus, &ErrorStatus, &AlarmStatus, &OtherAlarms, &EEPROMBadSectors);
StatusDecoded = false;
if (port == 0) {
EpdClock = 123; ErrorStatus = 0;
};
ErrorStatus &= 0xff;
OperatingStatus &= 0xff;
//RealTime The number of seconds since January 1st, 1970 according to your system time
if (CommitRV == 1) CommitRV = Commit();
if (CommitRV == 1) CommitRV = ReadEpdID(
&EpdID,
&HardVersion,
&SoftVersion,
&FunctionFlags);
if (CommitRV == 1) CommitRV = Commit();
if (CommitRV == 0) {
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
ReadStatusRV = ErrorReason;
rv = ErrorReason;
EPDStepResult = EpdStepResults::Error;
return rv;
}
else {
EPDStepResult = EpdStepResults::OK;
CurrentDeviceID = EpdID;
time_t t = RealTime;
TimeFunctions::UnixTimeToSystemTime(t, &tRealTime);
DecodeStatus();
DecodeFunctionFlags();
}
byte ff = (FunctionFlags >> 8) & 0x0f;
isBG = ff == 0;
isNG = ff == 3;
VersionOK = (isBG && SoftVersion >= 11) || (isNG && SoftVersion >= 3);
if (CommitRV == 1) {
if (EPDIssued == 1) {
CommitRV = ReadWearer(
WearerID,
WearerIDLength,
WearerName,
WearerNameLength);
if (CommitRV == 1) CommitRV = Commit();
if (CommitRV == 0) {
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
rv = ReadStatusRV = ErrorReason;
return rv;
}
}
else memset(WearerID, 0xb, WearerIDLength);
rv = 0;
for (int i = 0; i < WearerIDLength; i++)
if (WearerID[i] == 0xb) WearerID[i] = '0'; else WearerID[i] |= 0x30;
}
if (progressCallback) progressCallback(EPDStep, EPDStepResult);
return rv;
}
/// <summary>
///
/// </summary>
/// <returns>0 ok</returns>
WORD EpdBase::Epd2U::EPDReadExtraStatus()
{
int rv = 0;
if (port == 0) return 1;
byBatADC = bySupplyADC = 0;
/*CommitRV = ReadA2ConfigStatus(
&byBatADC,
&bySupplyADC,
&byStatus3,
&byStatus4);
if (CommitRV == 1) CommitRV = Commit();*/
if (CommitRV == 1) CommitRV = ReadCounts(&D1, &D2, &D3, &D4, &CountsClock);
if (CommitRV == 1) CommitRV = Commit();
if (CommitRV == 1) CommitRV = ReadBaseCounts(&BaseD1, &BaseD2, &BaseD3, &BaseD4, &BaseCountsClock);
if (CommitRV == 1) CommitRV = Commit();
if (CommitRV == 1) rv = 0;
else {
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
rv = ErrorReason;
}
return rv;
}
WORD EpdBase::Epd2U::EPDReadConfig()
{
if (port == 0) return 1;
ReadConfigRV = ReadConfig(
&CountDownTime,
&ReturnTime,
&ChirpRate,
&TeleBaudSetting,
&SelfTestInterval,
&BatteryLoadTestInt,
&GeneralControl,
&CommsTimeout,
&InhibitTimeout,
&MinTxInterval,
&MaxTxIntervals,
&RandomiseWindow,
&DoseIncThresh);
if (ReadConfigRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
CommitRV = Commit();
if (CommitRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
return CommitRV;
}
/// <summary>
///
/// </summary>
/// <returns>0=ok</returns>
WORD EpdBase::Epd2U::WriteCal()
{
int rv = 1;
CommitRV = 0;
if (port == 0 ) return 0;
if (isBG) return 1;
if (K6 > 2000) return 1;
Password = 9;
//((BYTE *)&Password)[0] = 9;
CommitRV = MFRLogin(Password);
if (CommitRV == 1) CommitRV = Commit();
if (CommitRV == 1) CommitRV = MFRWriteCalFactors(K1, K2, K3, K4, K5, K6);
if (CommitRV == 1) CommitRV = Commit();
if (CommitRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
else rv = 0; //ok
return rv;
}
WORD EpdBase::Epd2U::ReadCal()
{
ReadCalibrationDataRV = ReadCalibrationData(
&K1,
&K2,
&K3,
&K4,
&K5,
&K6,
&SG,
&BC,
&FB,
&HG);
CommitRV = Commit();
if (CommitRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
if (CommitRV == 1) return 0; else return 123;
}
/// <summary>
///
/// </summary>
/// <returns>0 Success</returns>
WORD EpdBase::Epd2U::ReadTresHolds()
{
int rv =0;
if (port == 0) {
Hp10THDose1 = Hp10THDose2 = Hp10THDose2 = 123;
Hp10Rate1On = Hp10Rate2On = Hp07RateOn = Hp10Rate1Off = Hp10Rate2Off = Hp07RateOff = 124;
return 1;
}
Hp10THDose1 = Hp10THDose2 = Hp07THDose = 0;
ReadDoseTresholdRV = ReadAlarmDoseThresholds(&Hp10THDose1, &Hp10THDose2, &Hp07THDose);
CommitRV = Commit();
if (CommitRV == 0) rv = Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
if (rv == 0) {
ReadAlarmRateThresholdsRV = ReadAlarmRateThresholds(
&Hp10Rate1On,
&Hp10Rate2On,
&Hp07RateOn,
&Hp10Rate1Off,
&Hp10Rate2Off,
&Hp07RateOff);
CommitRV = Commit();
if (CommitRV == 0) rv = Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
}
if (rv==0) rv = ReadCal();
return rv;
}
WORD EpdBase::Epd2U::ClearAlarms()
{
int rv = 0;
if (port == 0) return 0;
if (CommitRV) CommitRV = ClearFaultFlags();
if (CommitRV) CommitRV = ClearLatchedAlarms();
if (CommitRV) rv = 0; else rv = 1;
return rv;
}
/// <summary>
///
/// </summary>
/// <returns>0 OK</returns>
WORD EpdBase::Epd2U::ReadDoses()
{
Hp10FTime = Hp07FTime = 0UL;
if (port == 0) {
Hp10Dose = Hp07Dose = Hp10Total = Hp07Total = Knocks = Resets = QualityData = 21;
Hp10Peak = Hp07Peak = Hp10Time = Hp07Time = 1000;
eDosDose07Warning = eDosDose07Alarm = eDosDose10Warning = eDosDose10Alarm = eDosRate07Warning = eDosRate07Alarm = eDosRate10Warning = eDosRate10Alarm = eDosBatteryWarning = eDosDoseAlarm = eDosRateAlarm = 0;
ErrorSource = ErrorReason = ErrorData = 0;
K1 = 1; K2 = 2; K3 = 3; K4 = 4; K5 = 5; K6 = 6;
SG = 7; BC = 8; FB = 9; HG = 10;
return 1;
}
ReadDosesQualityRV = ReadPeaksRV = CommitRV = 0;
ReadDosesQualityRV = ReadDosesQuality(
&Hp10Dose,
&Hp07Dose,
&Hp10Total,
&Hp07Total,
&Knocks,
&Resets,
&QualityData);
if (ReadDosesQualityRV == 0) {
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
return 0;
}
QualityData &= 0x7f;
ReadPeaksRV = ReadPeaks(
&Hp10Peak,
&Hp07Peak,
&Hp10Time, //EpdClock of Occurence
&Hp07Time);
if (ReadPeaksRV == 0) {
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
return 0;
}
CommitRV = Commit();
if (CommitRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
TimeFunctions::EPD2PeakTimeToFiletime(EpdClock, Hp10Time, (LPFILETIME)&Hp10FTime);
TimeFunctions::EPD2PeakTimeToFiletime(EpdClock, Hp07Time, (LPFILETIME)&Hp07FTime);
ReadCalibrationData(
&K1,
&K2,
&K3,
&K4,
&K5,
&K6,
&SG,
&BC,
&FB,
&HG);
CommitRV = Commit();
if (CommitRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
return CommitRV==1 ? 0 : 1;
}
WORD EpdBase::Epd2U::PrepareForIssue()
{
int rv = 0;
if (port == 0) return 0;
EPDStep = EpdSteps::StepPrepareIssue;
EPDStepResult = EpdStepResults::Started;
CommitRV = WriteConfig();
CommitRV = 0;
ClearAlarms();
Commit();
//if (CommitRV) CommitRV = Commit();
if (CommitRV) CommitRV = ClearDose();
if (CommitRV) CommitRV = ClearTotalDose();
if (CommitRV) CommitRV = ClearPeakRates();
if (CommitRV) CommitRV = Commit();
if (CommitRV) rv = 0; else rv = 1;
EPDStepResult = EpdStepResults::OK;
if (progressCallback) {
progressCallback(EPDStep, EPDStepResult);
}
return rv;
}
/// <summary>
/// DeIssue and close
/// </summary>
/// <returns></returns>
WORD EpdBase::Epd2U::DeIssue(WORD doEndCom)
{
int rv = 0;
EPDStep = EpdSteps::StepDeIssue;
EPDStepResult = EpdStepResults::Started;
ClearDoseRV = ClearTotalDoseRV = ClearPeakRatesRV = DeIssueEpdRV = 0;
if (port == 0) return 1;
if (CommitRV) CommitRV = ClearDose();
if (CommitRV) CommitRV = ClearTotalDose();
if (CommitRV) CommitRV = ClearPeakRates();
if (CommitRV) CommitRV = Commit();
if (CommitRV) CommitRV = ClearFaultFlags();
if (CommitRV) CommitRV = ClearLatchedAlarms();//Hp10Rate1; Hp10Rate2; Hp07Rate; ReturnForRead
if (CommitRV) CommitRV = Commit();
CommitRV = ClearFailFlag();
if (CommitRV && EPDIssued) {
CommitRV = DeIssueEpd();
if (CommitRV) CommitRV = Commit();
}
if (CommitRV && DetectorsOn ) {
CommitRV = EpdOff();
CommitRV= Commit();
if (!VersionOK) Sleep(1000);// Versie < .. Commit & Sleep
}
if (CommitRV ) {
CloseAndSignal(EndSessionControl, 12, doEndCom);
rv = 0;
EPDStepResult = EpdStepResults::OK;
}
else
{
FlushBuffers(port);
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
CloseAndSignal(EndSessionControl, 40,doEndCom);
rv = ErrorReason;
EPDStepResult = EpdStepResults::Error;
}
progressCallback(EPDStep, EPDStepResult);
return rv;
}
/// <summary>
///
/// </summary>
/// <returns>O = OK</returns>
WORD EpdBase::Epd2U::Issue(WORD doEndCom)
{
int rv=0;
IssueEpdRV = WriteAlarmDoseThresholdsRV = WriteAlarmRateThresholdsRV = WriteWearerNameRV = OnRV = CommitRV = 0;
if (port == 0) return 0;
WORD OKRV = SetFailFlag(); // all actions have been completed
if (OKRV) OKRV = Commit();
if (OKRV) OKRV = BaseLineCounts();
if (OKRV) OKRV = WriteAlarmDoseThresholds(Hp10THDose1, Hp10THDose2, Hp07THDose);
if (OKRV) OKRV = WriteAlarmRateThresholds(Hp10Rate1On, Hp10Rate2On, Hp07RateOn, Hp10Rate1Off, Hp10Rate2Off, Hp07RateOff);
if (OKRV) OKRV = Commit();
if (OKRV) OKRV = IssueEpd(WearerID, WearerIDLength);
if (OKRV) OKRV = Commit();
if (OKRV) OKRV = WriteWearerName(WearerName,(WORD)strlen((char *)WearerName));
if (OKRV) OKRV = Commit();
if (OKRV == 0)
{
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
rv = 1;
}
else
EPDIssued = 1;
ClearFailFlag(); // all actions have been completed
if (OKRV)
{
if (!DetectorsOn) {
OKRV = EpdOn();
OKRV = Commit();
if (!VersionOK) Sleep(1500);
}
CloseAndSignal(EndSessionControl, 12, doEndCom);
rv = 0;
}
else
{
FlushBuffers(port);
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
CloseAndSignal(EndSessionControl, 40, doEndCom);
rv = 1;
}
return rv;
}
//main exit function
//does endcom at end
int EpdBase::Epd2U::GetAllDeissue()
{
int rv = 0;
rv = ReadDoses(); //0 = success
//rv = ReadTresHolds(); //tresholds not needed, only doses
rv = EPDReadExtraStatus();
rv = DeIssue(true); //does close
return rv;
}
//main get dos function
//does endcom at end
int EpdBase::Epd2U::GetAll(bool Closeconnection)
{
int rv = 0;
rv = ReadDoses(); //0 = success
rv = ReadTresHolds(); //0 = success Tresholds needed
if (Closeconnection) Close(1);
return rv;
}
/// <summary>
/// discover, connect and read status
/// </summary>
/// <param name="tokenSourceTimeout"></param>
/// <returns>0=success 1=connect error, 2 = no devices, 3= error reading status</returns>
int EpdBase::Epd2U::ConnectAndStatus(int tokenSourceTimeoutms)
{
WORD dllStatus;
int rv = 1;
if (CommsInitialized == 0) StartCom();
if (CommsInitialized == 0) rv = 1;
else {
dllStatus = StartDiscover(tokenSourceTimeoutms);
if (dllStatus != 1) rv = 1; //Connect error
else if (DeviceCount < 1) rv = 2; //TO
else if (ReadStatus() != 0) rv = 1; //Read Error
else rv = 0;
}
return rv;
}
// main EPD-issue function
// does endcom at the end
int EpdBase::Epd2U::IssueAndCheck(float gain)
{
//chirp not supported
int rv = 0;
if (isNG) {
int kx = (int)gain;
rv = ReadCal();
if (rv != 0 || K6 != 1310) { rv = 1; goto error; }
if (K3 != kx || K4 != kx)
{
K3 = K4 = kx;
rv = WriteCal();
if (rv != 0) goto error;
}
}
rv = PrepareForIssue();
rv = Issue(true); // data already loaded
return rv;
error:
return rv;
}

277
EpdBase/EpdBase.h Normal file
View file

@ -0,0 +1,277 @@
#pragma once
#pragma unmanaged
#include <windows.h>
#include "reader2.h"
#include "../EpdBaseClr/EpdProgress.h"
#pragma unmanaged
namespace EpdBase
{
class Epd2U
{
public:
bool isBG ;
bool isNG ;
bool VersionOK;
bool hasAlarm = false;
bool hasFault = false;
public:
WORD port = 3;
const WORD MaxDevices = 10;
WORD DeviceCount = 0;
DWORD DeviceIDs[10];
DWORD CurrentDeviceID;
WORD AlarmCtrl = 0b01111110;
//WORD AlarmCtrl = 0b01111010; // NO sound
WORD EndSessionControl = 0b00010110;
BYTE displayConfig[56] = { 0,0,1,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
DWORD EpdClock;
DWORD RealTime;
WORD IssueCount;
DWORD OffTime;
WORD OperatingStatus;
WORD ErrorStatus;
WORD AlarmStatus;
WORD OtherAlarms;
WORD EEPROMBadSectors;
WORD StatusDecoded;
WORD WriteConfig32 = 0;
WORD CommsInitialized = 0;
WORD InitRv = 0;
WORD DiscRV = 0;
WORD ConRV = 0;
WORD OpenRV=0;
WORD ReadStatusRV = 0;
WORD CommitRV = 0;
WORD OffRV = 0;
WORD OnRV = 0;
WORD EndSessionRV = 0;
WORD ReadConfigRV = 0;
WORD ReadDoseTresholdRV = 0;
WORD ReadAlarmRateThresholdsRV = 0;
WORD ReadCalibrationDataRV = 0;
WORD ReadWearerRV = 0;
WORD ReadEpdIDRV = 0;
WORD ReadDosesQualityRV;
WORD ReadPeaksRV = 0;
WORD ClearDoseRV;
WORD ClearTotalDoseRV;
WORD ClearPeakRatesRV;
WORD DeIssueEpdRV = 0;
WORD WriteAlarmDoseThresholdsRV = 0;
WORD WriteAlarmRateThresholdsRV = 0;
WORD WriteWearerNameRV = 0;
WORD IssueEpdRV = 0;
WORD Error=0;
WORD ErrorSource;
WORD ErrorReason;
WORD ErrorData;
//Identification
DWORD EpdID=0;
WORD HardVersion, HardVersionMinor;
WORD SoftVersion;
WORD FunctionFlags;
WORD EpdType = 0xff;
SYSTEMTIME tRealTime;
//Wearer
#define WearerIDLength 12
BYTE WearerID[(WearerIDLength)+1];
#define WearerNameLength 22
BYTE WearerName[WearerNameLength+1];
// Dose
DWORD Hp10Dose;
DWORD Hp07Dose;
DWORD Hp10Total;
DWORD Hp07Total;
WORD Knocks;
WORD Resets;
WORD QualityData;
//Peaks
DWORD Hp10Peak;
DWORD Hp07Peak;
DWORD Hp10Time;
DWORD Hp07Time;
long long Hp10FTime , Hp07FTime;
//AlarmDoseTreshold
DWORD Hp10THDose1;
DWORD Hp10THDose2;
DWORD Hp07THDose;
DWORD Hp10Rate1On;
DWORD Hp10Rate2On;
DWORD Hp07RateOn;
DWORD Hp10Rate1Off;
DWORD Hp10Rate2Off;
DWORD Hp07RateOff;
WORD K1;
WORD K2;
WORD K3;
WORD K4;
WORD K5;
WORD K6;
WORD SG;
WORD BC;
WORD FB;
WORD HG;
DWORD D1;
DWORD D2;
DWORD D3;
DWORD D4;
DWORD CountsClock;
DWORD BaseD1;
DWORD BaseD2;
DWORD BaseD3;
DWORD BaseD4;
DWORD BaseCountsClock;
//Config
WORD CountDownTime;
DWORD ReturnTime;
WORD ChirpRate;
WORD TeleBaudSetting;
WORD SelfTestInterval;
WORD BatteryLoadTestInt;
WORD GeneralControl;
WORD CommsTimeout;
WORD InhibitTimeout;
WORD MinTxInterval;
WORD MaxTxIntervals;
WORD RandomiseWindow;
WORD DoseIncThresh;
//OperatingStatus
BYTE DetectorsOn=0;
BYTE EPDIssued = 0;
BYTE EPDLocked = 0;
BYTE EPDTesting = 0;
BYTE EPDProcSec= 0;
BYTE EPDFaulty = 0;
//ERrrostatus
BYTE EPDNewFault = 0;
BYTE EPDComFault = 0;
BYTE EPDCalFault = 0;
BYTE EPDDetFault = 0;
BYTE EPDEprFault = 0;
BYTE EPDTrhFault = 0;
BYTE EPDOthFault = 0;
//AlarmStatus
BYTE AlarmDoseHP101G = 0;
BYTE AlarmDoseHP102G = 0;
BYTE AlarmDoseHP07N = 0;
BYTE AlarmRateHP101G = 0;
BYTE AlarmRateHP102G = 0;
BYTE AlarmRateHP07N = 0;
//OtherAlarm
BYTE OtherAlarmRateHp101G = 0;
BYTE OtherAlarmRateHp102G = 0;
BYTE OtherAlarmRateHp07N = 0;
BYTE OtherAlarmReturn = 0;
BYTE OtherAlarmBatLow = 0;
BYTE OtherAlarmCarrier= 0;
BYTE OtherAlarmBatVolt = 0;
//New fields
BYTE eDosDose07Warning = 0;
BYTE eDosDose07Alarm = 0;
BYTE eDosDose10Warning = 0;
BYTE eDosDose10Alarm = 0;
BYTE eDosRate07Warning = 0;
BYTE eDosRate07Alarm = 0;
BYTE eDosRate10Warning = 0;
BYTE eDosRate10Alarm = 0;
BYTE eDosBatteryWarning = 0;
BYTE eDosDoseAlarm = 0;
BYTE eDosRateAlarm = 0;
DWORD Password = 9;
BYTE byBatADC;
BYTE bySupplyADC;
BYTE byStatus3;
BYTE byStatus4;
int maxDiscoverTime = 10000;
int ConnectTries = 0;
LARGE_INTEGER WaitDiscovery;
BYTE ConnectTimerFired;
int StartDiscover(int EpdTimeout);
int Open(DWORD DeviceID);
void Close(WORD doEndCom);
int CloseAndSignal(WORD EndSessionControl, WORD duration, WORD doEndCom);
void DecodeFunctionFlags();
void DecodeStatus();
Epd2U(int comport);
WORD WriteConfig();
DWORD StartCom();
void EndCom();
WORD ReadStatus();
WORD EPDReadExtraStatus();
WORD EPDReadConfig();
WORD TurnOff();
WORD TurnOn();
WORD ReadCal();
WORD WriteCal();
WORD ReadTresHolds();
WORD ReadDoses();
WORD ClearAlarms();
WORD PrepareForIssue();
WORD DeIssue(WORD doEndCom);
WORD Issue(WORD doEndCom);
int GetAll(bool Close);
int GetAllDeissue();
~Epd2U();
int ConnectAndStatus(int tokenSourceTimeout);
int IssueAndCheck(float gain);
void CancelAll();
bool isCancelled();
public:
HANDLE hWaitTimer = 0;
HANDLE hCancel = 0;
EpdSteps EPDStep;
EpdStepResults EPDStepResult;
typedef void (*ProgressCallback)(EpdSteps percentage, EpdStepResults result);
ProgressCallback progressCallback;
void test();
};
}

BIN
EpdBase/EpdBase.rc Normal file

Binary file not shown.

163
EpdBase/EpdBase.vcxproj Normal file
View file

@ -0,0 +1,163 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{3114A047-7562-42FE-94DE-2418EF19AD9A}</ProjectGuid>
<TargetFrameworkVersion>
</TargetFrameworkVersion>
<Keyword>ManagedCProj</Keyword>
<RootNamespace>EpdBase</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<CLRSupport>false</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<CLRSupport>false</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies />
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="EpdBase.h" />
<ClInclude Include="reader2.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="resource3.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="TimeFunctions.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="EpdBase.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="TimeFunctions.cpp" />
</ItemGroup>
<ItemGroup>
<Image Include="app.ico" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="EpdBase.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="EpdBase.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="TimeFunctions.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="reader2.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resource3.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="EpdBase.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TimeFunctions.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Image Include="app.ico">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="EpdBase.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

BIN
EpdBase/EpdBase1.rc Normal file

Binary file not shown.

BIN
EpdBase/EpdBase2.rc Normal file

Binary file not shown.

BIN
EpdBase/RCa24260 Normal file

Binary file not shown.

BIN
EpdBase/RCb24260 Normal file

Binary file not shown.

BIN
EpdBase/RCc24260 Normal file

Binary file not shown.

3
EpdBase/Resource.h Normal file
View file

@ -0,0 +1,3 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by app.rc

129
EpdBase/TimeFunctions.cpp Normal file
View file

@ -0,0 +1,129 @@
#include "stdafx.h"
#include "TimeFunctions.h"
#pragma unmanaged
TimeFunctions::TimeFunctions()
{
lu.LL = 0;
}
time_t FileTime_to_POSIX_DST(FILETIME ft)
{
FILETIME localFileTime;
FileTimeToLocalFileTime(&ft, &localFileTime);
SYSTEMTIME sysTime;
FileTimeToSystemTime(&localFileTime, &sysTime);
struct tm tmtime = { 0 };
tmtime.tm_year = sysTime.wYear - 1900;
tmtime.tm_mon = sysTime.wMonth - 1;
tmtime.tm_mday = sysTime.wDay;
tmtime.tm_hour = sysTime.wHour;
tmtime.tm_min = sysTime.wMinute;
tmtime.tm_sec = sysTime.wSecond;
tmtime.tm_wday = 0;
tmtime.tm_yday = 0;
tmtime.tm_isdst = -1;
time_t ret = mktime(&tmtime);
return ret;
}
UINT32 FileTime_to_POSIX(FILETIME ft)
{
// takes the last modified date
LARGE_INTEGER date, adjust;
date.HighPart = ft.dwHighDateTime;
date.LowPart = ft.dwLowDateTime;
// 100-nanoseconds = milliseconds * 10000
adjust.QuadPart = 11644473600000 * 10000;
// removes the diff between 1970 and 1601
date.QuadPart -= adjust.QuadPart;
// converts back from 100-nanoseconds to seconds
return (UINT32)(date.QuadPart / 10000000);
}
UINT32 UnixTimeNow() {
FILETIME ft;
GetSystemTimeAsFileTime(&ft);
return FileTime_to_POSIX(ft);
}
void TimeFunctions::UnixTimeToFileTime(time_t t, LPFILETIME pft)
{
// Note that LONGLONG is a 64-bit value
LONGLONG ll;
ll = Int32x32To64(t, 10000000) + 116444736000000000;
pft->dwLowDateTime = (DWORD)ll;
pft->dwHighDateTime = ll >> 32;
}
void TimeFunctions::UnixTimeToSystemTime(time_t t, LPSYSTEMTIME pst)
{
FILETIME ft;
UnixTimeToFileTime(t, &ft);
FileTimeToSystemTime(&ft, pst);
}
void TimeFunctions::Epd2TimeToFileTime(INT32 t, LPFILETIME pft) //MK3
{
LONGLONG offset = 116444736000000000;
LONGLONG ll;
ll = Int32x32To64(t, 10000000) + offset; //1601-1-1 -> 2000
pft->dwLowDateTime = (DWORD)ll;
pft->dwHighDateTime = ll >> 32;
}
//void TimeFunctions::EpdTimeToFileTime(INT32 t, LPFILETIME pft, bool isMK2) //MK3
//{
// LONGLONG offset;
// if (isMK2) offset = 116444736000000000; else offset = 125911584000000000;;
// LONGLONG ll;
// ll = Int32x32To64(t, 10000000) + offset; //1601-1-1 -> 2000
// pft->dwLowDateTime = (DWORD)ll;
// pft->dwHighDateTime = ll >> 32;
//}
//void TimeFunctions::FileTimeToEpdTime(FILETIME pft, INT32* t, bool isMK2)
//{
// LONGLONG offset;
// if (isMK2) offset = 116444736000000000; else offset = 125911584000000000;
// LONGLONG ll = ((((LONGLONG)pft.dwHighDateTime << 32) + pft.dwLowDateTime) - offset) / 10000000;
// *t = (DWORD)ll;
//}
void TimeFunctions::FileTimeToEpd2Time(FILETIME pft, INT32* t)
{
LONGLONG offset= 116444736000000000;
LONGLONG ll = ((((LONGLONG)pft.dwHighDateTime << 32) + pft.dwLowDateTime) - offset) / 10000000;
*t = (DWORD)ll;
}
UINT32 TimeFunctions::NowToEpdTime(bool isMK2)
{
LONGLONG offset;
if (isMK2) offset = 116444736000000000; else offset = 125911584000000000;
SYSTEMTIME t;
GetSystemTime(&t);
FILETIME ft;
SystemTimeToFileTime((const SYSTEMTIME*)&t, &ft);
LONGLONG ll = ((((LONGLONG)ft.dwHighDateTime << 32U) + ft.dwLowDateTime) - offset) / 10000000;
return (DWORD)ll;
}
void TimeFunctions::EPD2PeakTimeToFiletime(DWORD EpdClock, DWORD EpdPeakTime, FILETIME *PeakFileTime ) {
if (EpdPeakTime != 0xCDCDCDCD) {
UINT32 tm = EpdClock - EpdPeakTime; //seconden geleden
GetSystemTimeAsFileTime(&lu.FT);
lu.LL -= UInt32x32To64(tm, 10000000UL);
*PeakFileTime = lu.FT;
}
else {
(*PeakFileTime).dwLowDateTime = (*PeakFileTime).dwHighDateTime = 0;
}
}

26
EpdBase/TimeFunctions.h Normal file
View file

@ -0,0 +1,26 @@
#pragma once
#include <windows.h>
#include <time.h>
class TimeFunctions
{
public:
TimeFunctions();
static void Epd2TimeToFileTime(INT32 t, LPFILETIME pft);
void FileTimeToEpd2Time(FILETIME pft, INT32* t);
static UINT32 NowToEpdTime(bool isMK2);
static void UnixTimeToFileTime(time_t t, LPFILETIME pft);
static void UnixTimeToSystemTime(time_t t, LPSYSTEMTIME pst);
static void EPD2PeakTimeToFiletime(DWORD EpdClock, DWORD EpdPeakTime, FILETIME* PeakFileTime);
};
static union {
FILETIME FT; unsigned long long LL;
} lu;
static SYSTEMTIME ST;
UINT32 FileTime_to_POSIX(FILETIME ft);
UINT32 UnixTimeNow();
UINT32 FileTime_to_POSIX(FILETIME ft);
UINT32 UnixTimeNow();

BIN
EpdBase/app.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

1374
EpdBase/dll2 - Copy/ex15.mif Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,132 @@
EXPORTS
?GetLogDirectory@@YGXPA_WG@Z
?GetLogFilename@@YGXPA_WG@Z
?GetLogIniFilename@@YGXPA_WG@Z
?GetLoggingLevel@@YGGXZ
?GetRawLoggingLevel@@YGGXZ
?GetRejectLogFilename@@YGXPA_WG@Z
?GetRejectLoggingLevel@@YGGXZ
?InitLogDirectory@@YGXXZ
?Initialize@@YGXXZ
?Log@@YAXQBDIGQB_WZZ
?LogPort@@YGXPA_WG@Z
?LogReject@@YGXGPAEK@Z
?SetLogFilename@@YGXQB_W@Z
?SetLogIniFilename@@YGXQB_W@Z
?SetLoggingLevel@@YGXG@Z
?SetRawLoggingLevel@@YGXG@Z
?SetRejectLogFilename@@YGXQB_W@Z
?SetRejectLoggingLevel@@YGXG@Z
ADSClearData
ADSClearOffEnable
ADSClearWearer
ADSDeIssue
ADSIssue
ADSLogin
ADSReadData
ADSReadWearer
ADSSetOffEnable
ADSWritePassword
Abort
AllocateMemory
BaseLineCounts
ClearDose
ClearErrorStore
ClearFailFlag
ClearFaultFlags
ClearLatchedAlarms
ClearPeakRates
ClearTotalDose
CloseDevice
Commit
Connect
DeIssueEpd
DeinitComms
Discover
DisplayFaultCode
EndSession
EpdOff
EpdOn
GetDataMetric
GetErrorDetails
InitComms
IssueEpd
MFRClearAlwaysCount
MFRClearGolden
MFRFormatEEPROM
MFRLogin
MFRResetEpd
MFRSetAlwaysCount
MFRSetGolden
MFRWriteASIC
MFRWriteCalFactors
MFRWriteDetectorThresholds
MFRWriteDirectEEPROM
MFRWriteEpdID
MFRWritePassword
MFRWriteRAM
MemoryAllocated
OpenDevice
ReadA2Config
ReadA2ConfigStatus
ReadASIC
ReadAlarmConfig
ReadAlarmDoseThresholds
ReadAlarmRateThresholds
ReadBaseCounts
ReadCalibrationData
ReadCommsStats
ReadConfig
ReadCounts
ReadDirectEEPROM
ReadDisplayConfig
ReadDoseProfile
ReadDoseProfileCache
ReadDoseProfileSince
ReadDosesQuality
ReadEpdID
ReadEpdStatus
ReadErrorStore
ReadMemory
ReadPeaks
ReadProfileControl
ReadRAM
ReadRates
ReadScratchPad
ReadSpecialDoseStore
ReadSpecialWriteTimes
ReadWearer
ReadWearerID
ReadWearerName
ReleaseMemory
SetAutoCommit
SetDiscoveryExpirationPeriod
SetDiscoveryTimeslotCount
SetDiscoveryTimeslotPeriod
SetFailFlag
SetRetryCounts
SetTimeouts
TestBattery
TestDetectors
WriteA2Config
WriteAlarmConfig
WriteAlarmDoseThresholds
WriteAlarmRateThresholds
WriteChirpRate
WriteConfig
WriteCountdownTimer
WriteDisplayConfig
WriteDisplayControlBits
WriteDisplayEnables
WriteDose
WriteMemory
WriteProfileControl
WriteReturnForReadTime
WriteScratchPad
WriteSpecialWriteTimes
WriteTotalDose
WriteWearerName
_FlushBuffers@4
_FlushDiscoveryCache@4
_Receive@8
_Transmit@8

View file

@ -0,0 +1,158 @@
Microsoft (R) COFF/PE Dumper Version 14.16.27027.1
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file reader2.dll
File Type: DLL
Section contains the following exports for IR_READER_MS_DLL.dll
00000000 characteristics
534E87DE time date stamp Wed Apr 16 15:38:38 2014
0.00 version
1 ordinal base
131 number of functions
131 number of names
ordinal hint RVA name
1 0 00007D60 ?GetLogDirectory@@YGXPA_WG@Z
2 1 00008370 ?GetLogFilename@@YGXPA_WG@Z
3 2 000082A0 ?GetLogIniFilename@@YGXPA_WG@Z
4 3 000084F0 ?GetLoggingLevel@@YGGXZ
5 4 00008550 ?GetRawLoggingLevel@@YGGXZ
6 5 00008430 ?GetRejectLogFilename@@YGXPA_WG@Z
7 6 00008520 ?GetRejectLoggingLevel@@YGGXZ
8 7 00007DB0 ?InitLogDirectory@@YGXXZ
9 8 00008160 ?Initialize@@YGXXZ
10 9 00008580 ?Log@@YAXQBDIGQB_WZZ
11 A 00007D90 ?LogPort@@YGXPA_WG@Z
12 B 00008740 ?LogReject@@YGXGPAEK@Z
13 C 000083A0 ?SetLogFilename@@YGXQB_W@Z
14 D 000082D0 ?SetLogIniFilename@@YGXQB_W@Z
15 E 00008500 ?SetLoggingLevel@@YGXG@Z
16 F 00008560 ?SetRawLoggingLevel@@YGXG@Z
17 10 00008460 ?SetRejectLogFilename@@YGXQB_W@Z
18 11 00008530 ?SetRejectLoggingLevel@@YGXG@Z
19 12 00005520 ADSClearData
20 13 000055B0 ADSClearOffEnable
21 14 00005420 ADSClearWearer
22 15 00005500 ADSDeIssue
23 16 00005490 ADSIssue
24 17 000053D0 ADSLogin
25 18 00003DB0 ADSReadData
26 19 00005440 ADSReadWearer
27 1A 00005590 ADSSetOffEnable
28 1B 00005540 ADSWritePassword
29 1C 00002940 Abort
30 1D 00002540 AllocateMemory
31 1E 000039B0 BaseLineCounts
32 1F 00004840 ClearDose
33 20 00009560 ClearErrorStore
34 21 000039F0 ClearFailFlag
35 22 00003A30 ClearFaultFlags
36 23 00003A10 ClearLatchedAlarms
37 24 000049A0 ClearPeakRates
38 25 00004920 ClearTotalDose
39 26 00003670 CloseDevice
40 27 00002F90 Commit
41 28 00002F10 Connect
42 29 00003930 DeIssueEpd
43 2A 00002880 DeinitComms
44 2B 00002BE0 Discover
45 2C 00003D90 DisplayFaultCode
46 2D 00005100 EndSession
47 2E 00003030 EpdOff
48 2F 00003750 EpdOn
51 30 00002790 GetDataMetric
52 31 00002740 GetErrorDetails
53 32 000027A0 InitComms
54 33 000038D0 IssueEpd
55 34 00003580 MFRClearAlwaysCount
56 35 00003580 MFRClearGolden
57 36 00003580 MFRFormatEEPROM
58 37 000055D0 MFRLogin
59 38 00003580 MFRResetEpd
60 39 00003580 MFRSetAlwaysCount
61 3A 00003580 MFRSetGolden
62 3B 00003570 MFRWriteASIC
63 3C 00005620 MFRWriteCalFactors
64 3D 000056B0 MFRWriteDetectorThresholds
65 3E 00003560 MFRWriteDirectEEPROM
66 3F 00003590 MFRWriteEpdID
67 40 00005980 MFRWritePassword
68 41 00003560 MFRWriteRAM
69 42 00002590 MemoryAllocated
70 43 00002DD0 OpenDevice
71 44 000059D0 ReadA2Config
72 45 00005A30 ReadA2ConfigStatus
73 46 00005320 ReadASIC
74 47 00004560 ReadAlarmConfig
75 48 00003CF0 ReadAlarmDoseThresholds
76 49 00003D30 ReadAlarmRateThresholds
77 4A 00003B90 ReadBaseCounts
78 4B 00003BE0 ReadCalibrationData
79 4C 000036F0 ReadCommsStats
80 4D 000044D0 ReadConfig
81 4E 00003AB0 ReadCounts
82 4F 00005360 ReadDirectEEPROM
83 50 000045B0 ReadDisplayConfig
84 51 00004390 ReadDoseProfile
85 52 00003390 ReadDoseProfileCache
86 53 00004430 ReadDoseProfileSince
87 54 00003A50 ReadDosesQuality
88 55 00003080 ReadEpdID
89 56 00003770 ReadEpdStatus
90 57 00004610 ReadErrorStore
91 58 00002620 ReadMemory
92 59 00003B00 ReadPeaks
93 5A 00003E20 ReadProfileControl
94 5B 000052B0 ReadRAM
95 5C 00003B50 ReadRates
96 5D 00005130 ReadScratchPad
97 5E 000047A0 ReadSpecialDoseStore
98 5F 00004760 ReadSpecialWriteTimes
99 60 00003880 ReadWearer
100 61 00003800 ReadWearerID
101 62 00003840 ReadWearerName
103 63 000025D0 ReleaseMemory
104 64 00002CF0 SetAutoCommit
105 65 00002A20 SetDiscoveryExpirationPeriod
106 66 00002B00 SetDiscoveryTimeslotCount
107 67 00002A90 SetDiscoveryTimeslotPeriod
108 68 000039D0 SetFailFlag
109 69 00002CA0 SetRetryCounts
110 6A 000029A0 SetTimeouts
111 6B 00005C50 TestBattery
112 6C 000037E0 TestDetectors
114 6D 00005A80 WriteA2Config
115 6E 00004B10 WriteAlarmConfig
116 6F 00004A10 WriteAlarmDoseThresholds
117 70 00004A80 WriteAlarmRateThresholds
118 71 00005260 WriteChirpRate
119 72 00004EE0 WriteConfig
120 73 000048C0 WriteCountdownTimer
121 74 00004CB0 WriteDisplayConfig
122 75 00005830 WriteDisplayControlBits
123 76 00005860 WriteDisplayEnables
124 77 00004860 WriteDose
125 78 000026B0 WriteMemory
126 79 00004FB0 WriteProfileControl
127 7A 000049C0 WriteReturnForReadTime
128 7B 000051A0 WriteScratchPad
129 7C 00005010 WriteSpecialWriteTimes
130 7D 00004940 WriteTotalDose
131 7E 00003950 WriteWearerName
49 7F 00002EA0 _FlushBuffers@4
50 80 00002B70 _FlushDiscoveryCache@4
102 81 00002D80 _Receive@8
113 82 00002D30 _Transmit@8
Summary
4000 .data
5000 .rdata
2000 .reloc
1000 .rsrc
1E000 .text

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

1374
EpdBase/dll2/reader2.h Normal file

File diff suppressed because it is too large Load diff

BIN
EpdBase/dll2/reader2.lib Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

1374
EpdBase/dll2/save/ex15.mif Normal file

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

1374
EpdBase/dll2/test/ex15.mif Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,132 @@
EXPORTS
?GetLogDirectory@@YGXPA_WG@Z
?GetLogFilename@@YGXPA_WG@Z
?GetLogIniFilename@@YGXPA_WG@Z
?GetLoggingLevel@@YGGXZ
?GetRawLoggingLevel@@YGGXZ
?GetRejectLogFilename@@YGXPA_WG@Z
?GetRejectLoggingLevel@@YGGXZ
?InitLogDirectory@@YGXXZ
?Initialize@@YGXXZ
?Log@@YAXQBDIGQB_WZZ
?LogPort@@YGXPA_WG@Z
?LogReject@@YGXGPAEK@Z
?SetLogFilename@@YGXQB_W@Z
?SetLogIniFilename@@YGXQB_W@Z
?SetLoggingLevel@@YGXG@Z
?SetRawLoggingLevel@@YGXG@Z
?SetRejectLogFilename@@YGXQB_W@Z
?SetRejectLoggingLevel@@YGXG@Z
ADSClearData
ADSClearOffEnable
ADSClearWearer
ADSDeIssue
ADSIssue
ADSLogin
ADSReadData
ADSReadWearer
ADSSetOffEnable
ADSWritePassword
Abort
AllocateMemory
BaseLineCounts
ClearDose
ClearErrorStore
ClearFailFlag
ClearFaultFlags
ClearLatchedAlarms
ClearPeakRates
ClearTotalDose
CloseDevice
Commit
Connect
DeIssueEpd
DeinitComms
Discover
DisplayFaultCode
EndSession
EpdOff
EpdOn
GetDataMetric
GetErrorDetails
InitComms
IssueEpd
MFRClearAlwaysCount
MFRClearGolden
MFRFormatEEPROM
MFRLogin
MFRResetEpd
MFRSetAlwaysCount
MFRSetGolden
MFRWriteASIC
MFRWriteCalFactors
MFRWriteDetectorThresholds
MFRWriteDirectEEPROM
MFRWriteEpdID
MFRWritePassword
MFRWriteRAM
MemoryAllocated
OpenDevice
ReadA2Config
ReadA2ConfigStatus
ReadASIC
ReadAlarmConfig
ReadAlarmDoseThresholds
ReadAlarmRateThresholds
ReadBaseCounts
ReadCalibrationData
ReadCommsStats
ReadConfig
ReadCounts
ReadDirectEEPROM
ReadDisplayConfig
ReadDoseProfile
ReadDoseProfileCache
ReadDoseProfileSince
ReadDosesQuality
ReadEpdID
ReadEpdStatus
ReadErrorStore
ReadMemory
ReadPeaks
ReadProfileControl
ReadRAM
ReadRates
ReadScratchPad
ReadSpecialDoseStore
ReadSpecialWriteTimes
ReadWearer
ReadWearerID
ReadWearerName
ReleaseMemory
SetAutoCommit
SetDiscoveryExpirationPeriod
SetDiscoveryTimeslotCount
SetDiscoveryTimeslotPeriod
SetFailFlag
SetRetryCounts
SetTimeouts
TestBattery
TestDetectors
WriteA2Config
WriteAlarmConfig
WriteAlarmDoseThresholds
WriteAlarmRateThresholds
WriteChirpRate
WriteConfig
WriteCountdownTimer
WriteDisplayConfig
WriteDisplayControlBits
WriteDisplayEnables
WriteDose
WriteMemory
WriteProfileControl
WriteReturnForReadTime
WriteScratchPad
WriteSpecialWriteTimes
WriteTotalDose
WriteWearerName
_FlushBuffers@4
_FlushDiscoveryCache@4
_Receive@8
_Transmit@8

View file

@ -0,0 +1,158 @@
Microsoft (R) COFF/PE Dumper Version 14.16.27027.1
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file reader2.dll
File Type: DLL
Section contains the following exports for IR_READER_MS_DLL.dll
00000000 characteristics
534E87DE time date stamp Wed Apr 16 15:38:38 2014
0.00 version
1 ordinal base
131 number of functions
131 number of names
ordinal hint RVA name
1 0 00007D60 ?GetLogDirectory@@YGXPA_WG@Z
2 1 00008370 ?GetLogFilename@@YGXPA_WG@Z
3 2 000082A0 ?GetLogIniFilename@@YGXPA_WG@Z
4 3 000084F0 ?GetLoggingLevel@@YGGXZ
5 4 00008550 ?GetRawLoggingLevel@@YGGXZ
6 5 00008430 ?GetRejectLogFilename@@YGXPA_WG@Z
7 6 00008520 ?GetRejectLoggingLevel@@YGGXZ
8 7 00007DB0 ?InitLogDirectory@@YGXXZ
9 8 00008160 ?Initialize@@YGXXZ
10 9 00008580 ?Log@@YAXQBDIGQB_WZZ
11 A 00007D90 ?LogPort@@YGXPA_WG@Z
12 B 00008740 ?LogReject@@YGXGPAEK@Z
13 C 000083A0 ?SetLogFilename@@YGXQB_W@Z
14 D 000082D0 ?SetLogIniFilename@@YGXQB_W@Z
15 E 00008500 ?SetLoggingLevel@@YGXG@Z
16 F 00008560 ?SetRawLoggingLevel@@YGXG@Z
17 10 00008460 ?SetRejectLogFilename@@YGXQB_W@Z
18 11 00008530 ?SetRejectLoggingLevel@@YGXG@Z
19 12 00005520 ADSClearData
20 13 000055B0 ADSClearOffEnable
21 14 00005420 ADSClearWearer
22 15 00005500 ADSDeIssue
23 16 00005490 ADSIssue
24 17 000053D0 ADSLogin
25 18 00003DB0 ADSReadData
26 19 00005440 ADSReadWearer
27 1A 00005590 ADSSetOffEnable
28 1B 00005540 ADSWritePassword
29 1C 00002940 Abort
30 1D 00002540 AllocateMemory
31 1E 000039B0 BaseLineCounts
32 1F 00004840 ClearDose
33 20 00009560 ClearErrorStore
34 21 000039F0 ClearFailFlag
35 22 00003A30 ClearFaultFlags
36 23 00003A10 ClearLatchedAlarms
37 24 000049A0 ClearPeakRates
38 25 00004920 ClearTotalDose
39 26 00003670 CloseDevice
40 27 00002F90 Commit
41 28 00002F10 Connect
42 29 00003930 DeIssueEpd
43 2A 00002880 DeinitComms
44 2B 00002BE0 Discover
45 2C 00003D90 DisplayFaultCode
46 2D 00005100 EndSession
47 2E 00003030 EpdOff
48 2F 00003750 EpdOn
51 30 00002790 GetDataMetric
52 31 00002740 GetErrorDetails
53 32 000027A0 InitComms
54 33 000038D0 IssueEpd
55 34 00003580 MFRClearAlwaysCount
56 35 00003580 MFRClearGolden
57 36 00003580 MFRFormatEEPROM
58 37 000055D0 MFRLogin
59 38 00003580 MFRResetEpd
60 39 00003580 MFRSetAlwaysCount
61 3A 00003580 MFRSetGolden
62 3B 00003570 MFRWriteASIC
63 3C 00005620 MFRWriteCalFactors
64 3D 000056B0 MFRWriteDetectorThresholds
65 3E 00003560 MFRWriteDirectEEPROM
66 3F 00003590 MFRWriteEpdID
67 40 00005980 MFRWritePassword
68 41 00003560 MFRWriteRAM
69 42 00002590 MemoryAllocated
70 43 00002DD0 OpenDevice
71 44 000059D0 ReadA2Config
72 45 00005A30 ReadA2ConfigStatus
73 46 00005320 ReadASIC
74 47 00004560 ReadAlarmConfig
75 48 00003CF0 ReadAlarmDoseThresholds
76 49 00003D30 ReadAlarmRateThresholds
77 4A 00003B90 ReadBaseCounts
78 4B 00003BE0 ReadCalibrationData
79 4C 000036F0 ReadCommsStats
80 4D 000044D0 ReadConfig
81 4E 00003AB0 ReadCounts
82 4F 00005360 ReadDirectEEPROM
83 50 000045B0 ReadDisplayConfig
84 51 00004390 ReadDoseProfile
85 52 00003390 ReadDoseProfileCache
86 53 00004430 ReadDoseProfileSince
87 54 00003A50 ReadDosesQuality
88 55 00003080 ReadEpdID
89 56 00003770 ReadEpdStatus
90 57 00004610 ReadErrorStore
91 58 00002620 ReadMemory
92 59 00003B00 ReadPeaks
93 5A 00003E20 ReadProfileControl
94 5B 000052B0 ReadRAM
95 5C 00003B50 ReadRates
96 5D 00005130 ReadScratchPad
97 5E 000047A0 ReadSpecialDoseStore
98 5F 00004760 ReadSpecialWriteTimes
99 60 00003880 ReadWearer
100 61 00003800 ReadWearerID
101 62 00003840 ReadWearerName
103 63 000025D0 ReleaseMemory
104 64 00002CF0 SetAutoCommit
105 65 00002A20 SetDiscoveryExpirationPeriod
106 66 00002B00 SetDiscoveryTimeslotCount
107 67 00002A90 SetDiscoveryTimeslotPeriod
108 68 000039D0 SetFailFlag
109 69 00002CA0 SetRetryCounts
110 6A 000029A0 SetTimeouts
111 6B 00005C50 TestBattery
112 6C 000037E0 TestDetectors
114 6D 00005A80 WriteA2Config
115 6E 00004B10 WriteAlarmConfig
116 6F 00004A10 WriteAlarmDoseThresholds
117 70 00004A80 WriteAlarmRateThresholds
118 71 00005260 WriteChirpRate
119 72 00004EE0 WriteConfig
120 73 000048C0 WriteCountdownTimer
121 74 00004CB0 WriteDisplayConfig
122 75 00005830 WriteDisplayControlBits
123 76 00005860 WriteDisplayEnables
124 77 00004860 WriteDose
125 78 000026B0 WriteMemory
126 79 00004FB0 WriteProfileControl
127 7A 000049C0 WriteReturnForReadTime
128 7B 000051A0 WriteScratchPad
129 7C 00005010 WriteSpecialWriteTimes
130 7D 00004940 WriteTotalDose
131 7E 00003950 WriteWearerName
49 7F 00002EA0 _FlushBuffers@4
50 80 00002B70 _FlushDiscoveryCache@4
102 81 00002D80 _Receive@8
113 82 00002D30 _Transmit@8
Summary
4000 .data
5000 .rdata
2000 .reloc
1000 .rsrc
1E000 .text

Binary file not shown.

View file

Binary file not shown.

View file

@ -0,0 +1,114 @@
EXPORTS
AllocateMemory@4
MemoryAllocated@4
ReleaseMemory@4
ReadMemory@16
WriteMemory@16
GetErrorDetails@12
GetDataMetric@8
InitComms@20
DeinitComms@4
Abort@0
SetTimeouts@16
SetDiscoveryExpirationPeriod@8
SetDiscoveryTimeslotPeriod@8
SetDiscoveryTimeslotCount@8
Discover@16
SetRetryCounts@8
SetAutoCommit@4
OpenDevice@8
CloseDevice@0
Connect@4
Commit@0
ReadCommsStats@28
EpdOn@0
EpdOff@0
ReadEpdID@16
ReadEpdStatus@36
ReadWearerID@8
ReadWearerName@8
ReadWearer@16
IssueEpd@8
DeIssueEpd@0
WriteWearerName@8
BaseLineCounts@0
SetFailFlag@0
ClearFailFlag@0
ClearLatchedAlarms@0
ClearFaultFlags@0
ReadDosesQuality@28
ReadCounts@20
ReadPeaks@16
ReadRates@8
ReadBaseCounts@20
ReadCalibrationData@40
ReadAlarmDoseThresholds@12
ReadAlarmRateThresholds@24
DisplayFaultCode@4
ADSReadData@36
ReadProfileControl@8
ReadDoseProfile@4
ReadDoseProfileSince@8
ReadDoseProfileCache@20
ReadConfig@52
ReadAlarmConfig@16
ReadDisplayConfig@28
ReadErrorStore@16
ReadSpecialWriteTimes@8
ReadSpecialDoseStore@24
ClearErrorStore@0
ClearDose@0
WriteDose@8
WriteCountdownTimer@8
ClearTotalDose@0
WriteTotalDose@8
ClearPeakRates@0
WriteReturnForReadTime@4
WriteAlarmDoseThresholds@12
WriteAlarmRateThresholds@24
WriteAlarmConfig@16
WriteDisplayConfig@28
WriteDisplayControlBits@4
WriteDisplayEnables@12
WriteConfig@52
WriteProfileControl@8
WriteSpecialWriteTimes@8
EndSession@8
ReadScratchPad@12
WriteScratchPad@12
WriteChirpRate@4
ReadRAM@12
ReadASIC@8
ReadDirectEEPROM@12
ADSLogin@4
ADSClearWearer@0
ADSReadWearer@16
ADSIssue@16
ADSDeIssue@0
ADSClearData@0
ADSWritePassword@4
ADSSetOffEnable@0
ADSClearOffEnable@0
ReadA2Config@28
ReadA2ConfigStatus@16
WriteA2Config@28
TestBattery@0
TestDetectors@0
MFRLogin@4
MFRWriteCalFactors@24
MFRWriteDetectorThresholds@16
MFRWriteRAM@12
MFRWriteDirectEEPROM@12
MFRResetEpd@0
MFRFormatEEPROM@0
MFRWriteASIC@8
MFRSetAlwaysCount@0
MFRClearAlwaysCount@0
MFRSetGolden@0
MFRClearGolden@0
MFRWriteEpdID@16
MFRWritePassword@4
FlushDiscoveryCache@4
Transmit@8
Receive@8
FlushBuffers@4

Binary file not shown.

Binary file not shown.

1374
EpdBase/reader2.h Normal file

File diff suppressed because it is too large Load diff

14
EpdBase/resource1.h Normal file
View file

@ -0,0 +1,14 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by EpdBase.rc
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

14
EpdBase/resource2.h Normal file
View file

@ -0,0 +1,14 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by EpdBase1.rc
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

16
EpdBase/resource3.h Normal file
View file

@ -0,0 +1,16 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by EpdBase.rc
//
#define IDI_ICON1 101
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

1
EpdBase/stdafx.cpp Normal file
View file

@ -0,0 +1 @@
#include "stdafx.h"

1
EpdBase/stdafx.h Normal file
View file

@ -0,0 +1 @@
#pragma once

11678
EpdBase/x.txt Normal file

File diff suppressed because it is too large Load diff

45
EpdBase3/CommonEpdTypes.h Normal file
View file

@ -0,0 +1,45 @@
#ifndef common_epd_types_h
#define common_epd_types_h
enum class EpdGeneration
{
None,
Mk2,
Mk3
};
enum class EpdTypes : uint8_t
{
Mk2BetaGamma = 0,
Mk2Neutron = 3,
Mk3BetaGamma = 4,
Mk3Neutron = 7,
Mk2Gamma = 16,
Mk3Gamma = 20
};
#pragma pack (push)
#pragma pack (1)
struct DiscoveryId
{
uint32_t Id;
EpdGeneration Gen;
uint32_t MaxBaud;
bool operator==(const DiscoveryId &other) const
{
return (Id == other.Id) && (Gen == other.Gen);
}
bool operator !=(const DiscoveryId &other) const
{
return !(*this == other);
}
} ;
typedef struct
{
uint16_t Address;
uint8_t Length;
} MemoryBlockDetails;
typedef struct
{
MemoryBlockDetails BlockDetail;
uint8_t Data[UINT8_MAX];
} MemoryData;
#pragma pack (pop)
#endif

75
EpdBase3/Epd2.h Normal file
View file

@ -0,0 +1,75 @@
#ifndef epd2_h
#define epd2_h
/******************************************************************************
*
* Module Name : Reader3.DLL
*
* File Name : Epd3.h
*
* File Description : Public API For EPD MK3 Communication
*
* Authors: : T Banahan
*
******************************************************************************
*
* This is an unpublished work, the copyright of which vests in Thermo
* Fisher Scientific. All rights reserved.
*
* The information contained herein is the property of Thermo Fisher
* Scientific and is supplied without liability for errors or ommissions
* and no part may be reproduced, used or disclosed except as authorised
* by contract or other written permission. The copyright and the foregoing
* restriction on reproduction, use and disclosure extends to all the media
* in which this information may be embodied.
*
******************************************************************************/
#ifndef WINAPI
#define WINAPI __stdcall
#endif
#ifdef READER3_EXPORTS
#define EPDDLL_API __declspec(dllexport) WINAPI
#else
#define EPDDLL_API __declspec(dllimport) WINAPI
#endif
#include <stdint.h>
extern "C"
{
/********************************************************************************************************************************************
*
* Telemetry
*
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadTelemetryMode_R2(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadTelemetryMode_R2(CommsHandle hComms, CompletionToken token, uint8_t *mode);
CompletionToken EPDDLL_API BeginWriteTelemetryMode_R2(CommsHandle hComms, uint8_t mode, CompletionCallback callback);
int32_t EPDDLL_API EndWriteTelemetryMode_R2(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
*
* Calibration data
*
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadCalibrationData_R2(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadCalibrationData_R2(CommsHandle hComms, CompletionToken token,
uint16_t * HGSens10, uint16_t * SGSens10, uint16_t * HGSens07, uint16_t * SGSens07,
uint16_t * FBSens07, uint16_t * BCSens07,
uint16_t * SGthresh, uint16_t * BCthresh,
uint16_t * FBthresh, uint16_t * HGthresh);
CompletionToken EPDDLL_API BeginWriteDetectorThresholds_R2(CommsHandle hComms, CompletionCallback callback,
uint16_t SGthresh, uint16_t BCthresh,
uint16_t FBthresh, uint16_t HGthresh);
int32_t EPDDLL_API EndWriteDetectorThresholds_R2(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteSensitivities_R2(CommsHandle hComms, CompletionCallback callback,
uint16_t HGSens10, uint16_t SGSens10, uint16_t HGSens07, uint16_t SGSens07,
uint16_t FBSens07, uint16_t BCSens07);
int32_t EPDDLL_API EndWriteSensitivities_R2(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
*
* Manufacturer Login
*
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginMfrLogin_R2(CommsHandle hComms, uint32_t password, CompletionCallback callback);
int32_t EPDDLL_API EndMfrLogin_R2(CommsHandle hComms, CompletionToken token);
}
#endif

461
EpdBase3/Epd3.h Normal file
View file

@ -0,0 +1,461 @@
#ifndef epd3_h
#define epd3_h
/******************************************************************************
*
* Module Name : Reader3.DLL
*
* File Name : Epd3.h
*
* File Description : Public API For EPD MK3 Communication
*
* Authors: : P Beeson
*
******************************************************************************
*
* This is an unpublished work, the copyright of which vests in Thermo
* Fisher Scientific. All rights reserved.
*
* The information contained herein is the property of Thermo Fisher
* Scientific and is supplied without liability for errors or ommissions
* and no part may be reproduced, used or disclosed except as authorised
* by contract or other written permission. The copyright and the foregoing
* restriction on reproduction, use and disclosure extends to all the media
* in which this information may be embodied.
*
******************************************************************************/
#ifndef WINAPI
#define WINAPI __stdcall
#endif
#ifdef READER3_EXPORTS
#define EPDDLL_API __declspec(dllexport) WINAPI
#else
#define EPDDLL_API __declspec(dllimport) WINAPI
#endif
#include <stdint.h>
#include "Mk3Types.h"
extern "C"
{
/********************************************************************************************************************************************
*
* MK3 Specific Event Log
*
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginWriteEventLogLevel_R3(CommsHandle hComms, uint8_t level, CompletionCallback callback = nullptr);
int32_t EPDDLL_API EndWriteEventLogLevel_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadEventLogLevel_R3(CommsHandle hComms, CompletionCallback callback = nullptr);
int32_t EPDDLL_API EndReadEventLogLevel_R3(CommsHandle hComms, CompletionToken token, uint8_t* level);
/********************************************************************************************************************************************
* MK3 Specific Counts Acquisition
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadFlashTestCounts_R3(CommsHandle hComms, uint8_t counterIds[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadFlashTestCounts_R3(CommsHandle hComms, CompletionToken token, Counter_t counts[], uint8_t length, uint8_t * numCounts, uint32_t * utc);
/********************************************************************************************************************************************
*
* Triggered Dose
*
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadTriggeredDoses_R3(CommsHandle hComms, uint8_t ids[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadTriggeredDoses_R3(CommsHandle hComms, CompletionToken token, MeasValue_t doses[], uint8_t length, uint8_t * numDoses, uint32_t * utc);
CompletionToken EPDDLL_API BeginWriteTriggeredDoses_R3(CommsHandle hComms, MeasValue_t doses[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteTriggeredDoses_R3(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
*
* Real Time Clock
*
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginWriteRTC_R3(CommsHandle hComms, uint32_t rtc, CompletionCallback callback = nullptr);
int32_t EPDDLL_API EndWriteRTC_R3(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
*
* MK3 Specific Calibration
*
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadDetectorThresholds_R3(CommsHandle hComms, uint8_t counterIds[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadDetectorThresholds_R3(CommsHandle hComms, CompletionToken token, DetectorThreshold_t thresholds[], uint8_t length, uint8_t * numThresholds);
CompletionToken EPDDLL_API BeginWriteDetectorThresholds_R3(CommsHandle hComms, DetectorThreshold_t thresholds[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteDetectorThresholds_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadSensitivities_R3(CommsHandle hComms, uint8_t sensIds[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadSensitivities_R3(CommsHandle hComms, CompletionToken token, CalSensitivity_t sensitivities[], uint8_t length, uint8_t * numSensitivities);
CompletionToken EPDDLL_API BeginWriteSensitivities_R3(CommsHandle hComms, CalSensitivity_t sensitivities[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteSensitivities_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadGains_R3(CommsHandle hComms, uint8_t sensIds[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadGains_R3(CommsHandle hComms, CompletionToken token, CalGain_t gains[], uint8_t length, uint8_t * numGains);
CompletionToken EPDDLL_API BeginWriteGains(CommsHandle hComms, CalGain_t gains[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteGains(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteNotCalibratedFlag_R3(CommsHandle hComms, uint8_t notCalibrated, CompletionCallback callback);
int32_t EPDDLL_API EndWriteNotCalibratedFlag_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteGainableFlag_R3(CommsHandle hComms, uint8_t gainable, CompletionCallback callback);
int32_t EPDDLL_API EndWriteGainableFlag_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteLastCalibrationProcess_R3(CommsHandle hComms, CalProcess_t process, CompletionCallback callback);
int32_t EPDDLL_API EndWriteLastCalibrationProcess_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadLastCalibrationProcess_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadLastCalibrationProcess_R3(CommsHandle hComms, CompletionToken token, CalProcess_t * process);
CompletionToken EPDDLL_API BeginWriteCalibrationFacility_R3(CommsHandle hComms, CalFacility_t facility, CompletionCallback callback);
int32_t EPDDLL_API EndWriteCalibrationFacility_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadCalibrationFacility_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadCalibrationFacility_R3(CommsHandle hComms, CompletionToken token, CalFacility_t * facility);
CompletionToken EPDDLL_API BeginWriteCalReference_R3(CommsHandle hComms, uint32_t calRef, CompletionCallback callback);
int32_t EPDDLL_API EndWriteCalReference_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadCalReference_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadCalReference_R3(CommsHandle hComms, CompletionToken token, uint32_t * calRef);
CompletionToken EPDDLL_API BeginWriteCalDueDate_R3(CommsHandle hComms, uint32_t utc, CompletionCallback callback);
int32_t EPDDLL_API EndWriteCalDueDate_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadCalDueDate_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadCalDueDate_R3(CommsHandle hComms, CompletionToken token, uint32_t* utc);
CompletionToken EPDDLL_API BeginWriteGoldenFlag_R3(CommsHandle hComms, uint8_t onState, CompletionCallback callback);
int32_t EPDDLL_API EndWriteGoldenFlag_R3(CommsHandle hComms, CompletionToken token);
// ***** MK3 Specific Detector Threshold Limits
CompletionToken EPDDLL_API BeginReadDetectorThresholdLimits_R3(CommsHandle hComms, uint8_t counterIds[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadDetectorThresholdLimits_R3(CommsHandle hComms, CompletionToken token, DetectorThresholdLimit_t limits[], uint8_t length, uint8_t * numLimits);
// * MK3 Specific Dead Time Factors
CompletionToken EPDDLL_API BeginReadDeadTimeFactors_R3(CommsHandle hComms, uint8_t counterIds[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadDeadTimeFactors_R3(CommsHandle hComms, CompletionToken token, DeadTimeCoefficient_t thresholds[], uint8_t length, uint8_t * numFactors);
CompletionToken EPDDLL_API BeginWriteDeadTimeFactors_R3(CommsHandle hComms, DeadTimeCoefficient_t factors[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteDeadTimeFactors_R3(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
* End of Calibration methods
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginWriteDoseSaveInterval_R3(CommsHandle hComms, uint8_t intervalMins, CompletionCallback callback);
int32_t EPDDLL_API EndWriteDoseSaveInterval_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadDoseSaveInterval_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadDoseSaveInterval_R3(CommsHandle hComms, CompletionToken token, uint8_t *intervalMins);
CompletionToken EPDDLL_API BeginClearEEPROM_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndClearEEPROM_R3(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
* MK3 Specific Identities
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadPcbSerialNum_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadPcbSerialNum_R3(CommsHandle hComms, CompletionToken token, uint32_t* pcbSerialNum);
CompletionToken EPDDLL_API BeginWritePcbSerialNumber_R3(CommsHandle hComms, uint32_t serNum, CompletionCallback callback);
int32_t EPDDLL_API EndWritePcbSerialNumber_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadFemSerialNum_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadFemSerialNum_R3(CommsHandle hComms, CompletionToken token, uint32_t* serialNum);
CompletionToken EPDDLL_API BeginWriteFemSerialNumber_R3(CommsHandle hComms, uint32_t serNum, CompletionCallback callback);
int32_t EPDDLL_API EndWriteFemSerialNumber_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadEpdPartNumber_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadEpdPartNumber_R3(CommsHandle hComms, CompletionToken token, PartNumber_t partNum);
CompletionToken EPDDLL_API BeginWriteEpdPartNumber_R3(CommsHandle hComms, PartNumber_t partNum, CompletionCallback callback);
int32_t EPDDLL_API EndWriteEpdPartNumber_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadModelName_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadModelName_R3(CommsHandle hComms, CompletionToken token, ModelName_t * name);
CompletionToken EPDDLL_API BeginWriteModelName_R3(CommsHandle hComms, ModelName_t name, CompletionCallback callback);
int32_t EPDDLL_API EndWriteModelName_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteCapabilities_R3(CommsHandle hComms, uint32_t capabilities, CompletionCallback callback);
int32_t EPDDLL_API EndWriteCapabilities_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteMarkNumber_R3(CommsHandle hComms, MarkNumber_t markNumber, CompletionCallback callback);
int32_t EPDDLL_API EndWriteMarkNumber_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadFirmwarePartNumber_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadFirmwarePartNumber_R3(CommsHandle hComms, CompletionToken token, FirmwarePartNumber_t partNum);
CompletionToken EPDDLL_API BeginReadFpgaVersion_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadFpgaVersion_R3(CommsHandle hComms, CompletionToken token, uint8_t *major, uint8_t *minor);
CompletionToken EPDDLL_API BeginWritePcbRevision_R3(CommsHandle hComms, uint16_t rev, CompletionCallback callback);
int32_t EPDDLL_API EndWritePcbRevision_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadPcbRevision_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadPcbRevision_R3(CommsHandle hComms, CompletionToken token, uint16_t* rev);
CompletionToken EPDDLL_API BeginReadPcbPartNumber_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadPcbPartNumber_R3(CommsHandle hComms, CompletionToken token, PcbPartNumber_t partNum);
CompletionToken EPDDLL_API BeginWritePcbPartNumber_R3(CommsHandle hComms, PcbPartNumber_t partNum, CompletionCallback callback);
int32_t EPDDLL_API EndWritePcbPartNumber_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteEpdRevision_R3(CommsHandle hComms, uint16_t rev, CompletionCallback callback);
int32_t EPDDLL_API EndWriteEpdRevision_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadEpdRevision_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadEpdRevision_R3(CommsHandle hComms, CompletionToken token, uint16_t* rev);
CompletionToken EPDDLL_API BeginReadRadioFirmwareVersion_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadRadioFirmwareVersion_R3(CommsHandle hComms, CompletionToken token, VersionNumber_t * version);
/********************************************************************************************************************************************
* MK3 Detector Test Limits
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadDetectorTestLimits_R3(CommsHandle hComms, uint8_t counterIds[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadDetectorTestLimits_R3(CommsHandle hComms, CompletionToken token, DetectorTestLimit_t limits[], uint8_t length, uint8_t * numLimits);
CompletionToken EPDDLL_API BeginWriteDetectorTestLimits_R3(CommsHandle hComms, DetectorTestLimit_t limits[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteDetectorTestLimits_R3(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
* Pulse Mode
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginWritePulseModeEnable_R3(CommsHandle hComms, uint8_t enable, CompletionCallback callback);
int32_t EPDDLL_API EndWritePulseModeEnable_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadPulseModeEnable_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadPulseModeEnable_R3(CommsHandle hComms, CompletionToken token, uint8_t * enabled);
CompletionToken EPDDLL_API BeginWritePulseModeIndustrial_R3(CommsHandle hComms, uint8_t industrial, CompletionCallback callback);
int32_t EPDDLL_API EndWritePulseModeIndustrial_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadPulseModeIndustrial_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadPulseModeIndustrial_R3(CommsHandle hComms, CompletionToken token, uint8_t * enabled);
CompletionToken EPDDLL_API BeginWritePulseModeThreshold_R3(CommsHandle hComms, uint8_t counts, CompletionCallback callback);
int32_t EPDDLL_API EndWritePulseModeThreshold_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadPulseModeThreshold_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadPulseModeThreshold_R3(CommsHandle hComms, CompletionToken token, uint8_t * counts);
CompletionToken EPDDLL_API BeginReadPulsedModeOverrangeThreshold_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadPulsedModeOverrangeThreshold_R3(CommsHandle hComms, CompletionToken token, float* threshold);
CompletionToken EPDDLL_API BeginWritePulsedModeOverrangeThreshold_R3(CommsHandle hComms, float threshold, CompletionCallback callback);
int32_t EPDDLL_API EndWritePulsedModeOverrangeThreshold_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadChirpEnable_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadChirpEnable_R3(CommsHandle hComms, CompletionToken token, uint8_t * enabled);
CompletionToken EPDDLL_API BeginWriteChirpEnable_R3(CommsHandle hComms, uint8_t enable, CompletionCallback callback);
int32_t EPDDLL_API EndWriteChirpEnable_R3(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
* MK3 Specific Wearer Identity
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadWearerDatabaseId_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadWearerDatabaseId_R3(CommsHandle hComms, CompletionToken token, DatabaseId_t * dbid);
CompletionToken EPDDLL_API BeginWriteWearerDatabaseId_R3(CommsHandle hComms, DatabaseId_t dbid, CompletionCallback callback);
int32_t EPDDLL_API EndWriteWearerDatabaseId_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadTaskId_R3(CommsHandle hComms, uint16_t type, CompletionCallback callback);
int32_t EPDDLL_API EndReadTaskId_R3(CommsHandle hComms, CompletionToken token, IdString_t * taskId);
CompletionToken EPDDLL_API BeginWriteTaskId_R3(CommsHandle hComms, IdString_t taskId, CompletionCallback callback);
int32_t EPDDLL_API EndWriteTaskId_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadTaskDatabaseId_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadTaskDatabaseId_R3(CommsHandle hComms, CompletionToken token, DatabaseId_t * dbid);
CompletionToken EPDDLL_API BeginWriteTaskDatabaseId_R3(CommsHandle hComms, DatabaseId_t dbid, CompletionCallback callback);
int32_t EPDDLL_API EndWriteTaskDatabaseId_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginClearWearerOrTaskId_R3(CommsHandle hComms, WearerAndTaskIdType_t ids[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndClearWearerOrTaskId_R3(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
* MK3 Graphics
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadGraphicSize_R3(CommsHandle hComms, uint16_t graphicId, CompletionCallback callback);
int32_t EPDDLL_API EndReadGraphicSize_R3(CommsHandle hComms, CompletionToken token, GraphicSize_t * size);
CompletionToken EPDDLL_API BeginClearGraphic_R3(CommsHandle hComms, uint16_t graphicId, CompletionCallback callback);
int32_t EPDDLL_API EndClearGraphic_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadGraphicData_R3(CommsHandle hComms, uint16_t graphicId, CompletionCallback callback);
int32_t EPDDLL_API EndReadGraphicData_R3(CommsHandle hComms, CompletionToken token, GraphicBitmap_t * data);
CompletionToken EPDDLL_API BeginWriteGraphicBitmap_R3(CommsHandle hComms, GraphicBitmap_t data, CompletionCallback callback);
int32_t EPDDLL_API EndWriteGraphicBitmap_R3(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
* MK3 Snapshot Summary
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadSnapshotSummary_R3(CommsHandle hComms, uint8_t snapshotNum, CompletionCallback callback);
int32_t EPDDLL_API EndReadSnapshotSummary_R3(CommsHandle hComms, CompletionToken token, Mk3SnapshotSummary_t * data);
CompletionToken EPDDLL_API BeginReadSnapshotMeasurements_R3(CommsHandle hComms, uint8_t snapshotNum, CompletionCallback callback);
int32_t EPDDLL_API EndReadSnapshotMeasurements_R3(CommsHandle hComms, CompletionToken token, Mk3SnapshotMeasurements_t * data);
CompletionToken EPDDLL_API BeginReadSnapshotCounters_R3(CommsHandle hComms, uint8_t snapshotNum, CompletionCallback callback);
int32_t EPDDLL_API EndReadSnapshotCounters_R3(CommsHandle hComms, CompletionToken token, Mk3SnapshotCounters_t * data);
CompletionToken EPDDLL_API BeginReadSnapshotAlarmThresholds_R3(CommsHandle hComms, uint8_t snapshotNum, CompletionCallback callback);
int32_t EPDDLL_API EndReadSnapshotAlarmThresholds_R3(CommsHandle hComms, CompletionToken token, Mk3SnapshotAlarmThresholds_t * data);
/********************************************************************************************************************************************
* MK3 Specific Dose Profile
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginWriteDoseProfileDoseIncrement_R3(CommsHandle hComms, float doseIncrement, CompletionCallback callback);
int32_t EPDDLL_API EndWriteDoseProfileDoseIncrement_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteDoseProfileMeasurands_R3(CommsHandle hComms, uint8_t ids[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteDoseProfileMeasurands_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadDoseProfileByIndex_R3(CommsHandle hComms, uint16_t start, uint16_t numRequested, CompletionCallback callback);
int32_t EPDDLL_API EndReadDoseProfileByIndex_R3(CommsHandle hComms, CompletionToken token, uint16_t * startIndex, DoseProfileRecord_t profile[], uint16_t length, uint16_t *count);
CompletionToken EPDDLL_API BeginReadDoseProfileConfiguration_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadDoseProfileConfiguration_R3(CommsHandle hComms, CompletionToken token, DoseProfileConfig_t * config);
CompletionToken EPDDLL_API BeginClearDoseProfile_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndClearDoseProfile_R3(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
* Other MK3 Specific Functions
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginEnableDeepSleep_R3(CommsHandle hComms, uint8_t onState, CompletionCallback callback);
int32_t EPDDLL_API EndEnableDeepSleep_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginEnableCovertMode_R3(CommsHandle hComms, uint8_t onState, CompletionCallback callback);
int32_t EPDDLL_API EndEnableCovertMode_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginEnableManufacturerLockout_R3(CommsHandle hComms, uint8_t onState, CompletionCallback callback);
int32_t EPDDLL_API EndEnableManufacturerLockout_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginEnableProtectedSession(CommsHandle hComms, uint8_t onState, CompletionCallback callback);
int32_t EPDDLL_API EndEnableProtectedSession(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginEnableResponderMode_R3(CommsHandle hComms, uint8_t onState, CompletionCallback callback);
int32_t EPDDLL_API EndEnableResponderMode_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginTriggerResponderMode_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndTriggerResponderMode_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadResponderTriggerUtc_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadResponderTriggerUtc_R3(CommsHandle hComms, CompletionToken token, uint32_t *utc);
CompletionToken EPDDLL_API BeginReadRunTime_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadRunTime_R3(CommsHandle hComms, CompletionToken token, uint32_t *seconds);
CompletionToken EPDDLL_API BeginWriteStayTime_R3(CommsHandle hComms, uint16_t minutes, CompletionCallback callback);
int32_t EPDDLL_API EndWriteStayTime_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadStayTime_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadStayTime_R3(CommsHandle hComms, CompletionToken token, uint16_t* minutes);
CompletionToken EPDDLL_API BeginWriteOffModeBatteryTestInterval_R3(CommsHandle hComms, uint16_t minutes, CompletionCallback callback);
int32_t EPDDLL_API EndWriteOffModeBatteryTestInterval_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadOffModeBatteryTestInterval_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadOffModeBatteryTestInterval_R3(CommsHandle hComms, CompletionToken token, uint16_t* minutes);
CompletionToken EPDDLL_API BeginWriteBatteryCriticalTiming_R3(CommsHandle hComms, uint16_t minutesToCritical, uint16_t minutesToShutdown, CompletionCallback callback);
int32_t EPDDLL_API EndWriteBatteryCriticalTiming_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadBatteryCriticalTiming_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadBatteryCriticalTiming_R3(CommsHandle hComms, CompletionToken token, uint16_t *minutesToCritical, uint16_t *minutesToShutdown);
CompletionToken EPDDLL_API BeginWriteBatteryTypeOverride_R3(CommsHandle hComms, int8_t batteryType, CompletionCallback callback);
int32_t EPDDLL_API EndWriteBatteryTypeOverride_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadBatteryTypeOverride_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadBatteryTypeOverride_R3(CommsHandle hComms, CompletionToken token, int8_t *batteryType);
CompletionToken EPDDLL_API BeginReadBatteryTypeFitted_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadBatteryTypeFitted_R3(CommsHandle hComms, CompletionToken token, int8_t *batteryType);
/********************************************************************************************************************************************
* MK3 Specific Access Level Functions
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadAccessPermissionsForLevel_R3(CommsHandle hComms, AccessLevel_t level, CompletionCallback callback);
int32_t EPDDLL_API EndReadAccessPermissionsForLevel_R3(CommsHandle hComms, uint16_t commandIds[], uint16_t length, uint16_t *numIds, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteAccessPermissionsForLevel_R3(CommsHandle hComms, AccessLevel_t level, uint16_t commandIds[], uint16_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteAccessPermissionsForLevel_R3(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
*
* Displays
*
********************************************************************************************************************************************/
/********************************************************************************************************************************************
*
* Display Quick Access List
*
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadQuickAccessDisplays_R3(CommsHandle hComms, uint8_t locationIndexes[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadQuickAccessDisplays_R3(CommsHandle hComms, CompletionToken token, QuickAccessDisplay_t displayIds[], uint8_t length, uint8_t * numDisplays);
CompletionToken EPDDLL_API BeginWriteQuickAccessDisplays_R3(CommsHandle hComms, QuickAccessDisplay_t displayIds[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteQuickAccessDisplays_R3(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
*
* Display Enables
*
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadDisplayEnables_R3(CommsHandle hComms, uint8_t menuIds[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadDisplayEnables_R3(CommsHandle hComms, CompletionToken token, DisplayAttributeMap_t enables[], uint8_t length, uint8_t * numItems);
CompletionToken EPDDLL_API BeginWriteDisplayEnables_R3(CommsHandle hComms, DisplayAttributeMap_t enables[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteDisplayEnables_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadDisplayEnablePermissions_R3(CommsHandle hComms, AccessLevel_t level, CompletionCallback callback);
int32_t EPDDLL_API EndReadDisplayEnablePermissions_R3(CommsHandle hComms, CompletionToken token, AccessLevel_t * level, uint16_t permissions[], uint8_t length, uint8_t * numMenus);
CompletionToken EPDDLL_API BeginWriteDisplayEnablePermissions_R3(CommsHandle hComms, AccessLevel_t level, uint16_t enables[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteDisplayEnablePermissions_R3(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
*
* Display Capabilities
*
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadDisplayCapability_R3(CommsHandle hComms, DisplayCapability_t capability, CompletionCallback callback);
int32_t EPDDLL_API EndReadDisplayCapability_R3(CommsHandle hComms, CompletionToken token, DisplayCapability_t* capabilityRequested, DisplayAttributeMap_t displayMaps[], uint8_t length, uint8_t * numItems);
/********************************************************************************************************************************************
*
* Off Mode Display
*
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginWriteOffModeDisplay_R3(CommsHandle hComms, OffModeDutyCycle dutyCycle, OffModeDisplayId_t offModeDispId, CompletionCallback callback);
int32_t EPDDLL_API EndWriteOffModeDisplay_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadOffModeDisplay_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadOffModeDisplay_R3(CommsHandle hComms, CompletionToken token, OffModeDutyCycle * dutyCycle, OffModeDisplayId_t * offModeDispId);
/********************************************************************************************************************************************
*
* Backlight
*
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginWriteBacklightEnable_R3(CommsHandle hComms, uint8_t enable, CompletionCallback callback);
int32_t EPDDLL_API EndWriteBacklightEnable_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadBacklightEnable_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadBacklightEnable_R3(CommsHandle hComms, CompletionToken token, uint8_t * enabled);
CompletionToken EPDDLL_API BeginTriggerBacklight_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndTriggerBacklight_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteSwitchOnFromButton_R3(CommsHandle hComms, uint8_t enable, CompletionCallback callback);
int32_t EPDDLL_API EndWriteSwitchOnFromButton_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadSwitchOnFromButton_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadSwitchOnFromButton_R3(CommsHandle hComms, CompletionToken token, uint8_t * enabled);
CompletionToken EPDDLL_API BeginWriteBacklightPeriod_R3(CommsHandle hComms, uint8_t seconds, CompletionCallback callback);
int32_t EPDDLL_API EndWriteBacklightPeriod_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadBacklightPeriod_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadBacklightPeriod_R3(CommsHandle hComms, CompletionToken token, uint8_t * seconds);
CompletionToken EPDDLL_API BeginWriteBacklightBrightness_R3(CommsHandle hComms, uint8_t level, CompletionCallback callback);
int32_t EPDDLL_API EndWriteBacklightBrightness_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadBacklightBrightness_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadBacklightBrightness_R3(CommsHandle hComms, CompletionToken token, uint8_t* level);
/********************************************************************************************************************************************
*
* Display Options
*
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginWriteDisplayOptionsLock_R3(CommsHandle hComms, uint8_t value, uint8_t mask, CompletionCallback callback);
int32_t EPDDLL_API EndWriteDisplayOptionsLock_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadDisplayOptionsLock_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadDisplayOptionsLock_R3(CommsHandle hComms, CompletionToken token, uint8_t * value);
// end of display group
/********************************************************************************************************************************************
*
* Alarm Configuration
*
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginWriteAlarmConfiguration_R3(CommsHandle hComms, AlarmConfig_t alarmConfigs[], uint16_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteAlarmConfiguration_R3(CommsHandle hComms, CompletionToken token);
__declspec(deprecated("BeginReadAlarmConfiguration_R3 is now deprecated. Use BeginReadAlarmConfiguration instead"))
CompletionToken EPDDLL_API BeginReadAlarmConfiguration_R3(CommsHandle hComms, AlarmConfigId alarmConfigIds[], uint16_t length, CompletionCallback callback);
__declspec(deprecated("EndReadAlarmConfiguration_R3 is now deprecated. Use EndReadAlarmConfiguration instead"))
int32_t EPDDLL_API EndReadAlarmConfiguration_R3(CommsHandle hComms, CompletionToken token, AlarmConfig_t alarmConfigs[], uint16_t length, uint16_t * numConfigs);
CompletionToken EPDDLL_API BeginWriteAlarmConfigurationLock_R3(CommsHandle hComms, AlarmConfig_t alarmConfigLocks[], uint16_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteAlarmConfigurationLock_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadAlarmConfigurationLock_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadAlarmConfigurationLock_R3(CommsHandle hComms, CompletionToken token, AlarmConfig_t alarmConfigLocks[], uint16_t length, uint16_t * numConfigs);
CompletionToken EPDDLL_API BeginReadMeasurandIds_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadMeasurandIds_R3(CommsHandle hComms, CompletionToken token, MeasurementId ids[], uint8_t length, uint8_t * numIds);
/********************************************************************************************************************************************
*
* Telemetry
*
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadTelemetryEnable_R3(CommsHandle hComms, uint8_t mode, CompletionCallback callback);
int32_t EPDDLL_API EndReadTelemetryEnable_R3(CommsHandle hComms, uint8_t *mode, uint8_t *enabled, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteTelemetryEnable_R3(CommsHandle hComms, uint8_t mode, uint8_t enabled, CompletionCallback callback);
int32_t EPDDLL_API EndWriteTelemetryEnable_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadTelemetryTxPower_R3(CommsHandle hComms, uint8_t mode, CompletionCallback callback);
int32_t EPDDLL_API EndReadTelemetryTxPower_R3(CommsHandle hComms, uint8_t *mode, int8_t *dBm, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteTelemetryTxPower_R3(CommsHandle hComms, uint8_t mode, int8_t dBm, CompletionCallback callback);
int32_t EPDDLL_API EndWriteTelemetryTxPower_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadTelemetryAdvContent_R3(CommsHandle hComms, uint8_t mode, CompletionCallback callback);
int32_t EPDDLL_API EndReadTelemetryAdvContent_R3(CommsHandle hComms, uint8_t *mode, uint8_t *advFlags, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteTelemetryAdvContent_R3(CommsHandle hComms, uint8_t mode, uint8_t advFlags, CompletionCallback callback);
int32_t EPDDLL_API EndWriteTelemetryAdvContent_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadTelemetryAdvConfig_R3(CommsHandle hComms, uint8_t mode, CompletionCallback callback);
int32_t EPDDLL_API EndReadTelemetryAdvConfig_R3(CommsHandle hComms, TeleAdvConfig_t *config, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteTelemetryAdvConfig_R3(CommsHandle hComms, TeleAdvConfig_t *config, CompletionCallback callback);
int32_t EPDDLL_API EndWriteTelemetryAdvConfig_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadTelemetryCxnConfig_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadTelemetryCxnConfig_R3(CommsHandle hComms, TeleCxnConfig_t *config, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteTelemetryCxnConfig_R3(CommsHandle hComms, TeleCxnConfig_t *config, CompletionCallback callback);
int32_t EPDDLL_API EndWriteTelemetryCxnConfig_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadTelemetryReportInterval_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadTelemetryReportInterval_R3(CommsHandle hComms, uint8_t *interval, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteTelemetryReportInterval_R3(CommsHandle hComms, uint8_t interval, CompletionCallback callback);
int32_t EPDDLL_API EndWriteTelemetryReportInterval_R3(CommsHandle hComms, CompletionToken token);
/*Debug Registers*/
CompletionToken EPDDLL_API BeginReadDebugRegister_R3(CommsHandle hComms, uint8_t registerId, CompletionCallback callback);
int32_t EPDDLL_API EndReadDebugRegister_R3(CommsHandle hComms, uint8_t *registerId, uint32_t *value, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteDebugRegister_R3(CommsHandle hComms, uint8_t registerId, uint32_t value, CompletionCallback callback);
int32_t EPDDLL_API EndWriteDebugRegister_R3(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
*
* MK3 Specific Zone Control
*
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginValidateEpdOwnerKey_R3(CommsHandle hComms, uint8_t encData[], CompletionCallback callback);
int32_t EPDDLL_API EndValidateEpdOwnerKey_R3(CommsHandle hComms, uint8_t *decData, CompletionToken token);
/********************************************************************************************************************************************
*
* MK3 Firmware Update
*
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginInitiateFirmwareUpdate_R3(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndInitiateFirmwareUpdate_R3(CommsHandle hComms, CompletionToken token);
//enkel 3.1
CompletionToken EPDDLL_API BeginTestLed_R3(CommsHandle hComms, float seconds, CompletionCallback callback);
int32_t EPDDLL_API EndTestLed_R3(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginTestVibe_R3(CommsHandle hComms, float seconds, CompletionCallback callback);
int32_t EPDDLL_API EndTestVibe_R3(CommsHandle hComms, CompletionToken token);
enum AlarmPatterns
{
PatNone = 0,
PatContinuousSingle = 1,
PatContinuousDualSlow = 2,
PatContinuousDualFast = 3,
PatIntermittentSingleSlow = 4,
PatIntermittentSingleFast = 5,
PatIntermittentDoubleSlow = 6,
PatIntermittentDoubleFast = 7,
PatIndustryDose = 14,
PatIndustryRate = 15
};
CompletionToken EPDDLL_API BeginTestSound_R3(CommsHandle hComms, AlarmPatterns pattern, BYTE volume, BYTE tone, float seconds, CompletionCallback callback);
int32_t EPDDLL_API EndTestSound_R3(CommsHandle hComms, CompletionToken token);
}
#endif

2131
EpdBase3/Epd3Base.cpp Normal file

File diff suppressed because it is too large Load diff

376
EpdBase3/Epd3Base.h Normal file
View file

@ -0,0 +1,376 @@
#pragma once
#pragma unmanaged
#include <windows.h>
#pragma unmanaged
#include "EpdCommon.h"
#include "Epd3.h"
#include "Epd2.h"
#include "../EpdBaseClr/EpdProgress.h"
#pragma unmanaged
#define MaxPeakRates 10
#define MaxSensitivities 10
#define MaxGains 10
#define MaxDoses 4
#define MaxCounts 6
#define MaxAlarmConfig 10
#define MaxTresholds 10
#define MaxSteps 50
#define MaxBatch 4
//ResponseTimeout was set to 2500 in code, but initial this was 500ms
#define ResponseTimeout 500
#define DiagnosticsWriteSize 256
namespace Epd3Base {
enum eFunctions {
ReadSensitivities, ReadGains, ReadDetectorThresholds, fReadDoses, ReadTotalDoses, ReadQualityData, ReadPeakRates, ClearTotalDose, ClearDose, ClearPeakRates, ClearFaultStatus, ClearLatchedAlarms, EpdOnOff, ReadAlarmConfiguration, ReadAlarmThresholds, WriteAlarmThresholds, WriteRateOffPercentage, DeissueEPD, SetBaselineCounters, WriteWearerId, ReadBaselineCounts, MfrLogin_R2, WriteSensitivities_R2, WriteSensitivities_R3, WriteGains_R3
, WriteAccessLevelAdmin, WriteAccessLevelOpen
, WriteQuickAccessDisplays_R3, WriteDisplayEnables_R3, WriteDisplayEnablePermissions_R3, WriteAlarmConfiguration_R3, WriteOffModeDisplay_R3, WriteSwitchOnFromButton_R3
, WriteChirpSensitivity, WriteChirpEnable_R3
, WriteRTC_R3
, ReadStatus, ReadEpdIdentities, ReadCounts, ReadWearerId, ReadRTC
, fDestroyReaderInterface
, fDisconnect , fDisconnectAndNotify
, fStartDiscover
, IssueEPD, EnableProtectedSession
, fCreateReaderInterface,fOpenReader
, TestVibe
};
class Epd3U
{
public:
char comPort[5] = { "COM4" };
CommsHandle epdComsHandle;
uint32_t CurrentDeviceID;
EpdGeneration EpdGen;
DiscoveryId Epd;
CompletionToken token, btoken[MaxBatch];
WORD port = 3;
const WORD MaxDevices = 10;
WORD DeviceCount = 0;
DWORD DeviceIDs[10];
int32_t StepReturnValues[MaxSteps][4];
int CurrentStep;
BYTE HasStepError = 0;
WORD WriteConfig32 = 1;
WORD Error = 0;
WORD ErrorStep = 0;
WORD ErrorSource;
WORD ErrorReason;
WORD ErrorData;
int ConnectRetries = 0;
int OpenRetries = 0;
BYTE isConnected = 0;
int32_t Dll3RV;
UINT16 EndSessionControl;
public:
//HANDLE hWaitTimer = 0;
HANDLE hCompletion = 0;
HANDLE hCancel = 0;
private:
WORD CommsInitialized = 0;
public:
Epd3U(int _comport);
~Epd3U();
DWORD StartCom();
void CancelAll();
void EndCom(bool doDiscon);
int StartDiscover(int tokentimeout);
int DiscoverStep;
enum DiscoverErrorCodes
{
DiscoverErrorNone = 0,
DiscoverErrorCancel = 1,
DiscoverErrorTimeout = 2,
DiscoverErrorOther=4,
DiscoverErrorConnecting=5
};
DiscoverErrorCodes DiscoverError;
EpdSteps EPDStep;
EpdStepResults EPDStepResult;
int EPDSubStep;
//OperatingStatus
BYTE DetectorsOn = 0;
BYTE EPDIssued = 0;
BYTE EPDLocked = 0;
BYTE EPDTesting = 0;
BYTE EPDProcSec = 0;
BYTE EPDFaulty = 0;
BYTE EPDTimeFault = 0;
//ErrorStatus
BYTE EPDNewFault = 0;
BYTE EPDComFault = 0;
BYTE EPDCalFault = 0;
BYTE EPDDetFault = 0;
BYTE EPDEprFault = 0;
BYTE EPDTrhFault = 0;
BYTE EPDOthFault = 0;
//AlarmStatus
BYTE AlarmDoseHP101G = 0;
BYTE AlarmDoseHP102G = 0;
BYTE AlarmDoseHP07N = 0;
BYTE AlarmRateHP101G = 0;
BYTE AlarmRateHP102G = 0;
BYTE AlarmRateHP07N = 0;
//OtherAlarm
BYTE OtherAlarmRateHp101G = 0;
BYTE OtherAlarmRateHp102G = 0;
BYTE OtherAlarmRateHp07N = 0;
BYTE OtherAlarmReturn = 0;
BYTE OtherAlarmBatLow = 0;
BYTE OtherAlarmCarrier = 0;
BYTE OtherAlarmBatVolt = 0;
//New fields
BYTE eDosDose07Warning = 0;
BYTE eDosDose07Alarm = 0;
BYTE eDosDose10Warning = 0;
BYTE eDosDose10Alarm = 0;
BYTE eDosRate07Warning = 0;
BYTE eDosRate07Alarm = 0;
BYTE eDosRate10Warning = 0;
BYTE eDosRate10Alarm = 0;
BYTE eDosBatteryWarning = 0;
BYTE eDosDoseAlarm = 0;
BYTE eDosRateAlarm = 0;
DWORD Password = 9;
//Identification
DWORD EpdID = 0;
WORD HardVersion, HardVersionMinor;
WORD SoftVersion;
WORD FunctionFlags;
DWORD EpdClock;
DWORD RealTime;
WORD IssueCount;
DWORD OffTime;
WORD OtherAlarms;
WORD EEPROMBadSectors;
EpdTypes EpdType = EpdTypes::Mk2Gamma;
bool isBG = false;
bool isNG = false;
bool VersionOK = false;
bool isMK3 = false;
bool hasAlarm = false;
bool hasFault = false;
bool StatusDecoded;
SYSTEMTIME tRealTime;
//Wearer
#define WearerIDLength 12
BYTE WearerID[(WearerIDLength)+1];
#define WearerNameLength 22
BYTE WearerName[WearerNameLength + 1];
// Dose
float Hp10Dose;
float Hp07Dose;
float Hp10Total;
float Hp07Total;
WORD Knocks;
WORD Resets;
WORD QualityData;
//Peaks
float Hp10Peak;
float Hp07Peak;
DWORD Hp10Time;
DWORD Hp07Time;
long long Hp10FTime,Hp07FTime;
//AlarmDoseTreshold
float Hp10THDose1;
float Hp10THDose2;
float Hp07THDoseA; //Alarm
float Hp07THDose;
float Hp10Rate1On;
float Hp10Rate2On;
float Hp07RateOn;
float Hp07RateAOn;
float Hp10Rate1Off;
float Hp10Rate2Off;
float Hp07RateOff;
float Hp07RateAOff;
float K1;
float K2;
float K3;
float K4;
float K5;
float K6;
float GainAn;
float GainFn;
uint32_t SG;
uint32_t BC;
uint32_t FB;
uint32_t HG;
DWORD D1;
DWORD D2;
DWORD D3;
DWORD D4;
DWORD CountsClock;
DWORD BaseD1;
DWORD BaseD2;
DWORD BaseD3;
DWORD BaseD4;
DWORD BaseCountsClock;
BYTE ConnectTimerFired;
OpStatusFlags OperatingStatus;
FaultStatusFlags ErrorStatus;
AlarmStatusFlags AlarmStatus;
StatusData_t epd3status;
uint8_t counterIds[MaxCounts]; //max 6 for mk3
uint8_t counterIdLen;
MeasurementId mIDs[MAX_MEASUREMENTS];
uint8_t nmIDs = 0;
MeasValue_t doses[MaxDoses];
MeasValue_t totdoses[MaxDoses];
PeakRate_t peakRates[MaxPeakRates];
AlarmConfig_t alarmConfig[MaxAlarmConfig];
CalSensitivity_t sensitivities[MaxSensitivities];
CalGain_t gains[MaxGains];
Counter_t Counts[MaxCounts];
uint8_t countsRead;
uint32_t seconds;
uint8_t numDoses, numtotDoses, numRates, numSensitivities, numTresholds, numGains;
uint16_t numAlarm;
uint32_t utc;
Mk3QualityData_t quality;
Mk3AlarmThresholds_t hp07tresholds;
Mk3RatePercentage_t RatePct[2];
Mk3AlarmThresholds_t hp10tresholds;
DetectorThreshold_t dTresholds[MaxTresholds];
DisplayAttributeMap_t* enables;
uint8_t numItems;
QuickAccessDisplay_t* displayIds;
uint8_t numDisplays;
AlarmConfig_t* alarmConfigIds;
uint16_t alarmConfigLen = 20;
OffModeDutyCycle dutyCycle;
OffModeDisplayId_t offModeDispId;
uint8_t OnOfenabled;
EncryptionKey EC { 0xE7 ,0xD3 ,0xE7 ,0x69 ,0xF3 ,0xF5 ,0x93 ,0xDA ,0xDC ,0xB8 ,0x63 ,0x4C ,0xC5 ,0xB0 ,0x9F ,0xC9 ,0x0D ,0xD3 ,0xA6 ,0x1C ,0x4A ,0x06 ,0xA7 ,0x9C ,0xB0 ,0x92 ,0x36 ,0x62 ,0xFE ,0x6F ,0xAE ,0x6B };
uint8_t ECLen=32;
//Functions
int OpenDev(DiscoveryId DeviceID);
int ReOpenDev();
int DisCon(UINT16 alarm);
int DisconnectAndConnect();
void CloseDev(bool CloseAll);
void DecodeStatus();
int SetTime();
int ReadStatusOnly(void);
int ReadStatus(bool statusOnly);
protected:
void decodeCounters(int count);
void decodeBaseCounters(int count);
void decodeTreshold(Mk3AlarmThresholds_t* th);
void encodeTreshold(Mk3AlarmThresholds_t* th);
void decodedTresholds(int numdTresholds);
void decodeSensitivities(int count);
void decodeGains(int count);
void decodetotDoses(int count);
void decodeDoses(int count);
void decodePeakRates(int count);
public:
int SetFunctionReturnValue(eFunctions f, BYTE CanIgnore);
void SetCommitReturnValue(int rv);
void SetCommitReturnValue(int step, int rv);
uint32_t SetEndReturnValue(int rv);
uint32_t SetEndReturnValue(int step, int rv);
int32_t CommitAndSetRV();
int32_t CommitAndSetRV(int idx[], int len);
int32_t CommitAndEnd2RV(int32_t (WINAPI *endFunction2)(CommsHandle hComms, CompletionToken token), CompletionToken token);
int32_t End2RV(int step, int32_t(WINAPI* endFunction2)(CommsHandle hComms, CompletionToken token), CompletionToken token);
int GetAll(bool Closeconnection);
int GetAllDeissue(bool reconnect);
int IssueAndCheck(float gain, float ChirpRate);
int SetChirp(float Sensitivity);
WORD ReadCal();
WORD ReadSensitivitiesAndTresholds();
WORD ReadDoses();
int ClearDoses();
int ClearAlarms();
WORD ReadAlarmConfig();
int ConnectAndStatus(int tokenSourceTimeout);
WORD ReadAlarmTresholds();
WORD WriteAlarmTresholds();
WORD DeIssue();
WORD WriteWearer();
WORD Issue(bool Preparedone);
WORD EPDReadExtraStatus();
WORD WriteCal();
WORD PrepareForIssue();
private:
int WriteConfig(void);
void ResetStepReturnValues();
public:
char DiagnosticsWrite[DiagnosticsWriteSize];
typedef void (*ProgressCallback)(EpdSteps percentage, EpdStepResults result);
ProgressCallback progressCallback;
void test();
};
}

BIN
EpdBase3/Epd3Base.rc Normal file

Binary file not shown.

10
EpdBase3/EpdBase3.cpp Normal file
View file

@ -0,0 +1,10 @@
// EpdBase3.cpp : Defines the functions for the static library.
//
#include "pch.h"
#include "framework.h"
// TODO: This is an example of a library function
void fnEpdBase3()
{
}

188
EpdBase3/EpdBase3.vcxproj Normal file
View file

@ -0,0 +1,188 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{e6bb4f4e-4774-4fe3-b341-7f4c24dc61e7}</ProjectGuid>
<RootNamespace>EpdBase3</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>Epd3Base</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<CustomBuildAfterTargets />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PreprocessToFile>false</PreprocessToFile>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="CommonEpdTypes.h" />
<ClInclude Include="Epd2.h" />
<ClInclude Include="Epd3.h" />
<ClInclude Include="Epd3Base.h" />
<ClInclude Include="EpdCommon.h" />
<ClInclude Include="EpdProgress.h" />
<ClInclude Include="framework.h" />
<ClInclude Include="Mk3Types.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="TimeFunctions.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Epd3Base.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="TimeFunctions.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Epd3Base.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="framework.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="pch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="CommonEpdTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Epd2.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Epd3.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Epd3Base.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Mk3Types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="EpdCommon.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="TimeFunctions.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="EpdProgress.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Epd3Base.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TimeFunctions.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Epd3Base.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

321
EpdBase3/EpdCommon.h Normal file
View file

@ -0,0 +1,321 @@
#ifndef epd_common_h
#define epd_common_h
#ifndef WINAPI
#define WINAPI __stdcall
#endif
#ifdef READER3_EXPORTS
#define EPDDLL_API __declspec(dllexport) WINAPI
#else
#define EPDDLL_API __declspec(dllimport) WINAPI
#endif
#include <stdint.h>
#include "Mk3Types.h"
// Grouping for Doxygen comments and function descriptions
// Documentation for method return codes
extern "C"
{
const int r_OK = 0;
const int r_UnknownError = -1;
const int r_InvalidCommsHandle = -2;
const int r_InvalidPortName = -3;
const int r_PortAlreadyOpen = -4;
const int r_PortClosed = -5;
const int r_OperationFailed = -6;
const int r_InvalidState = -7;
const int r_InvalidCompletionToken = -8;
const int r_OperationTimeout = -9;
const int r_UnknownCmd = -100;
const int r_InvalidParam = -101;
const int r_InsufficientPriv = -102;
const int r_UnsupportedOp = -103;
const int r_FunctionFail = -104;
const int r_InvalidOp = -105;
const int r_IncompleteCommand = -106;
const int r_ResponseTooBig = -107; //response exceeded single frame length
const int r_ErrorBadStoredData = -108;
const int r_InvalidResponseDataLength = -109;
const int r_PayloadTooBig = -110;
const int r_ParseFailure = -111;
const int r_EEPROMWriteFailure = -112;
const int r_Busy = -113;
//These are Mk2 errors
const int r_EEPROMReadFailure = -121;
const int r_WearerNameMismatch = -122;
const int r_DataTooLongForBuffer = -123;
// Error codes generated within DLL
const int r_ErrorUnexpectedResponse = -200;
const int r_ErrorNotProcessed = -201; //command not processed due to previous failure
const int r_ErrorNotConnected = -202;
const int r_ErrorUserCancelled = -203;
typedef void* CommsHandle;
typedef void* CompletionToken;
typedef void(WINAPI *DiscoveryCallback)(CommsHandle hComms, DiscoveryId const discovered[], int32_t count);
typedef void(WINAPI *CompletionCallback)(CommsHandle hComms, CompletionToken token);
typedef void(WINAPI *ConnectCallback)(CommsHandle hComms, DiscoveryId id);
typedef void(WINAPI *DisconnectCallback)(CommsHandle hComms, DiscoveryId id);
typedef void(WINAPI *RemovedCallback)(CommsHandle hComms, DiscoveryId id);
/********************************************************************************************************************************************
*
* Interface Setup & Tear down
*
********************************************************************************************************************************************/
CommsHandle EPDDLL_API CreateReaderInterface();
int32_t EPDDLL_API DestroyReaderInterface(CommsHandle hComms);
int32_t EPDDLL_API OpenReader(CommsHandle hComms, char* portName);
int32_t EPDDLL_API CloseReader(CommsHandle hComms);
/********************************************************************************************************************************************
*
* Interface configuration
*
********************************************************************************************************************************************/
int32_t EPDDLL_API SetDllLogLevel(CommsHandle hComms, uint32_t level);
int32_t EPDDLL_API GetDllLogLevel(CommsHandle hComms, uint32_t* level);
int32_t EPDDLL_API SetResponseTimeout(CommsHandle hComms, uint32_t ms);
int32_t EPDDLL_API GetResponseTimeout(CommsHandle hComms, uint32_t* ms);
int32_t EPDDLL_API SetRetryCount(CommsHandle hComms, uint32_t retries);
int32_t EPDDLL_API GetRetryCount(CommsHandle hComms, uint32_t* retries);
int32_t EPDDLL_API SetMultipleDiscoveryMode(CommsHandle hComms, bool state);
int32_t EPDDLL_API GetMultipleDiscoveryMode(CommsHandle hComms, bool *state);
int32_t EPDDLL_API SetDiscoveryTimeslots(CommsHandle hComms, uint32_t slots);
int32_t EPDDLL_API GetDiscoveryTimeslots(CommsHandle hComms, uint32_t *slots);
int32_t EPDDLL_API SetDiscoveryCacheTimeout(CommsHandle hComms, uint32_t ms);
int32_t EPDDLL_API GetDiscoveryTimeout(CommsHandle hComms, uint32_t *ms);
/********************************************************************************************************************************************
*
* General Stack Operation, Discovery, Connection Management etc
*
********************************************************************************************************************************************/
int32_t EPDDLL_API Commit3(CommsHandle hComms);
int32_t EPDDLL_API CommitAndWait(CommsHandle hComms);
int32_t EPDDLL_API Cancel(CommsHandle hComms);
int32_t EPDDLL_API StartDiscovery(CommsHandle hComms, DiscoveryCallback callback);
int32_t EPDDLL_API StopDiscovery(CommsHandle hComms);
int32_t EPDDLL_API GetDiscoveredEpds(CommsHandle hComms, DiscoveryId discovered[], uint32_t size, uint32_t* count);
int32_t EPDDLL_API Connect3(CommsHandle hComms, DiscoveryId epd, bool wait = false);
int32_t EPDDLL_API Disconnect(CommsHandle hComms);
int32_t EPDDLL_API DisconnectAndNotify(CommsHandle hComms, uint16_t alarmConfig, uint16_t duration);
int32_t EPDDLL_API SetConnectCallback(CommsHandle hComms, ConnectCallback callback);
int32_t EPDDLL_API SetDisconnectCallback(CommsHandle hComms, DisconnectCallback callback);
int32_t EPDDLL_API AwaitRemoval(CommsHandle hComms, DiscoveryId epd, bool wait=false);
int32_t EPDDLL_API SetRemovedCallback(CommsHandle hComms, RemovedCallback callback);
int32_t EPDDLL_API GetErrorCode();
/********************************************************************************************************************************************
* Real Time Clock
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadRTC(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadRTC(CommsHandle hComms, CompletionToken token, uint32_t* rtc);
/********************************************************************************************************************************************
* Common Counts Acquisition
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadCounts(CommsHandle hComms, uint8_t counterIds[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadCounts(CommsHandle hComms, CompletionToken token, Counter_t counts[], uint8_t length, uint8_t * numCounts, uint32_t * utc, uint32_t * secondsSinceBaseline);
CompletionToken EPDDLL_API BeginReadBaselineCounts(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadBaselineCounts(CommsHandle hComms, CompletionToken token, Counter_t counts[], uint8_t length, uint32_t * timestamp, uint8_t * numCounts);
CompletionToken EPDDLL_API BeginSetBaselineCounters(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndSetBaselineCounters(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginStartDetectorTest(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndStartDetectorTest(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadSelfTestInterval(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadSelfTestInterval(CommsHandle hComms, CompletionToken token, uint16_t * minutes);
CompletionToken EPDDLL_API BeginWriteSelfTestInterval(CommsHandle hComms, uint16_t minutes, CompletionCallback callback);
int32_t EPDDLL_API EndWriteSelfTestInterval(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteChirpSensitivity(CommsHandle hComms, float sensitivity, CompletionCallback callback);
int32_t EPDDLL_API EndWriteChirpSensitivity(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadChirpSensitivity(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadChirpSensitivity(CommsHandle hComms, CompletionToken token, float * sensitivity);
/********************************************************************************************************************************************
*
* Common Calibration
*
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginWriteFactoryCalDate(CommsHandle hComms, uint32_t utc, CompletionCallback callback);
int32_t EPDDLL_API EndWriteFactoryCalDate(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadFactoryCalDate(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadFactoryCalDate(CommsHandle hComms, CompletionToken token, uint32_t* utc);
CompletionToken EPDDLL_API BeginWriteCalDueDate(CommsHandle hComms, uint32_t utc, CompletionCallback callback);
int32_t EPDDLL_API EndWriteCalDueDate(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadCalDueDate(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadCalDueDate(CommsHandle hComms, CompletionToken token, uint32_t* utc);
CompletionToken EPDDLL_API BeginReadSensitivities(CommsHandle hComms, uint8_t sensIds[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadSensitivities(CommsHandle hComms, CompletionToken token, CalSensitivity_t sensitivities[], uint8_t length, uint8_t * numSensitivities);
CompletionToken EPDDLL_API BeginReadDetectorThresholds(CommsHandle hComms, uint8_t counterIds[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadDetectorThresholds(CommsHandle hComms, CompletionToken token, DetectorThreshold_t thresholds[], uint8_t length, uint8_t * numThresholds);
CompletionToken EPDDLL_API BeginReadGains(CommsHandle hComms, uint8_t sensIds[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadGains(CommsHandle hComms, CompletionToken token, CalGain_t gains[], uint8_t length, uint8_t * numGains);
/********************************************************************************************************************************************
*
* Common Dose Measurements
*
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadDoses(CommsHandle hComms, uint8_t ids[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadDoses(CommsHandle hComms, CompletionToken token, MeasValue_t doses[], uint8_t length, uint8_t * numDoses, uint32_t * utc);
CompletionToken EPDDLL_API BeginReadTotalDoses(CommsHandle hComms, uint8_t ids[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadTotalDoses(CommsHandle hComms, CompletionToken token, MeasValue_t doses[], uint8_t length, uint8_t * numDoses, uint32_t * utc);
CompletionToken EPDDLL_API BeginClearDose(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndClearDose(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginClearTotalDose(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndClearTotalDose(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginClearPeakRates(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndClearPeakRates(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteDoses(CommsHandle hComms, MeasValue_t doses[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteDoses(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteTotalDoses(CommsHandle hComms, MeasValue_t doses[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteTotalDoses(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadRates(CommsHandle hComms, uint8_t ids[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadRates(CommsHandle hComms, CompletionToken token, MeasValue_t rates[], uint8_t length, uint8_t * numRates, uint32_t * utc);
CompletionToken EPDDLL_API BeginReadPeakRates(CommsHandle hComms, uint8_t ids[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadPeakRates(CommsHandle hComms, CompletionToken token, PeakRate_t rates[], uint8_t length, uint8_t * numRates);
CompletionToken EPDDLL_API BeginReadQualityData(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadQualityData(CommsHandle hComms, CompletionToken token, Mk3QualityData_t * quality);
/********************************************************************************************************************************************
* Common Alarm Thresholds
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadAlarmThresholds(CommsHandle hComms, uint8_t measurandId, uint8_t thresholdIds[], uint8_t numThresholds, CompletionCallback callback);
int32_t EPDDLL_API EndReadAlarmThresholds(CommsHandle hComms, CompletionToken token, Mk3AlarmThresholds_t * thresholds);
CompletionToken EPDDLL_API BeginWriteAlarmThresholds(CommsHandle hComms, uint8_t measurandId, uint8_t numThresholds, Mk3AlarmThreshold_t thresholds[], CompletionCallback callback);
int32_t EPDDLL_API EndWriteAlarmThresholds(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadRateOffPercentage(CommsHandle hComms, uint8_t measurandIds[], uint8_t numThresholds, CompletionCallback callback);
int32_t EPDDLL_API EndReadRateOffPercentage(CommsHandle hComms, CompletionToken token, Mk3RatePercentage_t offThresholds[], uint8_t length, uint8_t * numThresholds);
CompletionToken EPDDLL_API BeginWriteRateOffPercentage(CommsHandle hComms, Mk3RatePercentage_t thresholds[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteRateOffPercentage(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
* Common General Management
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginEpdOnOff(CommsHandle hComms, uint8_t onState, CompletionCallback callback);
int32_t EPDDLL_API EndEpdOnOff(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
* Common EPD Status
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadStatus(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadStatus(CommsHandle hComms, CompletionToken token, StatusData_t * status);
CompletionToken EPDDLL_API BeginClearFaultStatus(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndClearFaultStatus(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginClearLatchedAlarms(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndClearLatchedAlarms(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginClearAllStatus(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndClearAllStatus(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
* Common Wearer Identity
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadWearerId(CommsHandle hComms, uint16_t type, CompletionCallback callback);
int32_t EPDDLL_API EndReadWearerId(CommsHandle hComms, CompletionToken token, IdString_t * wearerId);
CompletionToken EPDDLL_API BeginWriteWearerId(CommsHandle hComms, IdString_t wearerId, CompletionCallback callback);
int32_t EPDDLL_API EndWriteWearerId(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
* Common Issue & Return
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginIssueEPD(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndIssueEPD(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginDeissueEPD(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndDeissueEPD(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
* Common Identities
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadEpdIdentities(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadEpdIdentities(CommsHandle hComms, CompletionToken token, uint32_t * epdId, EpdTypes * epdType, uint32_t * capabilities,
MarkNumber_t * markNumber, VersionNumber_t * firmwareVersion, char* vcsRevBuf, uint32_t buflen);
CompletionToken EPDDLL_API BeginWriteEpdSerialNumber(CommsHandle hComms, uint32_t epdId, CompletionCallback callback);
int32_t EPDDLL_API EndWriteEpdSerialNumber(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadEpdSerialNum(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadEpdSerialNum(CommsHandle hComms, CompletionToken token, uint32_t* epdSerialNum);
CompletionToken EPDDLL_API BeginReadCapabilities(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadCapabilities(CommsHandle hComms, CompletionToken token, uint32_t* capabilities);
CompletionToken EPDDLL_API BeginReadMarkNumber(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadMarkNumber(CommsHandle hComms, CompletionToken token, MarkNumber_t * markNumber);
CompletionToken EPDDLL_API BeginReadEpdType(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadEpdType(CommsHandle hComms, CompletionToken token, EpdTypes * epdType);
CompletionToken EPDDLL_API BeginReadFirmwareVersion(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadFirmwareVersion(CommsHandle hComms, CompletionToken token, VersionNumber_t * version);
/********************************************************************************************************************************************
* Common General Configuration
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginWriteDoseWritableFlag(CommsHandle hComms, uint8_t enabled, CompletionCallback callback);
int32_t EPDDLL_API EndWriteDoseWritableFlag(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteClearDoseOnSwitchOn(CommsHandle hComms, uint8_t enable, CompletionCallback callback);
int32_t EPDDLL_API EndWriteClearDoseOnSwitchOn(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginWriteReturnForReadTime(CommsHandle hComms, uint32_t utc, CompletionCallback callback);
int32_t EPDDLL_API EndWriteReturnForReadTime(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadReturnForReadTime(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadReturnForReadTime(CommsHandle hComms, CompletionToken token, uint32_t* utc);
CompletionToken EPDDLL_API BeginReadAlarmConfiguration(CommsHandle hComms, AlarmConfigId alarmConfigIds[], uint16_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadAlarmConfiguration(CommsHandle hComms, CompletionToken token, AlarmConfig_t alarmConfigs[], uint16_t length, uint16_t * numConfigs);
/********************************************************************************************************************************************
* Common Dose Profile
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginWriteDoseProfileInterval(CommsHandle hComms, uint16_t interval, CompletionCallback callback);
int32_t EPDDLL_API EndWriteDoseProfileInterval(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadDoseProfileInterval(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadDoseProfileInterval(CommsHandle hComms, CompletionToken token, uint16_t * interval);
CompletionToken EPDDLL_API BeginReadDoseProfileByTime(CommsHandle hComms, uint32_t startTime, uint32_t endTime, CompletionCallback callback);
int32_t EPDDLL_API EndReadDoseProfileByTime(CommsHandle hComms, CompletionToken token, DoseProfileRecord_t * profile[], uint16_t *count);
void EPDDLL_API CleanUpReadDoseProfile(DoseProfileRecord_t * profile);
/********************************************************************************************************************************************
* Common Event Log
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadEventsByIndex(CommsHandle hComms, uint8_t start, uint8_t requested, CompletionCallback callback = nullptr);
int32_t EPDDLL_API EndReadEventsByIndex(CommsHandle hComms, CompletionToken token, EventLog * logs[], uint8_t *count);
void EPDDLL_API CleanUpReadEventLog(EventLog * logs);
/********************************************************************************************************************************************
* Common Scratchpad
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadScratchPad(CommsHandle hComms, uint16_t startAddress, uint16_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadScratchpad(CommsHandle hComms, CompletionToken token, uint16_t *address, uint8_t buffer[], uint16_t length, uint16_t* read);
CompletionToken EPDDLL_API BeginWriteScratchPad(CommsHandle hComms, uint16_t startAddress, uint8_t buffer[], uint16_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteScratchpad(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadScratchpadSize(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadScratchpadSize(CommsHandle hComms, CompletionToken token, uint16_t* size);
CompletionToken EPDDLL_API BeginClearScratchPad(CommsHandle hComms, uint8_t fillChar, CompletionCallback callback);
int32_t EPDDLL_API EndClearScratchpad(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
* Common EEProm
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginReadEEProm(CommsHandle hComms, uint16_t startAddress, uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndReadEEProm(CommsHandle hComms, CompletionToken token, uint16_t *address, uint8_t buffer[], uint8_t length, uint8_t* read);
CompletionToken EPDDLL_API BeginWriteEEProm(CommsHandle hComms, uint16_t startAddress, uint8_t buffer[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteEEProm(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
* Common Access level
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginWriteAccessLevel(CommsHandle hComms, AccessLevel_t level, EncryptionKey key, uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteAccessLevel(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadCurrentAccessLevel(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadCurrentAccessLevel(CommsHandle hComms, CompletionToken token, AccessLevel_t * level);
CompletionToken EPDDLL_API BeginWriteAccessKey(CommsHandle hComms, AccessLevel_t level, EncryptionKey key, int8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteAccessKey(CommsHandle hComms, CompletionToken token);
/********************************************************************************************************************************************
* Common Battery Management
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginWriteBatteryTestInterval(CommsHandle hComms, uint16_t minutes, CompletionCallback callback);
int32_t EPDDLL_API EndWriteBatteryTestInterval(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadBatteryTestInterval(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadBatteryTestInterval(CommsHandle hComms, CompletionToken token, uint16_t* minutes);
CompletionToken EPDDLL_API BeginWriteBatteryLowThreshold(CommsHandle hComms, int8_t batteryType, uint16_t mV, CompletionCallback callback);
int32_t EPDDLL_API EndWriteBatteryLowThreshold(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadBatteryLowThreshold(CommsHandle hComms, int8_t batteryType, CompletionCallback callback);
int32_t EPDDLL_API EndReadBatteryLowThreshold(CommsHandle hComms, CompletionToken token, int8_t* batteryType, uint16_t* mV );
CompletionToken EPDDLL_API BeginReadVoltages(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadVoltages(CommsHandle hComms, CompletionToken token, uint16_t* vbat0, uint16_t* vbat1, uint16_t* vcpu);
/********************************************************************************************************************************************
* Common User Inteface
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginWriteDisplayOptions(CommsHandle hComms, uint8_t value, uint8_t mask, CompletionCallback callback);
int32_t EPDDLL_API EndWriteDisplayOptions(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadDisplayOptions(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadDisplayOptions(CommsHandle hComms, CompletionToken token, uint8_t * value);
CompletionToken EPDDLL_API BeginWriteDisplayTimeout(CommsHandle hComms, uint8_t seconds, CompletionCallback callback);
int32_t EPDDLL_API EndWriteDisplayTimeout(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadDisplayTimeout(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadDisplayTimeout(CommsHandle hComms, CompletionToken token, uint8_t* seconds);
/********************************************************************************************************************************************
* Common Zone Control
********************************************************************************************************************************************/
CompletionToken EPDDLL_API BeginWriteZoneControlMap(CommsHandle hComms, uint8_t map[], uint8_t mask[], CompletionCallback callback);
int32_t EPDDLL_API EndWriteZoneControlMap(CommsHandle hComms, CompletionToken token);
CompletionToken EPDDLL_API BeginReadZoneControlMap(CommsHandle hComms, CompletionCallback callback);
int32_t EPDDLL_API EndReadZoneControlMap(CommsHandle hComms, CompletionToken token, uint8_t map[]);
CompletionToken EPDDLL_API BeginReadZoneAccessPermitted(CommsHandle hComms, uint8_t zone, CompletionCallback callback);
int32_t EPDDLL_API EndReadZoneAccessPermitted(CommsHandle hComms, CompletionToken token, bool *permitted);
}
#endif

29
EpdBase3/EpdProgress.h Normal file
View file

@ -0,0 +1,29 @@
#pragma once
//enum EpdSteps
//{
// StepTest=0,
// StepStartCom=1,
//
// StepInitialized=2,
// StepDiscovering=3,
//
// StepConnecting=4,
// StepReadStatus=5,
// StepReadIdentities=6,
// StepReadCounts=7,
// StepReadRTC=8 ,
// StepReadWearerId=9,
// StepPrepareIssue = 10,
// StepIssue=11,
// StepDeIssue=12
//
//};
//
//enum EpdStepResults
//{
// None=0,
// Started=1,
// OK=2,
// Error
//
//};

586
EpdBase3/Mk3Types.h Normal file
View file

@ -0,0 +1,586 @@
#ifndef Mk3Types_h
#define Mk3Types_h
#include <stdint.h>
#include "CommonEpdTypes.h"
#include <vector>
#define MAX_COUNTERS 6
// Mk3 Measurands
#define MK3_MEAS_HP10 0
#define MK3_MEAS_HP07 1
#define MK3_MEAS_HP10G 2
#define MK3_MEAS_HP10N 3
enum class CounterType : uint16_t
{
Counter_Hg1 = 0, // MK2 HG
Counter_Hg2 = 1,
Counter_Sg1 = 2, // Mk2 SG
Counter_Sg2 = 3, // Mk2 BC
Counter_Sg3 = 4,
Counter_Fb1 = 5, // Mk2 FB
Counter_Fb2 = 6,
Counter_An1 = 7,
Counter_Fn2 = 8
};
#define MAX_DET_THRESHOLDS MAX_COUNTERS
#pragma pack (push)
#pragma pack (1)
typedef struct
{
uint16_t eventId;
uint16_t info;
uint32_t timestamp;
}EventLog;
typedef struct
{
uint16_t type;
uint32_t value;
}Counter_t;
typedef struct
{
uint16_t type;
uint16_t value;
}DetectorThreshold_t;
typedef struct
{
CounterType id;
uint16_t scaledDeadTime;
uint16_t scaledCoefficient;
}DeadTimeCoefficient_t;
typedef struct
{
CounterType id;
uint8_t value;
}DetectorTestLimit_t;
typedef struct
{
uint16_t type;
uint16_t va;
uint16_t vb;
}DetectorThresholdLimit_t;
enum class OffModeDutyCycle :uint8_t
{
Off = 0,
On = 1,
Pct50 = 2,
Pct33 = 3,
Pct25 = 4,
Pct10 = 5,
NoChange = 255
};
enum class SensitivityId
{
//Hp10 Gamma contributors
Hg1Sens10G = 0, // Mk2 HGSens10 (K1)
Hg2Sens10G = 1,
Sg1Sens10G = 2, // Mk2 SGSens10 (K2)
Sg2Sens10G = 3,
Sg3Sens10G = 4,
//Hp10 Neutron contributors
//Hp07 Gamma contributors
Hg1Sens07G = 5, // Mk2 HGSens07 (K3)
Hg2Sens07G = 6,
Sg1Sens07G = 7, // Mk2 SGSens07 (K4)
Sg2Sens07G = 8,
Sg3Sens07G = 9,
//Hp07 Beta contributors
Fb1Sens07B = 10, // Mk2 FBSens07 (K5)
Fb2Sens07B = 11,
Sg2Sens07B = 12, // Mk2 BCSens07 (K6)
Sg3Sens07B = 13,
//Neutron
An1Sens10N = 14,
Fn1Sens10N = 15,
Fn2Sens10N = 16,
MaxSensitivity
};
#define MAX_SENSITIVITIES ((uint16_t)SensitivityId::MaxSensitivity)
#define LAST_SENSITIVITY (((uint16_t)SensitivityId::MaxSensitivity) - 1)
enum class MeasurementId : uint16_t
{
Meas_Hp10,
Meas_Hp07,
Meas_Hp10G,
Meas_Hp10N
};
#define MAX_MEASUREMENTS 4
enum class ThresholdId
{
Thres_DoseAlarm = 0,
Thres_DoseWarning = 1,
Thres_RateAlarm = 2,
Thres_RateWarning = 3
};
#define MAX_ALM_THRESHOLDS 4
enum class WearerIdType
{
WearerId_Name,
WearerId_Primary,
WearerId_Id2,
WearerId_Id3
};
#define MAX_WEARER_ID_TYPES 4
enum class TaskIdType
{
Task_Name,
Task_Primary
};
#define MAX_TASK_ID_TYPES 2
enum class WearerAndTaskIdType_t : uint16_t
{
WearerId_Name,
WearerId_Primary,
WearerId_Id2,
WearerId_Id3,
TaskName,
TaskID,
WearerDBID,
TaskDBID
};
#define MAX_WEARER_TASK_ID_TYPES 8
typedef struct
{
uint8_t RecordType;
uint8_t Measurand;
int32_t TimeStamp;
uint32_t Value;
}DoseProfileRecord_t;
typedef struct
{
float DoseIncrement;
uint16_t Interval;
uint16_t NumberOfMeasurands;
MeasurementId Enables[MAX_MEASUREMENTS];
}DoseProfileConfig_t;
typedef struct
{
uint16_t id;
float value;
}CalSensitivity_t;
typedef struct
{
uint16_t id;
float value;
}CalGain_t;
typedef struct
{
uint16_t id;
float value;
}MeasValue_t;
typedef struct
{
uint16_t id;
float value;
uint32_t timestamp;
}PeakRate_t;
typedef struct
{
uint32_t Utc;
uint16_t NumberOfMeasurands;
MeasValue_t Measurements[MAX_MEASUREMENTS];
}MeasurandDoseOrRate_t;
typedef struct
{
uint8_t Major;
uint8_t Minor;
uint8_t Patch;
uint16_t Build;
}VersionNumber_t;
typedef struct MarkNumberTag
{
uint8_t Major;
uint8_t Minor;
uint8_t Revision;
uint8_t Build;
} MarkNumber_t;
#define PART_NUM_LENGTH 10
typedef uint8_t PartNumber_t[PART_NUM_LENGTH];
#define PCB_PART_NUM_LENGTH 14
typedef uint8_t PcbPartNumber_t[PCB_PART_NUM_LENGTH];
#define FIRMWARE_PART_NUM_LENGTH 16
typedef uint8_t FirmwarePartNumber_t[FIRMWARE_PART_NUM_LENGTH];
#define MODEL_NAME_LENGTH 32
typedef struct ModelNameTag
{
uint8_t Name[MODEL_NAME_LENGTH];
} ModelName_t;
#define CAL_PROCESS_LENGTH 12
typedef struct CalProcessTag
{
uint8_t Process[CAL_PROCESS_LENGTH];
} CalProcess_t;
#define CAL_FACILITY_LENGTH 8
typedef struct CalFacilityTag
{
uint8_t Name[CAL_FACILITY_LENGTH];
} CalFacility_t;
#define MAX_ID_STRING_LENGTH 64
typedef struct IdStringTag
{
uint16_t IdType;
uint16_t Length;
uint8_t Utf8String[MAX_ID_STRING_LENGTH];
} IdString_t;
#define DB_ID_LENGTH 16
typedef struct DbIdTag
{
uint8_t Id[DB_ID_LENGTH];
} DatabaseId_t;
#define MAX_GRAPHIC_WIDTH 112
#define MAX_GRAPHIC_HEIGHT 24
#define MAX_GRAPHIC_PIXELS (MAX_GRAPHIC_WIDTH * MAX_GRAPHIC_HEIGHT)
#define MAX_GRAPHIC_ID 1
#define MAX_GRAPHIC_BYTES ((MAX_GRAPHIC_PIXELS)/8)
typedef struct GraphicSizeTag
{
uint16_t Id;
uint16_t Height;
uint16_t Width;
} GraphicSize_t;
typedef struct
{
GraphicSize_t Meta;
uint16_t DataLength;
uint8_t Data[MAX_GRAPHIC_BYTES];
} GraphicBitmap_t;
enum class OpStatusFlags : uint32_t {
EpdOn = 0x0001,
EpdIssued = 0x0002,
DetectorTestRequested = 0x0004,
DetectorTestPassed = 0x0008,
TelemetryOn = 0x0010,
TelemetryConnected = 0x0020,
CalibrationDue = 0x0040,
CalibrationInProgress = 0x0080,
GainAdjustable = 0x0100,
GainAdjusted = 0x0200,
ReducedRateOverrange = 0x0400,
DoseWriteEnabled = 0x0800,
ClearOnOnEnabled = 0x1000,
Golden = 0x2000,
ProtectedSession = 0x4000,
//NotYetDefined = 0x8000,
ResponderEnabled = 0x00010000,
ResponderTriggered = 0x00020000,
AlkalineFitted = 0x00040000,
DeepSleep = 0x00080000,
CovertMode = 0x00100000,
PulsedModeEnabled = 0x00200000,
PulsedModeActive = 0x00400000,
PulsedModeIndustrial=0x00800000,
};
enum class FaultStatusFlags : uint32_t {
NotInitialized = 0x0001,
BadThreshold = 0x0002,
BadSensitivities = 0x0004,
DetectorTestFail = 0x0008,
NotCalibrated = 0x0010,
EepromFailure = 0x0020,
ErrorLogged = 0x0040,
EpdFaulty = 0x0080,
TimeInvalid = 0x0100,
EarlyCommsTermination = 0x0200,
SounderFailure = 0x0400,
ResetWhileIssued = 0x0800,
};
enum class AlarmStatusFlags : uint32_t {
DoseWarning = 0x00000001,
DoseAlarm = 0x00000002,
DoseOverrange = 0x00000004,
TotalDoseOverrange = 0x00000008,
RateWarning = 0x00000010,
RateAlarm = 0x00000020,
RateOverrange = 0x00000040,
PulseOverrange = 0x00000080,
LatchedRateWarning = 0x00000100,
LatchedRateAlarm = 0x00000200,
LatchedRateOverrange = 0x00000400,
LatchedPulseOverrange = 0x00000800,
StayTimeExceeded = 0x00010000,
ReturnForRead = 0x00020000,
AbuseAlarm = 0x00040000,
LowBattery = 0x00080000,
TelemetryAlert = 0x00100000
};
enum class DoseAlarmFlags : uint32_t {
DoseWarning = 0x0001,
DoseAlarm = 0x0002,
DoseOverrange = 0x0004,
TotalDoseOverrange = 0x0008,
RateWarning = 0x0010,
RateAlarm = 0x0020,
RateOverrange = 0x0040,
LatchedRateWarning = 0x0100,
LatchedRateAlarm = 0x0200,
LatchedRateOverrange = 0x0400
};
enum class Mk2StatusFlags : uint32_t {
ADSIssued = 0x0001,
OneSecCountsProcessing = 0x0002,
RadioBatteryLow = 0x0004
};
typedef struct
{
uint16_t Id;
DoseAlarmFlags Status;
}Mk3DoseStatus_t;
typedef struct
{
OpStatusFlags OperatingStatus;
FaultStatusFlags FaultStatus;
AlarmStatusFlags AlarmStatus;
uint16_t IssueCount;
uint16_t FaultCode;
uint32_t OtherBits;
uint16_t NumberDoseAlarmWords;
Mk3DoseStatus_t DoseAlarms[MAX_MEASUREMENTS];
}StatusData_t;
enum class QualityFlags
{
DoseOverrange = 0x0001,
RateOverrange = 0x0002,
AbuseWarning = 0x0004,
CrcFailure = 0x0008,
CounterOverrange = 0x0010,
DetectorFail = 0x0040
};
typedef struct
{
uint16_t PowerCycles;
uint16_t Knocks;
QualityFlags Flags;
}Mk3QualityData_t;
typedef struct
{
uint16_t Id;
float Value;
}Mk3AlarmThreshold_t;
typedef struct
{
uint16_t MeasId;
uint16_t NumberThresholds;
Mk3AlarmThreshold_t Thresholds[MAX_ALM_THRESHOLDS];
}Mk3AlarmThresholds_t;
typedef struct
{
uint16_t MeasId;
std::vector<ThresholdId> Thresholds;
}Mk3AlarmThresholdsRequest_t;
typedef struct
{
uint16_t MeasId;
uint16_t Value;
}Mk3RatePercentage_t;
typedef struct
{
uint16_t MeasId;
uint16_t AlarmFlags;
float Dose;
}Mk3SnapshotDoseAndFlags_t;
typedef struct
{
uint16_t SnapshotNumber;
uint16_t IssueCount;
uint32_t StartTime;
uint32_t EndTime;
DatabaseId_t WearerDbId;
DatabaseId_t TaskDbId;
uint32_t OperatingStatus;
uint32_t FaultStatus;
uint32_t AlarmStatus;
uint16_t NumberOfMeasurands;
Mk3SnapshotDoseAndFlags_t DoseAndFlags[MAX_MEASUREMENTS];
}Mk3SnapshotSummary_t;
typedef struct
{
uint16_t MeasId;
uint16_t AlarmFlags;
float Dose;
float TriggeredDose;
float TotalDose;
float PeakRate;
uint32_t PeakRateTime;
}Mk3SnapshotMeasurement_t;
typedef struct
{
uint16_t SnapshotNumber;
uint16_t NumberOfMeasurands;
Mk3SnapshotMeasurement_t DoseAndFlags[MAX_MEASUREMENTS];
}Mk3SnapshotMeasurements_t;
typedef struct
{
uint16_t CounterId;
uint32_t StartCount;
uint32_t EndCount;
}Mk3SnapshotCount_t;
typedef struct
{
uint16_t SnapshotNumber;
uint16_t NumberOfCounters;
uint32_t StartTime;
uint32_t EndTime;
Mk3SnapshotCount_t Counters[MAX_COUNTERS];
}Mk3SnapshotCounters_t;
typedef struct
{
float DoseWarning;
float DoseAlarm;
float RateWarning;
float RateAlarm;
uint16_t MeasId;
}Mk3SnapshotAlarmThreshold_t;
typedef struct
{
uint16_t SnapshotNumber;
uint16_t NumberOfMeasurands;
Mk3SnapshotAlarmThreshold_t Thresholds[MAX_MEASUREMENTS];
}Mk3SnapshotAlarmThresholds_t;
// ****************
// Access Level
//
#define COMMAND_ID_MAP_SIZE 64
#define ENCRYPT_IV_SIZE 16
#define ENCRYPT_KEY_SIZE 32
#define ENCRYPT_CIPHER_SIZE 16
typedef uint8_t EncryptionKey[ENCRYPT_KEY_SIZE];
typedef uint8_t EncryptionText[ENCRYPT_CIPHER_SIZE];
typedef uint8_t PlainText[ENCRYPT_CIPHER_SIZE];
enum class AccessLevel_t : uint8_t
{
Open = 0,
Admin = 1,
Regulator = 2,
Manufacturer = 3
};
typedef struct SetAccessLevelRqTag
{
bool Granted;
EncryptionText Code;
EncryptionKey Key;
AccessLevel_t Level;
} SetAccessLevelRq_t;
typedef struct SetAccessPasswordRqTag
{
EncryptionKey Key;
AccessLevel_t Level;
} SetAccessPasswordRq_t;
typedef struct CommandIdPermissionsTag
{
AccessLevel_t Level;
uint8_t CommandIdPermissions[COMMAND_ID_MAP_SIZE];
}CommandIdPermissions_t;
// ****************
// UI Config
//
#define MAX_QUICK_ACCESS_DISPLAYS 6 /*5 + default display*/
typedef struct QuickAccessDisplayTag
{
uint8_t Position;
uint8_t DisplayId;
}QuickAccessDisplay_t;
typedef struct DisplayEnablesTag
{
uint8_t MenuId;
uint16_t EnableMask;
uint16_t Enables;
}DisplayAttributeMap_t;
#define MAX_MENUS 15
typedef struct DisplayEnablePrivilegesTag
{
AccessLevel_t Level;
uint8_t NumMenus;
uint16_t Privileges[MAX_MENUS];
} DisplayEnablePrivileges_t;
enum class DisplayCapability_t :uint8_t
{
DefaultDisplay = 1,
QuickDisplay = 2,
};
enum class OffModeDisplayId_t : uint8_t
{
Undefined = 0,
OffText = 1,
CalDueDate = 2,
UserBitmap = 3,
Manufacturer_PartnerLogo = 4,
CustomerLogo = 5,
ModelVersion=6
};
enum class AlarmIds : uint16_t
{
DoseAlarm = 0,
DoseWarning = 1,
RateWarning = 2,
RateAlarm = 3,
DoseOrRateOverRange = 4,
FailureAlarm = 5,
AbuseAlarm = 6,
BatteryLow = 7,
ReturnForRead = 8
};
#define MAX_OTHER_ALARMS 5
typedef struct AlarmConfigTag
{
AlarmIds AlarmId;
uint16_t MeasurandId;
uint16_t AlarmConfigMask;
uint16_t AlarmConfigBits;
uint16_t Duration;
}AlarmConfig_t;
typedef struct AlarmConfigIdTag
{
AlarmIds AlarmId;
uint16_t MeasurandId;
}AlarmConfigId;
// ****************
// Telemetry
//
typedef struct TeleAdvConfigTag
{
uint8_t operatingMode;
uint16_t undirectedInterval;
uint16_t directedInterval;
uint16_t directedTimeout;
}TeleAdvConfig_t;
typedef struct TeleCxnConfigTag
{
uint16_t minInterval;
uint16_t maxInterval;
uint16_t slaveLatency;
uint16_t supervisoryTimeout;
}TeleCxnConfig_t;
// ****************
// Debug Registers
//
typedef struct DebugRegisterValueTag
{
uint8_t registerId;
uint32_t value;
}DebugRegisterValue_t;
// ****************
// Battery Low Thesholds
//
typedef struct BatteryLowThresholdTag
{
uint8_t batteryType;
uint16_t mv;
}BatteryLowThreshold_t;
// ****************
// Battery Critical Timing
//
typedef struct BatteryCriticalTimingTag
{
uint16_t timeToCritical;
uint16_t timeToShutdown;
}BatteryCriticalTiming_t;
// ****************
// Battery Critical Timing
//
typedef struct MeasuredVoltagesTag
{
uint16_t vbat0;
uint16_t vbat1;
uint16_t vcpu;
}MeasuredVoltages_t;
#pragma pack (pop)
#endif

118
EpdBase3/TimeFunctions.cpp Normal file
View file

@ -0,0 +1,118 @@
#include "pch.h"
#include "TimeFunctions.h"
#pragma unmanaged
TimeFunctions::TimeFunctions()
{
}
UINT32 FileTime_to_POSIX(FILETIME ft)
{
// takes the last modified date
LARGE_INTEGER date, adjust;
date.HighPart = ft.dwHighDateTime;
date.LowPart = ft.dwLowDateTime;
// 100-nanoseconds = milliseconds * 10000
adjust.QuadPart = 11644473600000 * 10000;
// removes the diff between 1970 and 1601
date.QuadPart -= adjust.QuadPart;
// converts back from 100-nanoseconds to seconds
return (UINT32)(date.QuadPart / 10000000);
}
UINT32 UnixTimeNow() {
FILETIME ft;
GetSystemTimeAsFileTime(&ft);
return FileTime_to_POSIX(ft);
}
/// <summary>
/// Filetime is 100nS since 1601 01 01 UTC Unix = seconds since 1970
/// </summary>
/// <param name="t"></param>
/// <param name="pft"></param>
void TimeFunctions::UnixTimeToFileTime(time_t t, LPFILETIME pft)
{
ULONG64 ll = ((ULONG64)t * (ULONG64)10000000) + (ULONG64)116444736000000000;
pft->dwLowDateTime = (DWORD)ll;
pft->dwHighDateTime = ll >> 32;
}
void TimeFunctions::UnixTimeToSystemTime(time_t t, LPSYSTEMTIME pst)
{
FILETIME ft;
UnixTimeToFileTime(t, &ft);
FileTimeToSystemTime(&ft, pst);
}
/// <summary>
/// converts MK2/MK3 time to FileTime
/// </summary>
/// <param name="epdTime">UTC</param>
/// <param name="pft">UTC</param>
/// <param name="isMK2"></param>
//void TimeFunctions::EpdTimeToFileTime(UINT32 epdTime, LPFILETIME epdFileTime, bool isMK2) //MK3
//{
// ULONG64 ll = (ULONG64)epdTime * (ULONG64)10000000;
// if (isMK2) ll += (ULONG64) 116444736000000000; else ll += (ULONG64)125911584000000000; // 2000 base - 1601-1-1 (FT) Base
// epdFileTime->dwLowDateTime = (DWORD)(ll & 0xffffffff);
// epdFileTime->dwHighDateTime = ll >> 32;
//}
void TimeFunctions::Epd3TimeToFileTime(UINT32 epdTime, LPFILETIME epdFileTime) //MK3
{
ULONG64 ll = (ULONG64)epdTime * (ULONG64)10000000;
ll += (ULONG64)125911584000000000; // 2000 base - 1601-1-1 (FT) Base
epdFileTime->dwLowDateTime = (DWORD)(ll & 0xffffffff);
epdFileTime->dwHighDateTime = ll >> 32;
}
void TimeFunctions::FileTimeToEpdTime(FILETIME pft, INT32* t, bool isMK2)
{
ULONG64 offset;
if (isMK2) offset = (ULONG64)116444736000000000; else offset = (ULONG64)125911584000000000;
LONGLONG ll = ((((LONGLONG)pft.dwHighDateTime << 32) + pft.dwLowDateTime) - offset) / 10000000;
*t = (DWORD)ll;
}
UINT32 TimeFunctions::NowToEpd3Time()
{
ULONG64 offset;
offset = (ULONG64)125911584000000000;
SYSTEMTIME t;
GetSystemTime(&t); // is UTC !!
FILETIME ft;
SystemTimeToFileTime((const SYSTEMTIME*)&t, &ft);
LONGLONG ll = ((((LONGLONG)ft.dwHighDateTime << 32U) + ft.dwLowDateTime) - offset) / 10000000;
return (DWORD)ll;
}
//UINT32 TimeFunctions::NowToEpdTime(bool isMK2)
//{
// ULONG64 offset;
// if (isMK2) offset = (ULONG64)116444736000000000; else offset = (ULONG64)125911584000000000;
// SYSTEMTIME t;
// GetSystemTime(&t); // is UTC !!
// FILETIME ft;
// SystemTimeToFileTime((const SYSTEMTIME*)&t, &ft);
// LONGLONG ll = ((((LONGLONG)ft.dwHighDateTime << 32U) + ft.dwLowDateTime) - offset) / 10000000;
// return (DWORD)ll;
//}
void TimeFunctions::EPD2PeakTimeToFiletime(DWORD EpdClock, DWORD EpdPeakTime, FILETIME* PeakFileTime) {
if (EpdPeakTime != 0xCDCDCDCD) {
UINT32 tm = EpdClock - EpdPeakTime;
GetSystemTimeAsFileTime(&lu.FT);
lu.LL -= UInt32x32To64(tm, 10000000);
*PeakFileTime = lu.FT;
} else
{
(*PeakFileTime).dwLowDateTime = (*PeakFileTime).dwHighDateTime = 0;
}
}

25
EpdBase3/TimeFunctions.h Normal file
View file

@ -0,0 +1,25 @@
#pragma once
#include <windows.h>
#include <time.h>
class TimeFunctions
{
public:
TimeFunctions();
static void Epd3TimeToFileTime(UINT32 epdTime, LPFILETIME epdFileTime);
void FileTimeToEpdTime(FILETIME pft, INT32* t, bool isMK2);
//static UINT32 NowToEpdTime(bool isMK2);
static UINT32 NowToEpd3Time();
static void UnixTimeToFileTime(time_t t, LPFILETIME pft);
static void UnixTimeToSystemTime(time_t t, LPSYSTEMTIME pst);
static void EPD2PeakTimeToFiletime(DWORD EpdClock, DWORD EpdPeakTime, FILETIME* PeakFileTime);
};
static union {
FILETIME FT; unsigned long long LL;
} lu;
static SYSTEMTIME ST;
UINT32 FileTime_to_POSIX(FILETIME ft);
UINT32 UnixTimeNow();

3
EpdBase3/framework.h Normal file
View file

@ -0,0 +1,3 @@
#pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers

5
EpdBase3/pch.cpp Normal file
View file

@ -0,0 +1,5 @@
// pch.cpp: source file corresponding to the pre-compiled header
#include "pch.h"
// When you are using pre-compiled headers, this source file is necessary for compilation to succeed.

13
EpdBase3/pch.h Normal file
View file

@ -0,0 +1,13 @@
// pch.h: This is a precompiled header file.
// Files listed below are compiled only once, improving build performance for future builds.
// This also affects IntelliSense performance, including code completion and many code browsing features.
// However, files listed here are ALL re-compiled if any one of them is updated between builds.
// Do not add files here that you will be updating frequently as this negates the performance advantage.
#ifndef PCH_H
#define PCH_H
// add headers that you want to pre-compile here
#include "framework.h"
#endif //PCH_H

14
EpdBase3/resource.h Normal file
View file

@ -0,0 +1,14 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by Epd3Base.rc
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View file

@ -0,0 +1,22 @@
#include "stdafx.h"
using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
using namespace System::Runtime::InteropServices;
using namespace System::Security::Permissions;
[assembly:AssemblyTitleAttribute(L"EpdBaseClr")];
[assembly:AssemblyDescriptionAttribute(L"")];
[assembly:AssemblyConfigurationAttribute(L"")];
[assembly:AssemblyCompanyAttribute(L"SCK CEN")];
[assembly:AssemblyProductAttribute(L"EpdBaseClr")];
[assembly:AssemblyCopyrightAttribute(L"Copyright (c) 2019-2024 Luc Vandenbroucke")];
[assembly:AssemblyTrademarkAttribute(L"")];
[assembly:AssemblyCultureAttribute(L"")];
[assembly:AssemblyVersionAttribute("1.0.*")];
[assembly:ComVisible(false)];
[assembly:CLSCompliantAttribute(true)];

1086
EpdBaseClr/EpdBaseClr.cpp Normal file

File diff suppressed because it is too large Load diff

456
EpdBaseClr/EpdBaseClr.h Normal file
View file

@ -0,0 +1,456 @@
#pragma once
#pragma unmanaged
#include "..\EpdBase\EpdBase.h"
#pragma comment(lib,"dll2/Reader2.lib")
#undef EPDDLL_API
#pragma unmanaged
#include "../EpdBase3/Epd3Base.h"
#pragma comment(lib,"dll2/Reader32.lib")
#pragma managed
using namespace System;
using namespace System::Runtime::InteropServices;
namespace EpdBaseClr {
public enum class EpdSteps1
{
Idle = 0,
Running = 1,
Completed = 2,
Failed = 3
};
[UnmanagedFunctionPointer(CallingConvention::Cdecl)]
public delegate void ProgressCallbackDelegate(EpdSteps step, EpdStepResults result);
const char* cEpdError = "Setreader Error";
ref class Epd2;
public ref class cStepValues
{
public:
Int32 func;
Int32 commitrv;
Int32 endrv;
cStepValues();
~ cStepValues();
private:
};
cStepValues:: cStepValues()
{
func = -1; commitrv = -1; endrv = -1;
}
cStepValues::~ cStepValues()
{
}
public enum class EpdErrorCodes
{
EpdErrorNone = 0,
EpdErrorCancel = 1,
EpdErrorTimeout = 2,
EpdErrorOther = 4,
EpdErrorConnecting = 5
};
public ref class EpdEventArgs : EventArgs
{
public:
int deviceID;
bool isIssued, isBG, isMK3, retriesLeft;
EpdEventArgs(int epdID, bool epdIssued, bool isBG, bool isMK3, int retriesleft) : EventArgs()
{
this->deviceID = epdID;
this->isIssued = epdIssued;
this->isBG = isBG;
this->isMK3 = isMK3;
this->retriesLeft = retriesleft;
}
};
public ref struct EpdException : System::Exception
{
public:
int errorCode;
EpdException(int r) : System::Exception(gcnew String(cEpdError))
{
this->errorCode = r;
}
};
public ref class EpdErrorEventArgs : EventArgs
{
public:
int returnValue;
int ErrorRV; int ErrorStep;
EpdErrorCodes ErrorEPD;
EpdErrorEventArgs(int ReturnValue) : EventArgs()
{
ErrorRV= ErrorStep = 0;
this->returnValue = ReturnValue;
}
EpdErrorEventArgs(int ReturnValue, EpdErrorCodes errorEPD, int errorStep) : EventArgs()
{
this->ErrorEPD = errorEPD;
this->ErrorRV = 99;
this->ErrorStep = errorStep;
this->returnValue = ReturnValue;
}
EpdErrorEventArgs(int ReturnValue, int errorRV, int errorStep) : EventArgs()
{
this->ErrorEPD = EpdErrorCodes::EpdErrorOther;
this->ErrorRV = errorRV;
this->ErrorStep = errorStep;
this->returnValue = ReturnValue;
}
};
public ref class EpdTOEventArgs : EventArgs
{
public:
int tries;
bool connecttimeout;
EpdTOEventArgs(int _tries, bool _connecttimeout) : EventArgs()
{
this->tries=_tries;
this->connecttimeout = _connecttimeout;
}
};
/*public ref class sEpdBase
{
public :
DateTime^ RealTime;
unsigned int CurrentDeviceID;
};*/
public ref class Epd2
{
/*private:
DateTime^ Jan2000;*/
const wchar_t* tHp07 = L"HP07";
const wchar_t* tHp10 = L"HP10";
const wchar_t* tHp07N = L"HPN";
const wchar_t* tHp10G = L"HP10G";
public:
void OnProgress(EpdSteps step, EpdStepResults result);
ProgressCallbackDelegate^ progressDelegate;
delegate void dEpdRead(Epd2^ Sender, EpdEventArgs^ e);
delegate void dEpdTO(Epd2^ Sender, EpdTOEventArgs^ e);
delegate void dEpdError(Epd2^ Sender, EpdErrorEventArgs^ e);
delegate void dEpdProgress(Epd2^ Sender, EpdSteps step, EpdStepResults result);
dEpdRead^ _EpdRead;
dEpdTO^ _EpdTO;
dEpdError^ _EpdError;
dEpdProgress ^ _EpdProgress;
event dEpdRead^ EpdRead
{
void add(dEpdRead^ handler)
{
_EpdRead += handler;
}
void remove(dEpdRead^ handler)
{
_EpdRead -= handler;
}
}
event dEpdError^ EpdError
{
void add(dEpdError^ handler)
{
_EpdError += handler;
}
void remove(dEpdError^ handler)
{
_EpdError -= handler;
}
}
event dEpdTO^ EpdTO
{
void add(dEpdTO^ handler)
{
_EpdTO += handler;
}
void remove(dEpdTO^ handler)
{
_EpdTO -= handler;
}
}
event dEpdProgress^ EpdProgress
{
void add(dEpdProgress^ handler)
{
_EpdProgress += handler;
}
void remove(dEpdProgress^ handler)
{
_EpdProgress -= handler;
}
}
//private:
//bool hasAlarm = false;
public:
bool onlyMK2;
EpdBase::Epd2U *epd;
Epd3Base::Epd3U* epd3;
String^ Hp07Name;
String^ Hp10Name;
//System::Threading::ManualResetEvent^ cancelEvent;
void OnCancelRequested();
bool isTitleNG;
DateTime^ RealTime;
String^ WearerName;
String^ WearerID;
//bool Issued;
bool isOn;
bool isBG, isNG, VersionOK;
bool isMK3;
int InitRV;
int DiscRV;
int StatusRV;
int GetStatusError;
int GetDosesError;
int ReadTresholdsError;
int PrepareForIssueError;
int SetIssuedError;
int ConnectError;
int ReadDosesRV;
int DeviceCount = 0;
int ErrorStep=0;
int ErrorRV = 0;
EpdErrorCodes ErrorEPD;
double Hp07;
double Hp10;
double Hp07Peak;
double Hp10Peak;
System::Nullable<System::DateTime> Hp10PeakTime;
System::Nullable<System::DateTime> Hp07PeakTime;
double Hp07Total;
double Hp10Total;
double alarmHP07;
double alarmHP10;
double Hp10THDose1;
double Hp10THDose2;
double Hp07THDose;
double Hp10Rate1On;
double Hp10Rate2On;
double Hp07RateOn;
double Hp10Rate1Off;
double Hp10Rate2Off;
double Hp07RateOff;
double NGgain;
int K1;
int K2;
int K3;
int K4;
int K5;
int K6;
int SG;
int BC;
int FB;
int HG;
int QualityData;
unsigned int D1, D2, D3, D4, CountsClock, CountsClockBase;
int epdType;
int alarmStatus ;
int otherAlarms ;
int errorStatus ;
int operatingStatus ;
unsigned int EpdID ;
int HardVersion, HardVersionMinor;
int SoftVersion ;
int FunctionFlags ;
unsigned short BatADC;
unsigned short SupplyADC;
//OperatingStatus
BYTE DetectorsOn = 0;
bool EPDIssued = 0;
BYTE EPDLocked = 0;
BYTE EPDTesting = 0;
BYTE EPDProcSec = 0;
BYTE EPDFaulty = 0;
BYTE EPDTimeFault = 0;
//ERrrostatus
BYTE EPDNewFault = 0;
BYTE EPDComFault = 0;
BYTE EPDCalFault = 0;
BYTE EPDDetFault = 0;
BYTE EPDEprFault = 0;
BYTE EPDTrhFault = 0;
BYTE EPDOthFault = 0;
//AlarmStatus
BYTE AlarmDoseHP101G = 0;
BYTE AlarmDoseHP102G = 0;
BYTE AlarmDoseHP07N = 0;
BYTE AlarmRateHP101G = 0;
BYTE AlarmRateHP102G = 0;
BYTE AlarmRateHP07N = 0;
//OtherAlarm
BYTE OtherAlarmRateHp101G = 0;
BYTE OtherAlarmRateHp102G = 0;
BYTE OtherAlarmRateHp07N = 0;
BYTE OtherAlarmReturn = 0;
BYTE OtherAlarmBatLow = 0;
BYTE OtherAlarmCarrier = 0;
BYTE OtherAlarmBatVolt = 0;
//New fields
bool eDosDose07Warning =false;
bool eDosDose07Alarm = false;
bool eDosDose10Warning = false;
bool eDosDose10Alarm = false;
bool eDosRate07Warning = false;
bool eDosRate07Alarm = false;
bool eDosRate10Warning= false;
bool eDosRate10Alarm = false;
bool eDosBatteryWarning= false;
bool eDoshasAlarm = false;
bool eDosHasFault = false;
Epd2(int port, bool OnlyMK2);
~Epd2();
!Epd2();
//int StepReturnValues[50][3];
//int StepReturnMax;
//array<cStepValues^> StepReturnValues;
System::Collections::Generic::List<cStepValues^>^ StepReturnValues;
int SetFeedbackSound(byte sound, UINT16 sound3);
private:
int Connect(bool reinit, int EPDTimeout);
int Close();
int DecodeStatus(Epd3Base::Epd3U* epd);
int DecodeStatus(EpdBase::Epd2U* epd);
int GetStatus();
int GetDoses();
int GetDoses(EpdBase::Epd2U* epd);
int AfterGetDoses(Epd3Base::Epd3U* epd);
int GetDoses(Epd3Base::Epd3U* epd);
int ClearAlarms();
//int SetIssued();
int BeforeSetIssued(Epd3Base::Epd3U* epd);
//int SetIssued(Epd3Base::Epd3U* epd);
int BeforeSetIssued(EpdBase::Epd2U* epd);
//int SetIssued(EpdBase::Epd2U* epd);
int WriteCalibration();
int WriteCalibration(EpdBase::Epd2U* epd);
int WriteCalibration(Epd3Base::Epd3U* epd);
int ReadTresholds();
int AfterReadTresholds(EpdBase::Epd2U* epd);
int ReadTresholds(EpdBase::Epd2U* epd);
int AfterReadTresholds(Epd3Base::Epd3U* epd);
int ReadTresholds(Epd3Base::Epd3U* epd);
int ReadExtraStatus();
int ReadExtraStatus(EpdBase::Epd2U* epd);
int ReadExtraStatus(Epd3Base::Epd3U* epd);
int AfterGetDoses(EpdBase::Epd2U* epd);
int ConnectAndStatus();
int tokenSourceTimeout;
int readRetries;
System::Threading::Tasks::Task^ waitTask;
//int SetDeIssued();
public:
System::Threading::Tasks::Task^ Wait(int timeout, int Retries);
void WaitEnd();
int GetAll(bool close);
int GetAllDeissue(bool reconnect);
int IssueAndCheck(float gain, float ChirpRate, bool WriteConfig);
int GetSteps();
bool HasStepError();
private:
int AfterGetStatus(EpdBase::Epd2U* epd);
int AfterGetStatus(Epd3Base::Epd3U* epd);
int AfterGetStatus();
int SwitchCon();
void InitData();
void WaitEpd();
//int PrepareForIssue();
};
}
public ref class EpdHelpers
{
public:
static System::String^ EpdStepToString(EpdSteps step)
{
switch (step)
{
case EpdSteps::StepTest: return L"Test";
case EpdSteps::StepInitialized: return L"Initialized";
case EpdSteps::StepDiscovering: return L"Discovering";
case EpdSteps::StepConnecting: return L"Connecting";
case EpdSteps::StepReadStatus: return L"ReadStatus";
case EpdSteps::StepReadIdentities: return L"Read Identities";
case EpdSteps::StepReadCounts: return L"Read Counts";
case EpdSteps::StepReadRTC: return L"Read RTC";
case EpdSteps::StepReadWearerId: return L"Read WearerId";
default: return L"Unknown";
}
}
};

View file

@ -0,0 +1,186 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{F1F47B79-9930-48B0-8DDE-56E2C4BED2A2}</ProjectGuid>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<Keyword>ManagedCProj</Keyword>
<RootNamespace>EpdBaseClr</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
<PreferredToolArchitecture>x86</PreferredToolArchitecture>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<CopyLocalDeploymentContent>true</CopyLocalDeploymentContent>
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<CopyLocalDeploymentContent>true</CopyLocalDeploymentContent>
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies>$(ProjectDir)..\EpdBase\dll2\Reader2.lib;%(AdditionalDependencies)</AdditionalDependencies>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
<PreventDllBinding>false</PreventDllBinding>
</Link>
<PostBuildEvent>
<Command>c:\l\sign.cmd $(TargetPath)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies />
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
<PostBuildEvent>
<Command>if defined signer %signer% $(TargetPath)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies />
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="EpdBaseClr.h" />
<ClInclude Include="EpdProgress.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="VariableCapture.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="AssemblyInfo.cpp" />
<ClCompile Include="EpdBaseClr.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="VariableCapture.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="app.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="app.ico" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EpdBase3\EpdBase3.vcxproj">
<Project>{e6bb4f4e-4774-4fe3-b341-7f4c24dc61e7}</Project>
</ProjectReference>
<ProjectReference Include="..\EpdBase\EpdBase.vcxproj">
<Project>{3114a047-7562-42fe-94de-2418ef19ad9a}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="EpdBaseClr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="VariableCapture.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="EpdProgress.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="EpdBaseClr.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="AssemblyInfo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="VariableCapture.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="app.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Image Include="app.ico">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
</Project>

39
EpdBaseClr/EpdProgress.h Normal file
View file

@ -0,0 +1,39 @@
#pragma once
#ifdef __cplusplus_cli
// Compiled in a C++/CLI file (/clr enabled) -> Exports a public managed enum
#define EXPORT_MANAGED public
#else
// Compiled in a Native C++ file (/clr disabled) -> Becomes standard C++11 enum class
#define EXPORT_MANAGED
#endif
EXPORT_MANAGED enum class EpdSteps
{
StepTest=0,
StepStartCom=1,
StepInitialized=2,
StepDiscovering=3,
StepConnecting=4,
StepReadStatus=5,
StepReadIdentities=6,
StepReadCounts=7,
StepReadRTC=8 ,
StepReadWearerId=9,
StepPrepareIssue = 10,
StepIssue=11,
StepDeIssue=12,
};
EXPORT_MANAGED enum class EpdStepResults
{
None=0,
Started=1,
OK=2,
Error
};

0
EpdBaseClr/Helper.h Normal file
View file

Binary file not shown.

BIN
EpdBaseClr/RCa03548 Normal file

Binary file not shown.

3
EpdBaseClr/Resource.h Normal file
View file

@ -0,0 +1,3 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by app.rc

Some files were not shown because too many files have changed in this diff Show more