This commit is contained in:
Luc 2021-04-30 17:21:31 +02:00
parent e6efa8523a
commit e176beb922
33 changed files with 26129 additions and 52 deletions

View file

@ -128,6 +128,12 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\MK3\CommonEpdTypes.h" />
<ClInclude Include="..\MK3\Epd2.h" />
<ClInclude Include="..\MK3\Epd3.h" />
<ClInclude Include="..\MK3\EpdCommon.h" />
<ClInclude Include="..\MK3\Mk3Types.h" />
<ClInclude Include="..\MK3\TimeFunctions.h" />
<ClInclude Include="EpdBase.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="stdafx.h" />

View file

@ -27,6 +27,24 @@
<ClInclude Include="TimeFunctions.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\MK3\CommonEpdTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\MK3\Epd2.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\MK3\Epd3.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\MK3\EpdCommon.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\MK3\Mk3Types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\MK3\TimeFunctions.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="EpdBase.cpp">

20
MK3/AssemblyInfo.cpp Normal file
View file

@ -0,0 +1,20 @@
#include "pch.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"MK3")];
[assembly:AssemblyDescriptionAttribute(L"")];
[assembly:AssemblyConfigurationAttribute(L"")];
[assembly:AssemblyCompanyAttribute(L"")];
[assembly:AssemblyProductAttribute(L"MK3")];
[assembly:AssemblyCopyrightAttribute(L"Copyright (c) 2021")];
[assembly:AssemblyTrademarkAttribute(L"")];
[assembly:AssemblyCultureAttribute(L"")];
[assembly:AssemblyVersionAttribute("1.0.*")];
[assembly:ComVisible(false)];

45
MK3/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

73
MK3/Epd2.h Normal file
View file

@ -0,0 +1,73 @@
#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

433
MK3/Epd3.h Normal file
View file

@ -0,0 +1,433 @@
#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_R3(CommsHandle hComms, CalGain_t gains[], uint8_t length, CompletionCallback callback);
int32_t EPDDLL_API EndWriteGains_R3(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_R3(CommsHandle hComms, uint8_t onState, CompletionCallback callback);
int32_t EPDDLL_API EndEnableProtectedSession_R3(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);
}
#endif

319
MK3/EpdCommon.h Normal file
View file

@ -0,0 +1,319 @@
#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 Commit(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 Connect(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

279
MK3/MK3.cpp Normal file
View file

