public override CompareFirmwareResult CompareFirmwareVersion(string firmwareFileName)
        {
            int result;

            VerifyResult(_cco.CompareFirmwareVersion(firmwareFileName, out result));
            return((CompareFirmwareResult)InteropEnum <CompareFirmwareResult> .ToEnumFromInteger(result));
        }
示例#2
0
        private BiometricsInformationRecord ToBiometricsInformationRecordFromString(string value)
        {
            BiometricsInformationRecord Result = null;

            if ((!string.IsNullOrEmpty(value)) && (value.Length >= 45))
            {
                byte[]       array         = InteropCommon.ToByteArrayFromString(value, _binaryConversion);
                int          BDBLength     = BitConverter.ToInt32(array, 0) - 45;
                Version      headerVersion = new Version((int)array[4], 0);
                BirDataTypes bdt           = (BirDataTypes)InteropEnum <BirDataTypes> .ToEnumFromInteger((int)array[5]);

                int        formatIDOwner = BitConverter.ToUInt16(array, 7);
                int        formatIDType  = BitConverter.ToUInt16(array, 9);
                BirPurpose BIRPurpose    = (BirPurpose)InteropEnum <BirPurpose> .ToEnumFromInteger((int)array[11]);

                int        biometricTypeInteger = BitConverter.ToInt32(array, 12);
                SensorType biometricType        = (SensorType)InteropEnum <SensorType> .ToEnumFromInteger(biometricTypeInteger);

                byte[] bdb = null;
                if (BDBLength > 0)
                {
                    bdb = new byte[BDBLength];
                    Array.Copy(array, 45, bdb, 0, BDBLength);
                }
                Result = new BiometricsInformationRecord(headerVersion, bdt, formatIDOwner, formatIDType, BIRPurpose, biometricType, bdb);
            }

            return(Result);
        }
示例#3
0
        /// <summary>
        /// Check the processing result value of OPOS and generate a PosControlException exception if it is an error.
        /// </summary>
        /// <param name="value">OPOS method return value or ResultCode property value</param>
        private void VerifyResult(int value)
        {
            if (value != (int)ErrorCode.Success)
            {
                ErrorCode eValue = (ErrorCode)InteropEnum <ErrorCode> .ToEnumFromInteger(value);

                throw new Microsoft.PointOfService.PosControlException((_oposDeviceClass + ":" + _oposDeviceName), eValue, _cco.ResultCodeExtended);
            }
        }
示例#4
0
        private void _cco_ErrorEvent(int ResultCode, int ResultCodeExtended, int ErrorLocus, ref int pErrorResponse)
        {
            if (this.ErrorEvent != null)
            {
                ErrorCode eCode = (ErrorCode)InteropEnum <ErrorCode> .ToEnumFromInteger(ResultCode);

                ErrorLocus eLocus = (ErrorLocus)InteropEnum <ErrorLocus> .ToEnumFromInteger(ErrorLocus);

                ErrorResponse eResponse = (ErrorResponse)InteropEnum <ErrorResponse> .ToEnumFromInteger(pErrorResponse);

                DeviceErrorEventArgs eEE = new DeviceErrorEventArgs(eCode, ResultCodeExtended, eLocus, eResponse);
                ErrorEvent(this, eEE);
                pErrorResponse = (int)eEE.ErrorResponse;
            }
        }