commit 589c17cd01a69ccf1ad52e30344f5abb31926b97 Author: Luc Vandenbroucke Date: Fri Feb 1 09:54:48 2019 +0100 first diff --git a/EpdBase/AssemblyInfo.cpp b/EpdBase/AssemblyInfo.cpp new file mode 100644 index 0000000..d74e471 --- /dev/null +++ b/EpdBase/AssemblyInfo.cpp @@ -0,0 +1,22 @@ +#include "stdafx.h" + +using namespace System; +using namespace System::Reflection; +using namespace System::Runtime::CompilerServices; +using namespace System::Runtime::InteropServices; +using namespace System::Security::Permissions; + +[assembly:AssemblyTitleAttribute(L"EpdBase")]; +[assembly:AssemblyDescriptionAttribute(L"")]; +[assembly:AssemblyConfigurationAttribute(L"")]; +[assembly:AssemblyCompanyAttribute(L"")]; +[assembly:AssemblyProductAttribute(L"EpdBase")]; +[assembly:AssemblyCopyrightAttribute(L"Copyright (c) 2019 Luc Vandenbroucke")]; +[assembly:AssemblyTrademarkAttribute(L"")]; +[assembly:AssemblyCultureAttribute(L"")]; + +[assembly:AssemblyVersionAttribute("1.0.*")]; + +[assembly:ComVisible(false)]; + +[assembly:CLSCompliantAttribute(true)]; diff --git a/EpdBase/EpdBase.cpp b/EpdBase/EpdBase.cpp new file mode 100644 index 0000000..efd85ce --- /dev/null +++ b/EpdBase/EpdBase.cpp @@ -0,0 +1,208 @@ +#include "stdafx.h" +#include "EpdBase.h" + +EpdBase::Epd2U::Epd2U(int comport) +{ + port = comport; + SetAutoCommit(0); + Error = 123; + //SetTimeouts(port, 20, 1000, 1000); + //SetDiscoveryExpirationPeriod(port, 5000); + InitRv= InitComms(port, 9600, 8, 0, 0); + if (InitRv == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); +} + +EpdBase::Epd2U::~Epd2U() +{ + DeinitComms(port); + SetAutoCommit(0); +} + + +void EpdBase::Epd2U::StartDiscover() +{ + FlushDiscoveryCache(port); + DiscRV= Discover(port, DeviceIDs, MaxDevices, &DeviceCount); + if (DiscRV == 1 && DeviceCount == 0) { + OnRV = EpdOn(); + Sleep(1100); + DiscRV = Discover(port, DeviceIDs, MaxDevices, &DeviceCount); + } + +} + +void EpdBase::Epd2U::Open(DWORD DeviceID) +{ + CurrentDeviceID = DeviceID; + ConRV = Connect(DeviceID); + if (ConRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); + else { + OpenRV = OpenDevice(port, CurrentDeviceID); + if (OpenRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); + } +} + +void EpdBase::Epd2U::Close() +{ + CloseDevice(); +} + +void EpdBase::Epd2U::DecodeFunctionFlags() +{ + EpdType = (FunctionFlags & 0x0300) >> 8; +} + +void EpdBase::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 EpdBase::Epd2U::ReadStatus() +{ + memset(WearerID, 0, IDLength+1); + memset(WearerName, 0, NameLength+1); + + EpdClock = RealTime = IssueCount = OffTime = OperatingStatus = ErrorStatus = AlarmStatus = OtherAlarms = EEPROMBadSectors = 0; + ErrorSource = ErrorReason = ErrorData = 0; + + ReadStatusRV= ReadEpdStatus(&EpdClock, &RealTime, &IssueCount, &OffTime, &OperatingStatus, &ErrorStatus, &AlarmStatus, &OtherAlarms, &EEPROMBadSectors); + if (ReadStatusRV == 0) { + Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); + return ErrorReason; + } + + EpdID = HardVersion = SoftVersion = FunctionFlags = 0; + ReadEpdIDRV = ReadEpdID( + &EpdID, + &HardVersion, + &SoftVersion, + &FunctionFlags); + if (ReadEpdIDRV == 0) { + Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); + return ErrorReason; + } + + CommitRV = Commit(); + if(CommitRV == 0) { + Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); + return ErrorReason; + } + else { + time_t t = RealTime; + TimeFunctions::UnixTimeToSystemTime(t, &tRealTime); + DecodeStatus(); + DecodeFunctionFlags(); + } + + if (ReadStatusRV == 1 && EPDIssued == 1) { + ReadWearerRV = 3; + ReadWearerRV = ReadWearer( + WearerID, + IDLength, + WearerName, + NameLength); + CommitRV = Commit(); + if (CommitRV == 0) { + Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); + return ErrorReason; + } + } + else + ReadWearerRV = 4; + + + + return 1; +} + +WORD EpdBase::Epd2U::EPDReadConfig() +{ + ReadConfigRV = ReadConfig( + &CountDownTime, + &ReturnTime, + &ChirpRate, + &TeleBaudSetting, + &SelfTestInterval, + &BatteryLoadTestInt, + &GeneralControl, + &CommsTimeout, + &InhibitTimeout, + &MinTxInterval, + &MaxTxIntervals, + &RandomiseWindow, + &DoseIncThresh); + if (ReadConfigRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); + CommitRV = Commit(); + if (CommitRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); + return CommitRV; +} + +WORD EpdBase::Epd2U::TurnOff() +{ + OffRV = EpdOff(); + if (OffRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); + EndSessionRV = EndSession(AlarmCtrl,8); + if (EndSessionRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); + + else { + CommitRV = Commit(); + if (CommitRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); + } + return CommitRV; +} + +WORD EpdBase::Epd2U::ReadTresHolds() +{ + ReadDoseTresholdRV = ReadAlarmDoseThresholds(&Hp10Dose1, &Hp10Dose2, &Hp07Dose); + ReadAlarmRateThresholdsRV = ReadAlarmRateThresholds( + &Hp10Rate1On, + &Hp10Rate2On, + &Hp07RateOn, + &Hp10Rate1Off, + &Hp10Rate2Off, + &Hp07RateOff); + ReadCalibrationDataRV = ReadCalibrationData( + &K1, + &K2, + &K3, + &K4, + &K5, + &K6, + &SG, + &BC, + &FB, + &HG); + CommitRV = Commit(); + if (CommitRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); + return CommitRV; +} \ No newline at end of file diff --git a/EpdBase/EpdBase.h b/EpdBase/EpdBase.h new file mode 100644 index 0000000..d76e450 --- /dev/null +++ b/EpdBase/EpdBase.h @@ -0,0 +1,167 @@ +#pragma once +#include +#include "dll2/ex15.mif" +#include "TimeFunctions.h" + + +namespace EpdBase +{ + + class Epd2U + { + public: + WORD port = 3; + const WORD MaxDevices = 10; + WORD DeviceCount = 0; + DWORD DeviceIDs[10]; + DWORD CurrentDeviceID; + + WORD AlarmCtrl = 0b01101110; + + DWORD EpdClock; + DWORD RealTime; + WORD IssueCount; + DWORD OffTime; + WORD OperatingStatus; + WORD ErrorStatus; + WORD AlarmStatus; + WORD OtherAlarms; + WORD EEPROMBadSectors; + + 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 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 IDLength 12 + BYTE WearerID[(IDLength)+1]; + #define NameLength 22 + BYTE WearerName[NameLength+1]; + + //AlarmDoseTreshold + DWORD Hp10Dose1; + DWORD Hp10Dose2; + DWORD Hp07Dose; + + 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; + + //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; + + + + + //OperatringStatus + 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; + + + void StartDiscover(); + void Open(DWORD DeviceID); + void Close(); + + void DecodeFunctionFlags(); + + void DecodeStatus(); + + Epd2U(int comport); + WORD ReadStatus(); + WORD EPDReadConfig(); + WORD TurnOff(); + WORD ReadTresHolds(); + ~Epd2U(); + }; +} + + diff --git a/EpdBase/EpdBase.vcxproj b/EpdBase/EpdBase.vcxproj new file mode 100644 index 0000000..4262bea --- /dev/null +++ b/EpdBase/EpdBase.vcxproj @@ -0,0 +1,161 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {3114A047-7562-42FE-94DE-2418EF19AD9A} + v4.7.2 + ManagedCProj + EpdBase + 10.0.17763.0 + + + + StaticLibrary + true + v141 + true + Unicode + + + DynamicLibrary + false + v141 + true + Unicode + + + StaticLibrary + true + v141 + true + Unicode + + + DynamicLibrary + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + Use + Level3 + Disabled + WIN32;_DEBUG;%(PreprocessorDefinitions) + + + + + + + + Use + Level3 + Disabled + _DEBUG;%(PreprocessorDefinitions) + + + + + + + + Use + Level3 + WIN32;NDEBUG;%(PreprocessorDefinitions) + + + + + + + + Use + Level3 + NDEBUG;%(PreprocessorDefinitions) + + + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/EpdBase/EpdBase.vcxproj.filters b/EpdBase/EpdBase.vcxproj.filters new file mode 100644 index 0000000..774ebd0 --- /dev/null +++ b/EpdBase/EpdBase.vcxproj.filters @@ -0,0 +1,55 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Resource Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/EpdBase/Resource.h b/EpdBase/Resource.h new file mode 100644 index 0000000..d5ac7c4 --- /dev/null +++ b/EpdBase/Resource.h @@ -0,0 +1,3 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by app.rc diff --git a/EpdBase/TimeFunctions.cpp b/EpdBase/TimeFunctions.cpp new file mode 100644 index 0000000..b31212f --- /dev/null +++ b/EpdBase/TimeFunctions.cpp @@ -0,0 +1,25 @@ +#include "stdafx.h" +#include "TimeFunctions.h" + + +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); +} \ No newline at end of file diff --git a/EpdBase/TimeFunctions.h b/EpdBase/TimeFunctions.h new file mode 100644 index 0000000..aff36d8 --- /dev/null +++ b/EpdBase/TimeFunctions.h @@ -0,0 +1,13 @@ +#pragma once +#include +#include + +static class TimeFunctions +{ +public: + TimeFunctions(); + static void UnixTimeToFileTime(time_t t, LPFILETIME pft); + static void UnixTimeToSystemTime(time_t t, LPSYSTEMTIME pst); + +}; + diff --git a/EpdBase/app.ico b/EpdBase/app.ico new file mode 100644 index 0000000..789d7cc Binary files /dev/null and b/EpdBase/app.ico differ diff --git a/EpdBase/app.rc b/EpdBase/app.rc new file mode 100644 index 0000000..eab4306 Binary files /dev/null and b/EpdBase/app.rc differ diff --git a/EpdBase/dll2/Reader2.dll b/EpdBase/dll2/Reader2.dll new file mode 100644 index 0000000..3edbef2 Binary files /dev/null and b/EpdBase/dll2/Reader2.dll differ diff --git a/EpdBase/dll2/Reader2.exp b/EpdBase/dll2/Reader2.exp new file mode 100644 index 0000000..5ba58d1 Binary files /dev/null and b/EpdBase/dll2/Reader2.exp differ diff --git a/EpdBase/dll2/ex15.mif b/EpdBase/dll2/ex15.mif new file mode 100644 index 0000000..2cc2b02 --- /dev/null +++ b/EpdBase/dll2/ex15.mif @@ -0,0 +1,1374 @@ +/****************************************************************************** + * + * Module Name : 32 Bit Ex15 Interface DLL + * + * Module Part No. : 611/TA/40571/000 + * + * File Name : EX15.MIF + * + * File Description : Top level functions exported by the DLL. + * + * Authors: : K Ferguson + * + ****************************************************************************** + * + * This is an unpublished work, the copyright of which vests in Siemens + * plc. All rights reserved. + * + * The information contained herein is the property of Siemens plc and is + * supplied without liability for errors or omissions 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. + * + ****************************************************************************** + ****************************************************************************** + * + * MODIFICATION HISTORY + * ==================== + * + * Mod Date Inits PR Description + * --- ---- ----- --- ----------- + * AA 11/07/97 KLF - Initial version. + * AB 18/07/97 JMS - Modified to use AWP protocol. + * AC 23/07/97 JMS - Moved error source & code values from THREAD.LIF as + * they are used by external modules. + * AD 05/08/97 JMS - Added SetTimeouts() function to allow the user + * to set the comms. timeouts. + * AE 05/08/97 JMS - Clarified Discover() parameter names. + * AF 07/08/97 JMS - Seperated SetAutoCommit() from OpenDevice() + * function and added Port parameter to OpenDevice(). + * Removed now redundant TestCounts parameter from + * the ReadConfig() and WriteConfig() functions. + * AG 08/08/97 JMS - Added Connect() function. + * AH 11/08/97 JMS - Extended some of the error reporting. + * AI 12/08/97 JMS - Revamped timeouts to timeout at message/frame-level + * rather than at lower comms. levels. + * AH 15/08/97 JMS - Extended error reporting. + * Added SetDiscoveryTimeslotPeriod() function. + * AI 26/08/97 JMS - Added Transmit() and Receive() functions to allow + * lower-level calls (eg. from EXCOMM) to bypass some + * of the message layer functionality. + * AJ 27/08/97 JMS - Fixed a typo from the previous changes. + * AK 29/08/97 JMS - Added extra tests and error codes for frame buffer + * overflow and retries exceed conditions. + * AL 02/01/97 JMS - Added FlushDiscoveryCache() function to allow the + * cache to be flushed by the application. + * AM 02/10/97 JMS - Added FlushBuffers() function to allow the Tx and + * Rx buffers to be flushed by the application. + * AN 14/10/97 JMS - Corrected the type of the Hp07Dose parameter of the + * WriteAlarmDoseThresholds() function from WORD to + * DWORD. + * AO 16/10/97 JMS - Added part number, function headers, etc. following + * review. + * AP 17/10/97 JMS - Added SetRetryCounts() to allow the retry counts + * to be set by the application. + * AQ 22/10/97 JMS - Removed now redundant error codes (ERR_*). + * AR 24/10/97 JMS - Added part number for Developer's Guide doc. + * AS 02/12/97 KLF - Various corrections after testing on version 1A. + * BA 11/05/99 JMS - Changed timestamps and timeouts to use instances + * of the Timex class rather than TickCount times, as + * TickCount times will wrap-around after 49.7 days + * of continuous up-time. Changed the timeout periods + * to be long types rather than DWORD to match the + * Timex convention. + * BB 04/02/00 EMH - Added WriteDisplayControlBits and WriteDisplayEnables + * BC 30/01/01 JMP - ERR_INVALID_ALARM_SETTINGS added + * BD 30/01/01 JMP - ERR_INVALID_NUMBER_OF_ALARMS added + * BE 08/02/01 JMP - ERR_INVALID_CONFIGURATION_LENGTH added + * ERR_INVALID_DISPLAY_CONTROL added + * BF 21/02/01 JMP - ERR_SCRATCH_OFFSET_PLUS_LEN added + * BG 15/08/02 JMP - Added new ANALOG2 commands + * BH 04/10/02 JMP - Modified Analog2 interface + * BI 02/06/03 PEB - Modified for compatibility with Microsoft Embedded Tools + * & PDA version of DLL + ******************************************************************************/ + +/* + * + * IMPORTANT NOTE TO DEVELOPERS + * + * When using the DLL and not using the AutoCommit feature - that is to say + * functions are combined and processed upon a call to Commit - the following + * should be noted. + * + * 1) + * Data will not be assigned to pointers passed into functions until AFTER + * the Commit function has been called successfully. Developers should take + * care that the areas of memory that are referenced by the pointers remain + * valid until after the Commit function is called. + * + * 2) + * Functions are processed in the order that they are called. Should a call + * to the Commit function fail then the error information can be retrieved + * using the GetErrorDetails function. If the error information indicates + * that one of the combined functions failed, then the developer should assume + * that all the functions called BEFORE the one that failed, have been + * completed successfully. All the functions AFTER and INCLUDING the function + * which failed will NOT have been completed. The exception to this is Read + * functions which will NOT be completed in the conditions described above + * even if they were called BEFORE the function which failed. + * + */ + +/*============================================================================*/ + +#define SRC_NONE 0 // no error occured +#define SRC_INT 1 // internal error +#define SRC_DLL 2 // DLL logical error +#define SRC_EX15 3 // error from Ex15 + +#define ERR_NONE 0 // No error code (internal error) +#define ERR_MSG 1 // Message not expected +#define ERR_SHORT 2 // Message too short +#define ERR_LENGTH 3 // Message data length not correct +#define ERR_QUEUE 4 // Message queue overflow +#define ERR_OVER 5 // Message buffer overflow +#define ERR_PARAM 6 // Parameter error +#define ERR_MEMORY 7 // Memory allocation failed +#define ERR_NO_THREAD 8 // No thread object available +#define ERR_NO_MSG 9 // No message layer available +#define ERR_DEVICE_OPEN 10 // A device is already open +#define ERR_AWP_USER_BUFF_TOO_SMALL 11 // AWP user supplied buffer too small +#define ERR_AWP_TX_MSG_BUFF_OVERFLOW 12 // AWP message too big for buffer +#define ERR_AWP_SEQ_MISMATCH 13 // AWP sequence number mismatch +#define ERR_DISCOVERY_IN_PROGRESS 14 // Discovery in progress +#define ERR_MSG_OPEN_FAILED 15 // Message layer Open failed +#define ERR_MSG_NOT_ACTIVE 16 // Message layer not active +#define ERR_LINK_OPEN_FAILED 17 // Link layer Open failed +#define ERR_INVALID_FRAME 18 // Link layer invalid frame +#define ERR_FRAME_TX_TIMEOUT 19 // Link layer frame Tx timeout +#define ERR_OPEN_PORT_FAILED 20 // Link open device port failed +#define ERR_CLOSE_PORT_FAILED 21 // Link close device port failed +#define ERR_SET_PORT_TIMEOUTS_FAILED 22 // Link set port timeouts failed +#define ERR_FRAME_RX_BUFF_OVERFLOW 23 // Frame Rx buffer overflowed +#define ERR_FRAME_TX_RETRIES_EXCEEDED 24 // Frame Tx retry count exceeded +#define ERR_FRAME_RX_RETRIES_EXCEEDED 25 // Frame Rx retry count exceeded +#define ERR_FRAME_RX_RESULT_UNKNOWN 26 // Frame Receive() result unknown +#define ERR_INDEX_TOO_LARGE 27 // index greater than profile entries +#define ERR_INVALID_ALARM_SETTINGS 28 // This EPD may NOT have alarms 'off' +#define ERR_INVALID_NUMBER_OF_ALARMS 29 // Passed Alarm array is incorrect size. +#define ERR_INVALID_CONFIGURATION_LENGTH 30 // Passed Display Configuration is incorrect size. +#define ERR_INVALID_DISPLAY_CONTROL 31 // This EPD may NOT have Display Units Changed. +#define ERR_SCRATCH_OFFSET_PLUS_LEN 32 // This area of scratchpad may not be written. + +/*============================================================================*/ + +#ifdef __BORLANDC__ + #define EPDDLL_API _export +#else //assume microsoft + #ifdef EPDDLL_EXPORTS + #define EPDDLL_API __declspec(dllexport) + #else + #define EPDDLL_API __declspec(dllimport) + #endif +#endif + +#ifdef _WIN32_WCE //Windows CE / pocket PC +#define PDA_BUILD +#endif + +extern "C" +{ + +#ifndef PDA_BUILD //Only included on Desktop DLLs +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +EPDDLL_API void* WINAPI AllocateMemory( DWORD Size ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MemoryAllocated( void* const Address ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReleaseMemory( void* const Address ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadMemory( + + void* const Address, WORD Offset, WORD Size, DWORD* const Value ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteMemory( + + void* const Address, WORD Offset, WORD Size, DWORD* const Value ); + +#endif //PDA BUILD + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI GetErrorDetails( + + WORD* const Source, WORD* const Reason, WORD* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI GetDataMetric( WORD MetricNumber, WORD* const Metric ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI InitComms( + + WORD Port, DWORD Baud, WORD Data, WORD Parity, WORD Stop ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI DeinitComms( WORD Port ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Abort( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetTimeouts( WORD Port, long RxByteTimeout, + long RxMessageTimeout, long TxMessageTimeout ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetDiscoveryExpirationPeriod( WORD Port, + long ExpirationPeriod ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetDiscoveryTimeslotPeriod( WORD Port, long TimeslotPeriod ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetDiscoveryTimeslotCount( WORD Port, WORD TimeslotCount ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI FlushDiscoveryCache( WORD Port ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Discover( WORD Port, DWORD* DeviceIDs, WORD MaxDevices, + WORD* const Count ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetRetryCounts( WORD RxRetryCount, WORD TxRetryCount ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetAutoCommit( WORD AutoCommit ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI OpenDevice( WORD Port, DWORD DeviceID ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI CloseDevice( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI FlushBuffers( WORD Port ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Connect( DWORD DeviceID ); + +#define ALLOW_LOW_LEVEL +#ifdef ALLOW_LOW_LEVEL +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Transmit( BYTE* TxBuffer, DWORD TxLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Receive( BYTE* RxBuffer, DWORD* RxLength ); +#endif /* ALLOW_LOW_LEVEL */ + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Commit( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadCommsStats( + + WORD* const XBOFSeen, + WORD* const TotalTxFrames, + WORD* const TotalRxFrames, + WORD* const GoodRxFrames, + WORD* const BadRxFrames, + WORD* const TotalWakeups, + WORD* const RxErrors ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI EpdOn( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI EpdOff( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadEpdID( + + DWORD* const EpdID, + WORD* const HardVersion, + WORD* const SoftVersion, + WORD* const FunctionFlags ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadEpdStatus( + + DWORD* const EpdClock, + DWORD* const RealTime, + WORD* const IssueCount, + DWORD* const OffTime, + WORD* const OperatingStatus, + WORD* const ErrorStatus, + WORD* const AlarmsStatus, + WORD* const OtherAlarms, + WORD* const EEPROMBadSectors ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI TestDetectors( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadWearerID( BYTE* const WearerID, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadWearerName( BYTE* const WearerName, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadWearer( + + BYTE* const WearerID, WORD IDLength, + BYTE* const WearerName, WORD NameLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI IssueEpd( BYTE* const WearerID, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI DeIssueEpd( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteWearerName( BYTE* const WearerName, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI BaseLineCounts( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetFailFlag( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearFailFlag( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearLatchedAlarms( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearFaultFlags( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDosesQuality( + + DWORD* const Hp10Dose, DWORD* const Hp07Dose, + DWORD* const Hp10Total, DWORD* const Hp07Total, + WORD* const Knocks, WORD* const Resets, WORD* const QualityData ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadCounts( + + DWORD* const D1, DWORD* const D2, + DWORD* const D3, DWORD* const D4, DWORD* const EpdClock ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadPeaks( + + DWORD* const Hp10Peak, DWORD* const Hp07Peak, + DWORD* const Hp10Time, DWORD* const Hp07Time ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadRates( DWORD* const Hp10Rate, DWORD* const Hp07Rate ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadBaseCounts( + + DWORD* const D1, DWORD* const D2, + DWORD* const D3, DWORD* const D4, DWORD* const EpdClock ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadCalibrationData( + + WORD* const K1, WORD* const K2, WORD* const K3, + WORD* const K4, WORD* const K5, WORD* const K6, + WORD* const SG, WORD* const BC, WORD* const FB, WORD* const HG ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadAlarmDoseThresholds( + + DWORD* const Hp10Dose1, DWORD* const Hp10Dose2, DWORD* const Hp07Dose ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadAlarmRateThresholds( + + DWORD* const Hp10Rate1On, DWORD* const Hp10Rate2On, DWORD* const Hp07RateOn, + DWORD* const Hp10Rate1Off, DWORD* const Hp10Rate2Off, DWORD* const Hp07RateOff ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI DisplayFaultCode( WORD FaultCode ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSReadData( + + DWORD* const Hp10Dose, DWORD* const Hp07Dose, + WORD* const Knocks, WORD* const Resets, WORD* const QualityData, + DWORD* const Hp10Peak, DWORD* const Hp07Peak, + DWORD* const Hp10Time, DWORD* const Hp07Time ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadProfileControl( + + WORD* const Interval, DWORD* const TimeToNext ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDoseProfile( WORD* const ProfileEntries ); + +WORD EPDDLL_API WINAPI ReadDoseProfileSince( + + DWORD EpdClock, WORD* const ProfileEntries ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDoseProfileCache( + + WORD Index, + DWORD* const EpdClock, WORD* const Interval, + DWORD* const Hp10Dose, DWORD* const Hp07Dose ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadConfig( + + WORD* const CountDownTime, + DWORD* const ReturnTime, + WORD* const ChirpRate, + WORD* const TeleBaudSetting, + WORD* const SelfTestInterval, + WORD* const BatteryLoadTestInt, + WORD* const GeneralControl, + WORD* const CommsTimeout, + WORD* const InhibitTimeout, + WORD* const MinTxInterval, + WORD* const MaxTxIntervals, + WORD* const RandomiseWindow, + WORD* const DoseIncThresh ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadAlarmConfig( + + BYTE* const Config, WORD ConfigLength, + BYTE* const Duration, WORD DurationLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDisplayConfig( + + WORD* const Control, + WORD* const LongSwitchTime, + WORD* const DoubleClickTime, + WORD* const DisplayDefaultTime, + WORD* const Default, + BYTE* const Config, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadErrorStore( + + DWORD* const ErrorTime, WORD TimeLength, + BYTE* const ErrorCode, WORD CodeLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadSpecialWriteTimes( DWORD* const WriteTimes, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadSpecialDoseStore( + + WORD Index, WORD Count, + DWORD* const Hp10Dose, WORD Hp10Length, + DWORD* const Hp07Dose, WORD Hp07Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearErrorStore( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearDose( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteDose( DWORD Hp10Dose, DWORD Hp07Dose ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteCountdownTimer( WORD wCountDownTime, WORD wStartNow ); + +/*----------------------------------------------------------------------------* + * + * This function (WriteCountdownTimer) was written after the Developers Guide + * to the Ex15 Interface DLL (611/HB/40571/000) + * The first parameter wdCountDownTime is the count down time in seconds + * The second param byStartNow is a boolean to start the timer now + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearTotalDose( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteTotalDose( DWORD Hp10Total, DWORD Hp07Total ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearPeakRates( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteReturnForReadTime( DWORD ReturnTime ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteAlarmDoseThresholds( + + DWORD Hp10Dose1, DWORD Hp10Dose2, DWORD Hp07Dose ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteAlarmRateThresholds( + + DWORD Hp10Rate1On, DWORD Hp10Rate2On, DWORD Hp07RateOn, + DWORD Hp10Rate1Off, DWORD Hp10Rate2Off, DWORD Hp07RateOff ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteAlarmConfig( + + BYTE* const Config, WORD ConfigLength, + BYTE* const Duration, WORD DurationLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteDisplayConfig( + WORD Control, + WORD LongSwitchTime, + WORD DoubleClickTime, + WORD DisplayDefaultTime, + WORD Default, BYTE* const Config, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteDisplayControlBits( WORD DisplayControlBits ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + + WORD EPDDLL_API WINAPI WriteDisplayEnables( + WORD Default, BYTE* const Config, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + + WORD EPDDLL_API WINAPI WriteConfig( + + 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 ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteProfileControl( WORD Interval, DWORD TimeToNext ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteSpecialWriteTimes( + + DWORD* const WriteTimes, WORD Time ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI EndSession( WORD AlarmCtrl, WORD Duration ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadScratchPad( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteScratchPad( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteChirpRate( WORD ChirpRate ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadRAM( + + WORD Offset, WORD Length , void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadASIC( WORD Register, WORD* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDirectEEPROM( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSLogin( DWORD Password ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSClearWearer( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSReadWearer( + + BYTE* const WearerID, WORD IDLength, + BYTE* const WearerName, WORD NameLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSIssue( + + BYTE* const WearerID, WORD IDLength, + BYTE* const WearerName, WORD NameLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSDeIssue( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSClearData( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSWritePassword( DWORD Password ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSSetOffEnable( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSClearOffEnable( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRLogin( DWORD Password ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteCalFactors( + + WORD K1, WORD K2, WORD K3, WORD K4, WORD K5, WORD K6 ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteDetectorThresholds( + + WORD SG, WORD BC, WORD FB, WORD HG ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteRAM( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteDirectEEPROM( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRResetEpd( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRFormatEEPROM( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteASIC( WORD Register, WORD Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRSetAlwaysCount( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRClearAlwaysCount( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRSetGolden( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRClearGolden( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteEpdID( + + DWORD EpdID, + WORD HardVersion, + WORD SoftVersion, + WORD FunctionFlags ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWritePassword( DWORD Password ); + + + +//additional commands for ANALOG2 +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadA2Config( + BYTE* const byADC_LA, + BYTE* const byADC_LL, + BYTE* const byADC_SUPPLY, + BYTE* const byADC_BAT_TYPE, + WORD* const wOffDisplay, + BYTE* const byConfig7, + BYTE* const byConfig8); +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadA2ConfigStatus( + BYTE* const byBatADC, + BYTE* const bySupplyADC, + BYTE* const byStatus3, + BYTE* const byStatus4); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteA2Config( + BYTE byADC_LA, + BYTE byADC_LL, + BYTE byADC_SUPPLY, + BYTE byADC_BAT_TYPE, + WORD wOffDisplay, + BYTE byConfig7, + BYTE byConfig8 ); + + /*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI TestBattery( void ); + + + +} diff --git a/EpdBase/dll2/reader2.lib b/EpdBase/dll2/reader2.lib new file mode 100644 index 0000000..e69de29 diff --git a/EpdBase/dll2/save/Reader2.dll b/EpdBase/dll2/save/Reader2.dll new file mode 100644 index 0000000..3edbef2 Binary files /dev/null and b/EpdBase/dll2/save/Reader2.dll differ diff --git a/EpdBase/dll2/save/Reader2.exp b/EpdBase/dll2/save/Reader2.exp new file mode 100644 index 0000000..5ba58d1 Binary files /dev/null and b/EpdBase/dll2/save/Reader2.exp differ diff --git a/EpdBase/dll2/save/Reader2.lib b/EpdBase/dll2/save/Reader2.lib new file mode 100644 index 0000000..3e4941f Binary files /dev/null and b/EpdBase/dll2/save/Reader2.lib differ diff --git a/EpdBase/dll2/save/ex15.mif b/EpdBase/dll2/save/ex15.mif new file mode 100644 index 0000000..2cc2b02 --- /dev/null +++ b/EpdBase/dll2/save/ex15.mif @@ -0,0 +1,1374 @@ +/****************************************************************************** + * + * Module Name : 32 Bit Ex15 Interface DLL + * + * Module Part No. : 611/TA/40571/000 + * + * File Name : EX15.MIF + * + * File Description : Top level functions exported by the DLL. + * + * Authors: : K Ferguson + * + ****************************************************************************** + * + * This is an unpublished work, the copyright of which vests in Siemens + * plc. All rights reserved. + * + * The information contained herein is the property of Siemens plc and is + * supplied without liability for errors or omissions 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. + * + ****************************************************************************** + ****************************************************************************** + * + * MODIFICATION HISTORY + * ==================== + * + * Mod Date Inits PR Description + * --- ---- ----- --- ----------- + * AA 11/07/97 KLF - Initial version. + * AB 18/07/97 JMS - Modified to use AWP protocol. + * AC 23/07/97 JMS - Moved error source & code values from THREAD.LIF as + * they are used by external modules. + * AD 05/08/97 JMS - Added SetTimeouts() function to allow the user + * to set the comms. timeouts. + * AE 05/08/97 JMS - Clarified Discover() parameter names. + * AF 07/08/97 JMS - Seperated SetAutoCommit() from OpenDevice() + * function and added Port parameter to OpenDevice(). + * Removed now redundant TestCounts parameter from + * the ReadConfig() and WriteConfig() functions. + * AG 08/08/97 JMS - Added Connect() function. + * AH 11/08/97 JMS - Extended some of the error reporting. + * AI 12/08/97 JMS - Revamped timeouts to timeout at message/frame-level + * rather than at lower comms. levels. + * AH 15/08/97 JMS - Extended error reporting. + * Added SetDiscoveryTimeslotPeriod() function. + * AI 26/08/97 JMS - Added Transmit() and Receive() functions to allow + * lower-level calls (eg. from EXCOMM) to bypass some + * of the message layer functionality. + * AJ 27/08/97 JMS - Fixed a typo from the previous changes. + * AK 29/08/97 JMS - Added extra tests and error codes for frame buffer + * overflow and retries exceed conditions. + * AL 02/01/97 JMS - Added FlushDiscoveryCache() function to allow the + * cache to be flushed by the application. + * AM 02/10/97 JMS - Added FlushBuffers() function to allow the Tx and + * Rx buffers to be flushed by the application. + * AN 14/10/97 JMS - Corrected the type of the Hp07Dose parameter of the + * WriteAlarmDoseThresholds() function from WORD to + * DWORD. + * AO 16/10/97 JMS - Added part number, function headers, etc. following + * review. + * AP 17/10/97 JMS - Added SetRetryCounts() to allow the retry counts + * to be set by the application. + * AQ 22/10/97 JMS - Removed now redundant error codes (ERR_*). + * AR 24/10/97 JMS - Added part number for Developer's Guide doc. + * AS 02/12/97 KLF - Various corrections after testing on version 1A. + * BA 11/05/99 JMS - Changed timestamps and timeouts to use instances + * of the Timex class rather than TickCount times, as + * TickCount times will wrap-around after 49.7 days + * of continuous up-time. Changed the timeout periods + * to be long types rather than DWORD to match the + * Timex convention. + * BB 04/02/00 EMH - Added WriteDisplayControlBits and WriteDisplayEnables + * BC 30/01/01 JMP - ERR_INVALID_ALARM_SETTINGS added + * BD 30/01/01 JMP - ERR_INVALID_NUMBER_OF_ALARMS added + * BE 08/02/01 JMP - ERR_INVALID_CONFIGURATION_LENGTH added + * ERR_INVALID_DISPLAY_CONTROL added + * BF 21/02/01 JMP - ERR_SCRATCH_OFFSET_PLUS_LEN added + * BG 15/08/02 JMP - Added new ANALOG2 commands + * BH 04/10/02 JMP - Modified Analog2 interface + * BI 02/06/03 PEB - Modified for compatibility with Microsoft Embedded Tools + * & PDA version of DLL + ******************************************************************************/ + +/* + * + * IMPORTANT NOTE TO DEVELOPERS + * + * When using the DLL and not using the AutoCommit feature - that is to say + * functions are combined and processed upon a call to Commit - the following + * should be noted. + * + * 1) + * Data will not be assigned to pointers passed into functions until AFTER + * the Commit function has been called successfully. Developers should take + * care that the areas of memory that are referenced by the pointers remain + * valid until after the Commit function is called. + * + * 2) + * Functions are processed in the order that they are called. Should a call + * to the Commit function fail then the error information can be retrieved + * using the GetErrorDetails function. If the error information indicates + * that one of the combined functions failed, then the developer should assume + * that all the functions called BEFORE the one that failed, have been + * completed successfully. All the functions AFTER and INCLUDING the function + * which failed will NOT have been completed. The exception to this is Read + * functions which will NOT be completed in the conditions described above + * even if they were called BEFORE the function which failed. + * + */ + +/*============================================================================*/ + +#define SRC_NONE 0 // no error occured +#define SRC_INT 1 // internal error +#define SRC_DLL 2 // DLL logical error +#define SRC_EX15 3 // error from Ex15 + +#define ERR_NONE 0 // No error code (internal error) +#define ERR_MSG 1 // Message not expected +#define ERR_SHORT 2 // Message too short +#define ERR_LENGTH 3 // Message data length not correct +#define ERR_QUEUE 4 // Message queue overflow +#define ERR_OVER 5 // Message buffer overflow +#define ERR_PARAM 6 // Parameter error +#define ERR_MEMORY 7 // Memory allocation failed +#define ERR_NO_THREAD 8 // No thread object available +#define ERR_NO_MSG 9 // No message layer available +#define ERR_DEVICE_OPEN 10 // A device is already open +#define ERR_AWP_USER_BUFF_TOO_SMALL 11 // AWP user supplied buffer too small +#define ERR_AWP_TX_MSG_BUFF_OVERFLOW 12 // AWP message too big for buffer +#define ERR_AWP_SEQ_MISMATCH 13 // AWP sequence number mismatch +#define ERR_DISCOVERY_IN_PROGRESS 14 // Discovery in progress +#define ERR_MSG_OPEN_FAILED 15 // Message layer Open failed +#define ERR_MSG_NOT_ACTIVE 16 // Message layer not active +#define ERR_LINK_OPEN_FAILED 17 // Link layer Open failed +#define ERR_INVALID_FRAME 18 // Link layer invalid frame +#define ERR_FRAME_TX_TIMEOUT 19 // Link layer frame Tx timeout +#define ERR_OPEN_PORT_FAILED 20 // Link open device port failed +#define ERR_CLOSE_PORT_FAILED 21 // Link close device port failed +#define ERR_SET_PORT_TIMEOUTS_FAILED 22 // Link set port timeouts failed +#define ERR_FRAME_RX_BUFF_OVERFLOW 23 // Frame Rx buffer overflowed +#define ERR_FRAME_TX_RETRIES_EXCEEDED 24 // Frame Tx retry count exceeded +#define ERR_FRAME_RX_RETRIES_EXCEEDED 25 // Frame Rx retry count exceeded +#define ERR_FRAME_RX_RESULT_UNKNOWN 26 // Frame Receive() result unknown +#define ERR_INDEX_TOO_LARGE 27 // index greater than profile entries +#define ERR_INVALID_ALARM_SETTINGS 28 // This EPD may NOT have alarms 'off' +#define ERR_INVALID_NUMBER_OF_ALARMS 29 // Passed Alarm array is incorrect size. +#define ERR_INVALID_CONFIGURATION_LENGTH 30 // Passed Display Configuration is incorrect size. +#define ERR_INVALID_DISPLAY_CONTROL 31 // This EPD may NOT have Display Units Changed. +#define ERR_SCRATCH_OFFSET_PLUS_LEN 32 // This area of scratchpad may not be written. + +/*============================================================================*/ + +#ifdef __BORLANDC__ + #define EPDDLL_API _export +#else //assume microsoft + #ifdef EPDDLL_EXPORTS + #define EPDDLL_API __declspec(dllexport) + #else + #define EPDDLL_API __declspec(dllimport) + #endif +#endif + +#ifdef _WIN32_WCE //Windows CE / pocket PC +#define PDA_BUILD +#endif + +extern "C" +{ + +#ifndef PDA_BUILD //Only included on Desktop DLLs +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +EPDDLL_API void* WINAPI AllocateMemory( DWORD Size ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MemoryAllocated( void* const Address ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReleaseMemory( void* const Address ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadMemory( + + void* const Address, WORD Offset, WORD Size, DWORD* const Value ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteMemory( + + void* const Address, WORD Offset, WORD Size, DWORD* const Value ); + +#endif //PDA BUILD + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI GetErrorDetails( + + WORD* const Source, WORD* const Reason, WORD* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI GetDataMetric( WORD MetricNumber, WORD* const Metric ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI InitComms( + + WORD Port, DWORD Baud, WORD Data, WORD Parity, WORD Stop ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI DeinitComms( WORD Port ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Abort( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetTimeouts( WORD Port, long RxByteTimeout, + long RxMessageTimeout, long TxMessageTimeout ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetDiscoveryExpirationPeriod( WORD Port, + long ExpirationPeriod ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetDiscoveryTimeslotPeriod( WORD Port, long TimeslotPeriod ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetDiscoveryTimeslotCount( WORD Port, WORD TimeslotCount ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI FlushDiscoveryCache( WORD Port ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Discover( WORD Port, DWORD* DeviceIDs, WORD MaxDevices, + WORD* const Count ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetRetryCounts( WORD RxRetryCount, WORD TxRetryCount ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetAutoCommit( WORD AutoCommit ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI OpenDevice( WORD Port, DWORD DeviceID ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI CloseDevice( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI FlushBuffers( WORD Port ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Connect( DWORD DeviceID ); + +#define ALLOW_LOW_LEVEL +#ifdef ALLOW_LOW_LEVEL +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Transmit( BYTE* TxBuffer, DWORD TxLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Receive( BYTE* RxBuffer, DWORD* RxLength ); +#endif /* ALLOW_LOW_LEVEL */ + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Commit( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadCommsStats( + + WORD* const XBOFSeen, + WORD* const TotalTxFrames, + WORD* const TotalRxFrames, + WORD* const GoodRxFrames, + WORD* const BadRxFrames, + WORD* const TotalWakeups, + WORD* const RxErrors ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI EpdOn( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI EpdOff( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadEpdID( + + DWORD* const EpdID, + WORD* const HardVersion, + WORD* const SoftVersion, + WORD* const FunctionFlags ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadEpdStatus( + + DWORD* const EpdClock, + DWORD* const RealTime, + WORD* const IssueCount, + DWORD* const OffTime, + WORD* const OperatingStatus, + WORD* const ErrorStatus, + WORD* const AlarmsStatus, + WORD* const OtherAlarms, + WORD* const EEPROMBadSectors ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI TestDetectors( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadWearerID( BYTE* const WearerID, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadWearerName( BYTE* const WearerName, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadWearer( + + BYTE* const WearerID, WORD IDLength, + BYTE* const WearerName, WORD NameLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI IssueEpd( BYTE* const WearerID, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI DeIssueEpd( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteWearerName( BYTE* const WearerName, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI BaseLineCounts( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetFailFlag( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearFailFlag( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearLatchedAlarms( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearFaultFlags( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDosesQuality( + + DWORD* const Hp10Dose, DWORD* const Hp07Dose, + DWORD* const Hp10Total, DWORD* const Hp07Total, + WORD* const Knocks, WORD* const Resets, WORD* const QualityData ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadCounts( + + DWORD* const D1, DWORD* const D2, + DWORD* const D3, DWORD* const D4, DWORD* const EpdClock ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadPeaks( + + DWORD* const Hp10Peak, DWORD* const Hp07Peak, + DWORD* const Hp10Time, DWORD* const Hp07Time ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadRates( DWORD* const Hp10Rate, DWORD* const Hp07Rate ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadBaseCounts( + + DWORD* const D1, DWORD* const D2, + DWORD* const D3, DWORD* const D4, DWORD* const EpdClock ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadCalibrationData( + + WORD* const K1, WORD* const K2, WORD* const K3, + WORD* const K4, WORD* const K5, WORD* const K6, + WORD* const SG, WORD* const BC, WORD* const FB, WORD* const HG ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadAlarmDoseThresholds( + + DWORD* const Hp10Dose1, DWORD* const Hp10Dose2, DWORD* const Hp07Dose ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadAlarmRateThresholds( + + DWORD* const Hp10Rate1On, DWORD* const Hp10Rate2On, DWORD* const Hp07RateOn, + DWORD* const Hp10Rate1Off, DWORD* const Hp10Rate2Off, DWORD* const Hp07RateOff ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI DisplayFaultCode( WORD FaultCode ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSReadData( + + DWORD* const Hp10Dose, DWORD* const Hp07Dose, + WORD* const Knocks, WORD* const Resets, WORD* const QualityData, + DWORD* const Hp10Peak, DWORD* const Hp07Peak, + DWORD* const Hp10Time, DWORD* const Hp07Time ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadProfileControl( + + WORD* const Interval, DWORD* const TimeToNext ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDoseProfile( WORD* const ProfileEntries ); + +WORD EPDDLL_API WINAPI ReadDoseProfileSince( + + DWORD EpdClock, WORD* const ProfileEntries ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDoseProfileCache( + + WORD Index, + DWORD* const EpdClock, WORD* const Interval, + DWORD* const Hp10Dose, DWORD* const Hp07Dose ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadConfig( + + WORD* const CountDownTime, + DWORD* const ReturnTime, + WORD* const ChirpRate, + WORD* const TeleBaudSetting, + WORD* const SelfTestInterval, + WORD* const BatteryLoadTestInt, + WORD* const GeneralControl, + WORD* const CommsTimeout, + WORD* const InhibitTimeout, + WORD* const MinTxInterval, + WORD* const MaxTxIntervals, + WORD* const RandomiseWindow, + WORD* const DoseIncThresh ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadAlarmConfig( + + BYTE* const Config, WORD ConfigLength, + BYTE* const Duration, WORD DurationLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDisplayConfig( + + WORD* const Control, + WORD* const LongSwitchTime, + WORD* const DoubleClickTime, + WORD* const DisplayDefaultTime, + WORD* const Default, + BYTE* const Config, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadErrorStore( + + DWORD* const ErrorTime, WORD TimeLength, + BYTE* const ErrorCode, WORD CodeLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadSpecialWriteTimes( DWORD* const WriteTimes, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadSpecialDoseStore( + + WORD Index, WORD Count, + DWORD* const Hp10Dose, WORD Hp10Length, + DWORD* const Hp07Dose, WORD Hp07Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearErrorStore( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearDose( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteDose( DWORD Hp10Dose, DWORD Hp07Dose ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteCountdownTimer( WORD wCountDownTime, WORD wStartNow ); + +/*----------------------------------------------------------------------------* + * + * This function (WriteCountdownTimer) was written after the Developers Guide + * to the Ex15 Interface DLL (611/HB/40571/000) + * The first parameter wdCountDownTime is the count down time in seconds + * The second param byStartNow is a boolean to start the timer now + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearTotalDose( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteTotalDose( DWORD Hp10Total, DWORD Hp07Total ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearPeakRates( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteReturnForReadTime( DWORD ReturnTime ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteAlarmDoseThresholds( + + DWORD Hp10Dose1, DWORD Hp10Dose2, DWORD Hp07Dose ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteAlarmRateThresholds( + + DWORD Hp10Rate1On, DWORD Hp10Rate2On, DWORD Hp07RateOn, + DWORD Hp10Rate1Off, DWORD Hp10Rate2Off, DWORD Hp07RateOff ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteAlarmConfig( + + BYTE* const Config, WORD ConfigLength, + BYTE* const Duration, WORD DurationLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteDisplayConfig( + WORD Control, + WORD LongSwitchTime, + WORD DoubleClickTime, + WORD DisplayDefaultTime, + WORD Default, BYTE* const Config, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteDisplayControlBits( WORD DisplayControlBits ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + + WORD EPDDLL_API WINAPI WriteDisplayEnables( + WORD Default, BYTE* const Config, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + + WORD EPDDLL_API WINAPI WriteConfig( + + 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 ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteProfileControl( WORD Interval, DWORD TimeToNext ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteSpecialWriteTimes( + + DWORD* const WriteTimes, WORD Time ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI EndSession( WORD AlarmCtrl, WORD Duration ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadScratchPad( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteScratchPad( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteChirpRate( WORD ChirpRate ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadRAM( + + WORD Offset, WORD Length , void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadASIC( WORD Register, WORD* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDirectEEPROM( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSLogin( DWORD Password ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSClearWearer( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSReadWearer( + + BYTE* const WearerID, WORD IDLength, + BYTE* const WearerName, WORD NameLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSIssue( + + BYTE* const WearerID, WORD IDLength, + BYTE* const WearerName, WORD NameLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSDeIssue( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSClearData( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSWritePassword( DWORD Password ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSSetOffEnable( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSClearOffEnable( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRLogin( DWORD Password ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteCalFactors( + + WORD K1, WORD K2, WORD K3, WORD K4, WORD K5, WORD K6 ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteDetectorThresholds( + + WORD SG, WORD BC, WORD FB, WORD HG ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteRAM( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteDirectEEPROM( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRResetEpd( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRFormatEEPROM( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteASIC( WORD Register, WORD Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRSetAlwaysCount( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRClearAlwaysCount( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRSetGolden( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRClearGolden( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteEpdID( + + DWORD EpdID, + WORD HardVersion, + WORD SoftVersion, + WORD FunctionFlags ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWritePassword( DWORD Password ); + + + +//additional commands for ANALOG2 +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadA2Config( + BYTE* const byADC_LA, + BYTE* const byADC_LL, + BYTE* const byADC_SUPPLY, + BYTE* const byADC_BAT_TYPE, + WORD* const wOffDisplay, + BYTE* const byConfig7, + BYTE* const byConfig8); +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadA2ConfigStatus( + BYTE* const byBatADC, + BYTE* const bySupplyADC, + BYTE* const byStatus3, + BYTE* const byStatus4); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteA2Config( + BYTE byADC_LA, + BYTE byADC_LL, + BYTE byADC_SUPPLY, + BYTE byADC_BAT_TYPE, + WORD wOffDisplay, + BYTE byConfig7, + BYTE byConfig8 ); + + /*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI TestBattery( void ); + + + +} diff --git a/EpdBase/stdafx.cpp b/EpdBase/stdafx.cpp new file mode 100644 index 0000000..fd4f341 --- /dev/null +++ b/EpdBase/stdafx.cpp @@ -0,0 +1 @@ +#include "stdafx.h" diff --git a/EpdBase/stdafx.h b/EpdBase/stdafx.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/EpdBase/stdafx.h @@ -0,0 +1 @@ +#pragma once diff --git a/TestDirect/IR_READER_MS_DLL.dll b/TestDirect/IR_READER_MS_DLL.dll new file mode 100644 index 0000000..3edbef2 Binary files /dev/null and b/TestDirect/IR_READER_MS_DLL.dll differ diff --git a/TestDirect/LOG.INI b/TestDirect/LOG.INI new file mode 100644 index 0000000..e69de29 diff --git a/TestDirect/TestDirect.cpp b/TestDirect/TestDirect.cpp new file mode 100644 index 0000000..5a97f42 --- /dev/null +++ b/TestDirect/TestDirect.cpp @@ -0,0 +1,32 @@ +// TestDirect.cpp : This file contains the 'main' function. Program execution begins and ends there. +// + +#include "pch.h" +#include +#include +#include "dll2/ex15.mif" + +#pragma comment(lib,"dll2/Reader2.lib") + +int main() + +{ + std::cout << "Hello World!\n"; + + + DWORD port = 1; + WORD rv= InitComms(port, 9600, 8, 0, 1); + SetAutoCommit(0); + +} + +// Run program: Ctrl + F5 or Debug > Start Without Debugging menu +// Debug program: F5 or Debug > Start Debugging menu + +// Tips for Getting Started: +// 1. Use the Solution Explorer window to add/manage files +// 2. Use the Team Explorer window to connect to source control +// 3. Use the Output window to see build output and other messages +// 4. Use the Error List window to view errors +// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project +// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file diff --git a/TestDirect/TestDirect.vcxproj b/TestDirect/TestDirect.vcxproj new file mode 100644 index 0000000..e701c3b --- /dev/null +++ b/TestDirect/TestDirect.vcxproj @@ -0,0 +1,175 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {3655B312-F7C2-4825-BD5F-E087F6AF2D90} + Win32Proj + TestDirect + 10.0.17763.0 + + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + Use + Level3 + Disabled + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + %(DelayLoadDLLs) + %(AdditionalDependencies) + + + + + Use + Level3 + Disabled + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + %(DelayLoadDLLs) + %(AdditionalDependencies) + + + + + Use + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + true + true + + + + + Use + Level3 + MaxSpeed + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + true + true + + + + + + + + Create + Create + Create + Create + + + + + + + + + + \ No newline at end of file diff --git a/TestDirect/TestDirect.vcxproj.filters b/TestDirect/TestDirect.vcxproj.filters new file mode 100644 index 0000000..b919e55 --- /dev/null +++ b/TestDirect/TestDirect.vcxproj.filters @@ -0,0 +1,35 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/TestDirect/dll2/IR_READER_MS_DLL.dll b/TestDirect/dll2/IR_READER_MS_DLL.dll new file mode 100644 index 0000000..3edbef2 Binary files /dev/null and b/TestDirect/dll2/IR_READER_MS_DLL.dll differ diff --git a/TestDirect/dll2/Reader2.dll b/TestDirect/dll2/Reader2.dll new file mode 100644 index 0000000..3edbef2 Binary files /dev/null and b/TestDirect/dll2/Reader2.dll differ diff --git a/TestDirect/dll2/Reader2.exp b/TestDirect/dll2/Reader2.exp new file mode 100644 index 0000000..5ba58d1 Binary files /dev/null and b/TestDirect/dll2/Reader2.exp differ diff --git a/TestDirect/dll2/Reader2.lib b/TestDirect/dll2/Reader2.lib new file mode 100644 index 0000000..3e4941f Binary files /dev/null and b/TestDirect/dll2/Reader2.lib differ diff --git a/TestDirect/dll2/ex15.mif b/TestDirect/dll2/ex15.mif new file mode 100644 index 0000000..2cc2b02 --- /dev/null +++ b/TestDirect/dll2/ex15.mif @@ -0,0 +1,1374 @@ +/****************************************************************************** + * + * Module Name : 32 Bit Ex15 Interface DLL + * + * Module Part No. : 611/TA/40571/000 + * + * File Name : EX15.MIF + * + * File Description : Top level functions exported by the DLL. + * + * Authors: : K Ferguson + * + ****************************************************************************** + * + * This is an unpublished work, the copyright of which vests in Siemens + * plc. All rights reserved. + * + * The information contained herein is the property of Siemens plc and is + * supplied without liability for errors or omissions 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. + * + ****************************************************************************** + ****************************************************************************** + * + * MODIFICATION HISTORY + * ==================== + * + * Mod Date Inits PR Description + * --- ---- ----- --- ----------- + * AA 11/07/97 KLF - Initial version. + * AB 18/07/97 JMS - Modified to use AWP protocol. + * AC 23/07/97 JMS - Moved error source & code values from THREAD.LIF as + * they are used by external modules. + * AD 05/08/97 JMS - Added SetTimeouts() function to allow the user + * to set the comms. timeouts. + * AE 05/08/97 JMS - Clarified Discover() parameter names. + * AF 07/08/97 JMS - Seperated SetAutoCommit() from OpenDevice() + * function and added Port parameter to OpenDevice(). + * Removed now redundant TestCounts parameter from + * the ReadConfig() and WriteConfig() functions. + * AG 08/08/97 JMS - Added Connect() function. + * AH 11/08/97 JMS - Extended some of the error reporting. + * AI 12/08/97 JMS - Revamped timeouts to timeout at message/frame-level + * rather than at lower comms. levels. + * AH 15/08/97 JMS - Extended error reporting. + * Added SetDiscoveryTimeslotPeriod() function. + * AI 26/08/97 JMS - Added Transmit() and Receive() functions to allow + * lower-level calls (eg. from EXCOMM) to bypass some + * of the message layer functionality. + * AJ 27/08/97 JMS - Fixed a typo from the previous changes. + * AK 29/08/97 JMS - Added extra tests and error codes for frame buffer + * overflow and retries exceed conditions. + * AL 02/01/97 JMS - Added FlushDiscoveryCache() function to allow the + * cache to be flushed by the application. + * AM 02/10/97 JMS - Added FlushBuffers() function to allow the Tx and + * Rx buffers to be flushed by the application. + * AN 14/10/97 JMS - Corrected the type of the Hp07Dose parameter of the + * WriteAlarmDoseThresholds() function from WORD to + * DWORD. + * AO 16/10/97 JMS - Added part number, function headers, etc. following + * review. + * AP 17/10/97 JMS - Added SetRetryCounts() to allow the retry counts + * to be set by the application. + * AQ 22/10/97 JMS - Removed now redundant error codes (ERR_*). + * AR 24/10/97 JMS - Added part number for Developer's Guide doc. + * AS 02/12/97 KLF - Various corrections after testing on version 1A. + * BA 11/05/99 JMS - Changed timestamps and timeouts to use instances + * of the Timex class rather than TickCount times, as + * TickCount times will wrap-around after 49.7 days + * of continuous up-time. Changed the timeout periods + * to be long types rather than DWORD to match the + * Timex convention. + * BB 04/02/00 EMH - Added WriteDisplayControlBits and WriteDisplayEnables + * BC 30/01/01 JMP - ERR_INVALID_ALARM_SETTINGS added + * BD 30/01/01 JMP - ERR_INVALID_NUMBER_OF_ALARMS added + * BE 08/02/01 JMP - ERR_INVALID_CONFIGURATION_LENGTH added + * ERR_INVALID_DISPLAY_CONTROL added + * BF 21/02/01 JMP - ERR_SCRATCH_OFFSET_PLUS_LEN added + * BG 15/08/02 JMP - Added new ANALOG2 commands + * BH 04/10/02 JMP - Modified Analog2 interface + * BI 02/06/03 PEB - Modified for compatibility with Microsoft Embedded Tools + * & PDA version of DLL + ******************************************************************************/ + +/* + * + * IMPORTANT NOTE TO DEVELOPERS + * + * When using the DLL and not using the AutoCommit feature - that is to say + * functions are combined and processed upon a call to Commit - the following + * should be noted. + * + * 1) + * Data will not be assigned to pointers passed into functions until AFTER + * the Commit function has been called successfully. Developers should take + * care that the areas of memory that are referenced by the pointers remain + * valid until after the Commit function is called. + * + * 2) + * Functions are processed in the order that they are called. Should a call + * to the Commit function fail then the error information can be retrieved + * using the GetErrorDetails function. If the error information indicates + * that one of the combined functions failed, then the developer should assume + * that all the functions called BEFORE the one that failed, have been + * completed successfully. All the functions AFTER and INCLUDING the function + * which failed will NOT have been completed. The exception to this is Read + * functions which will NOT be completed in the conditions described above + * even if they were called BEFORE the function which failed. + * + */ + +/*============================================================================*/ + +#define SRC_NONE 0 // no error occured +#define SRC_INT 1 // internal error +#define SRC_DLL 2 // DLL logical error +#define SRC_EX15 3 // error from Ex15 + +#define ERR_NONE 0 // No error code (internal error) +#define ERR_MSG 1 // Message not expected +#define ERR_SHORT 2 // Message too short +#define ERR_LENGTH 3 // Message data length not correct +#define ERR_QUEUE 4 // Message queue overflow +#define ERR_OVER 5 // Message buffer overflow +#define ERR_PARAM 6 // Parameter error +#define ERR_MEMORY 7 // Memory allocation failed +#define ERR_NO_THREAD 8 // No thread object available +#define ERR_NO_MSG 9 // No message layer available +#define ERR_DEVICE_OPEN 10 // A device is already open +#define ERR_AWP_USER_BUFF_TOO_SMALL 11 // AWP user supplied buffer too small +#define ERR_AWP_TX_MSG_BUFF_OVERFLOW 12 // AWP message too big for buffer +#define ERR_AWP_SEQ_MISMATCH 13 // AWP sequence number mismatch +#define ERR_DISCOVERY_IN_PROGRESS 14 // Discovery in progress +#define ERR_MSG_OPEN_FAILED 15 // Message layer Open failed +#define ERR_MSG_NOT_ACTIVE 16 // Message layer not active +#define ERR_LINK_OPEN_FAILED 17 // Link layer Open failed +#define ERR_INVALID_FRAME 18 // Link layer invalid frame +#define ERR_FRAME_TX_TIMEOUT 19 // Link layer frame Tx timeout +#define ERR_OPEN_PORT_FAILED 20 // Link open device port failed +#define ERR_CLOSE_PORT_FAILED 21 // Link close device port failed +#define ERR_SET_PORT_TIMEOUTS_FAILED 22 // Link set port timeouts failed +#define ERR_FRAME_RX_BUFF_OVERFLOW 23 // Frame Rx buffer overflowed +#define ERR_FRAME_TX_RETRIES_EXCEEDED 24 // Frame Tx retry count exceeded +#define ERR_FRAME_RX_RETRIES_EXCEEDED 25 // Frame Rx retry count exceeded +#define ERR_FRAME_RX_RESULT_UNKNOWN 26 // Frame Receive() result unknown +#define ERR_INDEX_TOO_LARGE 27 // index greater than profile entries +#define ERR_INVALID_ALARM_SETTINGS 28 // This EPD may NOT have alarms 'off' +#define ERR_INVALID_NUMBER_OF_ALARMS 29 // Passed Alarm array is incorrect size. +#define ERR_INVALID_CONFIGURATION_LENGTH 30 // Passed Display Configuration is incorrect size. +#define ERR_INVALID_DISPLAY_CONTROL 31 // This EPD may NOT have Display Units Changed. +#define ERR_SCRATCH_OFFSET_PLUS_LEN 32 // This area of scratchpad may not be written. + +/*============================================================================*/ + +#ifdef __BORLANDC__ + #define EPDDLL_API _export +#else //assume microsoft + #ifdef EPDDLL_EXPORTS + #define EPDDLL_API __declspec(dllexport) + #else + #define EPDDLL_API __declspec(dllimport) + #endif +#endif + +#ifdef _WIN32_WCE //Windows CE / pocket PC +#define PDA_BUILD +#endif + +extern "C" +{ + +#ifndef PDA_BUILD //Only included on Desktop DLLs +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +EPDDLL_API void* WINAPI AllocateMemory( DWORD Size ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MemoryAllocated( void* const Address ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReleaseMemory( void* const Address ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadMemory( + + void* const Address, WORD Offset, WORD Size, DWORD* const Value ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteMemory( + + void* const Address, WORD Offset, WORD Size, DWORD* const Value ); + +#endif //PDA BUILD + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI GetErrorDetails( + + WORD* const Source, WORD* const Reason, WORD* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI GetDataMetric( WORD MetricNumber, WORD* const Metric ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI InitComms( + + WORD Port, DWORD Baud, WORD Data, WORD Parity, WORD Stop ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI DeinitComms( WORD Port ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Abort( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetTimeouts( WORD Port, long RxByteTimeout, + long RxMessageTimeout, long TxMessageTimeout ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetDiscoveryExpirationPeriod( WORD Port, + long ExpirationPeriod ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetDiscoveryTimeslotPeriod( WORD Port, long TimeslotPeriod ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetDiscoveryTimeslotCount( WORD Port, WORD TimeslotCount ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI FlushDiscoveryCache( WORD Port ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Discover( WORD Port, DWORD* DeviceIDs, WORD MaxDevices, + WORD* const Count ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetRetryCounts( WORD RxRetryCount, WORD TxRetryCount ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetAutoCommit( WORD AutoCommit ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI OpenDevice( WORD Port, DWORD DeviceID ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI CloseDevice( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI FlushBuffers( WORD Port ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Connect( DWORD DeviceID ); + +#define ALLOW_LOW_LEVEL +#ifdef ALLOW_LOW_LEVEL +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Transmit( BYTE* TxBuffer, DWORD TxLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Receive( BYTE* RxBuffer, DWORD* RxLength ); +#endif /* ALLOW_LOW_LEVEL */ + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Commit( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadCommsStats( + + WORD* const XBOFSeen, + WORD* const TotalTxFrames, + WORD* const TotalRxFrames, + WORD* const GoodRxFrames, + WORD* const BadRxFrames, + WORD* const TotalWakeups, + WORD* const RxErrors ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI EpdOn( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI EpdOff( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadEpdID( + + DWORD* const EpdID, + WORD* const HardVersion, + WORD* const SoftVersion, + WORD* const FunctionFlags ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadEpdStatus( + + DWORD* const EpdClock, + DWORD* const RealTime, + WORD* const IssueCount, + DWORD* const OffTime, + WORD* const OperatingStatus, + WORD* const ErrorStatus, + WORD* const AlarmsStatus, + WORD* const OtherAlarms, + WORD* const EEPROMBadSectors ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI TestDetectors( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadWearerID( BYTE* const WearerID, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadWearerName( BYTE* const WearerName, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadWearer( + + BYTE* const WearerID, WORD IDLength, + BYTE* const WearerName, WORD NameLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI IssueEpd( BYTE* const WearerID, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI DeIssueEpd( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteWearerName( BYTE* const WearerName, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI BaseLineCounts( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetFailFlag( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearFailFlag( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearLatchedAlarms( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearFaultFlags( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDosesQuality( + + DWORD* const Hp10Dose, DWORD* const Hp07Dose, + DWORD* const Hp10Total, DWORD* const Hp07Total, + WORD* const Knocks, WORD* const Resets, WORD* const QualityData ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadCounts( + + DWORD* const D1, DWORD* const D2, + DWORD* const D3, DWORD* const D4, DWORD* const EpdClock ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadPeaks( + + DWORD* const Hp10Peak, DWORD* const Hp07Peak, + DWORD* const Hp10Time, DWORD* const Hp07Time ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadRates( DWORD* const Hp10Rate, DWORD* const Hp07Rate ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadBaseCounts( + + DWORD* const D1, DWORD* const D2, + DWORD* const D3, DWORD* const D4, DWORD* const EpdClock ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadCalibrationData( + + WORD* const K1, WORD* const K2, WORD* const K3, + WORD* const K4, WORD* const K5, WORD* const K6, + WORD* const SG, WORD* const BC, WORD* const FB, WORD* const HG ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadAlarmDoseThresholds( + + DWORD* const Hp10Dose1, DWORD* const Hp10Dose2, DWORD* const Hp07Dose ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadAlarmRateThresholds( + + DWORD* const Hp10Rate1On, DWORD* const Hp10Rate2On, DWORD* const Hp07RateOn, + DWORD* const Hp10Rate1Off, DWORD* const Hp10Rate2Off, DWORD* const Hp07RateOff ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI DisplayFaultCode( WORD FaultCode ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSReadData( + + DWORD* const Hp10Dose, DWORD* const Hp07Dose, + WORD* const Knocks, WORD* const Resets, WORD* const QualityData, + DWORD* const Hp10Peak, DWORD* const Hp07Peak, + DWORD* const Hp10Time, DWORD* const Hp07Time ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadProfileControl( + + WORD* const Interval, DWORD* const TimeToNext ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDoseProfile( WORD* const ProfileEntries ); + +WORD EPDDLL_API WINAPI ReadDoseProfileSince( + + DWORD EpdClock, WORD* const ProfileEntries ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDoseProfileCache( + + WORD Index, + DWORD* const EpdClock, WORD* const Interval, + DWORD* const Hp10Dose, DWORD* const Hp07Dose ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadConfig( + + WORD* const CountDownTime, + DWORD* const ReturnTime, + WORD* const ChirpRate, + WORD* const TeleBaudSetting, + WORD* const SelfTestInterval, + WORD* const BatteryLoadTestInt, + WORD* const GeneralControl, + WORD* const CommsTimeout, + WORD* const InhibitTimeout, + WORD* const MinTxInterval, + WORD* const MaxTxIntervals, + WORD* const RandomiseWindow, + WORD* const DoseIncThresh ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadAlarmConfig( + + BYTE* const Config, WORD ConfigLength, + BYTE* const Duration, WORD DurationLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDisplayConfig( + + WORD* const Control, + WORD* const LongSwitchTime, + WORD* const DoubleClickTime, + WORD* const DisplayDefaultTime, + WORD* const Default, + BYTE* const Config, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadErrorStore( + + DWORD* const ErrorTime, WORD TimeLength, + BYTE* const ErrorCode, WORD CodeLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadSpecialWriteTimes( DWORD* const WriteTimes, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadSpecialDoseStore( + + WORD Index, WORD Count, + DWORD* const Hp10Dose, WORD Hp10Length, + DWORD* const Hp07Dose, WORD Hp07Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearErrorStore( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearDose( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteDose( DWORD Hp10Dose, DWORD Hp07Dose ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteCountdownTimer( WORD wCountDownTime, WORD wStartNow ); + +/*----------------------------------------------------------------------------* + * + * This function (WriteCountdownTimer) was written after the Developers Guide + * to the Ex15 Interface DLL (611/HB/40571/000) + * The first parameter wdCountDownTime is the count down time in seconds + * The second param byStartNow is a boolean to start the timer now + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearTotalDose( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteTotalDose( DWORD Hp10Total, DWORD Hp07Total ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearPeakRates( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteReturnForReadTime( DWORD ReturnTime ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteAlarmDoseThresholds( + + DWORD Hp10Dose1, DWORD Hp10Dose2, DWORD Hp07Dose ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteAlarmRateThresholds( + + DWORD Hp10Rate1On, DWORD Hp10Rate2On, DWORD Hp07RateOn, + DWORD Hp10Rate1Off, DWORD Hp10Rate2Off, DWORD Hp07RateOff ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteAlarmConfig( + + BYTE* const Config, WORD ConfigLength, + BYTE* const Duration, WORD DurationLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteDisplayConfig( + WORD Control, + WORD LongSwitchTime, + WORD DoubleClickTime, + WORD DisplayDefaultTime, + WORD Default, BYTE* const Config, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteDisplayControlBits( WORD DisplayControlBits ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + + WORD EPDDLL_API WINAPI WriteDisplayEnables( + WORD Default, BYTE* const Config, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + + WORD EPDDLL_API WINAPI WriteConfig( + + 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 ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteProfileControl( WORD Interval, DWORD TimeToNext ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteSpecialWriteTimes( + + DWORD* const WriteTimes, WORD Time ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI EndSession( WORD AlarmCtrl, WORD Duration ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadScratchPad( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteScratchPad( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteChirpRate( WORD ChirpRate ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadRAM( + + WORD Offset, WORD Length , void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadASIC( WORD Register, WORD* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDirectEEPROM( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSLogin( DWORD Password ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSClearWearer( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSReadWearer( + + BYTE* const WearerID, WORD IDLength, + BYTE* const WearerName, WORD NameLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSIssue( + + BYTE* const WearerID, WORD IDLength, + BYTE* const WearerName, WORD NameLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSDeIssue( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSClearData( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSWritePassword( DWORD Password ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSSetOffEnable( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSClearOffEnable( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRLogin( DWORD Password ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteCalFactors( + + WORD K1, WORD K2, WORD K3, WORD K4, WORD K5, WORD K6 ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteDetectorThresholds( + + WORD SG, WORD BC, WORD FB, WORD HG ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteRAM( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteDirectEEPROM( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRResetEpd( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRFormatEEPROM( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteASIC( WORD Register, WORD Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRSetAlwaysCount( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRClearAlwaysCount( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRSetGolden( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRClearGolden( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteEpdID( + + DWORD EpdID, + WORD HardVersion, + WORD SoftVersion, + WORD FunctionFlags ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWritePassword( DWORD Password ); + + + +//additional commands for ANALOG2 +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadA2Config( + BYTE* const byADC_LA, + BYTE* const byADC_LL, + BYTE* const byADC_SUPPLY, + BYTE* const byADC_BAT_TYPE, + WORD* const wOffDisplay, + BYTE* const byConfig7, + BYTE* const byConfig8); +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadA2ConfigStatus( + BYTE* const byBatADC, + BYTE* const bySupplyADC, + BYTE* const byStatus3, + BYTE* const byStatus4); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteA2Config( + BYTE byADC_LA, + BYTE byADC_LL, + BYTE byADC_SUPPLY, + BYTE byADC_BAT_TYPE, + WORD wOffDisplay, + BYTE byConfig7, + BYTE byConfig8 ); + + /*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI TestBattery( void ); + + + +} diff --git a/TestDirect/pch.cpp b/TestDirect/pch.cpp new file mode 100644 index 0000000..3a3d12b --- /dev/null +++ b/TestDirect/pch.cpp @@ -0,0 +1,5 @@ +// pch.cpp: source file corresponding to pre-compiled header; necessary for compilation to succeed + +#include "pch.h" + +// In general, ignore this file, but keep it around if you are using pre-compiled headers. diff --git a/TestDirect/pch.h b/TestDirect/pch.h new file mode 100644 index 0000000..b04e71e --- /dev/null +++ b/TestDirect/pch.h @@ -0,0 +1,14 @@ +// Tips for Getting Started: +// 1. Use the Solution Explorer window to add/manage files +// 2. Use the Team Explorer window to connect to source control +// 3. Use the Output window to see build output and other messages +// 4. Use the Error List window to view errors +// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project +// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file + +#ifndef PCH_H +#define PCH_H + +// TODO: add headers that you want to pre-compile here + +#endif //PCH_H diff --git a/TestEdosBase/IR_READER_MS_DLL.dll b/TestEdosBase/IR_READER_MS_DLL.dll new file mode 100644 index 0000000..3edbef2 Binary files /dev/null and b/TestEdosBase/IR_READER_MS_DLL.dll differ diff --git a/TestEdosBase/LOG.INI b/TestEdosBase/LOG.INI new file mode 100644 index 0000000..e69de29 diff --git a/TestEdosBase/TestEdosBase.cpp b/TestEdosBase/TestEdosBase.cpp new file mode 100644 index 0000000..4498249 --- /dev/null +++ b/TestEdosBase/TestEdosBase.cpp @@ -0,0 +1,38 @@ +// TestEdosBase.cpp : This file contains the 'main' function. Program execution begins and ends there. +// + +#include "pch.h" +#include +#include "..\EpdBase\EpdBase.h" +#pragma comment(lib,"EpdBase.lib") +#pragma comment(lib,"dll2/Reader2.lib") +int main() +{ + std::cout << "Hello World!\n"; + EpdBase::Epd2U ep = EpdBase::Epd2U(1); + ep.StartDiscover(); + + if (ep.DeviceCount > 0) { + ep.Open(ep.DeviceIDs[0]); + if (ep.ConRV == 1) { + ep.ReadStatus(); + ep.EPDReadConfig(); + ep.ReadTresHolds(); + ep.TurnOff(); + } + } + + + +} + +// Run program: Ctrl + F5 or Debug > Start Without Debugging menu +// Debug program: F5 or Debug > Start Debugging menu + +// Tips for Getting Started: +// 1. Use the Solution Explorer window to add/manage files +// 2. Use the Team Explorer window to connect to source control +// 3. Use the Output window to see build output and other messages +// 4. Use the Error List window to view errors +// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project +// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file diff --git a/TestEdosBase/TestEdosBase.vcxproj b/TestEdosBase/TestEdosBase.vcxproj new file mode 100644 index 0000000..af2a9a4 --- /dev/null +++ b/TestEdosBase/TestEdosBase.vcxproj @@ -0,0 +1,177 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {7B3DD1C5-D8D0-408C-A272-FF5E4A30DF24} + Win32Proj + TestEdosBase + 10.0.17763.0 + + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\EpdBase\dll2;$(LibraryPath) + + + true + $(SolutionDir)\EpdBase\dll2;$(LibraryPath) + + + false + + + false + + + + Use + Level3 + Disabled + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + %(AdditionalDependencies) + + + + + Use + Level3 + Disabled + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + %(AdditionalDependencies) + + + + + Use + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + true + true + + + + + Use + Level3 + MaxSpeed + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + true + true + + + + + + + + Create + Create + Create + Create + + + + + + {3114a047-7562-42fe-94de-2418ef19ad9a} + + + + + + \ No newline at end of file diff --git a/TestEdosBase/TestEdosBase.vcxproj.filters b/TestEdosBase/TestEdosBase.vcxproj.filters new file mode 100644 index 0000000..4644134 --- /dev/null +++ b/TestEdosBase/TestEdosBase.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/TestEdosBase/dll2/Reader2.dll b/TestEdosBase/dll2/Reader2.dll new file mode 100644 index 0000000..3edbef2 Binary files /dev/null and b/TestEdosBase/dll2/Reader2.dll differ diff --git a/TestEdosBase/dll2/Reader2.exp b/TestEdosBase/dll2/Reader2.exp new file mode 100644 index 0000000..5ba58d1 Binary files /dev/null and b/TestEdosBase/dll2/Reader2.exp differ diff --git a/TestEdosBase/dll2/Reader2.lib b/TestEdosBase/dll2/Reader2.lib new file mode 100644 index 0000000..3e4941f Binary files /dev/null and b/TestEdosBase/dll2/Reader2.lib differ diff --git a/TestEdosBase/dll2/ex15.mif b/TestEdosBase/dll2/ex15.mif new file mode 100644 index 0000000..2cc2b02 --- /dev/null +++ b/TestEdosBase/dll2/ex15.mif @@ -0,0 +1,1374 @@ +/****************************************************************************** + * + * Module Name : 32 Bit Ex15 Interface DLL + * + * Module Part No. : 611/TA/40571/000 + * + * File Name : EX15.MIF + * + * File Description : Top level functions exported by the DLL. + * + * Authors: : K Ferguson + * + ****************************************************************************** + * + * This is an unpublished work, the copyright of which vests in Siemens + * plc. All rights reserved. + * + * The information contained herein is the property of Siemens plc and is + * supplied without liability for errors or omissions 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. + * + ****************************************************************************** + ****************************************************************************** + * + * MODIFICATION HISTORY + * ==================== + * + * Mod Date Inits PR Description + * --- ---- ----- --- ----------- + * AA 11/07/97 KLF - Initial version. + * AB 18/07/97 JMS - Modified to use AWP protocol. + * AC 23/07/97 JMS - Moved error source & code values from THREAD.LIF as + * they are used by external modules. + * AD 05/08/97 JMS - Added SetTimeouts() function to allow the user + * to set the comms. timeouts. + * AE 05/08/97 JMS - Clarified Discover() parameter names. + * AF 07/08/97 JMS - Seperated SetAutoCommit() from OpenDevice() + * function and added Port parameter to OpenDevice(). + * Removed now redundant TestCounts parameter from + * the ReadConfig() and WriteConfig() functions. + * AG 08/08/97 JMS - Added Connect() function. + * AH 11/08/97 JMS - Extended some of the error reporting. + * AI 12/08/97 JMS - Revamped timeouts to timeout at message/frame-level + * rather than at lower comms. levels. + * AH 15/08/97 JMS - Extended error reporting. + * Added SetDiscoveryTimeslotPeriod() function. + * AI 26/08/97 JMS - Added Transmit() and Receive() functions to allow + * lower-level calls (eg. from EXCOMM) to bypass some + * of the message layer functionality. + * AJ 27/08/97 JMS - Fixed a typo from the previous changes. + * AK 29/08/97 JMS - Added extra tests and error codes for frame buffer + * overflow and retries exceed conditions. + * AL 02/01/97 JMS - Added FlushDiscoveryCache() function to allow the + * cache to be flushed by the application. + * AM 02/10/97 JMS - Added FlushBuffers() function to allow the Tx and + * Rx buffers to be flushed by the application. + * AN 14/10/97 JMS - Corrected the type of the Hp07Dose parameter of the + * WriteAlarmDoseThresholds() function from WORD to + * DWORD. + * AO 16/10/97 JMS - Added part number, function headers, etc. following + * review. + * AP 17/10/97 JMS - Added SetRetryCounts() to allow the retry counts + * to be set by the application. + * AQ 22/10/97 JMS - Removed now redundant error codes (ERR_*). + * AR 24/10/97 JMS - Added part number for Developer's Guide doc. + * AS 02/12/97 KLF - Various corrections after testing on version 1A. + * BA 11/05/99 JMS - Changed timestamps and timeouts to use instances + * of the Timex class rather than TickCount times, as + * TickCount times will wrap-around after 49.7 days + * of continuous up-time. Changed the timeout periods + * to be long types rather than DWORD to match the + * Timex convention. + * BB 04/02/00 EMH - Added WriteDisplayControlBits and WriteDisplayEnables + * BC 30/01/01 JMP - ERR_INVALID_ALARM_SETTINGS added + * BD 30/01/01 JMP - ERR_INVALID_NUMBER_OF_ALARMS added + * BE 08/02/01 JMP - ERR_INVALID_CONFIGURATION_LENGTH added + * ERR_INVALID_DISPLAY_CONTROL added + * BF 21/02/01 JMP - ERR_SCRATCH_OFFSET_PLUS_LEN added + * BG 15/08/02 JMP - Added new ANALOG2 commands + * BH 04/10/02 JMP - Modified Analog2 interface + * BI 02/06/03 PEB - Modified for compatibility with Microsoft Embedded Tools + * & PDA version of DLL + ******************************************************************************/ + +/* + * + * IMPORTANT NOTE TO DEVELOPERS + * + * When using the DLL and not using the AutoCommit feature - that is to say + * functions are combined and processed upon a call to Commit - the following + * should be noted. + * + * 1) + * Data will not be assigned to pointers passed into functions until AFTER + * the Commit function has been called successfully. Developers should take + * care that the areas of memory that are referenced by the pointers remain + * valid until after the Commit function is called. + * + * 2) + * Functions are processed in the order that they are called. Should a call + * to the Commit function fail then the error information can be retrieved + * using the GetErrorDetails function. If the error information indicates + * that one of the combined functions failed, then the developer should assume + * that all the functions called BEFORE the one that failed, have been + * completed successfully. All the functions AFTER and INCLUDING the function + * which failed will NOT have been completed. The exception to this is Read + * functions which will NOT be completed in the conditions described above + * even if they were called BEFORE the function which failed. + * + */ + +/*============================================================================*/ + +#define SRC_NONE 0 // no error occured +#define SRC_INT 1 // internal error +#define SRC_DLL 2 // DLL logical error +#define SRC_EX15 3 // error from Ex15 + +#define ERR_NONE 0 // No error code (internal error) +#define ERR_MSG 1 // Message not expected +#define ERR_SHORT 2 // Message too short +#define ERR_LENGTH 3 // Message data length not correct +#define ERR_QUEUE 4 // Message queue overflow +#define ERR_OVER 5 // Message buffer overflow +#define ERR_PARAM 6 // Parameter error +#define ERR_MEMORY 7 // Memory allocation failed +#define ERR_NO_THREAD 8 // No thread object available +#define ERR_NO_MSG 9 // No message layer available +#define ERR_DEVICE_OPEN 10 // A device is already open +#define ERR_AWP_USER_BUFF_TOO_SMALL 11 // AWP user supplied buffer too small +#define ERR_AWP_TX_MSG_BUFF_OVERFLOW 12 // AWP message too big for buffer +#define ERR_AWP_SEQ_MISMATCH 13 // AWP sequence number mismatch +#define ERR_DISCOVERY_IN_PROGRESS 14 // Discovery in progress +#define ERR_MSG_OPEN_FAILED 15 // Message layer Open failed +#define ERR_MSG_NOT_ACTIVE 16 // Message layer not active +#define ERR_LINK_OPEN_FAILED 17 // Link layer Open failed +#define ERR_INVALID_FRAME 18 // Link layer invalid frame +#define ERR_FRAME_TX_TIMEOUT 19 // Link layer frame Tx timeout +#define ERR_OPEN_PORT_FAILED 20 // Link open device port failed +#define ERR_CLOSE_PORT_FAILED 21 // Link close device port failed +#define ERR_SET_PORT_TIMEOUTS_FAILED 22 // Link set port timeouts failed +#define ERR_FRAME_RX_BUFF_OVERFLOW 23 // Frame Rx buffer overflowed +#define ERR_FRAME_TX_RETRIES_EXCEEDED 24 // Frame Tx retry count exceeded +#define ERR_FRAME_RX_RETRIES_EXCEEDED 25 // Frame Rx retry count exceeded +#define ERR_FRAME_RX_RESULT_UNKNOWN 26 // Frame Receive() result unknown +#define ERR_INDEX_TOO_LARGE 27 // index greater than profile entries +#define ERR_INVALID_ALARM_SETTINGS 28 // This EPD may NOT have alarms 'off' +#define ERR_INVALID_NUMBER_OF_ALARMS 29 // Passed Alarm array is incorrect size. +#define ERR_INVALID_CONFIGURATION_LENGTH 30 // Passed Display Configuration is incorrect size. +#define ERR_INVALID_DISPLAY_CONTROL 31 // This EPD may NOT have Display Units Changed. +#define ERR_SCRATCH_OFFSET_PLUS_LEN 32 // This area of scratchpad may not be written. + +/*============================================================================*/ + +#ifdef __BORLANDC__ + #define EPDDLL_API _export +#else //assume microsoft + #ifdef EPDDLL_EXPORTS + #define EPDDLL_API __declspec(dllexport) + #else + #define EPDDLL_API __declspec(dllimport) + #endif +#endif + +#ifdef _WIN32_WCE //Windows CE / pocket PC +#define PDA_BUILD +#endif + +extern "C" +{ + +#ifndef PDA_BUILD //Only included on Desktop DLLs +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +EPDDLL_API void* WINAPI AllocateMemory( DWORD Size ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MemoryAllocated( void* const Address ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReleaseMemory( void* const Address ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadMemory( + + void* const Address, WORD Offset, WORD Size, DWORD* const Value ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteMemory( + + void* const Address, WORD Offset, WORD Size, DWORD* const Value ); + +#endif //PDA BUILD + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI GetErrorDetails( + + WORD* const Source, WORD* const Reason, WORD* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI GetDataMetric( WORD MetricNumber, WORD* const Metric ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI InitComms( + + WORD Port, DWORD Baud, WORD Data, WORD Parity, WORD Stop ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI DeinitComms( WORD Port ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Abort( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetTimeouts( WORD Port, long RxByteTimeout, + long RxMessageTimeout, long TxMessageTimeout ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetDiscoveryExpirationPeriod( WORD Port, + long ExpirationPeriod ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetDiscoveryTimeslotPeriod( WORD Port, long TimeslotPeriod ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetDiscoveryTimeslotCount( WORD Port, WORD TimeslotCount ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI FlushDiscoveryCache( WORD Port ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Discover( WORD Port, DWORD* DeviceIDs, WORD MaxDevices, + WORD* const Count ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetRetryCounts( WORD RxRetryCount, WORD TxRetryCount ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetAutoCommit( WORD AutoCommit ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI OpenDevice( WORD Port, DWORD DeviceID ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI CloseDevice( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI FlushBuffers( WORD Port ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Connect( DWORD DeviceID ); + +#define ALLOW_LOW_LEVEL +#ifdef ALLOW_LOW_LEVEL +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Transmit( BYTE* TxBuffer, DWORD TxLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Receive( BYTE* RxBuffer, DWORD* RxLength ); +#endif /* ALLOW_LOW_LEVEL */ + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI Commit( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadCommsStats( + + WORD* const XBOFSeen, + WORD* const TotalTxFrames, + WORD* const TotalRxFrames, + WORD* const GoodRxFrames, + WORD* const BadRxFrames, + WORD* const TotalWakeups, + WORD* const RxErrors ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI EpdOn( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI EpdOff( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadEpdID( + + DWORD* const EpdID, + WORD* const HardVersion, + WORD* const SoftVersion, + WORD* const FunctionFlags ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadEpdStatus( + + DWORD* const EpdClock, + DWORD* const RealTime, + WORD* const IssueCount, + DWORD* const OffTime, + WORD* const OperatingStatus, + WORD* const ErrorStatus, + WORD* const AlarmsStatus, + WORD* const OtherAlarms, + WORD* const EEPROMBadSectors ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI TestDetectors( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadWearerID( BYTE* const WearerID, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadWearerName( BYTE* const WearerName, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadWearer( + + BYTE* const WearerID, WORD IDLength, + BYTE* const WearerName, WORD NameLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI IssueEpd( BYTE* const WearerID, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI DeIssueEpd( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteWearerName( BYTE* const WearerName, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI BaseLineCounts( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI SetFailFlag( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearFailFlag( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearLatchedAlarms( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearFaultFlags( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDosesQuality( + + DWORD* const Hp10Dose, DWORD* const Hp07Dose, + DWORD* const Hp10Total, DWORD* const Hp07Total, + WORD* const Knocks, WORD* const Resets, WORD* const QualityData ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadCounts( + + DWORD* const D1, DWORD* const D2, + DWORD* const D3, DWORD* const D4, DWORD* const EpdClock ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadPeaks( + + DWORD* const Hp10Peak, DWORD* const Hp07Peak, + DWORD* const Hp10Time, DWORD* const Hp07Time ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadRates( DWORD* const Hp10Rate, DWORD* const Hp07Rate ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadBaseCounts( + + DWORD* const D1, DWORD* const D2, + DWORD* const D3, DWORD* const D4, DWORD* const EpdClock ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadCalibrationData( + + WORD* const K1, WORD* const K2, WORD* const K3, + WORD* const K4, WORD* const K5, WORD* const K6, + WORD* const SG, WORD* const BC, WORD* const FB, WORD* const HG ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadAlarmDoseThresholds( + + DWORD* const Hp10Dose1, DWORD* const Hp10Dose2, DWORD* const Hp07Dose ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadAlarmRateThresholds( + + DWORD* const Hp10Rate1On, DWORD* const Hp10Rate2On, DWORD* const Hp07RateOn, + DWORD* const Hp10Rate1Off, DWORD* const Hp10Rate2Off, DWORD* const Hp07RateOff ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI DisplayFaultCode( WORD FaultCode ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSReadData( + + DWORD* const Hp10Dose, DWORD* const Hp07Dose, + WORD* const Knocks, WORD* const Resets, WORD* const QualityData, + DWORD* const Hp10Peak, DWORD* const Hp07Peak, + DWORD* const Hp10Time, DWORD* const Hp07Time ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadProfileControl( + + WORD* const Interval, DWORD* const TimeToNext ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDoseProfile( WORD* const ProfileEntries ); + +WORD EPDDLL_API WINAPI ReadDoseProfileSince( + + DWORD EpdClock, WORD* const ProfileEntries ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDoseProfileCache( + + WORD Index, + DWORD* const EpdClock, WORD* const Interval, + DWORD* const Hp10Dose, DWORD* const Hp07Dose ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadConfig( + + WORD* const CountDownTime, + DWORD* const ReturnTime, + WORD* const ChirpRate, + WORD* const TeleBaudSetting, + WORD* const SelfTestInterval, + WORD* const BatteryLoadTestInt, + WORD* const GeneralControl, + WORD* const CommsTimeout, + WORD* const InhibitTimeout, + WORD* const MinTxInterval, + WORD* const MaxTxIntervals, + WORD* const RandomiseWindow, + WORD* const DoseIncThresh ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadAlarmConfig( + + BYTE* const Config, WORD ConfigLength, + BYTE* const Duration, WORD DurationLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDisplayConfig( + + WORD* const Control, + WORD* const LongSwitchTime, + WORD* const DoubleClickTime, + WORD* const DisplayDefaultTime, + WORD* const Default, + BYTE* const Config, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadErrorStore( + + DWORD* const ErrorTime, WORD TimeLength, + BYTE* const ErrorCode, WORD CodeLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadSpecialWriteTimes( DWORD* const WriteTimes, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadSpecialDoseStore( + + WORD Index, WORD Count, + DWORD* const Hp10Dose, WORD Hp10Length, + DWORD* const Hp07Dose, WORD Hp07Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearErrorStore( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearDose( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteDose( DWORD Hp10Dose, DWORD Hp07Dose ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteCountdownTimer( WORD wCountDownTime, WORD wStartNow ); + +/*----------------------------------------------------------------------------* + * + * This function (WriteCountdownTimer) was written after the Developers Guide + * to the Ex15 Interface DLL (611/HB/40571/000) + * The first parameter wdCountDownTime is the count down time in seconds + * The second param byStartNow is a boolean to start the timer now + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearTotalDose( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteTotalDose( DWORD Hp10Total, DWORD Hp07Total ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ClearPeakRates( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteReturnForReadTime( DWORD ReturnTime ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteAlarmDoseThresholds( + + DWORD Hp10Dose1, DWORD Hp10Dose2, DWORD Hp07Dose ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteAlarmRateThresholds( + + DWORD Hp10Rate1On, DWORD Hp10Rate2On, DWORD Hp07RateOn, + DWORD Hp10Rate1Off, DWORD Hp10Rate2Off, DWORD Hp07RateOff ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteAlarmConfig( + + BYTE* const Config, WORD ConfigLength, + BYTE* const Duration, WORD DurationLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteDisplayConfig( + WORD Control, + WORD LongSwitchTime, + WORD DoubleClickTime, + WORD DisplayDefaultTime, + WORD Default, BYTE* const Config, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteDisplayControlBits( WORD DisplayControlBits ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + + WORD EPDDLL_API WINAPI WriteDisplayEnables( + WORD Default, BYTE* const Config, WORD Length ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + + WORD EPDDLL_API WINAPI WriteConfig( + + 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 ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteProfileControl( WORD Interval, DWORD TimeToNext ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteSpecialWriteTimes( + + DWORD* const WriteTimes, WORD Time ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI EndSession( WORD AlarmCtrl, WORD Duration ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadScratchPad( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteScratchPad( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteChirpRate( WORD ChirpRate ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadRAM( + + WORD Offset, WORD Length , void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadASIC( WORD Register, WORD* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadDirectEEPROM( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSLogin( DWORD Password ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSClearWearer( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSReadWearer( + + BYTE* const WearerID, WORD IDLength, + BYTE* const WearerName, WORD NameLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSIssue( + + BYTE* const WearerID, WORD IDLength, + BYTE* const WearerName, WORD NameLength ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSDeIssue( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSClearData( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSWritePassword( DWORD Password ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSSetOffEnable( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ADSClearOffEnable( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRLogin( DWORD Password ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteCalFactors( + + WORD K1, WORD K2, WORD K3, WORD K4, WORD K5, WORD K6 ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteDetectorThresholds( + + WORD SG, WORD BC, WORD FB, WORD HG ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteRAM( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteDirectEEPROM( + + WORD Offset, WORD Length, void* const Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRResetEpd( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRFormatEEPROM( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteASIC( WORD Register, WORD Data ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRSetAlwaysCount( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRClearAlwaysCount( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRSetGolden( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRClearGolden( void ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWriteEpdID( + + DWORD EpdID, + WORD HardVersion, + WORD SoftVersion, + WORD FunctionFlags ); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI MFRWritePassword( DWORD Password ); + + + +//additional commands for ANALOG2 +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadA2Config( + BYTE* const byADC_LA, + BYTE* const byADC_LL, + BYTE* const byADC_SUPPLY, + BYTE* const byADC_BAT_TYPE, + WORD* const wOffDisplay, + BYTE* const byConfig7, + BYTE* const byConfig8); +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI ReadA2ConfigStatus( + BYTE* const byBatADC, + BYTE* const bySupplyADC, + BYTE* const byStatus3, + BYTE* const byStatus4); + +/*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI WriteA2Config( + BYTE byADC_LA, + BYTE byADC_LL, + BYTE byADC_SUPPLY, + BYTE byADC_BAT_TYPE, + WORD wOffDisplay, + BYTE byConfig7, + BYTE byConfig8 ); + + /*----------------------------------------------------------------------------* + * + * See the Developer's Guide to the Ex15 Interface DLL (611/HB/40571/000) for + * an explanation of this API function. + * + *----------------------------------------------------------------------------*/ + +WORD EPDDLL_API WINAPI TestBattery( void ); + + + +} diff --git a/TestEdosBase/pch.cpp b/TestEdosBase/pch.cpp new file mode 100644 index 0000000..3a3d12b --- /dev/null +++ b/TestEdosBase/pch.cpp @@ -0,0 +1,5 @@ +// pch.cpp: source file corresponding to pre-compiled header; necessary for compilation to succeed + +#include "pch.h" + +// In general, ignore this file, but keep it around if you are using pre-compiled headers. diff --git a/TestEdosBase/pch.h b/TestEdosBase/pch.h new file mode 100644 index 0000000..b04e71e --- /dev/null +++ b/TestEdosBase/pch.h @@ -0,0 +1,14 @@ +// Tips for Getting Started: +// 1. Use the Solution Explorer window to add/manage files +// 2. Use the Team Explorer window to connect to source control +// 3. Use the Output window to see build output and other messages +// 4. Use the Error List window to view errors +// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project +// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file + +#ifndef PCH_H +#define PCH_H + +// TODO: add headers that you want to pre-compile here + +#endif //PCH_H diff --git a/eDos.sln b/eDos.sln new file mode 100644 index 0000000..f7ecd87 --- /dev/null +++ b/eDos.sln @@ -0,0 +1,51 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.329 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EpdBase", "EpdBase\EpdBase.vcxproj", "{3114A047-7562-42FE-94DE-2418EF19AD9A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestEdosBase", "TestEdosBase\TestEdosBase.vcxproj", "{7B3DD1C5-D8D0-408C-A272-FF5E4A30DF24}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestDirect", "TestDirect\TestDirect.vcxproj", "{3655B312-F7C2-4825-BD5F-E087F6AF2D90}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3114A047-7562-42FE-94DE-2418EF19AD9A}.Debug|x64.ActiveCfg = Debug|x64 + {3114A047-7562-42FE-94DE-2418EF19AD9A}.Debug|x64.Build.0 = Debug|x64 + {3114A047-7562-42FE-94DE-2418EF19AD9A}.Debug|x86.ActiveCfg = Debug|Win32 + {3114A047-7562-42FE-94DE-2418EF19AD9A}.Debug|x86.Build.0 = Debug|Win32 + {3114A047-7562-42FE-94DE-2418EF19AD9A}.Release|x64.ActiveCfg = Release|x64 + {3114A047-7562-42FE-94DE-2418EF19AD9A}.Release|x64.Build.0 = Release|x64 + {3114A047-7562-42FE-94DE-2418EF19AD9A}.Release|x86.ActiveCfg = Release|Win32 + {3114A047-7562-42FE-94DE-2418EF19AD9A}.Release|x86.Build.0 = Release|Win32 + {7B3DD1C5-D8D0-408C-A272-FF5E4A30DF24}.Debug|x64.ActiveCfg = Debug|x64 + {7B3DD1C5-D8D0-408C-A272-FF5E4A30DF24}.Debug|x64.Build.0 = Debug|x64 + {7B3DD1C5-D8D0-408C-A272-FF5E4A30DF24}.Debug|x86.ActiveCfg = Debug|Win32 + {7B3DD1C5-D8D0-408C-A272-FF5E4A30DF24}.Debug|x86.Build.0 = Debug|Win32 + {7B3DD1C5-D8D0-408C-A272-FF5E4A30DF24}.Release|x64.ActiveCfg = Release|x64 + {7B3DD1C5-D8D0-408C-A272-FF5E4A30DF24}.Release|x64.Build.0 = Release|x64 + {7B3DD1C5-D8D0-408C-A272-FF5E4A30DF24}.Release|x86.ActiveCfg = Release|Win32 + {7B3DD1C5-D8D0-408C-A272-FF5E4A30DF24}.Release|x86.Build.0 = Release|Win32 + {3655B312-F7C2-4825-BD5F-E087F6AF2D90}.Debug|x64.ActiveCfg = Debug|x64 + {3655B312-F7C2-4825-BD5F-E087F6AF2D90}.Debug|x64.Build.0 = Debug|x64 + {3655B312-F7C2-4825-BD5F-E087F6AF2D90}.Debug|x86.ActiveCfg = Debug|Win32 + {3655B312-F7C2-4825-BD5F-E087F6AF2D90}.Debug|x86.Build.0 = Debug|Win32 + {3655B312-F7C2-4825-BD5F-E087F6AF2D90}.Release|x64.ActiveCfg = Release|x64 + {3655B312-F7C2-4825-BD5F-E087F6AF2D90}.Release|x64.Build.0 = Release|x64 + {3655B312-F7C2-4825-BD5F-E087F6AF2D90}.Release|x86.ActiveCfg = Release|Win32 + {3655B312-F7C2-4825-BD5F-E087F6AF2D90}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {72198428-64BB-49B2-BC67-B588947AA1E1} + EndGlobalSection +EndGlobal