@ -0,0 +1,279 @@
#include "pch.h"
#include "MK3.h"
MK3::Epd2::Epd2(int port)
{
b = gcnew sEpdBase();
epd = new Epd2U(port);
this->InitRV = epd->InitRv;
epd->StartCom();
}
MK3::Epd2::~Epd2()
{
delete b;
delete epd;
this->!Epd2();
}
MK3::Epd2::!Epd2()
{
}
int MK3::Epd2::Connect(bool reinit)
{
ConnectError = 0;
b->CurrentDeviceID = 0;
DeviceCount = 0;
DiscRV = 0;
if (epd != nullptr) {
if (epd->CommsInitialized == 0) epd->StartCom();
DiscRV = epd->StartDiscover();
if (DiscRV == 1)
{
DeviceCount = epd->DeviceCount;
if (epd->DeviceCount >= 0) b->CurrentDeviceID = epd->DeviceIDs[0];
}
else {
ConnectError = epd->Error;
}
}
return DiscRV;
}
int MK3::Epd2::Close()
{
b->CurrentDeviceID = 0;
if (epd != nullptr) epd->Close();
return 0;
}
int MK3::Epd2::DecodeStatus()
{
epd->DecodeStatus();
//OperatingStatus
DetectorsOn = epd->DetectorsOn;
EPDIssued = epd->EPDIssued;
EPDLocked = epd->EPDLocked;
EPDTesting = epd->EPDTesting;
EPDProcSec = epd->EPDProcSec;
EPDFaulty = epd->EPDFaulty;
EPDNewFault = epd->EPDNewFault;
EPDComFault = epd->EPDComFault;
EPDCalFault = epd->EPDCalFault;
EPDDetFault = epd->EPDDetFault;
EPDEprFault = epd->EPDEprFault;
EPDTrhFault = epd->EPDTrhFault;
EPDOthFault = epd->EPDOthFault;
AlarmDoseHP101G = epd->AlarmDoseHP101G;
AlarmDoseHP102G = epd->AlarmDoseHP102G;
AlarmDoseHP07N = epd->AlarmDoseHP07N;
AlarmRateHP101G = epd->AlarmRateHP101G;
AlarmRateHP102G = epd->AlarmRateHP102G;
AlarmRateHP07N = epd->AlarmRateHP07N;
OtherAlarmRateHp101G = epd->OtherAlarmRateHp101G;
OtherAlarmRateHp102G = epd->OtherAlarmRateHp102G;
OtherAlarmRateHp07N = epd->OtherAlarmRateHp07N;
OtherAlarmReturn = epd->OtherAlarmReturn;
OtherAlarmBatLow = epd->OtherAlarmBatLow;
OtherAlarmCarrier = epd->OtherAlarmCarrier;
OtherAlarmBatVolt = epd->OtherAlarmBatVolt;
return 1;
}
int MK3::Epd2::GetStatus()
{
GetStatusError = 0; StatusRV = 0; Issued = false;
WearerID = String::Empty;
WearerName = String::Empty;
StatusRV = epd->ReadStatus();
if (StatusRV != 1) GetStatusError = epd->Error;
Issued = epd->EPDIssued;
WearerID = gcnew String((char*)epd->WearerID);
WearerName = gcnew String((char*)epd->WearerName);
isOn = (epd->DetectorsOn != 0);
epdType = epd->EpdType;
alarmStatus = epd->AlarmStatus;
otherAlarms = epd->OtherAlarms;
errorStatus = epd->ErrorStatus;
operatingStatus = epd->OperatingStatus;
EpdID = epd->EpdID;
HardVersion = epd->HardVersion;
SoftVersion = epd->SoftVersion;
FunctionFlags = epd->FunctionFlags;
CountsClock = epd->EpdClock;
DecodeStatus();
return StatusRV;
}
int MK3::Epd2::GetDoses()
{
Hp10 = Hp07 = 0.0;
ReadDosesRV = epd->ReadDoses();
if (ReadDosesRV == 1) {
GetDosesError = 0;
Hp10 = (double)epd->Hp10Dose / 64.0;
Hp07 = (double)epd->Hp07Dose / 64.0;
Hp07Peak = (double)epd->Hp07Peak / 64.0;
Hp10Peak = (double)epd->Hp10Peak / 64.0;
Hp07Total = epd->Hp07Total / 64.0;
Hp10Total = epd->Hp10Total / 64.0;
}
else {
GetDosesError = epd->Error;
}
if (epd->Hp10Time > 0) {
double x = (epd->EpdClock - epd->Hp10Time) * -1.0;
Hp10PeakTime = System::DateTime::Now.AddSeconds(x);
}
else
Hp10PeakTime = System::Nullable<System::DateTime>();;
if (epd->Hp07Time > 0) {
double x = (epd->EpdClock - epd->Hp07Time) * -1.0;
Hp07PeakTime = System::DateTime::Now.AddSeconds(x);
}
else
Hp10PeakTime = System::Nullable<System::DateTime>();
QualityData = epd->QualityData;
K1 = epd->K1;
K2 = epd->K2;
K3 = epd->K3;
K4 = epd->K4;
K5 = epd->K5;
K6 = epd->K6;
SG = epd->SG;
BC = epd->SG;
FB = epd->FB;
HG = epd->HG;
return ReadDosesRV;
}
int MK3::Epd2::SetDeIssued()
{
return epd->DeIssue();
}
int MK3::Epd2::PrepareForIssue()
{
PrepareForIssueError = 0;
int rv = epd->PrepareForIssue();
if (rv != 1) PrepareForIssueError = epd->Error;
return rv;
}
int MK3::Epd2::SetIssued()
{
SetIssuedError = 0;
epd->Hp07THDose = (DWORD)(Hp07THDose * 64.0);
epd->Hp10THDose1 = (DWORD)(Hp10THDose1 * 64.0);
epd->Hp10THDose2 = (DWORD)(Hp10THDose2 * 64.0);
epd->Hp10Rate1On = (DWORD)(Hp10Rate1On);
epd->Hp10Rate2On = (DWORD)(Hp10Rate2On);
epd->Hp07RateOn = (DWORD)(Hp07RateOn);
epd->Hp10Rate1Off = (DWORD)(Hp10Rate1Off);
epd->Hp10Rate2Off = (DWORD)(Hp10Rate2Off);
epd->Hp07RateOff = (DWORD)(Hp07RateOff);
memset(epd->WearerID, ' ', WearerIDLength); epd->WearerID[WearerIDLength] = 0;
char* str1 = (char*)(void*)Runtime::InteropServices::Marshal::StringToHGlobalAnsi(WearerID);
int l = strlen(str1);
if (l > WearerIDLength) l = WearerIDLength;
_memccpy(epd->WearerID + WearerIDLength - l, str1, l, WearerIDLength);
Runtime::InteropServices::Marshal::FreeHGlobal((IntPtr)str1);
memset(epd->WearerName, 0, WearerNameLength + 1);
char* str2 = (char*)(void*)Runtime::InteropServices::Marshal::StringToHGlobalAnsi(WearerName);
l = strlen(str2);
if (l > WearerNameLength) l = WearerNameLength;
_memccpy(epd->WearerName, str2, l, WearerNameLength);
Runtime::InteropServices::Marshal::FreeHGlobal((IntPtr)str2);
int rv = epd->Issue();
if (rv != 1) SetIssuedError = epd->Error;
return rv;
}
int MK3::Epd2::WriteCalibration()
{
epd->K1 = K1;
epd->K2 = K2;
epd->K3 = K3;
epd->K4 = K4;
epd->K5 = K5;
epd->K6 = K6;
//epd->K1 = 903;
//epd->K2 = 613;
//epd->K5 = 13100;
//epd->K6 = 1310;
int rv = epd->WriteCal();
return rv;
}
int MK3::Epd2::ReadTresholds()
{
ReadTresholdsError = 0;
int rv = epd->ReadTresHolds();
if (rv != 0) ReadTresholdsError = epd->Error;
Hp10THDose1 = (double)epd->Hp10THDose1 / 64.0;
Hp10THDose2 = (double)epd->Hp10THDose2 / 64.0;
Hp07THDose = (double)epd->Hp07THDose / 64.0;
Hp10Total = (double)epd->Hp10Total / 64.0;
Hp07Total = (double)epd->Hp07Total / 64.0;
Hp10Rate1On = (double)epd->Hp10Rate1On;
Hp10Rate2On = (double)epd->Hp10Rate2On;
Hp07RateOn = (double)epd->Hp07RateOn;
Hp10Rate1Off = (double)epd->Hp10Rate1Off;
Hp10Rate2Off = (double)epd->Hp10Rate2Off;
Hp07RateOff = (double)epd->Hp07RateOff;
K1 = epd->K1;
K2 = epd->K2;
K3 = epd->K3;
K4 = epd->K4;
K5 = epd->K5;
K6 = epd->K6;
SG = epd->SG;
BC = epd->BC;
FB = epd->FB;
HG = epd->HG;
return rv;
}
int MK3::Epd2::ReadExtraStatus()
{
int rv = epd->EPDReadExtraStatus();
BatADC = epd->byBatADC;
SupplyADC = epd->bySupplyADC;
D1 = epd->D1 - epd->BaseD1;
D2 = epd->D2 - epd->BaseD2;
D3 = epd->D3 - epd->BaseD3;
D4 = epd->D4 - epd->BaseD4;
CountsClock = epd->CountsClock;
CountsClockBase = epd->BaseCountsClock;
return rv;
}

