예제 #1
0
        public string Connect(string port, LogHandler traceLog, IngenicoLoggingLevel logLevel)
        {
            //RBA_API.logHandler = new LogHandler(traceLog);
            //RBA_API.SetDefaultLogLevel((LOG_LEVEL)logLevel);

            RBA_API.Initialize();

            //RBA_API.SetNotifyRbaDisconnected(new DisconnectHandler(DeviceConnectionEvent));

            //RBA_API.pinpadHandler = new PinPadMessageHandler(pinpadHandler);

            ERROR_ID result = SetDeviceCommunications(port);

            //set configuration for on demand
            //TODO - make this configuration driven
            SetDeviceToOnDemand();
            SoftReset();

            if (result.ToString().Contains("SUCCESS") || result.ToString().Contains("RESULT_ERROR_ALREADY_CONNECTED"))
            {
                Connected = true;

                //make sure Encryption is on
                //if (!IsEncryptionOn(CheckKeys()))
                //{
                //    Connected = false;
                //}
            }

            return(result.ToString());
        }