160
MK3/MK3.h Normal file
View file

@ -0,0 +1,160 @@
#pragma once
#include "MK3Base.h"
#pragma comment(lib,"Reader3.lib")
using namespace System;
namespace MK3 {
public ref class sEpdBase
{
public:
DateTime^ RealTime;
unsigned int CurrentDeviceID;
};
public ref class Epd2
{
public:
Epd2U* epd;
sEpdBase^ b;
DateTime^ RealTime;
String^ WearerName;
String^ WearerID;
bool Issued;
bool isOn;
int InitRV;
int DiscRV;
int StatusRV;
int GetStatusError;
int GetDosesError;
int ReadTresholdsError;
int PrepareForIssueError;
int SetIssuedError;
int ConnectError;
int ReadDosesRV;
int DeviceCount = 0;
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;
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;
int SoftVersion;
int FunctionFlags;
unsigned short BatADC;
unsigned short SupplyADC;
//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;
Epd2(int port);
~Epd2();
!Epd2();
int Connect(bool reinit);
int Close();
int DecodeStatus();
int GetStatus();
int GetDoses();
int SetDeIssued();
int SetIssued();
int PrepareForIssue();
int WriteCalibration();
int ReadTresholds();
int ReadExtraStatus();
};
}

165
MK3/MK3.vcxproj Normal file
View file

@ -0,0 +1,165 @@
<?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>
<ProjectGuid>{CFD0F68D-7EF9-4541-B55A-2A557D84295B}</ProjectGuid>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<Keyword>ManagedCProj</Keyword>
<RootNamespace>MK3</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>v142</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</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 />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies />
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="CommonEpdTypes.h" />
<ClInclude Include="Epd2.h" />
<ClInclude Include="Epd3.h" />
<ClInclude Include="EpdCommon.h" />
<ClInclude Include="MK3.h" />
<ClInclude Include="MK3Base.h" />
<ClInclude Include="Mk3Types.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="TimeFunctions.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="AssemblyInfo.cpp" />
<ClCompile Include="MK3.cpp" />
<ClCompile Include="MK3Base.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>
</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>
<CopyFileToFolders Include="Reader3.dll">
<FileType>Document</FileType>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</DeploymentContent>
</CopyFileToFolders>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

78
MK3/MK3.vcxproj.filters Normal file
View file

@ -0,0 +1,78 @@
<?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="MK3.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="pch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="MK3Base.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="EpdCommon.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Mk3Types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="TimeFunctions.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="MK3.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="AssemblyInfo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="MK3Base.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>
<ItemGroup>
<CopyFileToFolders Include="Reader3.dll">
<Filter>Resource Files</Filter>
</CopyFileToFolders>
</ItemGroup>
</Project>

207
MK3/MK3Base.cpp Normal file
View file

@ -0,0 +1,207 @@
#include "pch.h"
#include "MK3Base.h"
#pragma unmanaged
MK3::Epd2U::Epd2U(int _comport)
{
port = _comport;
comPort[3] = 48 + _comport;
CommsInitialized = 0;
epdComsHandle = INVALID_HANDLE_VALUE;
//SetAutoCommit(0); alleen epd2
Error = 123;
if (_comport == 0) return;
}
WORD MK3::Epd2U::WriteConfig()
{
if (port == 0) return 1;
return 0; // WriteDisplayConfig(00, 2, 40, 10, 2, displayConfig, 56);
}
DWORD MK3::Epd2U::StartCom()
{
DWORD rv;
ErrorReason = 0;
int mx = 10;
if (port == 0) {
CommsInitialized = 1;
return 1;
}
if (CommsInitialized == 0) {
epdComsHandle = CreateReaderInterface();
rv = OpenReader(epdComsHandle, comPort);
if (InitRv == 0)
{
SetMultipleDiscoveryMode(epdComsHandle, false);
//SetRetryCount(epdComsHandle, retry);
//SetDiscoveryTimeslotPeriod(port, DiscoveryTimeslotPeriod);
//DiscoveryTimeout(epdComsHandle,DiscoveryExpirationPeriod);
CommsInitialized = 1;
}
}
return rv;
}
MK3::Epd2U::~Epd2U()
{
if (epdComsHandle != INVALID_HANDLE_VALUE) DestroyReaderInterface(epdComsHandle);
CommsInitialized = 0;
}
void WINAPI MK3::Epd2U::discovery(CommsHandle hComms, DiscoveryId const discovered[], int32_t count)
{
if (count > 0)
{
current->CurrentDeviceID = discovered[0].Id;
memcpy(&current->Epd, &discovered[0], sizeof(DiscoveryId));
SetEvent(Ev1);
}
}
int MK3::Epd2U::StartDiscover()
{
int32_t rv;
//System::Diagnostics::Trace::WriteLine("StartDiscover");
Error = 0;
if (port == 0) {
DeviceCount = 1;
DeviceIDs[0] = 768;
return 1;
}
Cancel(epdComsHandle);
//FlushDiscoveryCache(port);
//FlushBuffers(port);
int tries = 25; DeviceCount = 0; DiscRV = 1;
while (tries-- > 0 && DeviceCount == 0)
{
//memset(DevceIDs, 0, sizeof(DeviceIDs));
current = this;
Ev1 = CreateEvent(NULL, TRUE,FALSE,NULL);
rv = StartDiscovery(epdComsHandle, discovery);
rv = WaitForSingleObject(Ev1, 10000);
}
//System::Diagnostics::Trace::WriteLine(System::String::Format("Discover DeviceCount = {0}", DeviceCount));
return DiscRV;
}
void MK3::Epd2U::Open(DWORD DeviceID)
{
CurrentDeviceID = DeviceID;
if (port > 0) {
ConRV = Connect(DeviceID);
if (ConRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
else {
OpenRV = OpenDevice(port, CurrentDeviceID);
if (OpenRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
}
}
else { OpenRV = ConRV = 1; }
}
void MK3::Epd2U::Close()
{
if (port > 0) CloseDevice();
//DeinitComms(port); CommsInitialized = 0;
}
void MK3::Epd2U::DecodeFunctionFlags()
{
EpdType = (FunctionFlags & 0x1F00) >> 8;
}
void MK3::Epd2U::DecodeStatus()
{
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;
}
WORD MK3::Epd2U::ReadStatus()
{
Error = 0; ReadStatusRV = 0;
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 = SoftVersion = FunctionFlags = 0;
if (port == 0) {
EpdID = 4567;
EpdType = 0;
FunctionFlags = 0x000;
return 1;
}
CommitRV = ReadEpdStatus(&EpdClock, &RealTime, &IssueCount, &OffTime, &OperatingStatus, &ErrorStatus, &AlarmStatus, &OtherAlarms, &EEPROMBadSectors);
if (port == 0) {
EpdClock = 123; ErrorStatus = 0;
};
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;
return 0;
}
else {
if (CurrentDeviceID == 0) CurrentDeviceID = EpdID;
time_t t = RealTime;
TimeFunctions::UnixTimeToSystemTime(t, &tRealTime);
DecodeStatus();
DecodeFunctionFlags();
}
if (CommitRV == 1 && EPDIssued == 1)
{
CommitRV = ReadWearer(
WearerID,
WearerIDLength,
WearerName,
WearerNameLength);
if (CommitRV == 1) CommitRV = Commit();
if (CommitRV == 0) {
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
ReadStatusRV = ErrorReason;
return 0;
}
else {
for (int i = 0; i < WearerIDLength; i++)
if (WearerID[i] == 0xb) WearerID[i] = '0'; else WearerID[i] |= 0x30;
}
}
return CommitRV;
}

252
MK3/MK3Base.h Normal file
View file

@ -0,0 +1,252 @@
#pragma once
#include <windows.h>
#include "EpdCommon.h"
#include "TimeFunctions.h"
#pragma unmanaged
namespace MK3
{
class Epd2U
{
public:
char comPort[5] = {"COM4"};
CommsHandle epdComsHandle;
uint32_t CurrentDeviceID;
EpdGeneration EpdGen;
DiscoveryId Epd;
CompletionToken token;
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 = 0b00010010;
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 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;
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;
//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;
DWORD Password = 9;
BYTE byBatADC;
BYTE bySupplyADC;
BYTE byStatus3;
BYTE byStatus4;
int StartDiscover();
void Open(DWORD DeviceID);
void Close();
void DecodeFunctionFlags();
void DecodeStatus();
Epd2U(int comport);
WORD WriteConfig();
DWORD StartCom();
WORD ReadStatus();
WORD EPDReadExtraStatus();
WORD EPDReadConfig();
WORD TurnOff();
WORD TurnOn();
WORD WriteCal();
WORD ReadTresHolds();
WORD ReadDoses();
WORD PrepareForIssue();
WORD DeIssue();
WORD Issue();
~Epd2U();
static HANDLE Ev1 = INVALID_HANDLE_VALUE;
static Epd2U* current;
static void WINAPI discovery (CommsHandle hComms, DiscoveryId const discovered[], int32_t count);
};
}

581
MK3/Mk3Types.h Normal file
View file

@ -0,0 +1,581 @@
#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,
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

BIN
MK3/Reader3.dll Normal file

Binary file not shown.

3
MK3/Resource.h Normal file
View file

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

26
MK3/TimeFunctions.cpp Normal file
View file

@ -0,0 +1,26 @@
#include "stdafx.h"
#include "TimeFunctions.h"
#pragma unmanaged
TimeFunctions::TimeFunctions()
{
}
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);
}

13
MK3/TimeFunctions.h Normal file
View file

@ -0,0 +1,13 @@
#pragma once
#include <windows.h>
#include <time.h>
class TimeFunctions
{
public:
TimeFunctions();
static void UnixTimeToFileTime(time_t t, LPFILETIME pft);
static void UnixTimeToSystemTime(time_t t, LPSYSTEMTIME pst);
};

BIN
MK3/app.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
MK3/app.rc Normal file

Binary file not shown.

5
MK3/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.

12
MK3/pch.h Normal file
View file

@ -0,0 +1,12 @@
// 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
#endif //PCH_H

View file

@ -1,14 +1,85 @@
// TestMK3.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <wtypes.h>
#include <synchapi.h>
#include <iostream>
#include "EpdCommon.h"
char comPort[] = "COM4";
CommsHandle epdComsHandle;
uint32_t EpdID;
EpdGeneration EpdGen;
DiscoveryId Epd;
HANDLE Ev1 = INVALID_HANDLE_VALUE;
CompletionToken token;
StatusData_t status;
MeasValue_t doses[4];
uint8_t numDoses;
uint32_t utc;
void WINAPI discovery(CommsHandle hComms, DiscoveryId const discovered[], int32_t count)
{
EpdID = 0;
if (count > 0) {
EpdID = discovered[0].Id;
EpdGen = discovered[0].Gen;
}
memcpy(&Epd,&discovered[0],sizeof(DiscoveryId));
SetEvent(Ev1);
}
void WINAPI completion(CommsHandle hComms, CompletionToken token)
{
SetEvent(Ev1);
}
void GetEPD()
{
epdComsHandle = CreateReaderInterface();
int r = OpenReader(epdComsHandle, comPort);
Ev1 = CreateEvent(
NULL, // default security attributes
TRUE, // manual-reset event
FALSE, // initial state is nonsignaled
TEXT("WriteEvent") // object name
);
r = StartDiscovery(epdComsHandle, discovery);
std::cout << "wacht effen!\n";
r = WaitForSingleObject(Ev1, 10000); // no time-out interval
std::cout << "ok!\n";
r = Connect(epdComsHandle,Epd, true);
ResetEvent(Ev1);
std::cout << "get status\n";
token = BeginReadStatus(epdComsHandle, completion);
r = Commit(epdComsHandle);
r = WaitForSingleObject(Ev1, 10000); // no time-out interval
std::cout << "got status\n";
r = EndReadStatus(epdComsHandle, token, &status);
ResetEvent(Ev1);
token = BeginReadDoses(epdComsHandle, new uint8_t[]{0, 1}, 2, completion);
r = Commit(epdComsHandle);
r = WaitForSingleObject(Ev1, 10000); // no time-out interval
std::cout << "got doses\n";
r = EndReadDoses(epdComsHandle, token, doses, 2, &numDoses, &utc);
}
int main()
{
CommsHandle i = CreateReaderInterface();
OpenReader(i,"")
GetEPD();
std::cout << "Hello World!\n";
std::getchar();
}
// Run program: Ctrl + F5 or Debug > Start Without Debugging menu

View file

@ -158,9 +158,14 @@
<ClInclude Include="Mk3Types.h" />
</ItemGroup>
<ItemGroup>
<None Include="Reader3.dll">
<CopyFileToFolders Include="Reader3.dll">
<DeploymentContent>true</DeploymentContent>
</None>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</ExcludedFromBuild>
<FileType>Document</FileType>
</CopyFileToFolders>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View file

@ -37,6 +37,8 @@
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="Reader3.dll" />
<CopyFileToFolders Include="Reader3.dll">
<Filter>Resource Files</Filter>
</CopyFileToFolders>
</ItemGroup>
</Project>

11630
TestMK3/x.txt Normal file

File diff suppressed because it is too large Load diff

11630
TestMK3/x.yxy Normal file

File diff suppressed because it is too large Load diff

View file

@ -21,13 +21,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "syncEdosLocal", "syncEdosLo
EndProject
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "eDosSetup", "SetupProject1\eDosSetup.wixproj", "{D24E8510-81C4-4F32-B48D-38BA67AEFB0A}"
EndProject
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "SetupProjectTestSched", "SetupProjectTestSched\SetupProjectTestSched.wixproj", "{BCF97910-CF22-486A-8D27-0A685FE83E4E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mk3clr", "mk3clr\mk3clr.vcxproj", "{099A033B-FA40-4C98-B6CA-825B6494ED62}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestMK3", "TestMK3\TestMK3.vcxproj", "{5AF7D0D5-9A6D-4C41-8466-3DFBA4F94D84}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "reader3.dll", "reader3.dll\reader3.dll.vcxproj", "{5464D378-9032-47A8-92B3-DBC6936FFF86}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MK3", "MK3\MK3.vcxproj", "{CFD0F68D-7EF9-4541-B55A-2A557D84295B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -183,32 +179,6 @@ Global
{D24E8510-81C4-4F32-B48D-38BA67AEFB0A}.Release|x64.ActiveCfg = Release|x86
{D24E8510-81C4-4F32-B48D-38BA67AEFB0A}.Release|x86.ActiveCfg = Release|x86
{D24E8510-81C4-4F32-B48D-38BA67AEFB0A}.Release|x86.Build.0 = Release|x86
{BCF97910-CF22-486A-8D27-0A685FE83E4E}.Debug|Any CPU.ActiveCfg = Debug|x86
{BCF97910-CF22-486A-8D27-0A685FE83E4E}.Debug|ARM.ActiveCfg = Debug|x86
{BCF97910-CF22-486A-8D27-0A685FE83E4E}.Debug|ARM64.ActiveCfg = Debug|x86
{BCF97910-CF22-486A-8D27-0A685FE83E4E}.Debug|x64.ActiveCfg = Debug|x86
{BCF97910-CF22-486A-8D27-0A685FE83E4E}.Debug|x86.ActiveCfg = Debug|x86
{BCF97910-CF22-486A-8D27-0A685FE83E4E}.Debug|x86.Build.0 = Debug|x86
{BCF97910-CF22-486A-8D27-0A685FE83E4E}.Release|Any CPU.ActiveCfg = Release|x86
{BCF97910-CF22-486A-8D27-0A685FE83E4E}.Release|ARM.ActiveCfg = Release|x86
{BCF97910-CF22-486A-8D27-0A685FE83E4E}.Release|ARM64.ActiveCfg = Release|x86
{BCF97910-CF22-486A-8D27-0A685FE83E4E}.Release|x64.ActiveCfg = Release|x86
{BCF97910-CF22-486A-8D27-0A685FE83E4E}.Release|x86.ActiveCfg = Release|x86
{BCF97910-CF22-486A-8D27-0A685FE83E4E}.Release|x86.Build.0 = Release|x86
{099A033B-FA40-4C98-B6CA-825B6494ED62}.Debug|Any CPU.ActiveCfg = Debug|Win32
{099A033B-FA40-4C98-B6CA-825B6494ED62}.Debug|ARM.ActiveCfg = Debug|Win32
{099A033B-FA40-4C98-B6CA-825B6494ED62}.Debug|ARM64.ActiveCfg = Debug|Win32
{099A033B-FA40-4C98-B6CA-825B6494ED62}.Debug|x64.ActiveCfg = Debug|x64
{099A033B-FA40-4C98-B6CA-825B6494ED62}.Debug|x64.Build.0 = Debug|x64
{099A033B-FA40-4C98-B6CA-825B6494ED62}.Debug|x86.ActiveCfg = Debug|Win32
{099A033B-FA40-4C98-B6CA-825B6494ED62}.Debug|x86.Build.0 = Debug|Win32
{099A033B-FA40-4C98-B6CA-825B6494ED62}.Release|Any CPU.ActiveCfg = Release|Win32
{099A033B-FA40-4C98-B6CA-825B6494ED62}.Release|ARM.ActiveCfg = Release|Win32
{099A033B-FA40-4C98-B6CA-825B6494ED62}.Release|ARM64.ActiveCfg = Release|Win32
{099A033B-FA40-4C98-B6CA-825B6494ED62}.Release|x64.ActiveCfg = Release|x64
{099A033B-FA40-4C98-B6CA-825B6494ED62}.Release|x64.Build.0 = Release|x64
{099A033B-FA40-4C98-B6CA-825B6494ED62}.Release|x86.ActiveCfg = Release|Win32
{099A033B-FA40-4C98-B6CA-825B6494ED62}.Release|x86.Build.0 = Release|Win32
{5AF7D0D5-9A6D-4C41-8466-3DFBA4F94D84}.Debug|Any CPU.ActiveCfg = Debug|Win32
{5AF7D0D5-9A6D-4C41-8466-3DFBA4F94D84}.Debug|ARM.ActiveCfg = Debug|Win32
{5AF7D0D5-9A6D-4C41-8466-3DFBA4F94D84}.Debug|ARM64.ActiveCfg = Debug|Win32
@ -223,20 +193,20 @@ Global
{5AF7D0D5-9A6D-4C41-8466-3DFBA4F94D84}.Release|x64.Build.0 = Release|x64
{5AF7D0D5-9A6D-4C41-8466-3DFBA4F94D84}.Release|x86.ActiveCfg = Release|Win32
{5AF7D0D5-9A6D-4C41-8466-3DFBA4F94D84}.Release|x86.Build.0 = Release|Win32
{5464D378-9032-47A8-92B3-DBC6936FFF86}.Debug|Any CPU.ActiveCfg = Debug|Win32
{5464D378-9032-47A8-92B3-DBC6936FFF86}.Debug|ARM.ActiveCfg = Debug|Win32
{5464D378-9032-47A8-92B3-DBC6936FFF86}.Debug|ARM64.ActiveCfg = Debug|Win32
{5464D378-9032-47A8-92B3-DBC6936FFF86}.Debug|x64.ActiveCfg = Debug|x64
{5464D378-9032-47A8-92B3-DBC6936FFF86}.Debug|x64.Build.0 = Debug|x64
{5464D378-9032-47A8-92B3-DBC6936FFF86}.Debug|x86.ActiveCfg = Debug|Win32
{5464D378-9032-47A8-92B3-DBC6936FFF86}.Debug|x86.Build.0 = Debug|Win32
{5464D378-9032-47A8-92B3-DBC6936FFF86}.Release|Any CPU.ActiveCfg = Release|Win32
{5464D378-9032-47A8-92B3-DBC6936FFF86}.Release|ARM.ActiveCfg = Release|Win32
{5464D378-9032-47A8-92B3-DBC6936FFF86}.Release|ARM64.ActiveCfg = Release|Win32
{5464D378-9032-47A8-92B3-DBC6936FFF86}.Release|x64.ActiveCfg = Release|x64
{5464D378-9032-47A8-92B3-DBC6936FFF86}.Release|x64.Build.0 = Release|x64
{5464D378-9032-47A8-92B3-DBC6936FFF86}.Release|x86.ActiveCfg = Release|Win32
{5464D378-9032-47A8-92B3-DBC6936FFF86}.Release|x86.Build.0 = Release|Win32
{CFD0F68D-7EF9-4541-B55A-2A557D84295B}.Debug|Any CPU.ActiveCfg = Debug|Win32
{CFD0F68D-7EF9-4541-B55A-2A557D84295B}.Debug|ARM.ActiveCfg = Debug|Win32
{CFD0F68D-7EF9-4541-B55A-2A557D84295B}.Debug|ARM64.ActiveCfg = Debug|Win32
{CFD0F68D-7EF9-4541-B55A-2A557D84295B}.Debug|x64.ActiveCfg = Debug|x64
{CFD0F68D-7EF9-4541-B55A-2A557D84295B}.Debug|x64.Build.0 = Debug|x64
{CFD0F68D-7EF9-4541-B55A-2A557D84295B}.Debug|x86.ActiveCfg = Debug|Win32
{CFD0F68D-7EF9-4541-B55A-2A557D84295B}.Debug|x86.Build.0 = Debug|Win32
{CFD0F68D-7EF9-4541-B55A-2A557D84295B}.Release|Any CPU.ActiveCfg = Release|Win32
{CFD0F68D-7EF9-4541-B55A-2A557D84295B}.Release|ARM.ActiveCfg = Release|Win32
{CFD0F68D-7EF9-4541-B55A-2A557D84295B}.Release|ARM64.ActiveCfg = Release|Win32
{CFD0F68D-7EF9-4541-B55A-2A557D84295B}.Release|x64.ActiveCfg = Release|x64
{CFD0F68D-7EF9-4541-B55A-2A557D84295B}.Release|x64.Build.0 = Release|x64
{CFD0F68D-7EF9-4541-B55A-2A557D84295B}.Release|x86.ActiveCfg = Release|Win32
{CFD0F68D-7EF9-4541-B55A-2A557D84295B}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -23,7 +23,7 @@ namespace eDosStation
sp = s;
if (ep.DetectorsOn > 0) tb_Add("DetectorsOn");
if (ep.EPDIssued > 0) tb_Add("EPD Issued");
if (ep.EPDLocked > 0) tb_Add("EPD Locked");
//if (ep.EPDLocked > 0) tb_Add("EPD Locked");
if (ep.EPDTesting > 0) tb_Add("EPD Detector test active");
if (ep.EPDProcSec > 0) tb_Add("EPD Processing every second");
if (ep.EPDFaulty > 0) tb_Add("EPD Faulty");

0
mk3clr/Epd3Clr.cpp Normal file
View file

0
mk3clr/Epd3Clr.h Normal file
View file

60
mk3clr/mk3clr.rc Normal file
View file

@ -0,0 +1,60 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE 19, 2
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

14
mk3clr/resource.h Normal file
View file

@ -0,0 +1,14 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by mk3clr.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